From 2c663c945afd55bdf3993943ec357c7c69ff07f4 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 15:49:51 +0200 Subject: Merge [SD2] r1302 Create folder structure for sorting instance by continent and move empty folders. - skip r1303 Start move source files to new folders, sorted by continent. --HG-- branch : trunk --- src/bindings/scripts/CMakeLists.txt | 300 ++-- src/bindings/scripts/VC80/80ScriptDev2.vcproj | 1900 ++++++++++---------- src/bindings/scripts/VC90/90ScriptDev2.vcproj | 1900 ++++++++++---------- .../blackrock_depths/blackrock_depths.cpp | 1294 +++++++++++++ .../blackrock_depths/boss_ambassador_flamelash.cpp | 107 ++ .../blackrock_depths/boss_anubshiah.cpp | 116 ++ .../boss_emperor_dagran_thaurissan.cpp | 106 ++ .../blackrock_depths/boss_general_angerforge.cpp | 168 ++ .../blackrock_depths/boss_gorosh_the_dervish.cpp | 82 + .../blackrock_depths/boss_grizzle.cpp | 89 + .../boss_high_interrogator_gerstahn.cpp | 106 ++ .../blackrock_depths/boss_magmus.cpp | 85 + .../blackrock_depths/boss_moira_bronzebeard.cpp | 100 ++ .../blackrock_depths/boss_tomb_of_seven.cpp | 249 +++ .../blackrock_depths/def_blackrock_depths.h | 38 + .../blackrock_depths/instance_blackrock_depths.cpp | 424 +++++ .../blackrock_spire/boss_drakkisath.cpp | 102 ++ .../eastern_kingdoms/blackrock_spire/boss_gyth.cpp | 206 +++ .../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 | 130 ++ .../blackrock_spire/boss_pyroguard_emberseer.cpp | 94 + .../blackrock_spire/boss_quartermaster_zigris.cpp | 86 + .../blackrock_spire/boss_rend_blackhand.cpp | 92 + .../boss_shadow_hunter_voshgajin.cpp | 96 + .../blackrock_spire/boss_the_beast.cpp | 94 + .../blackrock_spire/boss_warmaster_voone.cpp | 122 ++ .../blackwing_lair/boss_broodlord_lashlayer.cpp | 112 ++ .../blackwing_lair/boss_chromaggus.cpp | 316 ++++ .../blackwing_lair/boss_ebonroc.cpp | 104 ++ .../blackwing_lair/boss_firemaw.cpp | 95 + .../blackwing_lair/boss_flamegor.cpp | 98 + .../blackwing_lair/boss_nefarian.cpp | 225 +++ .../blackwing_lair/boss_razorgore.cpp | 129 ++ .../blackwing_lair/boss_vaelastrasz.cpp | 258 +++ .../blackwing_lair/boss_victor_nefarius.cpp | 392 ++++ .../blackwing_lair/instance_blackwing_lair.cpp | 25 + .../eastern_kingdoms/deadmines/deadmines.cpp | 237 +++ .../eastern_kingdoms/deadmines/def_deadmines.h | 14 + .../deadmines/instance_deadmines.cpp | 23 + .../eastern_kingdoms/karazhan/boss_curator.cpp | 201 +++ .../karazhan/boss_maiden_of_virtue.cpp | 150 ++ .../eastern_kingdoms/karazhan/boss_midnight.cpp | 323 ++++ .../eastern_kingdoms/karazhan/boss_moroes.cpp | 819 +++++++++ .../eastern_kingdoms/karazhan/boss_netherspite.cpp | 353 ++++ .../eastern_kingdoms/karazhan/boss_nightbane.cpp | 421 +++++ .../karazhan/boss_prince_malchezaar.cpp | 632 +++++++ .../karazhan/boss_shade_of_aran.cpp | 591 ++++++ .../karazhan/boss_terestian_illhoof.cpp | 432 +++++ .../eastern_kingdoms/karazhan/bosses_opera.cpp | 1500 ++++++++++++++++ .../eastern_kingdoms/karazhan/def_karazhan.h | 54 + .../karazhan/instance_karazhan.cpp | 309 ++++ .../scripts/eastern_kingdoms/karazhan/karazhan.cpp | 651 +++++++ .../magisters_terrace/boss_felblood_kaelthas.cpp | 688 +++++++ .../magisters_terrace/boss_priestess_delrissa.cpp | 1339 ++++++++++++++ .../magisters_terrace/boss_selin_fireheart.cpp | 370 ++++ .../magisters_terrace/boss_vexallus.cpp | 228 +++ .../magisters_terrace/def_magisters_terrace.h | 31 + .../instance_magisters_terrace.cpp | 205 +++ .../magisters_terrace/magisters_terrace.cpp | 174 ++ .../molten_core/boss_baron_geddon.cpp | 107 ++ .../eastern_kingdoms/molten_core/boss_garr.cpp | 143 ++ .../eastern_kingdoms/molten_core/boss_gehennas.cpp | 92 + .../eastern_kingdoms/molten_core/boss_golemagg.cpp | 198 ++ .../eastern_kingdoms/molten_core/boss_lucifron.cpp | 91 + .../eastern_kingdoms/molten_core/boss_magmadar.cpp | 100 ++ .../molten_core/boss_majordomo_executus.cpp | 139 ++ .../eastern_kingdoms/molten_core/boss_ragnaros.cpp | 301 ++++ .../eastern_kingdoms/molten_core/boss_shazzrah.cpp | 124 ++ .../molten_core/boss_sulfuron_harbinger.cpp | 214 +++ .../eastern_kingdoms/molten_core/def_molten_core.h | 22 + .../molten_core/instance_molten_core.cpp | 268 +++ .../eastern_kingdoms/molten_core/molten_core.cpp | 89 + .../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 | 866 +++++++++ .../scarlet_monastery/boss_herod.cpp | 159 ++ .../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 | 360 ++++ .../scarlet_monastery/boss_scorn.cpp | 101 ++ .../scarlet_monastery/def_scarlet_monastery.h | 18 + .../instance_scarlet_monastery.cpp | 156 ++ .../scholomance/boss_darkmaster_gandling.cpp | 226 +++ .../scholomance/boss_death_knight_darkreaver.cpp | 60 + .../scholomance/boss_doctor_theolen_krastinov.cpp | 111 ++ .../scholomance/boss_illucia_barov.cpp | 117 ++ .../scholomance/boss_instructor_malicia.cpp | 153 ++ .../scholomance/boss_jandice_barov.cpp | 223 +++ .../eastern_kingdoms/scholomance/boss_kormok.cpp | 158 ++ .../scholomance/boss_lord_alexei_barov.cpp | 99 + .../scholomance/boss_lorekeeper_polkelt.cpp | 114 ++ .../scholomance/boss_ras_frostwhisper.cpp | 126 ++ .../scholomance/boss_the_ravenian.cpp | 117 ++ .../eastern_kingdoms/scholomance/boss_vectus.cpp | 98 + .../eastern_kingdoms/scholomance/def_scholomance.h | 17 + .../scholomance/instance_scholomance.cpp | 146 ++ .../shadowfang_keep/def_shadowfang_keep.h | 13 + .../shadowfang_keep/instance_shadowfang_keep.cpp | 208 +++ .../shadowfang_keep/shadowfang_keep.cpp | 143 ++ .../stratholme/boss_baron_rivendare.cpp | 191 ++ .../stratholme/boss_baroness_anastari.cpp | 127 ++ .../stratholme/boss_cannon_master_willey.cpp | 221 +++ .../stratholme/boss_dathrohan_balnazzar.cpp | 217 +++ .../stratholme/boss_magistrate_barthilas.cpp | 133 ++ .../stratholme/boss_maleki_the_pallid.cpp | 108 ++ .../stratholme/boss_nerubenkan.cpp | 139 ++ .../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 + .../eastern_kingdoms/stratholme/def_stratholme.h | 28 + .../stratholme/instance_stratholme.cpp | 423 +++++ .../eastern_kingdoms/stratholme/stratholme.cpp | 290 +++ .../sunwell_plateau/boss_brutallus.cpp | 326 ++++ .../sunwell_plateau/boss_eredar_twins.cpp | 761 ++++++++ .../sunwell_plateau/boss_felmyst.cpp | 623 +++++++ .../sunwell_plateau/boss_kalecgos.cpp | 693 +++++++ .../sunwell_plateau/boss_kiljaeden.cpp | 1311 ++++++++++++++ .../eastern_kingdoms/sunwell_plateau/boss_muru.cpp | 668 +++++++ .../sunwell_plateau/def_sunwell_plateau.h | 37 + .../sunwell_plateau/instance_sunwell_plateau.cpp | 274 +++ .../sunwell_plateau/sunwell_plateau.cpp | 66 + .../eastern_kingdoms/uldaman/boss_archaedas.cpp | 493 +++++ .../eastern_kingdoms/uldaman/boss_ironaya.cpp | 106 ++ .../eastern_kingdoms/uldaman/instance_uldaman.cpp | 306 ++++ .../scripts/eastern_kingdoms/uldaman/uldaman.cpp | 188 ++ .../eastern_kingdoms/zulaman/boss_akilzon.cpp | 456 +++++ .../eastern_kingdoms/zulaman/boss_halazzi.cpp | 403 +++++ .../eastern_kingdoms/zulaman/boss_hexlord.cpp | 912 ++++++++++ .../eastern_kingdoms/zulaman/boss_janalai.cpp | 704 ++++++++ .../eastern_kingdoms/zulaman/boss_nalorakk.cpp | 453 +++++ .../eastern_kingdoms/zulaman/boss_zuljin.cpp | 624 +++++++ .../scripts/eastern_kingdoms/zulaman/def_zulaman.h | 19 + .../eastern_kingdoms/zulaman/instance_zulaman.cpp | 320 ++++ .../scripts/eastern_kingdoms/zulaman/zulaman.cpp | 192 ++ .../eastern_kingdoms/zulgurub/boss_arlokk.cpp | 274 +++ .../eastern_kingdoms/zulgurub/boss_gahzranka.cpp | 93 + .../eastern_kingdoms/zulgurub/boss_grilek.cpp | 93 + .../eastern_kingdoms/zulgurub/boss_hakkar.cpp | 250 +++ .../eastern_kingdoms/zulgurub/boss_hazzarah.cpp | 105 ++ .../eastern_kingdoms/zulgurub/boss_jeklik.cpp | 291 +++ .../eastern_kingdoms/zulgurub/boss_jindo.cpp | 275 +++ .../eastern_kingdoms/zulgurub/boss_mandokir.cpp | 333 ++++ .../eastern_kingdoms/zulgurub/boss_marli.cpp | 261 +++ .../eastern_kingdoms/zulgurub/boss_renataki.cpp | 152 ++ .../eastern_kingdoms/zulgurub/boss_thekal.cpp | 556 ++++++ .../eastern_kingdoms/zulgurub/boss_venoxis.cpp | 200 +++ .../eastern_kingdoms/zulgurub/boss_wushoolay.cpp | 85 + .../eastern_kingdoms/zulgurub/def_zulgurub.h | 28 + .../zulgurub/instance_zulgurub.cpp | 159 ++ .../zone/blackrock_depths/blackrock_depths.cpp | 1294 ------------- .../blackrock_depths/boss_ambassador_flamelash.cpp | 107 -- .../zone/blackrock_depths/boss_anubshiah.cpp | 116 -- .../boss_emperor_dagran_thaurissan.cpp | 106 -- .../blackrock_depths/boss_general_angerforge.cpp | 168 -- .../blackrock_depths/boss_gorosh_the_dervish.cpp | 82 - .../scripts/zone/blackrock_depths/boss_grizzle.cpp | 89 - .../boss_high_interrogator_gerstahn.cpp | 106 -- .../scripts/zone/blackrock_depths/boss_magmus.cpp | 85 - .../blackrock_depths/boss_moira_bronzebeard.cpp | 100 -- .../zone/blackrock_depths/boss_tomb_of_seven.cpp | 249 --- .../zone/blackrock_depths/def_blackrock_depths.h | 38 - .../blackrock_depths/instance_blackrock_depths.cpp | 424 ----- .../zone/blackrock_spire/boss_drakkisath.cpp | 102 -- .../scripts/zone/blackrock_spire/boss_gyth.cpp | 206 --- .../scripts/zone/blackrock_spire/boss_halycon.cpp | 96 - .../zone/blackrock_spire/boss_highlord_omokk.cpp | 132 -- .../blackrock_spire/boss_mother_smolderweb.cpp | 87 - .../blackrock_spire/boss_overlord_wyrmthalak.cpp | 130 -- .../blackrock_spire/boss_pyroguard_emberseer.cpp | 94 - .../blackrock_spire/boss_quartermaster_zigris.cpp | 86 - .../zone/blackrock_spire/boss_rend_blackhand.cpp | 92 - .../boss_shadow_hunter_voshgajin.cpp | 96 - .../zone/blackrock_spire/boss_the_beast.cpp | 94 - .../zone/blackrock_spire/boss_warmaster_voone.cpp | 122 -- .../blackwing_lair/boss_broodlord_lashlayer.cpp | 112 -- .../zone/blackwing_lair/boss_chromaggus.cpp | 316 ---- .../scripts/zone/blackwing_lair/boss_ebonroc.cpp | 104 -- .../scripts/zone/blackwing_lair/boss_firemaw.cpp | 95 - .../scripts/zone/blackwing_lair/boss_flamegor.cpp | 98 - .../scripts/zone/blackwing_lair/boss_nefarian.cpp | 225 --- .../scripts/zone/blackwing_lair/boss_razorgore.cpp | 129 -- .../zone/blackwing_lair/boss_vaelastrasz.cpp | 258 --- .../zone/blackwing_lair/boss_victor_nefarius.cpp | 392 ---- .../blackwing_lair/instance_blackwing_lair.cpp | 25 - .../scripts/scripts/zone/deadmines/deadmines.cpp | 237 --- .../scripts/scripts/zone/deadmines/def_deadmines.h | 14 - .../scripts/zone/deadmines/instance_deadmines.cpp | 23 - .../scripts/scripts/zone/karazhan/boss_curator.cpp | 201 --- .../zone/karazhan/boss_maiden_of_virtue.cpp | 150 -- .../scripts/zone/karazhan/boss_midnight.cpp | 323 ---- .../scripts/scripts/zone/karazhan/boss_moroes.cpp | 819 --------- .../scripts/zone/karazhan/boss_netherspite.cpp | 353 ---- .../scripts/zone/karazhan/boss_nightbane.cpp | 421 ----- .../zone/karazhan/boss_prince_malchezaar.cpp | 632 ------- .../scripts/zone/karazhan/boss_shade_of_aran.cpp | 591 ------ .../zone/karazhan/boss_terestian_illhoof.cpp | 432 ----- .../scripts/scripts/zone/karazhan/bosses_opera.cpp | 1500 ---------------- .../scripts/scripts/zone/karazhan/def_karazhan.h | 54 - .../scripts/zone/karazhan/instance_karazhan.cpp | 309 ---- .../scripts/scripts/zone/karazhan/karazhan.cpp | 651 ------- .../magisters_terrace/boss_felblood_kaelthas.cpp | 688 ------- .../magisters_terrace/boss_priestess_delrissa.cpp | 1339 -------------- .../magisters_terrace/boss_selin_fireheart.cpp | 370 ---- .../zone/magisters_terrace/boss_vexallus.cpp | 228 --- .../zone/magisters_terrace/def_magisters_terrace.h | 31 - .../instance_magisters_terrace.cpp | 205 --- .../zone/magisters_terrace/magisters_terrace.cpp | 174 -- .../scripts/zone/molten_core/boss_baron_geddon.cpp | 107 -- .../scripts/scripts/zone/molten_core/boss_garr.cpp | 143 -- .../scripts/zone/molten_core/boss_gehennas.cpp | 92 - .../scripts/zone/molten_core/boss_golemagg.cpp | 198 -- .../scripts/zone/molten_core/boss_lucifron.cpp | 91 - .../scripts/zone/molten_core/boss_magmadar.cpp | 100 -- .../zone/molten_core/boss_majordomo_executus.cpp | 139 -- .../scripts/zone/molten_core/boss_ragnaros.cpp | 301 ---- .../scripts/zone/molten_core/boss_shazzrah.cpp | 124 -- .../zone/molten_core/boss_sulfuron_harbinger.cpp | 214 --- .../scripts/zone/molten_core/def_molten_core.h | 22 - .../zone/molten_core/instance_molten_core.cpp | 268 --- .../scripts/zone/molten_core/molten_core.cpp | 89 - .../zone/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 | 866 --------- .../scripts/zone/scarlet_monastery/boss_herod.cpp | 159 -- .../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 | 360 ---- .../scripts/zone/scarlet_monastery/boss_scorn.cpp | 101 -- .../zone/scarlet_monastery/def_scarlet_monastery.h | 18 - .../instance_scarlet_monastery.cpp | 156 -- .../zone/scholomance/boss_darkmaster_gandling.cpp | 226 --- .../scholomance/boss_death_knight_darkreaver.cpp | 60 - .../scholomance/boss_doctor_theolen_krastinov.cpp | 111 -- .../zone/scholomance/boss_illucia_barov.cpp | 117 -- .../zone/scholomance/boss_instructor_malicia.cpp | 153 -- .../zone/scholomance/boss_jandice_barov.cpp | 223 --- .../scripts/zone/scholomance/boss_kormok.cpp | 158 -- .../zone/scholomance/boss_lord_alexei_barov.cpp | 99 - .../zone/scholomance/boss_lorekeeper_polkelt.cpp | 114 -- .../zone/scholomance/boss_ras_frostwhisper.cpp | 126 -- .../scripts/zone/scholomance/boss_the_ravenian.cpp | 117 -- .../scripts/zone/scholomance/boss_vectus.cpp | 98 - .../scripts/zone/scholomance/def_scholomance.h | 17 - .../zone/scholomance/instance_scholomance.cpp | 146 -- .../zone/shadowfang_keep/def_shadowfang_keep.h | 13 - .../shadowfang_keep/instance_shadowfang_keep.cpp | 208 --- .../zone/shadowfang_keep/shadowfang_keep.cpp | 143 -- .../zone/stratholme/boss_baron_rivendare.cpp | 191 -- .../zone/stratholme/boss_baroness_anastari.cpp | 127 -- .../zone/stratholme/boss_cannon_master_willey.cpp | 221 --- .../zone/stratholme/boss_dathrohan_balnazzar.cpp | 217 --- .../zone/stratholme/boss_magistrate_barthilas.cpp | 133 -- .../zone/stratholme/boss_maleki_the_pallid.cpp | 108 -- .../scripts/zone/stratholme/boss_nerubenkan.cpp | 139 -- .../zone/stratholme/boss_order_of_silver_hand.cpp | 157 -- .../zone/stratholme/boss_postmaster_malown.cpp | 144 -- .../zone/stratholme/boss_ramstein_the_gorger.cpp | 102 -- .../zone/stratholme/boss_timmy_the_cruel.cpp | 83 - .../scripts/zone/stratholme/def_stratholme.h | 28 - .../zone/stratholme/instance_stratholme.cpp | 423 ----- .../scripts/scripts/zone/stratholme/stratholme.cpp | 290 --- .../zone/sunwell_plateau/boss_brutallus.cpp | 326 ---- .../zone/sunwell_plateau/boss_eredar_twins.cpp | 761 -------- .../scripts/zone/sunwell_plateau/boss_felmyst.cpp | 623 ------- .../scripts/zone/sunwell_plateau/boss_kalecgos.cpp | 693 ------- .../zone/sunwell_plateau/boss_kiljaeden.cpp | 1311 -------------- .../scripts/zone/sunwell_plateau/boss_muru.cpp | 668 ------- .../zone/sunwell_plateau/def_sunwell_plateau.h | 37 - .../sunwell_plateau/instance_sunwell_plateau.cpp | 274 --- .../zone/sunwell_plateau/sunwell_plateau.cpp | 66 - .../scripts/zone/uldaman/boss_archaedas.cpp | 493 ----- .../scripts/scripts/zone/uldaman/boss_ironaya.cpp | 106 -- .../scripts/zone/uldaman/instance_uldaman.cpp | 306 ---- .../scripts/scripts/zone/uldaman/uldaman.cpp | 188 -- .../scripts/scripts/zone/zulaman/boss_akilzon.cpp | 456 ----- .../scripts/scripts/zone/zulaman/boss_halazzi.cpp | 403 ----- .../scripts/scripts/zone/zulaman/boss_hexlord.cpp | 912 ---------- .../scripts/scripts/zone/zulaman/boss_janalai.cpp | 704 -------- .../scripts/scripts/zone/zulaman/boss_nalorakk.cpp | 453 ----- .../scripts/scripts/zone/zulaman/boss_zuljin.cpp | 624 ------- .../scripts/scripts/zone/zulaman/def_zulaman.h | 19 - .../scripts/zone/zulaman/instance_zulaman.cpp | 320 ---- .../scripts/scripts/zone/zulaman/zulaman.cpp | 192 -- .../scripts/scripts/zone/zulgurub/boss_arlokk.cpp | 274 --- .../scripts/zone/zulgurub/boss_gahzranka.cpp | 93 - .../scripts/scripts/zone/zulgurub/boss_grilek.cpp | 93 - .../scripts/scripts/zone/zulgurub/boss_hakkar.cpp | 250 --- .../scripts/zone/zulgurub/boss_hazzarah.cpp | 105 -- .../scripts/scripts/zone/zulgurub/boss_jeklik.cpp | 291 --- .../scripts/scripts/zone/zulgurub/boss_jindo.cpp | 275 --- .../scripts/zone/zulgurub/boss_mandokir.cpp | 333 ---- .../scripts/scripts/zone/zulgurub/boss_marli.cpp | 261 --- .../scripts/zone/zulgurub/boss_renataki.cpp | 152 -- .../scripts/scripts/zone/zulgurub/boss_thekal.cpp | 556 ------ .../scripts/scripts/zone/zulgurub/boss_venoxis.cpp | 200 --- .../scripts/zone/zulgurub/boss_wushoolay.cpp | 85 - .../scripts/scripts/zone/zulgurub/def_zulgurub.h | 28 - .../scripts/zone/zulgurub/instance_zulgurub.cpp | 159 -- src/bindings/scripts/system/ScriptLoader.cpp | 634 +++---- 306 files changed, 39911 insertions(+), 40039 deletions(-) create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/def_blackrock_depths.h create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/deadmines/deadmines.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/deadmines/def_deadmines.h create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_curator.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/karazhan/def_karazhan.h create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/karazhan/instance_karazhan.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/karazhan/karazhan.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/def_magisters_terrace.h create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/instance_magisters_terrace.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_garr.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/molten_core/def_molten_core.h create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/molten_core/instance_molten_core.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/molten_core/molten_core.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/def_scarlet_monastery.h create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/instance_scarlet_monastery.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scholomance/def_scholomance.h create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scholomance/instance_scholomance.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/def_shadowfang_keep.h create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/instance_shadowfang_keep.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stratholme/def_stratholme.h create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/stratholme/stratholme.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/def_sunwell_plateau.h create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/uldaman/uldaman.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_hexlord.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulaman/def_zulaman.h create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulaman/instance_zulaman.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulaman/zulaman.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/def_zulgurub.h create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/instance_zulgurub.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_depths/def_blackrock_depths.h delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp delete mode 100644 src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp delete mode 100644 src/bindings/scripts/scripts/zone/deadmines/def_deadmines.h delete mode 100644 src/bindings/scripts/scripts/zone/deadmines/instance_deadmines.cpp delete mode 100644 src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp delete mode 100644 src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp delete mode 100644 src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp delete mode 100644 src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp delete mode 100644 src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp delete mode 100644 src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp delete mode 100644 src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp delete mode 100644 src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp delete mode 100644 src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp delete mode 100644 src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h delete mode 100644 src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp delete mode 100644 src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp delete mode 100644 src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp delete mode 100644 src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h delete mode 100644 src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp delete mode 100644 src/bindings/scripts/scripts/zone/magisters_terrace/magisters_terrace.cpp delete mode 100644 src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp delete mode 100644 src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp delete mode 100644 src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp delete mode 100644 src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp delete mode 100644 src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp delete mode 100644 src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp delete mode 100644 src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp delete mode 100644 src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h delete mode 100644 src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp delete mode 100644 src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h delete mode 100644 src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h delete mode 100644 src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp delete mode 100644 src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h delete mode 100644 src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp delete mode 100644 src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h delete mode 100644 src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp delete mode 100644 src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp delete mode 100644 src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp delete mode 100644 src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp delete mode 100644 src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp delete mode 100644 src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp delete mode 100644 src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp delete mode 100644 src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h delete mode 100644 src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp delete mode 100644 src/bindings/scripts/scripts/zone/sunwell_plateau/sunwell_plateau.cpp delete mode 100644 src/bindings/scripts/scripts/zone/uldaman/boss_archaedas.cpp delete mode 100644 src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp delete mode 100644 src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp delete mode 100644 src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h delete mode 100644 src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h delete mode 100644 src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 9736d172850..0d63ed10020 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -16,7 +16,157 @@ SET(trinityscript_LIB_SRCS include/sc_creature.h include/sc_gossip.h include/sc_instance.h + scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp + scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp + scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp + scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp + scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp + scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp + scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp + scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp + scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp + scripts/eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.cpp + scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp + scripts/eastern_kingdoms/blackrock_depths/def_blackrock_depths.h + scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp + scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp + scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp + scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp + scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp + scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp + scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp + scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp + scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp + scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp + scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp + scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp + scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp + scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp + scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp + scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp + scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp + scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp + scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp + scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp + scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp + scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp + scripts/eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp + scripts/eastern_kingdoms/deadmines/def_deadmines.h + scripts/eastern_kingdoms/deadmines/deadmines.cpp + scripts/eastern_kingdoms/karazhan/boss_curator.cpp + scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp + scripts/eastern_kingdoms/karazhan/boss_midnight.cpp + scripts/eastern_kingdoms/karazhan/boss_moroes.cpp + scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp + scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp + scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp + scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp + scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp + scripts/eastern_kingdoms/karazhan/bosses_opera.cpp + scripts/eastern_kingdoms/karazhan/def_karazhan.h + scripts/eastern_kingdoms/karazhan/instance_karazhan.cpp + scripts/eastern_kingdoms/karazhan/karazhan.cpp + scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp + scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp + scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp + scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp + scripts/eastern_kingdoms/magisters_terrace/def_magisters_terrace.h + scripts/eastern_kingdoms/magisters_terrace/instance_magisters_terrace.cpp + scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp + scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp + scripts/eastern_kingdoms/molten_core/boss_garr.cpp + scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp + scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp + scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp + scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp + scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp + scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp + scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp + scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp + scripts/eastern_kingdoms/molten_core/def_molten_core.h + scripts/eastern_kingdoms/molten_core/instance_molten_core.cpp + scripts/eastern_kingdoms/molten_core/molten_core.cpp scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp + scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp + scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp + scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp + scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp + scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp + scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp + scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp + scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp + scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp + scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp + scripts/eastern_kingdoms/scarlet_monastery/instance_scarlet_monastery.cpp + scripts/eastern_kingdoms/scarlet_monastery/def_scarlet_monastery.h + scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp + scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp + scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp + scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp + scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp + scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp + scripts/eastern_kingdoms/scholomance/boss_kormok.cpp + scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp + scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp + scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp + scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp + scripts/eastern_kingdoms/scholomance/boss_vectus.cpp + scripts/eastern_kingdoms/scholomance/def_scholomance.h + scripts/eastern_kingdoms/scholomance/instance_scholomance.cpp + scripts/eastern_kingdoms/shadowfang_keep/def_shadowfang_keep.h + scripts/eastern_kingdoms/shadowfang_keep/instance_shadowfang_keep.cpp + scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp + scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp + scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp + scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp + scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp + scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp + scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp + scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp + scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp + scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp + scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp + scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp + scripts/eastern_kingdoms/stratholme/def_stratholme.h + scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp + scripts/eastern_kingdoms/stratholme/stratholme.cpp + scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp + scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp + scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp + scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp + scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp + scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp + scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.cpp + scripts/eastern_kingdoms/sunwell_plateau/def_sunwell_plateau.h + scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp + scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp + scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp + scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp + scripts/eastern_kingdoms/uldaman/uldaman.cpp + scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp + scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp + scripts/eastern_kingdoms/zulaman/boss_hexlord.cpp + scripts/eastern_kingdoms/zulaman/boss_janalai.cpp + scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp + scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp + scripts/eastern_kingdoms/zulaman/def_zulaman.h + scripts/eastern_kingdoms/zulaman/instance_zulaman.cpp + scripts/eastern_kingdoms/zulaman/zulaman.cpp + scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp + scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp + scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp + scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp + scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp + scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp + scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp + scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp + scripts/eastern_kingdoms/zulgurub/boss_marli.cpp + scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp + scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp + scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp + scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp + scripts/eastern_kingdoms/zulgurub/def_zulgurub.h + scripts/eastern_kingdoms/zulgurub/instance_zulgurub.cpp scripts/eastern_kingdoms/alterac_mountains.cpp scripts/eastern_kingdoms/arathi_highlands.cpp scripts/eastern_kingdoms/blasted_lands.cpp @@ -109,41 +259,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/black_temple/instance_black_temple.cpp scripts/zone/blackfathom_depths/instance_blackfathom_deeps.cpp scripts/zone/blackfathom_depths/def_blackfathom_deeps.h - scripts/zone/blackrock_depths/blackrock_depths.cpp - scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp - scripts/zone/blackrock_depths/boss_anubshiah.cpp - scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp - scripts/zone/blackrock_depths/boss_general_angerforge.cpp - scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp - scripts/zone/blackrock_depths/boss_grizzle.cpp - scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp - scripts/zone/blackrock_depths/boss_magmus.cpp - scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp - scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp - scripts/zone/blackrock_depths/def_blackrock_depths.h - scripts/zone/blackrock_depths/instance_blackrock_depths.cpp - scripts/zone/blackrock_spire/boss_drakkisath.cpp - scripts/zone/blackrock_spire/boss_gyth.cpp - scripts/zone/blackrock_spire/boss_halycon.cpp - scripts/zone/blackrock_spire/boss_highlord_omokk.cpp - scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp - scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp - scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp - scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp - scripts/zone/blackrock_spire/boss_rend_blackhand.cpp - scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp - scripts/zone/blackrock_spire/boss_the_beast.cpp - scripts/zone/blackrock_spire/boss_warmaster_voone.cpp - scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp - scripts/zone/blackwing_lair/boss_chromaggus.cpp - scripts/zone/blackwing_lair/boss_ebonroc.cpp - scripts/zone/blackwing_lair/boss_firemaw.cpp - scripts/zone/blackwing_lair/boss_flamegor.cpp - scripts/zone/blackwing_lair/boss_nefarian.cpp - scripts/zone/blackwing_lair/boss_razorgore.cpp - scripts/zone/blackwing_lair/boss_vaelastrasz.cpp - scripts/zone/blackwing_lair/boss_victor_nefarius.cpp - scripts/zone/blackwing_lair/instance_blackwing_lair.cpp scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp @@ -183,8 +298,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp - scripts/zone/deadmines/def_deadmines.h - scripts/zone/deadmines/deadmines.cpp scripts/zone/gruuls_lair/boss_gruul.cpp scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp scripts/zone/gruuls_lair/def_gruuls_lair.h @@ -207,43 +320,10 @@ SET(trinityscript_LIB_SRCS scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp - scripts/zone/karazhan/boss_curator.cpp - scripts/zone/karazhan/boss_maiden_of_virtue.cpp - scripts/zone/karazhan/boss_midnight.cpp - scripts/zone/karazhan/boss_moroes.cpp - scripts/zone/karazhan/boss_netherspite.cpp - scripts/zone/karazhan/boss_nightbane.cpp - scripts/zone/karazhan/boss_prince_malchezaar.cpp - scripts/zone/karazhan/boss_shade_of_aran.cpp - scripts/zone/karazhan/boss_terestian_illhoof.cpp - scripts/zone/karazhan/bosses_opera.cpp - scripts/zone/karazhan/def_karazhan.h - scripts/zone/karazhan/instance_karazhan.cpp - scripts/zone/karazhan/karazhan.cpp - scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp - scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp - scripts/zone/magisters_terrace/boss_selin_fireheart.cpp - scripts/zone/magisters_terrace/boss_vexallus.cpp - scripts/zone/magisters_terrace/def_magisters_terrace.h - scripts/zone/magisters_terrace/instance_magisters_terrace.cpp - scripts/zone/magisters_terrace/magisters_terrace.cpp scripts/zone/maraudon/boss_celebras_the_cursed.cpp scripts/zone/maraudon/boss_landslide.cpp scripts/zone/maraudon/boss_noxxion.cpp scripts/zone/maraudon/boss_princess_theradras.cpp - scripts/zone/molten_core/boss_baron_geddon.cpp - scripts/zone/molten_core/boss_garr.cpp - scripts/zone/molten_core/boss_gehennas.cpp - scripts/zone/molten_core/boss_golemagg.cpp - scripts/zone/molten_core/boss_lucifron.cpp - scripts/zone/molten_core/boss_magmadar.cpp - scripts/zone/molten_core/boss_majordomo_executus.cpp - scripts/zone/molten_core/boss_ragnaros.cpp - scripts/zone/molten_core/boss_shazzrah.cpp - scripts/zone/molten_core/boss_sulfuron_harbinger.cpp - scripts/zone/molten_core/def_molten_core.h - scripts/zone/molten_core/instance_molten_core.cpp - scripts/zone/molten_core/molten_core.cpp scripts/zone/naxxramas/boss_anubrekhan.cpp scripts/zone/naxxramas/boss_faerlina.cpp scripts/zone/naxxramas/boss_gluth.cpp @@ -274,58 +354,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp - scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp - scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp - scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp - scripts/zone/scarlet_monastery/boss_herod.cpp - scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp - scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp - scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp - scripts/zone/scarlet_monastery/boss_scorn.cpp - scripts/zone/scarlet_monastery/boss_headless_horseman.cpp - scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp - scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp - scripts/zone/scarlet_monastery/def_scarlet_monastery.h - scripts/zone/scholomance/boss_darkmaster_gandling.cpp - scripts/zone/scholomance/boss_death_knight_darkreaver.cpp - scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp - scripts/zone/scholomance/boss_illucia_barov.cpp - scripts/zone/scholomance/boss_instructor_malicia.cpp - scripts/zone/scholomance/boss_jandice_barov.cpp - scripts/zone/scholomance/boss_kormok.cpp - scripts/zone/scholomance/boss_lord_alexei_barov.cpp - scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp - scripts/zone/scholomance/boss_ras_frostwhisper.cpp - scripts/zone/scholomance/boss_the_ravenian.cpp - scripts/zone/scholomance/boss_vectus.cpp - scripts/zone/scholomance/def_scholomance.h - scripts/zone/scholomance/instance_scholomance.cpp - scripts/zone/shadowfang_keep/def_shadowfang_keep.h - scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp - scripts/zone/shadowfang_keep/shadowfang_keep.cpp - scripts/zone/stratholme/boss_baron_rivendare.cpp - scripts/zone/stratholme/boss_baroness_anastari.cpp - scripts/zone/stratholme/boss_cannon_master_willey.cpp - scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp - scripts/zone/stratholme/boss_magistrate_barthilas.cpp - scripts/zone/stratholme/boss_maleki_the_pallid.cpp - scripts/zone/stratholme/boss_nerubenkan.cpp - scripts/zone/stratholme/boss_order_of_silver_hand.cpp - scripts/zone/stratholme/boss_postmaster_malown.cpp - scripts/zone/stratholme/boss_ramstein_the_gorger.cpp - scripts/zone/stratholme/boss_timmy_the_cruel.cpp - scripts/zone/stratholme/def_stratholme.h - scripts/zone/stratholme/instance_stratholme.cpp - scripts/zone/stratholme/stratholme.cpp - scripts/zone/sunwell_plateau/boss_kiljaeden.cpp - scripts/zone/sunwell_plateau/boss_muru.cpp - scripts/zone/sunwell_plateau/boss_eredar_twins.cpp - scripts/zone/sunwell_plateau/boss_felmyst.cpp - scripts/zone/sunwell_plateau/boss_brutallus.cpp - scripts/zone/sunwell_plateau/boss_kalecgos.cpp - scripts/zone/sunwell_plateau/sunwell_plateau.cpp - scripts/zone/sunwell_plateau/def_sunwell_plateau.h - scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp scripts/zone/tempest_keep/arcatraz/arcatraz.cpp scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp scripts/zone/tempest_keep/arcatraz/def_arcatraz.h @@ -358,39 +386,11 @@ SET(trinityscript_LIB_SRCS scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp - scripts/zone/uldaman/boss_archaedas.cpp - scripts/zone/uldaman/instance_uldaman.cpp - scripts/zone/uldaman/boss_ironaya.cpp - scripts/zone/uldaman/uldaman.cpp scripts/zone/ungoro_crater/ungoro_crater.cpp scripts/zone/wailing_caverns/def_wailing_caverns.h scripts/zone/wailing_caverns/instance_wailing_caverns.cpp scripts/zone/wailing_caverns/wailing_caverns.cpp - scripts/zone/zulaman/boss_akilzon.cpp - scripts/zone/zulaman/boss_halazzi.cpp - scripts/zone/zulaman/boss_hexlord.cpp - scripts/zone/zulaman/boss_janalai.cpp - scripts/zone/zulaman/boss_nalorakk.cpp - scripts/zone/zulaman/boss_zuljin.cpp - scripts/zone/zulaman/def_zulaman.h - scripts/zone/zulaman/instance_zulaman.cpp - scripts/zone/zulaman/zulaman.cpp scripts/zone/zulfarrak/zulfarrak.cpp - scripts/zone/zulgurub/boss_arlokk.cpp - scripts/zone/zulgurub/boss_gahzranka.cpp - scripts/zone/zulgurub/boss_grilek.cpp - scripts/zone/zulgurub/boss_hakkar.cpp - scripts/zone/zulgurub/boss_hazzarah.cpp - scripts/zone/zulgurub/boss_jeklik.cpp - scripts/zone/zulgurub/boss_jindo.cpp - scripts/zone/zulgurub/boss_mandokir.cpp - scripts/zone/zulgurub/boss_marli.cpp - scripts/zone/zulgurub/boss_renataki.cpp - scripts/zone/zulgurub/boss_thekal.cpp - scripts/zone/zulgurub/boss_venoxis.cpp - scripts/zone/zulgurub/boss_wushoolay.cpp - scripts/zone/zulgurub/def_zulgurub.h - scripts/zone/zulgurub/instance_zulgurub.cpp scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 2ddcba982b5..ece3e669445 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -395,102 +395,762 @@ Name="eastern_kingdoms" > + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + - - + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -681,1019 +1341,331 @@ Name="Kalimdor" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Blackfathom Depths" + > - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + - - diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index 85946ca217c..87b5cb00ce4 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -392,102 +392,762 @@ Name="eastern_kingdoms" > + + + + + + + + + + + + + + + + + + + + + + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + - - + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -678,1019 +1338,331 @@ Name="Kalimdor" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Blackfathom Depths" + > - - - - - - - - - - - - - - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + - - diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp new file mode 100644 index 00000000000..a9cf7b7391f --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp @@ -0,0 +1,1294 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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 "precompiled.h" +#include "escortAI.h" +#include "def_blackrock_depths.h" + +/*###### ++## go_shadowforge_brazier ++######*/ + +bool GOHello_go_shadowforge_brazier(Player* pPlayer, GameObject* pGo) +{ + if (ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData()) + { + if (pInstance->GetData(TYPE_LYCEUM) == IN_PROGRESS) + pInstance->SetData(TYPE_LYCEUM, DONE); + else + pInstance->SetData(TYPE_LYCEUM, IN_PROGRESS); + } + return false; +} + +/*###### +## npc_grimstone +######*/ + +enum +{ + 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, AreaTriggerEntry *at) +{ + ScriptedInstance* pInstance = (pPlayer->GetInstanceData()); + + 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 +######*/ + +//TODO: implement quest part of event (different end boss) +struct TRINITY_DLL_DECL 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() + { + m_creature->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 = m_creature->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 = m_creature->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(-1000000, m_creature);//2 + CanWalk = false; + Event_Timer = 5000; + break; + case 1: + DoScriptText(-1000000, m_creature);//4 + CanWalk = false; + Event_Timer = 5000; + break; + case 2: + CanWalk = false; + break; + case 3: + DoScriptText(-1000000, m_creature);//5 + break; + case 4: + DoScriptText(-1000000, m_creature);//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(*m_creature,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(*m_creature,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(-1000000, m_creature);//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; + m_creature->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: + m_creature->SetVisibility(VISIBILITY_ON); + HandleGameObject(DATA_ARENA1, false); + DoScriptText(-1000000, m_creature);//4 + CanWalk = true; + Event_Timer = 0; + break; + case 8: + HandleGameObject(DATA_ARENA2, true); + Event_Timer = 5000; + break; + case 9: + m_creature->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 +######*/ + +#define SPELL_THUNDERCLAP 8732 +#define SPELL_FIREBALLVOLLEY 22425 +#define SPELL_MIGHTYBLOW 14099 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_THUNDERCLAP); + ThunderClap_Timer = 10000; + }else ThunderClap_Timer -= diff; + + //FireballVolley_Timer + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51) + { + if (FireballVolley_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FIREBALLVOLLEY); + FireballVolley_Timer = 15000; + }else FireballVolley_Timer -= diff; + } + + //MightyBlow_Timer + if (MightyBlow_Timer < diff) + { + DoCast(m_creature->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 +######*/ + +#define QUEST_4001 4001 +#define 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 +######*/ + +#define ITEM_THRORIUM_BROTHERHOOD_CONTRACT 18628 +#define ITEM_SULFURON_INGOT 17203 +#define QUEST_A_BINDING_CONTRACT 7604 +#define 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 +######*/ + +#define 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 TRINITY_DLL_DECL npc_dughal_stormwingAI : public npc_escortAI +{ + npc_dughal_stormwingAI(Creature *c) : npc_escortAI(c) {} + + void WaypointReached(uint32 i) + { + switch(i) + { + case 0:m_creature->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break; + case 1:pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; + case 2: + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->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 == m_creature) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->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) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + else + { + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->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 TRINITY_DLL_DECL 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: + m_creature->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 7: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + m_creature->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 10: + m_creature->setFaction(534); + break; + case 12: + m_creature->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID); + pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS); + break; + case 13: + m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK + break; + case 14: + pInstance->SetData(DATA_GATE_SR,0); + m_creature->setFaction(11); + break; + case 16: + m_creature->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID); + break; + case 17: + m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK + break; + case 18: + pInstance->SetData(DATA_GATE_SC,0); + break; + case 19: + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->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(rand()%3) + { + case 0:m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID);break; + case 1:m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID);break; + case 2:m_creature->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) + IsOnHold = false; + if (!pInstance->GetData(DATA_GATE_D) && pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED) + { + m_creature->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) + { + m_creature->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) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + else + { + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->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 TRINITY_DLL_DECL 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: + m_creature->setFaction(11); + m_creature->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 1: + m_creature->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 7: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + m_creature->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 8: + m_creature->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 11: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + m_creature->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 12: + m_creature->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 13: + m_creature->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID); + break; + case 20: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + m_creature->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 21: + m_creature->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID); + break; + case 23: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + m_creature->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID); + IsOnHold=true; + break; + case 24: + m_creature->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID); + break; + case 31: + m_creature->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID); + break; + case 32: + m_creature->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID); + PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, m_creature); + pInstance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); + break; + } + } + + void MoveInLineOfSight(Unit *who) + { + if (IsBeingEscorted) + return; + + if (who->GetTypeId() == TYPEID_PLAYER) + { + if (CAST_PLR(who)->GetQuestStatus(4322) == QUEST_STATUS_INCOMPLETE) + { + float Radius = 10.0; + if (m_creature->IsWithinDistInMap(who, Radius)) + { + IsOnHold = false; + Start(true, false, who->GetGUID()); + } + } + } + } + + void EnterCombat(Unit* who) + { + switch(rand()%3) + { + case 0:m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID);break; + case 1:m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID);break; + case 2:m_creature->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) + { + IsOnHold = 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); + IsOnHold = 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); + m_creature->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) + { + IsOnHold = false; + pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_ENDED); + } + } + if (pInstance->GetData(DATA_TOBIAS)==ENCOUNTER_STATE_OBJECTIVE_COMPLETED) IsOnHold = 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 TRINITY_DLL_DECL 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 == m_creature) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED); + } + } + + void WaypointReached(uint32 i) + { + switch(i) + { + case 0:m_creature->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break; + case 2: + pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; + case 4: + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->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) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + else + { + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->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 +######*/ + +#define SAY_GOT_BEER -1230000 +#define SPELL_DRUNKEN_RAGE 14872 +#define QUEST_ALE 4295 + +struct TRINITY_DLL_DECL 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 (IsBeingEscorted) + 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: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + break; + case 2: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); + break; + case 3: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); + break; + case 4: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + break; + case 5: + m_creature->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(*m_creature,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/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.cpp new file mode 100644 index 00000000000..1f2147b722c --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_ambassador_flamelash.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_Ambassador_Flamelash +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_FIREBLAST 15573 + +struct TRINITY_DLL_DECL boss_ambassador_flamelashAI : public ScriptedAI +{ + boss_ambassador_flamelashAI(Creature *c) : ScriptedAI(c) {} + + uint32 FireBlast_Timer; + uint32 Spirit_Timer; + int Rand; + int RandX; + int RandY; + Creature* Summoned; + + void Reset() + { + FireBlast_Timer = 2000; + Spirit_Timer = 24000; + } + + void EnterCombat(Unit *who) {} + + void SummonSpirits(Unit* victim) + { + Rand = rand()%10; + switch (rand()%2) + { + case 0: RandX -= Rand; break; + case 1: RandX += Rand; break; + } + Rand = 0; + Rand = rand()%10; + switch (rand()%2) + { + case 0: RandY -= Rand; break; + case 1: RandY += Rand; break; + } + Summoned = DoSpawnCreature(9178, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + if (Summoned) + (Summoned->AI())->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //FireBlast_Timer + if (FireBlast_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FIREBLAST); + FireBlast_Timer = 7000; + }else FireBlast_Timer -= diff; + + //Spirit_Timer + if (Spirit_Timer < diff) + { + SummonSpirits(m_creature->getVictim()); + SummonSpirits(m_creature->getVictim()); + SummonSpirits(m_creature->getVictim()); + SummonSpirits(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_anubshiah.cpp new file mode 100644 index 00000000000..3ad9458aba4 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/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 "precompiled.h" + +#define SPELL_SHADOWBOLT 17228 +#define SPELL_CURSEOFTONGUES 15470 +#define SPELL_CURSEOFWEAKNESS 17227 +#define SPELL_DEMONARMOR 11735 +#define SPELL_ENVELOPINGWEB 15471 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_SHADOWBOLT); + ShadowBolt_Timer = 7000; + }else ShadowBolt_Timer -= diff; + + //CurseOfTongues_Timer + if (CurseOfTongues_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) DoCast(target,SPELL_CURSEOFTONGUES); + CurseOfTongues_Timer = 18000; + }else CurseOfTongues_Timer -= diff; + + //CurseOfWeakness_Timer + if (CurseOfWeakness_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS); + CurseOfWeakness_Timer = 45000; + }else CurseOfWeakness_Timer -= diff; + + //DemonArmor_Timer + if (DemonArmor_Timer < diff) + { + DoCast(m_creature,SPELL_DEMONARMOR); + DemonArmor_Timer = 300000; + }else DemonArmor_Timer -= diff; + + //EnvelopingWeb_Timer + if (EnvelopingWeb_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) DoCast(target,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/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.cpp new file mode 100644 index 00000000000..2b6e67a7903 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_emperor_dagran_thaurissan.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_Emperor_Dagran_Thaurissan +SD%Complete: 99 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1230001 +#define SAY_SLAY -1230002 + +#define SPELL_HANDOFTHAURISSAN 17492 +#define SPELL_AVATAROFFLAME 15636 + +struct TRINITY_DLL_DECL 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, m_creature); + m_creature->CallForHelp(VISIBLE_RANGE); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (HandOfThaurissan_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,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(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp new file mode 100644 index 00000000000..337071c938e --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_general_angerforge.cpp @@ -0,0 +1,168 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" + +#define SPELL_MIGHTYBLOW 14099 +#define SPELL_HAMSTRING 9080 +#define SPELL_CLEAVE 20691 + +struct TRINITY_DLL_DECL 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; + int Rand1; + int Rand1X; + int Rand1Y; + int Rand2; + int Rand2X; + int Rand2Y; + Creature* SummonedAdds; + Creature* SummonedMedics; + + void Reset() + { + MightyBlow_Timer = 8000; + HamString_Timer = 12000; + Cleave_Timer = 16000; + Adds_Timer = 0; + Medics = false; + } + + void EnterCombat(Unit *who) + { + } + + void SummonAdds(Unit* victim) + { + Rand1 = rand()%15; + switch (rand()%2) + { + case 0: Rand1X = 0 - Rand1; break; + case 1: Rand1X = 0 + Rand1; break; + } + Rand1 = 0; + Rand1 = rand()%15; + switch (rand()%2) + { + case 0: Rand1Y = 0 - Rand1; break; + case 1: Rand1Y = 0 + Rand1; break; + } + Rand1 = 0; + SummonedAdds = DoSpawnCreature(8901, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); + if (SummonedAdds) + (SummonedAdds->AI())->AttackStart(victim); + } + + void SummonMedics(Unit* victim) + { + Rand2 = rand()%10; + switch (rand()%2) + { + case 0: Rand2X = 0 - Rand2; break; + case 1: Rand2X = 0 + Rand2; break; + } + Rand2 = 0; + Rand2 = rand()%10; + switch (rand()%2) + { + case 0: Rand2Y = 0 - Rand2; break; + case 1: Rand2Y = 0 + Rand2; break; + } + Rand2 = 0; + SummonedMedics = DoSpawnCreature(8894, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); + if (SummonedMedics) + (SummonedMedics->AI())->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //MightyBlow_Timer + if (MightyBlow_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW); + MightyBlow_Timer = 18000; + }else MightyBlow_Timer -= diff; + + //HamString_Timer + if (HamString_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_HAMSTRING); + HamString_Timer = 15000; + }else HamString_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 9000; + }else Cleave_Timer -= diff; + + //Adds_Timer + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21) + { + if (Adds_Timer < diff) + { + // summon 3 Adds every 25s + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + + Adds_Timer = 25000; + } else Adds_Timer -= diff; + } + + //Summon Medics + if (!Medics && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21) + { + SummonMedics(m_creature->getVictim()); + SummonMedics(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp new file mode 100644 index 00000000000..a4400e4d663 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_gorosh_the_dervish.cpp @@ -0,0 +1,82 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" + +#define SPELL_WHIRLWIND 15589 +#define SPELL_MORTALSTRIKE 24573 + +struct TRINITY_DLL_DECL 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(m_creature,SPELL_WHIRLWIND); + WhirlWind_Timer = 15000; + }else WhirlWind_Timer -= diff; + + //MortalStrike_Timer + if (MortalStrike_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp new file mode 100644 index 00000000000..faaa8f0a069 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_grizzle.cpp @@ -0,0 +1,89 @@ +/* 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 "precompiled.h" + +#define EMOTE_GENERIC_FRENZY_KILL -1000001 + +#define SPELL_GROUNDTREMOR 6524 +#define SPELL_FRENZY 28371 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_GROUNDTREMOR); + GroundTremor_Timer = 8000; + }else GroundTremor_Timer -= diff; + + //Frenzy_Timer + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51) + { + if (Frenzy_Timer < diff) + { + DoCast(m_creature,SPELL_FRENZY); + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); + + 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/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_high_interrogator_gerstahn.cpp new file mode 100644 index 00000000000..c2c97a9ec8a --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/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 "precompiled.h" + +#define SPELL_SHADOWWORDPAIN 10894 +#define SPELL_MANABURN 10876 +#define SPELL_PSYCHICSCREAM 8122 +#define SPELL_SHADOWSHIELD 22417 + +struct TRINITY_DLL_DECL 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) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target)DoCast(target,SPELL_SHADOWWORDPAIN); + ShadowWordPain_Timer = 7000; + }else ShadowWordPain_Timer -= diff; + + //ManaBurn_Timer + if (ManaBurn_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target)DoCast(target,SPELL_MANABURN); + ManaBurn_Timer = 10000; + }else ManaBurn_Timer -= diff; + + //PsychicScream_Timer + if (PsychicScream_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_PSYCHICSCREAM); + PsychicScream_Timer = 30000; + }else PsychicScream_Timer -= diff; + + //ShadowShield_Timer + if (ShadowShield_Timer < diff) + { + DoCast(m_creature,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/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.cpp new file mode 100644 index 00000000000..d0b97116c28 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_magmus.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_Magmus +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Depths +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_FIERYBURST 13900 +#define SPELL_WARSTOMP 24375 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_FIERYBURST); + FieryBurst_Timer = 6000; + }else FieryBurst_Timer -= diff; + + //WarStomp_Timer + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51) + { + if (WarStomp_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_WARSTOMP); + WarStomp_Timer = 8000; + }else WarStomp_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; +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/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.cpp new file mode 100644 index 00000000000..7602a14fbfe --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_moira_bronzebeard.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_Moira_Bronzbeard +SD%Complete: 90 +SDComment: Healing of Emperor NYI +SDCategory: Blackrock Depths +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_HEAL 10917 +#define SPELL_RENEW 10929 +#define SPELL_SHIELD 10901 +#define SPELL_MINDBLAST 10947 +#define SPELL_SHADOWWORDPAIN 10894 +#define SPELL_SMITE 10934 + +struct TRINITY_DLL_DECL boss_moira_bronzebeardAI : public ScriptedAI +{ + boss_moira_bronzebeardAI(Creature *c) : ScriptedAI(c) {} + + uint32 Heal_Timer; + uint32 MindBlast_Timer; + uint32 ShadowWordPain_Timer; + uint32 Smite_Timer; + Unit* PlayerHolder; + Unit* Target; + bool Heal; + + void Reset() + { + Target = NULL; + 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(m_creature->getVictim(),SPELL_MINDBLAST); + MindBlast_Timer = 14000; + }else MindBlast_Timer -= diff; + + //ShadowWordPain_Timer + if (ShadowWordPain_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN); + ShadowWordPain_Timer = 18000; + }else ShadowWordPain_Timer -= diff; + + //Smite_Timer + if (Smite_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp new file mode 100644 index 00000000000..d7ee6a6667c --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/boss_tomb_of_seven.cpp @@ -0,0 +1,249 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_blackrock_depths.h" + +enum +{ + SPELL_SMELT_DARK_IRON = 14891, + SPELL_LEARN_SMELT = 14894, + QUEST_SPECTRAL_CHALICE = 4083, + 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_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) >= 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) >= SKILLPOINT_MIN) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TRIBUTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), 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, "[PH] Continue...", 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 +{ + SPELL_SHADOWBOLTVOLLEY = 15245, + SPELL_IMMOLATE = 12742, + SPELL_CURSEOFWEAKNESS = 12493, + SPELL_DEMONARMOR = 13787, + SPELL_SUMMON_VOIDWALKERS = 15092 +}; + +struct TRINITY_DLL_DECL 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; + int Rand; + int RandX; + int RandY; + Creature* Summoned; + + void Reset() + { + ShadowVolley_Timer = 10000; + Immolate_Timer = 18000; + CurseOfWeakness_Timer = 5000; + DemonArmor_Timer = 16000; + Voidwalkers = false; + + m_creature->setFaction(FACTION_FRIEND); + + // was set before event start, so set again + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + + if (pInstance) + if (pInstance->GetData(DATA_GHOSTKILL) >= 7) + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + else + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + + void EnterCombat(Unit *who) + { + } + + void EnterEvadeMode() + { + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->LoadCreaturesAddon(); + if (m_creature->isAlive()) + m_creature->GetMotionMaster()->MoveTargetedHome(); + m_creature->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(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY); + ShadowVolley_Timer = 12000; + }else ShadowVolley_Timer -= diff; + + //Immolate_Timer + if (Immolate_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_IMMOLATE); + + Immolate_Timer = 25000; + }else Immolate_Timer -= diff; + + //CurseOfWeakness_Timer + if (CurseOfWeakness_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS); + CurseOfWeakness_Timer = 45000; + }else CurseOfWeakness_Timer -= diff; + + //DemonArmor_Timer + if (DemonArmor_Timer < diff) + { + DoCast(m_creature,SPELL_DEMONARMOR); + DemonArmor_Timer = 300000; + }else DemonArmor_Timer -= diff; + + //Summon Voidwalkers + if (!Voidwalkers && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51) + { + m_creature->CastSpell(m_creature->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!" + +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, "[PH] Continue...", 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_NOT_ATTACKABLE_2); + 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/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/def_blackrock_depths.h b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/def_blackrock_depths.h new file mode 100644 index 00000000000..6ce124a7c3e --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/def_blackrock_depths.h @@ -0,0 +1,38 @@ +/* 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 +{ + 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 +}; +#endif + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp new file mode 100644 index 00000000000..f8993b36124 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/instance_blackrock_depths.cpp @@ -0,0 +1,424 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along 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 "precompiled.h" +#include "def_blackrock_depths.h" + +#define TIMER_TOMBOFTHESEVEN 15000 + +enum +{ + 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, + + 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_GOLEM_ROOM_N = 170573, + GO_GOLEM_ROOM_S = 170574, + GO_THONE_ROOM = 170575, + + GO_SPECTRAL_CHALICE = 164869, + GO_CHEST_SEVEN = 169243 +}; + +struct TRINITY_DLL_DECL 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 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 GoGolemNGUID; + uint64 GoGolemSGUID; + uint64 GoThoneGUID; + 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; + + 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; + GoGolemNGUID = 0; + GoGolemSGUID = 0; + GoThoneGUID = 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; + } + } + + 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_GOLEM_ROOM_N: GoGolemNGUID = pGo->GetGUID(); break; + case GO_GOLEM_ROOM_S: GoGolemSGUID = pGo->GetGUID(); break; + case GO_THONE_ROOM: GoThoneGUID = 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; + } + 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_NOT_ATTACKABLE_2); + if (Unit* target = boss->SelectNearestTarget(500)) + boss->AI()->AttackStart(target); + } + } + } + + 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(); + }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/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_drakkisath.cpp new file mode 100644 index 00000000000..72bc0aa6bd2 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/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 "precompiled.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 TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_FIRENOVA); + FireNova_Timer = 10000; + }else FireNova_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 8000; + }else Cleave_Timer -= diff; + + //Confliguration_Timer + if (Confliguration_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CONFLIGURATION); + Confliguration_Timer = 18000; + }else Confliguration_Timer -= diff; + + //Thunderclap_Timer + if (Thunderclap_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp new file mode 100644 index 00000000000..4a6a01af71d --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_gyth.cpp @@ -0,0 +1,206 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gyth +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_CORROSIVEACID 20667 +#define SPELL_FREEZE 18763 +#define SPELL_FLAMEBREATH 20712 + +struct TRINITY_DLL_DECL 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; + Creature *SummonedCreature; + + 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 + m_creature->SetDisplayId(11686); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit *who) + { + } + + void SummonCreatureWithRandomTarget(uint32 creatureId) + { + Unit* Summoned = m_creature->SummonCreature(creatureId, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000); + if (Summoned) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + Summoned->AddThreat(target, 1.0f); + } + } + + void UpdateAI(const uint32 diff) + { + //char buf[200]; + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (!RootSelf) + { + //m_creature->m_canMove = true; + DoCast(m_creature, 33356); + RootSelf = true; + } + + if (!bAggro && Line1Count == 0 && Line2Count == 0) + { + if (Aggro_Timer < diff) + { + bAggro = true; + // Visible now! + m_creature->SetDisplayId(9723); + m_creature->setFaction(14); + m_creature->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(m_creature->getVictim(), SPELL_CORROSIVEACID); + CorrosiveAcid_Timer = 7000; + } else CorrosiveAcid_Timer -= diff; + + // Freeze_Timer + if (Freeze_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FREEZE); + Freeze_Timer = 16000; + } else Freeze_Timer -= diff; + + // Flamebreath_Timer + if (Flamebreath_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FLAMEBREATH); + Flamebreath_Timer = 10500; + } else Flamebreath_Timer -= diff; + + //Summon Rend + if (!SummonedRend && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11 + && m_creature->GetHealth() > 0) + { + //summon Rend and Change model to normal Gyth + //Inturrupt any spell casting + m_creature->InterruptNonMeleeSpells(false); + //Gyth model + m_creature->SetDisplayId(9806); + m_creature->SummonCreature(10429, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_halycon.cpp new file mode 100644 index 00000000000..1727105427b --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/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 "precompiled.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 TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_CROWDPUMMEL); + CrowdPummel_Timer = 14000; + }else CrowdPummel_Timer -= diff; + + //MightyBlow_Timer + if (MightyBlow_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW); + MightyBlow_Timer = 10000; + }else MightyBlow_Timer -= diff; + + //Summon Gizrul + if (!Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25) + { + m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_highlord_omokk.cpp new file mode 100644 index 00000000000..06dee5b5775 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/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 "precompiled.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 TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_WARSTOMP); + WarStomp_Timer = 14000; + }else WarStomp_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 8000; + }else Cleave_Timer -= diff; + + //Strike_Timer + if (Strike_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_STRIKE); + Strike_Timer = 10000; + }else Strike_Timer -= diff; + + //Rend_Timer + if (Rend_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_REND); + Rend_Timer = 18000; + }else Rend_Timer -= diff; + + //SunderArmor_Timer + if (SunderArmor_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SUNDERARMOR); + SunderArmor_Timer = 25000; + }else SunderArmor_Timer -= diff; + + //KnockAway_Timer + if (KnockAway_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY); + KnockAway_Timer = 12000; + }else KnockAway_Timer -= diff; + + //Slow_Timer + if (Slow_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_mother_smolderweb.cpp new file mode 100644 index 00000000000..0bc2f9d2370 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/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 "precompiled.h" + +#define SPELL_CRYSTALIZE 16104 +#define SPELL_MOTHERSMILK 16468 +#define SPELL_SUMMON_SPIRE_SPIDERLING 16103 + +struct TRINITY_DLL_DECL 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 (m_creature->GetHealth() <= damage) + m_creature->CastSpell(m_creature,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(m_creature,SPELL_CRYSTALIZE); + Crystalize_Timer = 15000; + }else Crystalize_Timer -= diff; + + //MothersMilk_Timer + if (MothersMilk_Timer < diff) + { + DoCast(m_creature,SPELL_MOTHERSMILK); + MothersMilk_Timer = 5000+rand()%7500; + }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/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp new file mode 100644 index 00000000000..0931db0319a --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_overlord_wyrmthalak.cpp @@ -0,0 +1,130 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Overlord_Wyrmthalak +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.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 TRINITY_DLL_DECL boss_overlordwyrmthalakAI : public ScriptedAI +{ + boss_overlordwyrmthalakAI(Creature *c) : ScriptedAI(c) {} + + uint32 BlastWave_Timer; + uint32 Shout_Timer; + uint32 Cleave_Timer; + uint32 Knockaway_Timer; + bool Summoned; + Creature *SummonedCreature; + + 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(m_creature->getVictim(),SPELL_BLASTWAVE); + BlastWave_Timer = 20000; + }else BlastWave_Timer -= diff; + + //Shout_Timer + if (Shout_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SHOUT); + Shout_Timer = 10000; + }else Shout_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 7000; + }else Cleave_Timer -= diff; + + //Knockaway_Timer + if (Knockaway_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY); + Knockaway_Timer = 14000; + }else Knockaway_Timer -= diff; + + //Summon two Beserks + if (!Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + SummonedCreature = m_creature->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000); + if (SummonedCreature) + (SummonedCreature->AI())->AttackStart(target); + SummonedCreature = m_creature->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000); + if (SummonedCreature) + (SummonedCreature->AI())->AttackStart(target); + 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/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp new file mode 100644 index 00000000000..dd4479fbeaa --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_pyroguard_emberseer.cpp @@ -0,0 +1,94 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" + +#define SPELL_FIRENOVA 23462 +#define SPELL_FLAMEBUFFET 23341 +#define SPELL_PYROBLAST 17274 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_FIRENOVA); + FireNova_Timer = 6000; + }else FireNova_Timer -= diff; + + //FlameBuffet_Timer + if (FlameBuffet_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FLAMEBUFFET); + FlameBuffet_Timer = 14000; + }else FlameBuffet_Timer -= diff; + + //PyroBlast_Timer + if (PyroBlast_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) DoCast(target,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/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_quartermaster_zigris.cpp new file mode 100644 index 00000000000..c2db9b7f750 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/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 "precompiled.h" + +#define SPELL_SHOOT 16496 +#define SPELL_STUNBOMB 16497 +#define SPELL_HEALING_POTION 15504 +#define SPELL_HOOKEDNET 15609 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_SHOOT); + Shoot_Timer = 500; + }else Shoot_Timer -= diff; + + //StunBomb_Timer + if (StunBomb_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_rend_blackhand.cpp new file mode 100644 index 00000000000..2899b05deb6 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/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 "precompiled.h" + +#define SPELL_WHIRLWIND 26038 +#define SPELL_CLEAVE 20691 +#define SPELL_THUNDERCLAP 23931 //Not sure if he cast this spell + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_WHIRLWIND); + WhirlWind_Timer = 18000; + }else WhirlWind_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 10000; + }else Cleave_Timer -= diff; + + //Thunderclap_Timer + if (Thunderclap_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.cpp new file mode 100644 index 00000000000..ae44306cf30 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_shadow_hunter_voshgajin.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_Shadow_Hunter_Voshgajin +SD%Complete: 100 +SDComment: +SDCategory: Blackrock Spire +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_CURSEOFBLOOD 24673 +#define SPELL_HEX 16708 +#define SPELL_CLEAVE 20691 + +struct TRINITY_DLL_DECL 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; + + //m_creature->CastSpell(m_creature,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(m_creature->getVictim(),SPELL_CURSEOFBLOOD); + CurseOfBlood_Timer = 45000; + }else CurseOfBlood_Timer -= diff; + + //Hex_Timer + if (Hex_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) DoCast(target,SPELL_HEX); + Hex_Timer = 15000; + }else Hex_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp new file mode 100644 index 00000000000..802ab32cc80 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_the_beast.cpp @@ -0,0 +1,94 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" + +#define SPELL_FLAMEBREAK 16785 +#define SPELL_IMMOLATE 20294 +#define SPELL_TERRIFYINGROAR 14100 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_FLAMEBREAK); + Flamebreak_Timer = 10000; + }else Flamebreak_Timer -= diff; + + //Immolate_Timer + if (Immolate_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) DoCast(target,SPELL_IMMOLATE); + Immolate_Timer = 8000; + }else Immolate_Timer -= diff; + + //TerrifyingRoar_Timer + if (TerrifyingRoar_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/boss_warmaster_voone.cpp new file mode 100644 index 00000000000..2257a290a1b --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_spire/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 "precompiled.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 TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_SNAPKICK); + Snapkick_Timer = 6000; + }else Snapkick_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 12000; + }else Cleave_Timer -= diff; + + //Uppercut_Timer + if (Uppercut_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_UPPERCUT); + Uppercut_Timer = 14000; + }else Uppercut_Timer -= diff; + + //MortalStrike_Timer + if (MortalStrike_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE); + MortalStrike_Timer = 10000; + }else MortalStrike_Timer -= diff; + + //Pummel_Timer + if (Pummel_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_PUMMEL); + Pummel_Timer = 16000; + }else Pummel_Timer -= diff; + + //ThrowAxe_Timer + if (ThrowAxe_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_broodlord_lashlayer.cpp new file mode 100644 index 00000000000..48a2888c1e6 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/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 "precompiled.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 TRINITY_DLL_DECL 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, m_creature); + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 7000; + }else Cleave_Timer -= diff; + + // BlastWave + if (BlastWave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_BLASTWAVE); + BlastWave_Timer = 8000 + rand()%8000; + }else BlastWave_Timer -= diff; + + //MortalStrike_Timer + if (MortalStrike_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE); + MortalStrike_Timer = 25000 + rand()%10000; + }else MortalStrike_Timer -= diff; + + if (KnockBack_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KNOCKBACK); + //Drop 50% aggro + if (DoGetThreat(m_creature->getVictim())) + DoModifyThreatPercent(m_creature->getVictim(),-50); + + KnockBack_Timer = 15000 + rand()%15000; + }else KnockBack_Timer -= diff; + + if (EnterEvadeIfOutOfCombatArea(diff)) + DoScriptText(SAY_LEASH, m_creature); + + 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/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp new file mode 100644 index 00000000000..7b3e04f9d37 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_chromaggus.cpp @@ -0,0 +1,316 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" + +#define EMOTE_FRENZY -1469002 +#define EMOTE_SHIMMER -1469003 + +//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% +#define SPELL_FIRE_VURNALBILTY 22277 +#define SPELL_FROST_VURNALBILTY 22278 +#define SPELL_SHADOW_VURNALBILTY 22279 +#define SPELL_NATURE_VURNALBILTY 22280 +#define SPELL_ARCANE_VURNALBILTY 22281 + +#define SPELL_INCINERATE 23308 //Incinerate 23308,23309 +#define SPELL_TIMELAPSE 23310 //Time lapse 23310, 23311(old threat mod that was removed in 2.01) +#define SPELL_CORROSIVEACID 23313 //Corrosive Acid 23313, 23314 +#define SPELL_IGNITEFLESH 23315 //Ignite Flesh 23315,23316 +#define 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 +#define SPELL_BROODAF_BLUE 23153 //Blue affliction 23153 +#define SPELL_BROODAF_BLACK 23154 //Black affliction 23154 +#define SPELL_BROODAF_RED 23155 //Red affliction 23155 (23168 on death) +#define SPELL_BROODAF_BRONZE 23170 //Bronze Affliction 23170 +#define SPELL_BROODAF_GREEN 23169 //Brood Affliction Green 23169 + +#define SPELL_CHROMATIC_MUT_1 23174 //Spell cast on player if they get all 5 debuffs + +#define SPELL_FRENZY 28371 //The frenzy spell may be wrong +#define SPELL_ENRAGE 28747 + +struct TRINITY_DLL_DECL 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 + srand(time(NULL)); + switch (rand()%20) + { + //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 vurlnability 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 vurlnability spell + if (CurrentVurln_Spell) + m_creature->RemoveAurasDueToSpell(CurrentVurln_Spell); + + //Cast new random vurlnabilty on self + uint32 spell; + switch (rand()%5) + { + case 0: spell = SPELL_FIRE_VURNALBILTY; break; + case 1: spell = SPELL_FROST_VURNALBILTY; break; + case 2: spell = SPELL_SHADOW_VURNALBILTY; break; + case 3: spell = SPELL_NATURE_VURNALBILTY; break; + case 4: spell = SPELL_ARCANE_VURNALBILTY; break; + } + + DoCast(m_creature,spell); + CurrentVurln_Spell = spell; + + DoScriptText(EMOTE_SHIMMER, m_creature); + Shimmer_Timer = 45000; + }else Shimmer_Timer -= diff; + + //Breath1_Timer + if (Breath1_Timer < diff) + { + DoCast(m_creature->getVictim(),Breath1_Spell); + Breath1_Timer = 60000; + }else Breath1_Timer -= diff; + + //Breath2_Timer + if (Breath2_Timer < diff) + { + DoCast(m_creature->getVictim(),Breath2_Spell); + Breath2_Timer = 60000; + }else Breath2_Timer -= diff; + + //Affliction_Timer + if (Affliction_Timer < diff) + { + uint32 SpellAfflict = 0; + + switch (rand()%5) + { + case 0: SpellAfflict = SPELL_BROODAF_BLUE; break; + case 1: SpellAfflict = SPELL_BROODAF_BLACK; break; + case 2: SpellAfflict = SPELL_BROODAF_RED; break; + case 3: SpellAfflict = SPELL_BROODAF_BRONZE; break; + case 4: SpellAfflict = SPELL_BROODAF_GREEN; break; + } + + std::list::iterator i; + + for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end();) + { + Unit* pUnit = NULL; + pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + ++i; + + if (pUnit) + { + //Cast affliction + DoCast(pUnit, SpellAfflict, 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)) + { + //target->RemoveAllAuras(); + //DoCast(target,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(m_creature,SPELL_FRENZY); + DoScriptText(EMOTE_FRENZY, m_creature); + Frenzy_Timer = 10000 + (rand() % 5000); + }else Frenzy_Timer -= diff; + + //Enrage if not already enraged and below 20% + if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) + { + DoCast(m_creature,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/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_ebonroc.cpp new file mode 100644 index 00000000000..02f59819516 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/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 "precompiled.h" + +#define SPELL_SHADOWFLAME 22539 +#define SPELL_WINGBUFFET 18500 +#define SPELL_SHADOWOFEBONROC 23340 +#define SPELL_HEAL 41386 //Thea Heal spell of his Shadow + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_SHADOWFLAME); + ShadowFlame_Timer = 12000 + rand()%3000; + }else ShadowFlame_Timer -= diff; + + //Wing Buffet Timer + if (WingBuffet_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_WINGBUFFET); + WingBuffet_Timer = 25000; + }else WingBuffet_Timer -= diff; + + //Shadow of Ebonroc Timer + if (ShadowOfEbonroc_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SHADOWOFEBONROC); + ShadowOfEbonroc_Timer = 25000 + rand()%10000; + }else ShadowOfEbonroc_Timer -= diff; + + if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC)) + { + if (Heal_Timer < diff) + { + DoCast(m_creature, SPELL_HEAL); + Heal_Timer = 1000 + rand()%2000; + }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/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_firemaw.cpp new file mode 100644 index 00000000000..bab716acffd --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/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 "precompiled.h" + +#define SPELL_SHADOWFLAME 22539 +#define SPELL_WINGBUFFET 23339 +#define SPELL_FLAMEBUFFET 23341 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_SHADOWFLAME); + ShadowFlame_Timer = 15000 + rand()%3000; + }else ShadowFlame_Timer -= diff; + + //WingBuffet_Timer + if (WingBuffet_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_WINGBUFFET); + if (DoGetThreat(m_creature->getVictim())) + DoModifyThreatPercent(m_creature->getVictim(),-75); + + WingBuffet_Timer = 25000; + }else WingBuffet_Timer -= diff; + + //FlameBuffet_Timer + if (FlameBuffet_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_flamegor.cpp new file mode 100644 index 00000000000..5492477193f --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/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 "precompiled.h" + +#define EMOTE_FRENZY -1469031 + +#define SPELL_SHADOWFLAME 22539 +#define SPELL_WINGBUFFET 23339 +#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_SHADOWFLAME); + ShadowFlame_Timer = 15000 + rand()%7000; + }else ShadowFlame_Timer -= diff; + + //WingBuffet_Timer + if (WingBuffet_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_WINGBUFFET); + if (DoGetThreat(m_creature->getVictim())) + DoModifyThreatPercent(m_creature->getVictim(),-75); + + WingBuffet_Timer = 25000; + }else WingBuffet_Timer -= diff; + + //Frenzy_Timer + if (Frenzy_Timer < diff) + { + DoScriptText(EMOTE_FRENZY, m_creature); + DoCast(m_creature,SPELL_FRENZY); + Frenzy_Timer = 8000 + (rand()%2000); + }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/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.cpp new file mode 100644 index 00000000000..4ecfda2e329 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_nefarian.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_Nefarian +SD%Complete: 80 +SDComment: Some issues with class calls effecting more than one class +SDCategory: Blackwing Lair +EndScriptData */ + +#include "precompiled.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 TRINITY_DLL_DECL 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; + + 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; + } + + void KilledUnit(Unit* Victim) + { + if (rand()%5) + return; + + DoScriptText(SAY_SLAY, m_creature, Victim); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void EnterCombat(Unit *who) + { + switch (rand()%3) + { + case 0: DoScriptText(SAY_XHEALTH, m_creature); break; + case 1: DoScriptText(SAY_AGGRO, m_creature); break; + case 2: DoScriptText(SAY_SHADOWFLAME, m_creature); break; + } + + DoCast(who,SPELL_SHADOWFLAME_INITIAL); + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //ShadowFlame_Timer + if (ShadowFlame_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME); + ShadowFlame_Timer = 12000; + }else ShadowFlame_Timer -= diff; + + //BellowingRoar_Timer + if (BellowingRoar_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_BELLOWINGROAR); + BellowingRoar_Timer = 30000; + }else BellowingRoar_Timer -= diff; + + //VeilOfShadow_Timer + if (VeilOfShadow_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_VEILOFSHADOW); + VeilOfShadow_Timer = 15000; + }else VeilOfShadow_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->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(m_creature->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 (rand()%9) + { + case 0: + DoScriptText(SAY_MAGE, m_creature); + DoCast(m_creature,SPELL_MAGE); + break; + case 1: + DoScriptText(SAY_WARRIOR, m_creature); + DoCast(m_creature,SPELL_WARRIOR); + break; + case 2: + DoScriptText(SAY_DRUID, m_creature); + DoCast(m_creature,SPELL_DRUID); + break; + case 3: + DoScriptText(SAY_PRIEST, m_creature); + DoCast(m_creature,SPELL_PRIEST); + break; + case 4: + DoScriptText(SAY_PALADIN, m_creature); + DoCast(m_creature,SPELL_PALADIN); + break; + case 5: + DoScriptText(SAY_SHAMAN, m_creature); + DoCast(m_creature,SPELL_SHAMAN); + break; + case 6: + DoScriptText(SAY_WARLOCK, m_creature); + DoCast(m_creature,SPELL_WARLOCK); + break; + case 7: + DoScriptText(SAY_HUNTER, m_creature); + DoCast(m_creature,SPELL_HUNTER); + break; + case 8: + DoScriptText(SAY_ROGUE, m_creature); + DoCast(m_creature,SPELL_ROGUE); + break; + } + + ClassCall_Timer = 35000 + (rand() % 5000); + }else ClassCall_Timer -= diff; + + //Phase3 begins when we are below X health + if (!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) + { + Phase3 = true; + DoScriptText(SAY_RAISE_SKELETONS, m_creature); + } + + 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/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp new file mode 100644 index 00000000000..731e32578d2 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_razorgore.cpp @@ -0,0 +1,129 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.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 TRINITY_DLL_DECL 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, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 7000 + rand()%3000; + }else Cleave_Timer -= diff; + + //WarStomp_Timer + if (WarStomp_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_WARSTOMP); + WarStomp_Timer = 15000 + rand()%10000; + }else WarStomp_Timer -= diff; + + //FireballVolley_Timer + if (FireballVolley_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FIREBALLVOLLEY); + FireballVolley_Timer = 12000 + rand()%3000; + }else FireballVolley_Timer -= diff; + + //Conflagration_Timer + if (Conflagration_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CONFLAGRATION); + //We will remove this threat reduction and add an aura check. + + //if (DoGetThreat(m_creature->getVictim())) + //DoModifyThreatPercent(m_creature->getVictim(),-50); + + Conflagration_Timer = 12000; + }else Conflagration_Timer -= diff; + + // Aura Check. If the gamer is affected by confliguration we attack a random gamer. + if (m_creature->getVictim() && m_creature->getVictim()->HasAura(SPELL_CONFLAGRATION)) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target) + m_creature->TauntApply(target); + } + + 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/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp new file mode 100644 index 00000000000..39fbd1f4be9 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_vaelastrasz.cpp @@ -0,0 +1,258 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.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 TRINITY_DLL_DECL boss_vaelAI : public ScriptedAI +{ + boss_vaelAI(Creature *c) : ScriptedAI(c) + { + c->SetUInt32Value(UNIT_NPC_FLAGS,1); + c->setFaction(35); + c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + uint64 PlayerGUID; + uint32 SpeachTimer; + uint32 SpeachNum; + uint32 Cleave_Timer; + uint32 FlameBreath_Timer; + uint32 FireNova_Timer; + uint32 BurningAdrenalineCaster_Timer; + uint32 BurningAdrenalineTank_Timer; + uint32 TailSwipe_Timer; + bool HasYelled; + bool DoingSpeach; + + void Reset() + { + PlayerGUID = 0; + SpeachTimer = 0; + SpeachNum = 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; + DoingSpeach = false; + } + + void BeginSpeach(Unit* target) + { + //Stand up and begin speach + PlayerGUID = target->GetGUID(); + + //10 seconds + DoScriptText(SAY_LINE1, m_creature); + + SpeachTimer = 10000; + SpeachNum = 0; + DoingSpeach = true; + } + + void KilledUnit(Unit *victim) + { + if (rand()%5) + return; + + DoScriptText(SAY_KILLTARGET, m_creature, victim); + } + + void EnterCombat(Unit *who) + { + DoCast(m_creature,SPELL_ESSENCEOFTHERED); + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + //Speach + if (DoingSpeach) + { + if (SpeachTimer < diff) + { + switch (SpeachNum) + { + case 0: + //16 seconds till next line + DoScriptText(SAY_LINE2, m_creature); + SpeachTimer = 16000; + SpeachNum++; + 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, m_creature); + SpeachTimer = 10000; + SpeachNum++; + break; + case 2: + m_creature->setFaction(103); + m_creature->SetHealth(int(m_creature->GetMaxHealth()*.3)); + if (PlayerGUID && Unit::GetUnit((*m_creature),PlayerGUID)) + { + AttackStart(Unit::GetUnit((*m_creature),PlayerGUID)); + DoCast(m_creature,SPELL_ESSENCEOFTHERED); + } + SpeachTimer = 0; + DoingSpeach = false; + break; + } + }else SpeachTimer -= diff; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + // Yell if hp lower than 15% + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 15 && !HasYelled) + { + DoScriptText(SAY_HALFLIFE, m_creature); + HasYelled = true; + } + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 15000; + }else Cleave_Timer -= diff; + + //FlameBreath_Timer + if (FlameBreath_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FLAMEBREATH); + FlameBreath_Timer = 4000 + rand()%4000; + }else FlameBreath_Timer -= diff; + + //BurningAdrenalineCaster_Timer + if (BurningAdrenalineCaster_Timer < diff) + { + Unit* target = NULL; + + int i = 0 ; + while (i < 3) // max 3 tries to get a random target with power_mana + { + ++i; + target = SelectUnit(SELECT_TARGET_RANDOM,1);//not aggro leader + if (target) + if (target->getPowerType() == POWER_MANA) + i=3; + } + if (target) // cast on self (see below) + target->CastSpell(target,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 + m_creature->getVictim()->CastSpell(m_creature->getVictim(),SPELL_BURNINGADRENALINE,1); + + BurningAdrenalineTank_Timer = 45000; + }else BurningAdrenalineTank_Timer -= diff; + + //FireNova_Timer + if (FireNova_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FIRENOVA); + FireNova_Timer = 5000; + }else FireNova_Timer -= diff; + + //TailSwipe_Timer + if (TailSwipe_Timer < diff) + { + //Only cast if we are behind + /*if (!m_creature->HasInArc(M_PI, m_creature->getVictim())) + { + DoCast(m_creature->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())->BeginSpeach(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) +{ + 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/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp new file mode 100644 index 00000000000..78ed29fc27e --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/boss_victor_nefarius.cpp @@ -0,0 +1,392 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.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 TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI +{ + boss_victor_nefariusAI(Creature *c) : ScriptedAI(c) + { + NefarianGUID = 0; + srand(time(NULL)); + switch (rand()%20) + { + 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; + + m_creature->SetUInt32Value(UNIT_NPC_FLAGS,1); + m_creature->setFaction(35); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void BeginEvent(Player* target) + { + DoScriptText(SAY_GAMESBEGIN_2, m_creature); + + //Trinity::Singleton::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin(); + /* + list ::iterator i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin(); + + for (i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin(); i != MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().end(); ++i) + { + AttackStart((*i)); + } + */ + m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0); + m_creature->setFaction(103); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + AttackStart(target); + } + + 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 && m_creature->IsHostileTo(who)) + { + //Add them to our threat list + m_creature->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) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + DoCast(target,SPELL_SHADOWBOLT); + + ShadowBoltTimer = 3000 + (rand()%7000); + }else ShadowBoltTimer -= diff; + + //FearTimer + if (FearTimer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + DoCast(target,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* target = NULL; + + //1 in 3 chance it will be a chromatic + if (rand()%3 == 0) + CreatureID = CREATURE_CHROMATIC_DRAKANOID; + else CreatureID = DrakType1; + + SpawnedAdds++; + + //Spawn Creature and force it to start attacking a random target + Spawned = m_creature->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target && Spawned) + { + Spawned->AI()->AttackStart(target); + Spawned->setFaction(103); + } + + //1 in 3 chance it will be a chromatic + if (rand()%3 == 0) + CreatureID = CREATURE_CHROMATIC_DRAKANOID; + else CreatureID = DrakType2; + + SpawnedAdds++; + + target = NULL; + Spawned = NULL; + Spawned = m_creature->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target && Spawned) + { + Spawned->AI()->AttackStart(target); + 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(m_creature->GetMapId(), m_creature)->CreatureRelocation(m_creature,0,0,-5000,0); + + //Inturrupt any spell casting + m_creature->InterruptNonMeleeSpells(false); + + //Root self + DoCast(m_creature,33356); + + //Make super invis + DoCast(m_creature,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); + m_creature->addUnitState(UNIT_STAT_FLEEING); + + //Spawn nef and have him attack a random target + Creature* Nefarian = NULL; + Nefarian = m_creature->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000); + target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target && Nefarian) + { + Nefarian->AI()->AttackStart(target); + 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((*m_creature),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; + m_creature->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/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/instance_blackwing_lair.cpp new file mode 100644 index 00000000000..97bf717589a --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackwing_lair/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 "precompiled.h" + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/deadmines/deadmines.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/deadmines/deadmines.cpp new file mode 100644 index 00000000000..b631c3b13e7 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/deadmines/deadmines.cpp @@ -0,0 +1,237 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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 "precompiled.h" +#include "def_deadmines.h" +#include "Spell.h" + +#define SOUND_CANNONFIRE 1400 +#define SOUND_DESTROYDOOR 3079 +#define SAY_MR_SMITE_ALARM1 "You there, check out that noise!" +#define SOUND_MR_SMITE_ALARM1 5775 +#define SAY_MR_SMITE_ALARM2 "We're under attack! A vast, ye swabs! Repel the invaders!" +#define SOUND_MR_SMITE_ALARM2 5777 + +#define GO_IRONCLAD_DOOR 16397 +#define GO_DEFIAS_CANNON 16398 +#define GO_DOOR_LEVER 101833 + +#define CANNON_BLAST_TIMER 3000 +#define PIRATES_DELAY_TIMER 1000 + +struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance +{ + instance_deadmines(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + GameObject* IronCladDoor; + GameObject* DefiasCannon; + GameObject* DoorLever; + Creature* DefiasPirate1; + Creature* DefiasPirate2; + Creature* DefiasCompanion; + uint32 State; + uint32 CannonBlast_Timer; + uint32 PiratesDelay_Timer; + + void Initialize() + { + IronCladDoor = NULL; + DefiasCannon = NULL; + DoorLever = NULL; + State = CANNON_NOT_USED; + } + + virtual void Update(uint32 diff) + { + if (!IronCladDoor || !DefiasCannon || !DoorLever) + return; + + switch(State) + { + case CANNON_GUNPOWDER_USED: + CannonBlast_Timer = CANNON_BLAST_TIMER; + // it's a hack - Mr. Smite should do that but his too far away + IronCladDoor->SetName("Mr. Smite"); + IronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM1, LANG_UNIVERSAL, 0); + DoPlaySound(IronCladDoor, SOUND_MR_SMITE_ALARM1); + State=CANNON_BLAST_INITIATED; + break; + case CANNON_BLAST_INITIATED: + PiratesDelay_Timer = PIRATES_DELAY_TIMER; + if (CannonBlast_TimerMonsterYell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, 0); + DoPlaySound(IronCladDoor, SOUND_MR_SMITE_ALARM2); + State = PIRATES_ATTACK; + }else + CannonBlast_Timer-=diff; + break; + case PIRATES_ATTACK: + if (PiratesDelay_TimerSummonCreature(657,IronCladDoor->GetPositionX() - 2,IronCladDoor->GetPositionY()-7,IronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + DefiasPirate2 = IronCladDoor->SummonCreature(657,IronCladDoor->GetPositionX() + 3,IronCladDoor->GetPositionY()-6,IronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + DefiasCompanion = IronCladDoor->SummonCreature(3450,IronCladDoor->GetPositionX() + 2,IronCladDoor->GetPositionY()-6,IronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); + } + + void MoveCreaturesInside() + { + if (!DefiasPirate1 || !DefiasPirate2 || !DefiasCompanion) + return; + + MoveCreatureInside(DefiasPirate1); + MoveCreatureInside(DefiasPirate2); + MoveCreatureInside(DefiasCompanion); + } + + void MoveCreatureInside(Creature* pCreature) + { + pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pCreature->GetMotionMaster()->MovePoint(0, -102.7,-655.9, pCreature->GetPositionZ()); + } + + void ShootCannon() + { + DefiasCannon->SetGoState(GO_STATE_ACTIVE); + DoPlaySound(DefiasCannon, SOUND_CANNONFIRE); + } + + void BlastOutDoor() + { + IronCladDoor->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); + DoPlaySound(IronCladDoor, SOUND_DESTROYDOOR); + } + + void LeverStucked() + { + DoorLever->SetUInt32Value(GAMEOBJECT_FLAGS, 4); + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case GO_IRONCLAD_DOOR: + IronCladDoor = pGo; + break; + case GO_DEFIAS_CANNON: + DefiasCannon = pGo; + break; + case GO_DOOR_LEVER: + DoorLever = pGo; + break; + } + } + + void SetData(uint32 type, uint32 data) + { + if (type == EVENT_STATE) + { + if (DefiasCannon && IronCladDoor) + State=data; + } + } + + uint32 GetData(uint32 type) + { + if (type == EVENT_STATE) + return State; + 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); + } +}; + +/*##### +# item_Defias_Gunpowder +#####*/ + +bool ItemUse_item_defias_gunpowder(Player* pPlayer, Item* _Item, SpellCastTargets const& targets) +{ + ScriptedInstance *pInstance = (pPlayer->GetInstanceData()) ? (pPlayer->GetInstanceData()) : NULL; + + 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(_Item->GetEntry(), 1, true); + return true; +} + +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(); + + newscript = new Script; + newscript->Name = "item_defias_gunpowder"; + newscript->pItemUse = &ItemUse_item_defias_gunpowder; + newscript->RegisterSelf(); +} + + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/deadmines/def_deadmines.h b/src/bindings/scripts/scripts/eastern_kingdoms/deadmines/def_deadmines.h new file mode 100644 index 00000000000..9b535a9fd80 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/deadmines/def_deadmines.h @@ -0,0 +1,14 @@ +#ifndef DEF_DEADMINES_H +#define DEF_DEADMINES_H + +#include "precompiled.h" + +#define CANNON_NOT_USED 1 +#define CANNON_GUNPOWDER_USED 2 +#define CANNON_BLAST_INITIATED 3 +#define PIRATES_ATTACK 4 +#define EVENT_DONE 5 + +#define EVENT_STATE 1 +#endif + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp new file mode 100644 index 00000000000..35bd4cb34b5 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/deadmines/instance_deadmines.cpp @@ -0,0 +1,23 @@ +/* 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: 0 +SDComment: Placeholder +SDCategory: Deadmines +EndScriptData */ + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_curator.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_curator.cpp new file mode 100644 index 00000000000..218a1dafc39 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_curator.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_Curator +SD%Complete: 100 +SDComment: +SDCategory: Karazhan +EndScriptData */ + +#include "precompiled.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 TRINITY_DLL_DECL 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; + + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL1, m_creature); break; + case 1: DoScriptText(SAY_KILL2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //always decrease BerserkTimer + if (BerserkTimer < diff) + { + //if evocate, then break evocate + if (Evocating) + { + if (m_creature->HasAura(SPELL_EVOCATION)) + m_creature->RemoveAurasDueToSpell(SPELL_EVOCATION); + + Evocating = false; + } + + //may not be correct SAY (generic hard enrage) + DoScriptText(SAY_ENRAGE, m_creature); + + m_creature->InterruptNonMeleeSpells(true); + DoCast(m_creature, 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 (m_creature->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* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (AstralFlare && target) + { + AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false); + AstralFlare->AI()->AttackStart(target); + } + + //Reduce Mana by 10% of max health + if (int32 mana = m_creature->GetMaxPower(POWER_MANA)) + { + mana /= 10; + m_creature->ModifyPower(POWER_MANA, -mana); + + //if this get's us below 10%, then we evocate (the 10th should be summoned now) + if (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA) < 10) + { + DoScriptText(SAY_EVOCATE, m_creature); + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, SPELL_EVOCATION); + Evocating = true; + //no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected + return; + } + else + { + switch(rand()%4) + { + case 0: DoScriptText(SAY_SUMMON1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON2, m_creature); break; + } + } + } + + AddTimer = 10000; + }else AddTimer -= diff; + + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 15) + { + Enraged = true; + DoCast(m_creature, SPELL_ENRAGE); + DoScriptText(SAY_ENRAGE, m_creature); + } + } + + if (HatefulBoltTimer < diff) + { + if (Enraged) + HatefulBoltTimer = 7000; + else + HatefulBoltTimer = 15000; + + if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) + DoCast(target, 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/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp new file mode 100644 index 00000000000..508e718797d --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_maiden_of_virtue.cpp @@ -0,0 +1,150 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.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 TRINITY_DLL_DECL 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 (rand()%2) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature);break; + case 1: DoScriptText(SAY_SLAY2, m_creature);break; + case 2: DoScriptText(SAY_SLAY3, m_creature);break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Enrage_Timer < diff && !Enraged) + { + DoCast(m_creature, SPELL_BERSERK,true); + Enraged = true; + }else Enrage_Timer -=diff; + + if (Holyground_Timer < diff) + { + DoCast(m_creature, SPELL_HOLYGROUND, true); //Triggered so it doesn't interrupt her at all + Holyground_Timer = 3000; + }else Holyground_Timer -= diff; + + if (Repentance_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_REPENTANCE); + + switch(rand()%2) + { + case 0: DoScriptText(SAY_REPENTANCE1, m_creature);break; + case 1: DoScriptText(SAY_REPENTANCE2, m_creature);break; + } + Repentance_Timer = 25000 + rand()%10000; //A little randomness on that spell + }else Repentance_Timer -= diff; + + if (Holyfire_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_HOLYFIRE); + + Holyfire_Timer = 8000 + rand()%15000; //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* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_HOLYWRATH); + + Holywrath_Timer = 20000+(rand()%5000); //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/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp new file mode 100644 index 00000000000..53b1c2d11b2 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_midnight.cpp @@ -0,0 +1,323 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.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 TRINITY_DLL_DECL 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; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetVisibility(VISIBILITY_ON); + } + + void EnterCombat(Unit* who) {} + + void KilledUnit(Unit *victim) + { + if (Phase == 2) + { + if (Unit *pUnit = Unit::GetUnit(*m_creature, Attumen)) + DoScriptText(SAY_MIDNIGHT_KILL, pUnit); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Phase == 1 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 95) + { + Phase = 2; + if (Creature* pAttumen = m_creature->SummonCreature(SUMMON_ATTUMEN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000)) + { + Attumen = pAttumen->GetGUID(); + pAttumen->AI()->AttackStart(m_creature->getVictim()); + SetMidnight(pAttumen, m_creature->GetGUID()); + switch(rand()%3) + { + case 0: DoScriptText(SAY_APPEAR1, pAttumen); break; + case 1: DoScriptText(SAY_APPEAR2, pAttumen); break; + case 2: DoScriptText(SAY_APPEAR3, pAttumen); break; + } + } + } + else if (Phase == 2 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 25) + { + if (Unit *pAttumen = Unit::GetUnit(*m_creature, Attumen)) + Mount(pAttumen); + } + else if (Phase ==3) + { + if (Mount_Timer) + { + if (Mount_Timer <= diff) + { + Mount_Timer = 0; + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->GetMotionMaster()->MoveIdle(); + if (Unit *pAttumen = Unit::GetUnit(*m_creature, 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; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + float angle = m_creature->GetAngle(pAttumen); + float distance = m_creature->GetDistance2d(pAttumen); + float newX = m_creature->GetPositionX() + cos(angle)*(distance/2) ; + float newY = m_creature->GetPositionY() + sin(angle)*(distance/2) ; + float newZ = 50; + //m_creature->Relocate(newX,newY,newZ,angle); + //m_creature->SendMonsterMove(newX, newY, newZ, 0, true, 1000); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MovePoint(0, newX, newY, newZ); + distance += 10; + newX = m_creature->GetPositionX() + cos(angle)*(distance/2) ; + newY = m_creature->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 TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI +{ + boss_attumenAI(Creature *c) : ScriptedAI(c) + { + Phase = 1; + + CleaveTimer = 10000 + (rand()%6)*1000; + CurseTimer = 30000; + RandomYellTimer = 30000 + (rand()%31)*1000; //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) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL1, m_creature); break; + case 1: DoScriptText(SAY_KILL2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + if (Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight)) + pMidnight->DealDamage(pMidnight, pMidnight->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + + void UpdateAI(const uint32 diff) + { + if (ResetTimer) + { + if (ResetTimer <= diff) + { + ResetTimer = 0; + Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight); + if (pMidnight) + { + pMidnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pMidnight->SetVisibility(VISIBILITY_ON); + } + Midnight = 0; + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } else ResetTimer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE)) + return; + + if (CleaveTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SHADOWCLEAVE); + CleaveTimer = 10000 + (rand()%6)*1000; + } else CleaveTimer -= diff; + + if (CurseTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_INTANGIBLE_PRESENCE); + CurseTimer = 30000; + } else CurseTimer -= diff; + + if (RandomYellTimer < diff) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_RANDOM1, m_creature); break; + case 1: DoScriptText(SAY_RANDOM2, m_creature); break; + } + RandomYellTimer = 30000 + (rand()%31)*1000; + } else RandomYellTimer -= diff; + + if (m_creature->GetUInt32Value(UNIT_FIELD_DISPLAYID) == MOUNTED_DISPLAYID) + { + if (ChargeTimer < diff) + { + Unit *target; + std::list t_list = m_creature->getThreatManager().getThreatList(); + std::vector target_list; + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (target && !target->IsWithinDist(m_creature, ATTACK_DISTANCE, false)) + target_list.push_back(target); + target = NULL; + } + if (target_list.size()) + target = *(target_list.begin()+rand()%target_list.size()); + + DoCast(target, SPELL_BERSERKER_CHARGE); + ChargeTimer = 20000; + } else ChargeTimer -= diff; + } + else + { + if ((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 25) + { + Creature *pMidnight = Unit::GetCreature(*m_creature, Midnight); + if (pMidnight && pMidnight->GetTypeId() == TYPEID_UNIT) + { + CAST_AI(boss_midnightAI, (pMidnight->AI()))->Mount(m_creature); + m_creature->SetHealth(pMidnight->GetHealth()); + DoResetThreat(); + } + } + } + + DoMeleeAttackIfReady(); + } + + void SpellHit(Unit *source, const SpellEntry *spell) + { + if (spell->Mechanic == MECHANIC_DISARM) + DoScriptText(SAY_DISARMED, m_creature); + } +}; + +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/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp new file mode 100644 index 00000000000..6d871ef04b7 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_moroes.cpp @@ -0,0 +1,819 @@ +/* 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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 (m_creature->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, m_creature); + AddsAttack(); + DoZoneInCombat(); + } + + void KilledUnit(Unit* victim) + { + switch (rand()%3) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + case 2: DoScriptText(SAY_KILL_3, m_creature); break; + } + } + + void JustDied(Unit* victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(TYPE_MOROES, DONE); + + DeSpawnAdds(); + + //remove aura from spell Garrote when Moroes dies + Map* pMap = m_creature->GetMap(); + if (pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (PlayerList.isEmpty()) + return; + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive() && i->getSource()->HasAura(SPELL_GARROTE,0)) + i->getSource()->RemoveAurasDueToSpell(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::iterator itr = AddList.begin(); itr != AddList.end(); ++itr) + { + uint32 entry = *itr; + + pCreature = m_creature->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 = m_creature->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((*m_creature),AddGUID[i]); + if (Temp && Temp->isAlive()) + { + (*Temp).GetMotionMaster()->Clear(true); + Temp->DealDamage(Temp, Temp->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + Temp->RemoveCorpse(); + } + + } + } + } + + void AddsAttack() + { + for(uint8 i = 0; i < 4; ++i) + { + Creature* Temp = NULL; + if (AddGUID[i]) + { + Temp = Creature::GetCreature((*m_creature),AddGUID[i]); + if (Temp && Temp->isAlive()) + { + Temp->AI()->AttackStart(m_creature->getVictim()); + DoZoneInCombat(Temp); + }else + EnterEvadeMode(); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (pInstance && !pInstance->GetData(TYPE_MOROES)) + { + EnterEvadeMode(); + return; + } + + if (!Enrage && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30) + { + DoCast(m_creature, SPELL_FRENZY); + Enrage = true; + } + + if (CheckAdds_Timer < diff) + { + for (uint8 i = 0; i < 4; ++i) + { + Creature* Temp = NULL; + if (AddGUID[i]) + { + Temp = Unit::GetCreature((*m_creature),AddGUID[i]); + if (Temp && Temp->isAlive()) + if (!Temp->getVictim()) + Temp->AI()->AttackStart(m_creature->getVictim()); + } + } + CheckAdds_Timer = 5000; + }else CheckAdds_Timer -= diff; + + if (!Enrage) + { + //Cast Vanish, then Garrote random victim + if (Vanish_Timer < diff) + { + DoCast(m_creature, SPELL_VANISH); + InVanish = true; + Vanish_Timer = 30000; + Wait_Timer = 5000; + }else Vanish_Timer -= diff; + + if (Gouge_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_GOUGE); + Gouge_Timer = 40000; + }else Gouge_Timer -= diff; + + if (Blind_Timer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target && target->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinMeleeRange(target)) + { + DoCast(target, SPELL_BLIND); + + Blind_Timer = 40000; + } + else + Blind_Timer = 1000; + }else Blind_Timer -= diff; + } + + if (InVanish) + { + if (Wait_Timer < diff) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPECIAL_1, m_creature); break; + case 1: DoScriptText(SAY_SPECIAL_2, m_creature); break; + } + + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + target->CastSpell(target, SPELL_GARROTE,true); + + InVanish = false; + }else Wait_Timer -= diff; + } + + if (!InVanish) + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL 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; + + GuestGUID[0] = pInstance->GetData64(DATA_MOROES); + Creature* Moroes = (Unit::GetCreature((*m_creature), GuestGUID[0])); + if (Moroes) + { + for(uint8 i = 0; i < 3; ++i) + { + uint64 GUID = CAST_AI(boss_moroesAI, Moroes->AI())->AddGUID[i]; + if (GUID && GUID != m_creature->GetGUID()) + GuestGUID[i+1] = GUID; + } + } + } + + Unit* SelectTarget() + { + uint64 TempGUID = GuestGUID[rand()%5]; + if (TempGUID) + { + Unit* pUnit = Unit::GetUnit((*m_creature), TempGUID); + if (pUnit && pUnit->isAlive()) + return pUnit; + } + + return m_creature; + } + + 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 TRINITY_DLL_DECL 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(m_creature,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(m_creature->getVictim(),SPELL_MINDFLY); + MindFlay_Timer = 12000; //3sec channeled + }else MindFlay_Timer -= diff; + + if (ManaBurn_Timer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target && (target->getPowerType() == POWER_MANA)) + DoCast(target,SPELL_MANABURN); + ManaBurn_Timer = 5000; //3 sec cast + }else ManaBurn_Timer -= diff; + + if (ShadowWordPain_Timer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + { + DoCast(target,SPELL_SWPAIN); + ShadowWordPain_Timer = 7000; + } + }else ShadowWordPain_Timer -= diff; + } +}; + +#define SPELL_HAMMEROFJUSTICE 13005 +#define SPELL_JUDGEMENTOFCOMMAND 29386 +#define SPELL_SEALOFCOMMAND 29385 + +struct TRINITY_DLL_DECL 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(m_creature,SPELL_SEALOFCOMMAND); + SealOfCommand_Timer = 32000; + JudgementOfCommand_Timer = 29000; + }else SealOfCommand_Timer -= diff; + + if (JudgementOfCommand_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_JUDGEMENTOFCOMMAND); + JudgementOfCommand_Timer = SealOfCommand_Timer + 29000; + }else JudgementOfCommand_Timer -= diff; + + if (HammerOfJustice_Timer < diff) + { + DoCast(m_creature->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 TRINITY_DLL_DECL 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(m_creature,SPELL_PWSHIELD); + PowerWordShield_Timer = 15000; + }else PowerWordShield_Timer -= diff; + + if (GreaterHeal_Timer < diff) + { + Unit* target = SelectTarget(); + + DoCast(target, SPELL_GREATERHEAL); + GreaterHeal_Timer = 17000; + }else GreaterHeal_Timer -= diff; + + if (HolyFire_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_HOLYFIRE); + HolyFire_Timer = 22000; + }else HolyFire_Timer -= diff; + + if (DispelMagic_Timer < diff) + { + if (rand()%2) + { + Unit* target = SelectTarget(); + + DoCast(target, SPELL_DISPELMAGIC); + } + else + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), 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 TRINITY_DLL_DECL 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(m_creature,SPELL_DIVINESHIELD); + DivineShield_Timer = 31000; + }else DivineShield_Timer -= diff; + + if (HolyLight_Timer < diff) + { + Unit* target = SelectTarget(); + + DoCast(target, SPELL_HOLYLIGHT); + HolyLight_Timer = 10000; + }else HolyLight_Timer -= diff; + + if (GreaterBless_Timer < diff) + { + Unit* target = SelectTarget(); + + DoCast(target, SPELL_GREATERBLESSOFMIGHT); + + GreaterBless_Timer = 50000; + }else GreaterBless_Timer -= diff; + + if (Cleanse_Timer < diff) + { + Unit* target = SelectTarget(); + + DoCast(target, SPELL_CLEANSE); + + Cleanse_Timer = 10000; + }else Cleanse_Timer -= diff; + } +}; + +#define SPELL_HAMSTRING 9080 +#define SPELL_MORTALSTRIKE 29572 +#define SPELL_WHIRLWIND 29573 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_HAMSTRING); + Hamstring_Timer = 12000; + }else Hamstring_Timer -= diff; + + if (MortalStrike_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE); + MortalStrike_Timer = 18000; + }else MortalStrike_Timer -= diff; + + if (WhirlWind_Timer < diff) + { + DoCast(m_creature,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 TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_DISARM); + Disarm_Timer = 12000; + }else Disarm_Timer -= diff; + + if (HeroicStrike_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_HEROICSTRIKE); + HeroicStrike_Timer = 10000; + }else HeroicStrike_Timer -= diff; + + if (ShieldBash_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SHIELDBASH); + ShieldBash_Timer = 13000; + }else ShieldBash_Timer -= diff; + + if (ShieldWall_Timer < diff) + { + DoCast(m_creature,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/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp new file mode 100644 index 00000000000..fc90ff5b4f0 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_netherspite.cpp @@ -0,0 +1,353 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI +{ + boss_netherspiteAI(Creature* c) : ScriptedAI(c) + { + pInstance = ((ScriptedInstance*)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* target, WorldObject* u2) // the in-line checker + { + if(!u1 || !u2 || !target) + return false; + + float xn, yn, xp, yp, xh, yh; + xn = u1->GetPositionX(); + yn = u1->GetPositionY(); + xp = u2->GetPositionX(); + yp = u2->GetPositionY(); + xh = target->GetPositionX(); + yh = target->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 = m_creature->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(*m_creature, PortalGUID[i])) + { + portal->SetVisibility(VISIBILITY_OFF); + portal->DealDamage(portal, portal->GetMaxHealth()); + portal->RemoveFromWorld(); + } + if(Creature *portal = Unit::GetCreature(*m_creature, BeamerGUID[i])) + { + portal->SetVisibility(VISIBILITY_OFF); + portal->DealDamage(portal, portal->GetMaxHealth()); + portal->RemoveFromWorld(); + } + 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(*m_creature, 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 *target = m_creature; + + if(Map* map = m_creature->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 + && (!target || target->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(m_creature, p, portal)) // on the beam + target = p; + } + } + // buff the target + if(target->GetTypeId() == TYPEID_PLAYER) + target->AddAura(PlayerBuff[j], target); + else + target->AddAura(NetherBuff[j], target); + // cast visual beam on the chosen target if switched + // simple target switching isn't working -> using BeamerGUID to cast (workaround) + if(!current || target != current) + { + BeamTarget[j] = target->GetGUID(); + // remove currently beaming portal + if(Creature *beamer = Unit::GetCreature(*portal, BeamerGUID[j])) + { + beamer->CastSpell(target, PortalBeam[j], false); + beamer->SetVisibility(VISIBILITY_OFF); + beamer->DealDamage(beamer, beamer->GetMaxHealth()); + beamer->RemoveFromWorld(); + 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(target, PortalBeam[j], false); + BeamerGUID[j] = beamer->GetGUID(); + } + } + // aggro target if Red Beam + if(j==RED_PORTAL && m_creature->getVictim() != target && target->GetTypeId() == TYPEID_PLAYER) + m_creature->getThreatManager().addThreat(target, 100000.0f+DoGetThreat(m_creature->getVictim())); + } + } + + void SwitchToPortalPhase() + { + m_creature->RemoveAurasDueToSpell(SPELL_BANISH_ROOT); + m_creature->RemoveAurasDueToSpell(SPELL_BANISH_VISUAL); + SummonPortals(); + PhaseTimer = 60000; + PortalPhase = true; + PortalTimer = 10000; + EmpowermentTimer = 10000; + DoScriptText(EMOTE_PHASE_PORTAL,m_creature); + } + + void SwitchToBanishPhase() + { + m_creature->RemoveAurasDueToSpell(SPELL_EMPOWERMENT); + m_creature->RemoveAurasDueToSpell(SPELL_NETHERBURN_AURA); + DoCast(m_creature,SPELL_BANISH_VISUAL,true); + DoCast(m_creature,SPELL_BANISH_ROOT,true); + DestroyPortals(); + PhaseTimer = 30000; + PortalPhase = false; + DoScriptText(EMOTE_PHASE_BANISH,m_creature); + + for(int i=0; i<3; ++i) + m_creature->RemoveAurasDueToSpell(NetherBuff[i]); + } + + void HandleDoors(bool open) // Massive Door switcher + { + if(GameObject *Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_MASSIVE_DOOR))) + 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) + { + m_creature->AddAura(SPELL_NETHER_INFUSION, m_creature); + DoCast(m_creature, 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(m_creature, SPELL_EMPOWERMENT); + m_creature->AddAura(SPELL_NETHERBURN_AURA, m_creature); + EmpowermentTimer = 90000; + }else EmpowermentTimer -= diff; + + if(PhaseTimer < diff) + { + if(!m_creature->IsNonMeleeSpellCasted(false)) + { + SwitchToBanishPhase(); + return; + } + }else PhaseTimer -= diff; + } + else // BANISH PHASE + { + // Netherbreath + if(NetherbreathTimer < diff) + { + if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,40,true)) + DoCast(target,SPELL_NETHERBREATH); + NetherbreathTimer = 5000+rand()%2000; + }else NetherbreathTimer -= diff; + + if(PhaseTimer < diff) + { + if(!m_creature->IsNonMeleeSpellCasted(false)) + { + SwitchToPortalPhase(); + return; + } + }else PhaseTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_netherspite(Creature *_Creature) +{ + return new boss_netherspiteAI(_Creature); +} + +void AddSC_boss_netherspite() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_netherspite"; + newscript->GetAI = GetAI_boss_netherspite; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp new file mode 100644 index 00000000000..cf7d7237042 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_nightbane.cpp @@ -0,0 +1,421 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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; + + m_creature->SetSpeed(MOVE_RUN, 2.0f); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->setActive(true); + + if (pInstance->GetData(TYPE_NIGHTBANE) == DONE || pInstance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + } + else + { + if (pInstance) + pInstance->SetData(TYPE_NIGHTBANE, NOT_STARTED); + } + + HandleTerraceDoors(true); + + Flying = false; + Movement = false; + + if (!Intro) + { + m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0); + m_creature->GetMotionMaster()->MoveTargetedHome(); + } + } + + void HandleTerraceDoors(bool open) + { + 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); + m_creature->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; + m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0); + return; + } + + WaitTimer = 1; + } + + if (Flying) + { + if (id == 0) + { + m_creature->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(m_creature->getVictim()); + } + + void TakeOff() + { + m_creature->MonsterYell(YELL_FLY_PHASE, LANG_UNIVERSAL, NULL); + + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + (*m_creature).GetMotionMaster()->Clear(false); + (*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]); + + Flying = true; + + FlyTimer = 45000+rand()%15000; //timer wrong between 45 and 60 seconds + ++FlyCount; + + RainofBonesTimer = 5000; //timer wrong (maybe) + RainBones = false; + Skeletons = false; + } + + void UpdateAI(const uint32 diff) + { + if (WaitTimer) + if (WaitTimer < diff) + { + if (Intro) + { + if (MovePhase >= 7) + { + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + m_creature->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]); + } + else + { + m_creature->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]); + ++MovePhase; + } + } + + if (Flying) + { + if (MovePhase >= 7) + { + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + m_creature->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]); + } + else + { + m_creature->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(m_creature->getVictim()); + Movement = false; + } + + if (BellowingRoarTimer < diff) + { + DoCast(m_creature->getVictim(),SPELL_BELLOWING_ROAR); + BellowingRoarTimer = 30000+rand()%10000 ; //Timer + }else BellowingRoarTimer -= diff; + + if (SmolderingBreathTimer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SMOLDERING_BREATH); + SmolderingBreathTimer = 20000;//timer + }else SmolderingBreathTimer -= diff; + + if (CharredEarthTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target,SPELL_CHARRED_EARTH); + CharredEarthTimer = 20000; //timer + }else CharredEarthTimer -= diff; + + if (TailSweepTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (!m_creature->HasInArc(M_PI, target)) + DoCast(target,SPELL_TAIL_SWEEP); + TailSweepTimer = 15000;//timer + }else TailSweepTimer -= diff; + + if (SearingCindersTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target,SPELL_SEARING_CINDERS); + SearingCindersTimer = 10000; //timer + }else SearingCindersTimer -= diff; + + uint32 Prozent; + Prozent = (m_creature->GetHealth()*100) / m_creature->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(m_creature->getVictim(), SPELL_SUMMON_SKELETON); + Skeletons = true; + } + } + + if (RainofBonesTimer < diff && !RainBones) // only once at the beginning of phase 2 + { + DoCast(m_creature->getVictim(),SPELL_RAIN_OF_BONES); + RainBones = true; + SmokingBlastTimer = 20000; + }else RainofBonesTimer -= diff; + + if (DistractingAshTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target,SPELL_DISTRACTING_ASH); + DistractingAshTimer = 2000;//timer wrong + }else DistractingAshTimer -= diff; + } + + if (RainBones) + { + if (SmokingBlastTimer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SMOKING_BLAST); + SmokingBlastTimer = 1500 ; //timer wrong + }else SmokingBlastTimer -= diff; + } + + if (FireballBarrageTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_FARTHEST, 0)) + DoCast(target,SPELL_FIREBALL_BARRAGE); + FireballBarrageTimer = 20000; //Timer + }else FireballBarrageTimer -= diff; + + if (FlyTimer < diff) //landing + { + if (rand()%2 == 0) + m_creature->MonsterYell(YELL_LAND_PHASE_1, LANG_UNIVERSAL, NULL); + else + m_creature->MonsterYell(YELL_LAND_PHASE_2, LANG_UNIVERSAL, NULL); + + (*m_creature).GetMotionMaster()->Clear(false); + m_creature->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/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp new file mode 100644 index 00000000000..ba797dc13c2 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_prince_malchezaar.cpp @@ -0,0 +1,632 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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(m_creature, 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(*m_creature, malchezaar); + if (pMalchezaar) + CAST_CRE(pMalchezaar)->AI()->KilledUnit(who); + } + + void SpellHit(Unit *who, const SpellEntry *spell) + { + if (spell->Id == SPELL_INFERNAL_RELAY) + { + m_creature->SetDisplayId(m_creature->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID)); + m_creature->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 TRINITY_DLL_DECL 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 = 7500 + rand()%12500; + SunderArmorTimer = 5000 + rand()%5000; + phase = 1; + + if (pInstance) + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), true); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + 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, m_creature); + + if (pInstance) + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in + } + + void InfernalCleanup() + { + //Infernal Cleanup + for(std::vector::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr) + { + Unit *pInfernal = Unit::GetUnit(*m_creature, *itr); + if (pInfernal && 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(*m_creature, axes[i]); + if (axe && axe->isAlive()) + axe->DealDamage(axe, axe->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + axes[i] = 0; + } + } + + void ClearWeapons() + { + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + + //damage + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg); + m_creature->UpdateDamagePhysical(BASE_ATTACK); + } + + void EnfeebleHealthEffect() + { + const SpellEntry *info = GetSpellStore()->LookupEntry(SPELL_ENFEEBLE_EFFECT); + if (!info) + return; + + std::list t_list = m_creature->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::iterator itr = t_list.begin(); + std::advance(itr, 1); + for(; itr!= t_list.end(); ++itr) //store the threat list in a different container + { + Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + //only on alive players + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + targets.push_back(target); + } + + //cut down to size if we have more than 5 targets + while(targets.size() > 5) + targets.erase(targets.begin()+rand()%targets.size()); + + int i = 0; + for(std::vector::iterator iter = targets.begin(); iter!= targets.end(); ++iter, ++i) + { + Unit *target = *iter; + if (target) + { + enfeeble_targets[i] = target->GetGUID(); + enfeeble_health[i] = target->GetHealth(); + + target->CastSpell(target, SPELL_ENFEEBLE, true, 0, 0, m_creature->GetGUID()); + target->SetHealth(1); + } + } + + } + + void EnfeebleResetHealth() + { + for(uint8 i = 0; i < 5; ++i) + { + Unit *target = Unit::GetUnit(*m_creature, enfeeble_targets[i]); + if (target && target->isAlive()) + target->SetHealth(enfeeble_health[i]); + enfeeble_targets[i] = 0; + enfeeble_health[i] = 0; + } + } + + void SummonInfernal(const uint32 diff) + { + InfernalPoint *point = NULL; + float posX,posY,posZ; + if ((m_creature->GetMapId() != 532) || positions.empty()) + { + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 60, posX, posY, posZ); + } + else + { + std::vector::iterator itr = positions.begin()+rand()%positions.size(); + point = *itr; + positions.erase(itr); + + posX = point->x; + posY = point->y; + posZ = INFERNAL_Z; + } + + Creature *Infernal = m_creature->SummonCreature(NETHERSPITE_INFERNAL, posX, posY, posZ, 0, TEMPSUMMON_TIMED_DESPAWN, 180000); + + if (Infernal) + { + Infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE); + Infernal->setFaction(m_creature->getFaction()); + if (point) + CAST_AI(netherspite_infernalAI, Infernal->AI())->point=point; + CAST_AI(netherspite_infernalAI, Infernal->AI())->malchezaar=m_creature->GetGUID(); + + infernals.push_back(Infernal->GetGUID()); + DoCast(Infernal, SPELL_INFERNAL_RELAY); + } + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SUMMON1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (EnfeebleResetTimer) + if (EnfeebleResetTimer <= diff) //Let's not forget to reset that + { + EnfeebleResetHealth(); + EnfeebleResetTimer=0; + }else EnfeebleResetTimer -= diff; + + if (m_creature->hasUnitState(UNIT_STAT_STUNNED)) //While shifting to phase 2 malchezaar stuns himself + return; + + if (m_creature->GetUInt64Value(UNIT_FIELD_TARGET)!=m_creature->getVictim()->GetGUID()) + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->getVictim()->GetGUID()); + + if (phase == 1) + { + if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 60) + { + m_creature->InterruptNonMeleeSpells(false); + + phase = 2; + + //animation + DoCast(m_creature, SPELL_EQUIP_AXES); + + //text + DoScriptText(SAY_AXE_TOSS1, m_creature); + + //passive thrash aura + m_creature->CastSpell(m_creature, SPELL_THRASH_AURA, true); + + //models + SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE); + + //damage + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg); + m_creature->UpdateDamagePhysical(BASE_ATTACK); + + m_creature->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg); + m_creature->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg); + //Sigh, updating only works on main attack , do it manually .... + m_creature->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg); + m_creature->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg); + + m_creature->SetAttackTime(OFF_ATTACK, (m_creature->GetAttackTime(BASE_ATTACK)*150)/100); + } + } + else if (phase == 2) + { + if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 30) + { + InfernalTimer = 15000; + + phase = 3; + + ClearWeapons(); + + //remove thrash + m_creature->RemoveAurasDueToSpell(SPELL_THRASH_AURA); + + DoScriptText(SAY_AXE_TOSS2, m_creature); + + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); + for(uint32 i=0; i<2; ++i) + { + Creature *axe = m_creature->SummonCreature(MALCHEZARS_AXE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (axe) + { + axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + axe->setFaction(m_creature->getFaction()); + axes[i] = axe->GetGUID(); + if (target) + { + axe->AI()->AttackStart(target); + // axe->getThreatManager().tauntApply(target); //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(target, 10000000.0f); + } + } + } + + if (ShadowNovaTimer > 35000) + ShadowNovaTimer = EnfeebleTimer + 5000; + + return; + } + + if (SunderArmorTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SUNDER_ARMOR); + SunderArmorTimer = 10000 + rand()%8000; + + }else SunderArmorTimer -= diff; + + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + Cleave_Timer = 6000 + rand()%6000; + + }else Cleave_Timer -= diff; + } + else + { + if (AxesTargetSwitchTimer < diff) + { + AxesTargetSwitchTimer = 7500 + rand()%12500 ; + + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + { + for(uint8 i = 0; i < 2; ++i) + { + Unit *axe = Unit::GetUnit(*m_creature, axes[i]); + if (axe) + { + float threat = 1000000.0f; + if (axe->getVictim() && DoGetThreat(axe->getVictim())) + { + threat = axe->getThreatManager().getThreat(axe->getVictim()); + axe->getThreatManager().modifyThreatPercent(axe->getVictim(), -100); + } + if (target) + axe->AddThreat(target, threat); + //axe->getThreatManager().tauntFadeOut(axe->getVictim()); + //axe->getThreatManager().tauntApply(target); + } + } + } + } else AxesTargetSwitchTimer -= diff; + + if (AmplifyDamageTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AMPLIFY_DAMAGE); + AmplifyDamageTimer = 20000 + rand()%10000; + }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(m_creature->getVictim(), SPELL_SHADOWNOVA); + ShadowNovaTimer = phase == 3 ? 31000 : -1; + }else ShadowNovaTimer -= diff; + + if (phase != 2) + { + if (SWPainTimer < diff) + { + Unit* target = NULL; + if (phase == 1) + target = m_creature->getVictim(); // the tank + else //anyone but the tank + target = SelectUnit(SELECT_TARGET_RANDOM, 1); + + if (target) + DoCast(target, 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 (m_creature->IsWithinMeleeRange(m_creature->getVictim()) && !m_creature->IsNonMeleeSpellCasted(false)) + { + //Check for base attack + if (m_creature->isAttackReady() && m_creature->getVictim()) + { + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + //Check for offhand attack + if (m_creature->isAttackReady(OFF_ATTACK) && m_creature->getVictim()) + { + m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK); + m_creature->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(*m_creature, malchezaar); + + if (pMalchezaar && pMalchezaar->isAlive()) + CAST_AI(boss_malchezaarAI, CAST_CRE(pMalchezaar)->AI())->Cleanup(m_creature, 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/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp new file mode 100644 index 00000000000..d672851315e --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_shade_of_aran.cpp @@ -0,0 +1,591 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "simple_ai.h" +#include "def_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 TRINITY_DLL_DECL 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) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL1, m_creature); break; + case 1: DoScriptText(SAY_KILL2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + { + pInstance->SetData(TYPE_ARAN, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true); + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + 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 = m_creature->getThreatManager().getThreatList(); + + if (!t_list.size()) + return; + + //store the threat list in a different container + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + //only on alive players + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + targets.push_back(target); + } + + //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::iterator itr = targets.begin(); itr!= targets.end(); ++itr) + { + if (*itr) + { + FlameWreathTarget[i] = (*itr)->GetGUID(); + FWTargPosX[i] = (*itr)->GetPositionX(); + FWTargPosY[i] = (*itr)->GetPositionY(); + m_creature->CastSpell((*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 && m_creature->GetMaxPower(POWER_MANA) && (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA)) < 20) + { + Drinking = true; + m_creature->InterruptNonMeleeSpells(false); + + DoScriptText(SAY_DRINK, m_creature); + + if (!DrinkInturrupted) + { + m_creature->CastSpell(m_creature, SPELL_MASS_POLY, true); + m_creature->CastSpell(m_creature, SPELL_CONJURE, false); + m_creature->CastSpell(m_creature, SPELL_DRINK, false); + m_creature->SetStandState(UNIT_STAND_STATE_SIT); + DrinkInturruptTimer = 10000; + } + } + + //Drink Inturrupt + if (Drinking && DrinkInturrupted) + { + Drinking = false; + m_creature->RemoveAurasDueToSpell(SPELL_DRINK); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->SetPower(POWER_MANA, m_creature->GetMaxPower(POWER_MANA)-32000); + m_creature->CastSpell(m_creature, SPELL_POTION, false); + } + + //Drink Inturrupt Timer + if (Drinking && !DrinkInturrupted) + if (DrinkInturruptTimer >= diff) + DrinkInturruptTimer -= diff; + else + { + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->CastSpell(m_creature, SPELL_POTION, true); + m_creature->CastSpell(m_creature, 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 (!m_creature->IsNonMeleeSpellCasted(false)) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (!target) + 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(target, CurrentNormalSpell); + } + } + NormalCastTimer = 1000; + }else NormalCastTimer -= diff; + + if (SecondarySpellTimer < diff) + { + switch (rand()%2) + { + + case 0: + DoCast(m_creature, SPELL_AOE_CS); + break; + case 1: + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_CHAINSOFICE); + break; + } + SecondarySpellTimer = 5000 + (rand()%15000); + }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[rand()%2]; + + switch (LastSuperSpell) + { + case SUPER_AE: + + if (rand()%2) + DoScriptText(SAY_EXPLOSION1, m_creature); + else + DoScriptText(SAY_EXPLOSION2, m_creature); + + m_creature->CastSpell(m_creature, SPELL_BLINK_CENTER, true); + m_creature->CastSpell(m_creature, SPELL_PLAYERPULL, true); + m_creature->CastSpell(m_creature, SPELL_MASSSLOW, true); + m_creature->CastSpell(m_creature, SPELL_AEXPLOSION, false); + break; + + case SUPER_FLAME: + if (rand()%2) + DoScriptText(SAY_FLAMEWREATH1, m_creature); + else + DoScriptText(SAY_FLAMEWREATH2, m_creature); + + FlameWreathTimer = 20000; + FlameWreathCheckTime = 500; + + FlameWreathTarget[0] = 0; + FlameWreathTarget[1] = 0; + FlameWreathTarget[2] = 0; + + FlameWreathEffect(); + break; + + case SUPER_BLIZZARD: + + if (rand()%2) + DoScriptText(SAY_BLIZZARD1, m_creature); + else + DoScriptText(SAY_BLIZZARD2, m_creature); + + if (Creature* pSpawn = m_creature->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000)) + { + pSpawn->setFaction(m_creature->getFaction()); + pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false); + } + break; + } + + SuperCastTimer = 35000 + (rand()%5000); + }else SuperCastTimer -= diff; + + if (!ElementalsSpawned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40) + { + ElementalsSpawned = true; + + for (uint32 i = 0; i < 4; ++i) + { + if (Creature* pUnit = m_creature->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000)) + { + pUnit->Attack(m_creature->getVictim(), true); + pUnit->setFaction(m_creature->getFaction()); + } + } + + DoScriptText(SAY_ELEMENTALS, m_creature); + } + + if (BerserkTimer < diff) + { + for (uint32 i = 0; i < 5; ++i) + { + if (Creature* pUnit = m_creature->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) + { + pUnit->Attack(m_creature->getVictim(), true); + pUnit->setFaction(m_creature->getFaction()); + } + } + + DoScriptText(SAY_TIMEOVER, m_creature); + + BerserkTimer = 60000; + }else BerserkTimer -= diff; + + //Flame Wreath check + if (FlameWreathTimer) + { + if (FlameWreathTimer >= diff) + FlameWreathTimer -= diff; + else FlameWreathTimer = 0; + + if (FlameWreathCheckTime < diff) + { + for (uint32 i = 0; i < 3; ++i) + { + if (!FlameWreathTarget[i]) + continue; + + Unit* pUnit = Unit::GetUnit(*m_creature, FlameWreathTarget[i]); + if (pUnit && !pUnit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3)) + { + pUnit->CastSpell(pUnit, 20476, true, 0, 0, m_creature->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) || !m_creature->IsNonMeleeSpellCasted(false)) + return; + + //Inturrupt effect + m_creature->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 TRINITY_DLL_DECL 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(m_creature->getVictim(), SPELL_WATERBOLT); + CastTimer = 2000 + (rand()%3000); + }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/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp new file mode 100644 index 00000000000..c824f344942 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/boss_terestian_illhoof.cpp @@ -0,0 +1,432 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_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_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 PORTAL_Z 179.434 + +float PortalLocations[2][2]= +{ + {-11249.6933, -1704.61023}, + {-11242.1160, -1713.33325}, +}; + +struct TRINITY_DLL_DECL 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(m_creature); + return; + } + + Creature* Terestian = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_TERESTIAN))); + if (Terestian && !Terestian->getVictim()) + Terestian->AddThreat(who, 1.0f); + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + uint64 TerestianGUID = pInstance->GetData64(DATA_TERESTIAN); + if (TerestianGUID) + { + Unit* Terestian = Unit::GetUnit((*m_creature), TerestianGUID); + if (Terestian && Terestian->isAlive()) + DoCast(Terestian, SPELL_BROKEN_PACT, true); + } + }else ERROR_INST_DATA(m_creature); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (AmplifyTimer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature->getVictim(),SPELL_AMPLIFY_FLAMES); + + AmplifyTimer = 10000 + rand()%10000; + }else AmplifyTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL 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((*m_creature),SacrificeGUID); + if (Sacrifice) + Sacrifice->RemoveAurasDueToSpell(SPELL_SACRIFICE); + } + } +}; + +struct TRINITY_DLL_DECL 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 KilrekGUID; + uint64 PortalGUID[2]; + + uint32 CheckKilrekTimer; + uint32 SacrificeTimer; + uint32 ShadowboltTimer; + uint32 SummonTimer; + uint32 BerserkTimer; + + bool ReSummon; + bool SummonKilrek; + bool SummonedPortals; + bool Berserk; + + void Reset() + { + for(uint8 i = 0; i < 2; ++i) + { + if (PortalGUID[i]) + { + if (Creature* pPortal = Unit::GetCreature(*m_creature, PortalGUID[i])) + pPortal->ForcedDespawn(); + + PortalGUID[i] = 0; + } + } + + CheckKilrekTimer = 5000; + SacrificeTimer = 30000; + ShadowboltTimer = 5000; + SummonTimer = 10000; + BerserkTimer = 600000; + + SummonedPortals = false; + Berserk = false; + ReSummon = false; + + if (pInstance) + pInstance->SetData(TYPE_TERESTIAN, NOT_STARTED); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + { + Creature* Kilrek = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KILREK))); + // Respawn Kil'rek on aggro if Kil'rek is dead. + if (Kilrek && !Kilrek->isAlive()) + { + Kilrek->Respawn(); + } + + // Put Kil'rek in combat against our target so players don't skip him + if (Kilrek && !Kilrek->getVictim()) + Kilrek->AddThreat(who, 1.0f); + + pInstance->SetData(TYPE_TERESTIAN, IN_PROGRESS); + }else ERROR_INST_DATA(m_creature); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *killer) + { + for(uint8 i = 0; i < 2; ++i) + { + if (PortalGUID[i]) + { + if (Creature* pPortal = Unit::GetCreature((*m_creature), PortalGUID[i])) + pPortal->ForcedDespawn(); + + PortalGUID[i] = 0; + } + } + + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(TYPE_TERESTIAN, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (CheckKilrekTimer < diff) + { + + CheckKilrekTimer = 5000; + + if (pInstance) + uint64 KilrekGUID = pInstance->GetData64(DATA_KILREK); + else ERROR_INST_DATA(m_creature); + + Creature* Kilrek = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KILREK))); + if (SummonKilrek && Kilrek) + { + Kilrek->Respawn(); + if (Kilrek->AI()) + { + Kilrek->AI()->AttackStart(m_creature->getVictim()); + m_creature->RemoveAurasDueToSpell(SPELL_BROKEN_PACT); + } + + SummonKilrek = false; + } + + if (!Kilrek || !Kilrek->isAlive()) + { + SummonKilrek = true; + CheckKilrekTimer = 45000; + } + }else CheckKilrekTimer -= diff; + + if (SacrificeTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + { + DoCast(target, SPELL_SACRIFICE, true); + Creature* Chains = m_creature->SummonCreature(CREATURE_DEMONCHAINS, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 21000); + if (Chains) + { + CAST_AI(mob_demon_chainAI, Chains->AI())->SacrificeGUID = target->GetGUID(); + Chains->CastSpell(Chains, SPELL_DEMON_CHAINS, true); + switch(rand()%2) + { + case 0: DoScriptText(SAY_SACRIFICE1, m_creature); break; + case 1: DoScriptText(SAY_SACRIFICE2, m_creature); break; + } + 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 (!SummonedPortals) + { + for(uint8 i = 0; i < 2; ++i) + { + Creature* Portal = m_creature->SummonCreature(CREATURE_PORTAL, PortalLocations[i][0], PortalLocations[i][1], PORTAL_Z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (Portal) + PortalGUID[i] = Portal->GetGUID(); + } + SummonedPortals = true; + switch(rand()%2) + { + case 0: DoScriptText(SAY_SUMMON1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON2, m_creature); break; + } + } + uint32 random = rand()%2; + Creature* Imp = m_creature->SummonCreature(CREATURE_FIENDISHIMP, PortalLocations[random][0], PortalLocations[random][1], PORTAL_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 15000); + if (Imp) + { + Imp->AddThreat(m_creature->getVictim(), 1.0f); + Imp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 1)); + } + SummonTimer = 5000; + }else SummonTimer -= diff; + + if (!Berserk) + { + if (BerserkTimer < diff) + { + DoCast(m_creature, SPELL_BERSERK); + Berserk = true; + }else BerserkTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +#define SPELL_FIREBOLT 30050 // Blasts a target for 181-209 Fire damage. + +struct TRINITY_DLL_DECL mob_fiendish_impAI : public ScriptedAI +{ + mob_fiendish_impAI(Creature *c) : ScriptedAI(c) {} + + uint32 FireboltTimer; + + void Reset() + { + FireboltTimer = 2000; + + m_creature->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(m_creature->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_demon_chain(Creature* pCreature) +{ + return new mob_demon_chainAI(pCreature); +} + +CreatureAI* GetAI_boss_terestian_illhoof(Creature* pCreature) +{ + return new boss_terestianAI (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_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/bindings/scripts/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp new file mode 100644 index 00000000000..da6f77e7c20 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/bosses_opera.cpp @@ -0,0 +1,1500 @@ +/* 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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, m_creature); + } + + void JustReachedHome() + { + m_creature->ForcedDespawn(); + } + + void SummonTito(); // See below + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DOROTHEE_DEATH, m_creature); + + if (pInstance) + SummonCroneIfReady(pInstance, m_creature); + } + + void AttackStart(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void UpdateAI(const uint32 diff) + { + if (AggroTimer) + { + if (AggroTimer <= diff) + { + m_creature->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(m_creature->getVictim(), SPELL_SCREAM); + FearTimer = 30000; + }else FearTimer -= diff; + + if (!SummonedTito) + { + if (SummonTitoTimer < diff) + SummonTito(); + else SummonTitoTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL 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((*m_creature), 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(m_creature->getVictim(), SPELL_YIPPING); + YipTimer = 10000; + }else YipTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +void boss_dorotheeAI::SummonTito() +{ + if (Creature* pTito = m_creature->SummonCreature(CREATURE_TITO, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) + { + DoScriptText(SAY_DOROTHEE_SUMMON, m_creature); + CAST_AI(mob_titoAI, pTito->AI())->DorotheeGUID = m_creature->GetGUID(); + pTito->AI()->AttackStart(m_creature->getVictim()); + SummonedTito = true; + TitoDied = false; + } +} + +struct TRINITY_DLL_DECL 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 (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_STRAWMAN_AGGRO, m_creature); + } + + void JustReachedHome() + { + m_creature->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(m_creature, SPELL_BURNING_STRAW, true); + } + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_STRAWMAN_DEATH, m_creature); + + if (pInstance) + SummonCroneIfReady(pInstance, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_STRAWMAN_SLAY, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (AggroTimer) + { + if (AggroTimer <= diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + }else AggroTimer -= diff; + } + + if (!UpdateVictim()) + return; + + if (BrainBashTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BRAIN_BASH); + BrainBashTimer = 15000; + }else BrainBashTimer -= diff; + + if (BrainWipeTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_BRAIN_WIPE); + BrainWipeTimer = 20000; + }else BrainWipeTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL 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, m_creature); + } + + void JustReachedHome() + { + m_creature->ForcedDespawn(); + } + + void AttackStart(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_TINHEAD_DEATH, m_creature); + + if (pInstance) + SummonCroneIfReady(pInstance, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_TINHEAD_SLAY, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (AggroTimer) + { + if (AggroTimer < diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + }else AggroTimer -= diff; + } + + if (!UpdateVictim()) + return; + + if (CleaveTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + CleaveTimer = 5000; + }else CleaveTimer -= diff; + + if (RustCount < 8) + { + if (RustTimer < diff) + { + RustCount++; + DoScriptText(EMOTE_RUST, m_creature); + DoCast(m_creature, SPELL_RUST); + RustTimer = 6000; + }else RustTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL 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 (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void AttackStart(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_ROAR_AGGRO, m_creature); + } + + void JustReachedHome() + { + m_creature->ForcedDespawn(); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_ROAR_DEATH, m_creature); + + if (pInstance) + SummonCroneIfReady(pInstance, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_ROAR_SLAY, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (AggroTimer) + { + if (AggroTimer <= diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer = 0; + }else AggroTimer -= diff; + } + + if (!UpdateVictim()) + return; + + if (MangleTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_MANGLE); + MangleTimer = 5000 + rand()%3000; + }else MangleTimer -= diff; + + if (ShredTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SHRED); + ShredTimer = 10000 + rand()%5000; + }else ShredTimer -= diff; + + if (ScreamTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FRIGHTENED_SCREAM); + ScreamTimer = 20000 + rand()%10000; + }else ScreamTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL 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() + { + m_creature->ForcedDespawn(); + } + + void EnterCombat(Unit* who) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_CRONE_AGGRO, m_creature); break; + case 1: DoScriptText(SAY_CRONE_AGGRO2, m_creature); break; + } + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_CRONE_DEATH, m_creature); + + 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 (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (CycloneTimer < diff) + { + Creature* Cyclone = DoSpawnCreature(CREATURE_CYCLONE, rand()%10, rand()%10, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000); + if (Cyclone) + Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_VISUAL, true); + CycloneTimer = 30000; + }else CycloneTimer -= diff; + + if (ChainLightningTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING); + ChainLightningTimer = 15000; + }else ChainLightningTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL 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 (!m_creature->HasAura(SPELL_KNOCKBACK)) + DoCast(m_creature, SPELL_KNOCKBACK, true); + + if (MoveTimer < diff) + { + float x,y,z; + m_creature->GetPosition(x,y,z); + float PosX, PosY, PosZ; + m_creature->GetRandomPoint(x,y,z,10, PosX, PosY, PosZ); + m_creature->GetMotionMaster()->MovePoint(0, PosX, PosY, PosZ); + MoveTimer = 5000 + rand()%3000; + }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 TRINITY_DLL_DECL 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, m_creature); + } + + void JustReachedHome() + { + m_creature->ForcedDespawn(); + } + + void JustDied(Unit* killer) + { + DoPlaySoundToSet(m_creature, 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) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + DoScriptText(SAY_WOLF_HOOD, m_creature); + + DoCast(target, SPELL_LITTLE_RED_RIDING_HOOD, true); + TempThreat = DoGetThreat(target); + if (TempThreat) + DoModifyThreatPercent(target, -100); + HoodGUID = target->GetGUID(); + m_creature->AddThreat(target, 1000000.0f); + ChaseTimer = 20000; + IsChasing = true; + } + } + else + { + IsChasing = false; + + if (Unit* target = Unit::GetUnit((*m_creature), HoodGUID)) + { + HoodGUID = 0; + if (DoGetThreat(target)) + DoModifyThreatPercent(target, -100); + m_creature->AddThreat(target, TempThreat); + TempThreat = 0; + } + + ChaseTimer = 40000; + } + }else ChaseTimer -= diff; + + if (IsChasing) + return; + + if (FearTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_TERRIFYING_HOWL); + FearTimer = 25000 + rand()%10000; + }else FearTimer -= diff; + + if (SwipeTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WIDE_SWIPE); + SwipeTimer = 25000 + rand()%5000; + }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* target) +{ + target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + target->SetHealth(target->GetMaxHealth()); + target->SetStandState(UNIT_STAND_STATE_STAND); + target->CastSpell(target, SPELL_RES_VISUAL, true); + if (target->getVictim()) + { + target->GetMotionMaster()->MoveChase(target->getVictim()); + target->AI()->AttackStart(target->getVictim()); + } + else + target->GetMotionMaster()->Initialize(); +}; + +struct TRINITY_DLL_DECL 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(m_creature); + IsFakingDeath = false; + } + + SummonedRomulo = false; + RomuloDead = false; + } + + void EnterCombat(Unit* who) {} + + void AttackStart(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustReachedHome() + { + m_creature->ForcedDespawn(); + } + + void SpellHit(Unit* caster, const SpellEntry *Spell) + { + if (Spell->Id == SPELL_DRINK_POISON) + { + DoScriptText(SAY_JULIANNE_DEATH01, m_creature); + DrinkPoisonTimer = 2500; + } + } + + void DamageTaken(Unit* done_by, uint32 &damage); + + void JustDied(Unit* killer) + { + DoScriptText(SAY_JULIANNE_DEATH02, m_creature); + + 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, m_creature); + } + + void UpdateAI(const uint32 diff); +}; + +struct TRINITY_DLL_DECL 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() + { + m_creature->ForcedDespawn(); + } + + void DamageTaken(Unit* done_by, uint32 &damage); + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_ROMULO_AGGRO, m_creature); + if (JulianneGUID) + { + Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)); + if (Julianne && Julianne->getVictim()) + { + m_creature->AddThreat(Julianne->getVictim(), 1.0f); + AttackStart(Julianne->getVictim()); + } + } + } + + void MoveInLineOfSight(Unit* who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_ROMULO_DEATH, m_creature); + + 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, m_creature); + } + + void UpdateAI(const uint32 diff); +}; + +void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage) +{ + if (damage < m_creature->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; + + m_creature->InterruptNonMeleeSpells(true); + DoCast(m_creature, SPELL_DRINK_POISON); + + IsFakingDeath = true; + //IS THIS USEFULL? Creature* Julianne = (Unit::GetCreature((*m_creature), 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((*m_creature), 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((*m_creature), RomuloGUID))) + { + PretendToDie(m_creature); + 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 < m_creature->GetHealth()) + return; + + //anything below only used if incoming damage will kill + + if (Phase == PHASE_ROMULO) + { + DoScriptText(SAY_ROMULO_DEATH, m_creature); + PretendToDie(m_creature); + IsFakingDeath = true; + Phase = PHASE_BOTH; + + if (Creature* Julianne = (Unit::GetCreature((*m_creature), 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((*m_creature), 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((*m_creature), JulianneGUID))) + { + PretendToDie(m_creature); + 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, m_creature); + EntryYellTimer = 0; + }else EntryYellTimer -= diff; + } + + if (AggroYellTimer) + { + if (AggroYellTimer <= diff) + { + DoScriptText(SAY_JULIANNE_AGGRO, m_creature); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->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(m_creature); + Phase = PHASE_ROMULO; + SummonRomuloTimer = 10000; + DrinkPoisonTimer = 0; + }else DrinkPoisonTimer -= diff; + } + + if (Phase == PHASE_ROMULO && !SummonedRomulo) + { + if (SummonRomuloTimer < diff) + { + if (Creature* pRomulo = m_creature->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS)) + { + RomuloGUID = pRomulo->GetGUID(); + CAST_AI(boss_romuloAI, pRomulo->AI())->JulianneGUID = m_creature->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(m_creature); + Phase = PHASE_BOTH; + IsFakingDeath = false; + + if (m_creature->getVictim()) + AttackStart(m_creature->getVictim()); + + ResurrectSelfTimer = 0; + ResurrectTimer = 1000; + }else ResurrectSelfTimer -= diff; + } + + if (!UpdateVictim() || IsFakingDeath) + return; + + if (RomuloDead) + { + if (ResurrectTimer < diff) + { + Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID)); + if (Romulo && CAST_AI(boss_romuloAI, Romulo->AI())->IsFakingDeath) + { + DoScriptText(SAY_JULIANNE_RESURRECT, m_creature); + Resurrect(Romulo); + CAST_AI(boss_romuloAI, Romulo->AI())->IsFakingDeath = false; + RomuloDead = false; + ResurrectTimer = 10000; + } + }else ResurrectTimer -= diff; + } + + if (BlindingPassionTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_BLINDING_PASSION); + BlindingPassionTimer = 30000 + rand()%15000; + }else BlindingPassionTimer -= diff; + + if (DevotionTimer < diff) + { + DoCast(m_creature, SPELL_DEVOTION); + DevotionTimer = 15000 + rand()%30000; + }else DevotionTimer -= diff; + + if (PowerfulAttractionTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_POWERFUL_ATTRACTION); + PowerfulAttractionTimer = 5000 + rand()%25000; + }else PowerfulAttractionTimer -= diff; + + if (EternalAffectionTimer < diff) + { + if (rand()%2 == 1 && SummonedRomulo) + { + Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID)); + if (Romulo && Romulo->isAlive() && !RomuloDead) + DoCast(Romulo, SPELL_ETERNAL_AFFECTION); + }else DoCast(m_creature, SPELL_ETERNAL_AFFECTION); + + EternalAffectionTimer = 45000 + rand()%15000; + }else EternalAffectionTimer -= diff; + + DoMeleeAttackIfReady(); +} + +void boss_romuloAI::UpdateAI(const uint32 diff) +{ + if (!UpdateVictim() || IsFakingDeath) + return; + + if (JulianneDead) + { + if (ResurrectTimer < diff) + { + Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)); + if (Julianne && CAST_AI(boss_julianneAI, Julianne->AI())->IsFakingDeath) + { + DoScriptText(SAY_ROMULO_RESURRECT, m_creature); + Resurrect(Julianne); + CAST_AI(boss_julianneAI, Julianne->AI())->IsFakingDeath = false; + JulianneDead = false; + ResurrectTimer = 10000; + } + }else ResurrectTimer -= diff; + } + + if (BackwardLungeTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (target && !m_creature->HasInArc(M_PI, target)) + { + DoCast(target, SPELL_BACKWARD_LUNGE); + BackwardLungeTimer = 15000 + rand()%15000; + } + }else BackwardLungeTimer -= diff; + + if (DaringTimer < diff) + { + DoCast(m_creature, SPELL_DARING); + DaringTimer = 20000 + rand()%20000; + }else DaringTimer -= diff; + + if (DeadlySwatheTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DEADLY_SWATHE); + DeadlySwatheTimer = 15000 + rand()%10000; + }else DeadlySwatheTimer -= diff; + + if (PoisonThrustTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_POISON_THRUST); + PoisonThrustTimer = 10000 + rand()%10000; + }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/bindings/scripts/scripts/eastern_kingdoms/karazhan/def_karazhan.h b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/def_karazhan.h new file mode 100644 index 00000000000..67cb5e6ece5 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/def_karazhan.h @@ -0,0 +1,54 @@ +/* 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 +{ + 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/bindings/scripts/scripts/eastern_kingdoms/karazhan/instance_karazhan.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/instance_karazhan.cpp new file mode 100644 index 00000000000..2ee3f3958cf --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/instance_karazhan.cpp @@ -0,0 +1,309 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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: m_auiEncounter[11] = uiData; break; + if (m_auiEncounter[11] == DONE) + break; + 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/bindings/scripts/scripts/eastern_kingdoms/karazhan/karazhan.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/karazhan.cpp new file mode 100644 index 00000000000..91dd4e44ad3 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/karazhan.cpp @@ -0,0 +1,651 @@ + /* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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 "precompiled.h" +#include "def_karazhan.h" +#include "escortAI.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 TRINITY_DLL_DECL 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: + m_creature->CastSpell(m_creature, SPELL_TUXEDO, false); + pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_STAGEDOORLEFT)); + break; + case 4: + TalkCount = 0; + IsOnHold = true; + + if (Creature* pSpotlight = m_creature->SummonCreature(CREATURE_SPOTLIGHT, + m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->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, m_creature); + } + + 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 = m_creature->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 (IsOnHold) + { + if (TalkTimer < diff) + { + if (TalkCount > 3) + { + if (Creature* pSpotlight = Unit::GetCreature(*m_creature, m_uiSpotlightGUID)) + pSpotlight->ForcedDespawn(); + + IsOnHold = false; + return; + } + + Talk(TalkCount); + ++TalkCount; + } + else + TalkTimer -= diff; + } + + if (PerformanceReady) + { + if (!RaidWiped) + { + if (WipeTimer < diff) + { + Map* pMap = m_creature->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 = (ScriptedInstance*)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 +{ + 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 = (ScriptedInstance*)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(pCreature->GetNpcTextId(), 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 TRINITY_DLL_DECL 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, m_creature->GetGUID()); + (*m_creature).GetMotionMaster()->MovePoint(1,MedivPos[0],MedivPos[1],MedivPos[2]); + Step = 0; + }else + { + m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + } + } + void EnterCombat(Unit* who){} + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + if (id == 1) + { + StartEvent(); + m_creature->SetOrientation(MedivPos[3]); + m_creature->SetOrientation(MedivPos[3]); + } + } + + void StartEvent() + { + Step = 1; + EventStarted = true; + Creature* Arcanagos = m_creature->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]); + m_creature->SetOrientation(MedivPos[3]); + YellTimer = 10000; + } + + + uint32 NextStep(uint32 Step) + { + Unit* arca = Unit::GetUnit((*m_creature),ArcanagosGUID); + Map* pMap = m_creature->GetMap(); + switch(Step) + { + case 0: return 9999999; + case 1: + m_creature->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: + m_creature->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: + m_creature->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(m_creature, SPELL_MANA_SHIELD); + return 10000; + case 9: + m_creature->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false); + return 10000; + case 10: + if (arca) + m_creature->CastSpell(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: + m_creature->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL); + return 10000; + case 14: + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->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((*m_creature),ArcanagosGUID); + + if (FireArcanagosTimer < diff) + { + if (arca) + arca->CastSpell(m_creature, 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/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp new file mode 100644 index 00000000000..2d6b34d64e5 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_felblood_kaelthas.cpp @@ -0,0 +1,688 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI +{ + boss_felblood_kaelthasAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); Heroic = c->GetMap()->IsHeroic(); + } + + 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 Heroic; + 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, m_creature); + + if (!pInstance) + return; + + pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), true); + // Open the encounter door + } + + void DamageTaken(Unit* done_by, uint32 &damage) + { + if (damage > m_creature->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 && m_creature->IsWithinDistInMap(who, 40.0)) + { + DoScriptText(SAY_AGGRO, m_creature); + HasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void SetThreatList(Creature* SummonedUnit) + { + if (!SummonedUnit) + return; + + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + std::list::iterator i = m_threatlist.begin(); + for(i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit && pUnit->isAlive()) + { + float threat = m_creature->getThreatManager().getThreat(pUnit); + SummonedUnit->AddThreat(pUnit, threat); + } + } + } + + void TeleportPlayersToSelf() + { + float x = KaelLocations[0][0]; + float y = KaelLocations[0][1]; + m_creature->GetMap()->CreatureRelocation(m_creature, x, y, LOCATION_Z, 0.0f); + //m_creature->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues... + std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); + for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) + pUnit->CastSpell(pUnit, SPELL_TELEPORT_CENTER, true); + } + DoCast(m_creature, SPELL_TELEPORT_CENTER, true); + } + + void CastGravityLapseKnockUp() + { + std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); + for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) + // Knockback into the air + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, m_creature->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::iterator i = m_creature->getThreatManager().getThreatList().begin(); + for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*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, m_creature->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::iterator i = m_creature->getThreatManager().getThreatList().begin(); + for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*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 (Heroic) + { + if (PyroblastTimer < diff) + { + m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL); + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + DoCast(m_creature, SPELL_SHOCK_BARRIER, true); + DoCast(m_creature->getVictim(), SPELL_PYROBLAST); + PyroblastTimer = 60000; + }else PyroblastTimer -= diff; + } + + if (FireballTimer < diff) + { + DoCast(m_creature->getVictim(), Heroic ? SPELL_FIREBALL_HEROIC : SPELL_FIREBALL_NORMAL); + FireballTimer = 2000 + rand()%4000; + }else FireballTimer -= diff; + + if (PhoenixTimer < diff) + { + + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1); + + uint32 random = rand()%2 + 1; + float x = KaelLocations[random][0]; + float y = KaelLocations[random][1]; + + Creature* Phoenix = m_creature->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(target); + } + + DoScriptText(SAY_PHOENIX, m_creature); + + PhoenixTimer = 60000; + }else PhoenixTimer -= diff; + + if (FlameStrikeTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL); + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + DoCast(target, SPELL_FLAMESTRIKE3, true); + DoScriptText(SAY_FLAMESTRIKE, m_creature); + } + FlameStrikeTimer = 15000 + rand()%10000; + }else FlameStrikeTimer -= diff; + + // Below 50% + if (m_creature->GetMaxHealth() * 0.5 > m_creature->GetHealth()) + { + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + m_creature->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, m_creature); + 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, m_creature); + } + + DoCast(m_creature, 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* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Orb && target) + { + //SetThreatList(Orb); + Orb->AddThreat(target, 1.0f); + Orb->AI()->AttackStart(target); + } + + } + + DoCast(m_creature, SPELL_GRAVITY_LAPSE_CHANNEL); + break; + + case 4: + m_creature->InterruptNonMeleeSpells(false); + DoScriptText(SAY_TIRED, m_creature); + DoCast(m_creature, SPELL_POWER_FEEDBACK); + RemoveGravityLapse(); + GravityLapseTimer = 10000; + GravityLapsePhase = 0; + break; + } + }else GravityLapseTimer -= diff; + } + break; + } + } +}; + +struct TRINITY_DLL_DECL mob_felkael_flamestrikeAI : public ScriptedAI +{ + mob_felkael_flamestrikeAI(Creature *c) : ScriptedAI(c) + { + Heroic = c->GetMap()->IsHeroic(); + } + + uint32 FlameStrikeTimer; + bool Heroic; + + void Reset() + { + FlameStrikeTimer = 5000; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->setFaction(14); + + DoCast(m_creature, SPELL_FLAMESTRIKE2, true); + } + + void EnterCombat(Unit *who) {} + void MoveInLineOfSight(Unit *who) {} + void UpdateAI(const uint32 diff) + { + if (FlameStrikeTimer < diff) + { + DoCast(m_creature, Heroic ? SPELL_FLAMESTRIKE1_HEROIC : SPELL_FLAMESTRIKE1_NORMAL, true); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + }else FlameStrikeTimer -= diff; + } +}; + +struct TRINITY_DLL_DECL 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() + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->CastSpell(m_creature,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 < m_creature->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; + + m_creature->InterruptNonMeleeSpells(false); + m_creature->SetHealth(0); + m_creature->StopMoving(); + m_creature->ClearComboPointHolders(); + m_creature->RemoveAllAurasOnDeath(); + m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); + m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->ClearAllReactives(); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + + } + + } + + void JustDied(Unit* slayer) + { + m_creature->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(m_creature, SPELL_REBIRTH_DMG); + Rebirth = true; + } + + if (Rebirth) + { + + if (Death_Timer < diff) + { + m_creature->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + m_creature->setDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + 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. + uint32 dmg = urand(1650,2050); + m_creature->DealDamage(m_creature, dmg, 0, DOT, SPELL_SCHOOL_MASK_FIRE, NULL, false); + BurnTimer += 2000; + } BurnTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL 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) + { + m_creature->SummonCreature(CREATURE_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + }else HatchTimer -= diff; + + } +}; + +struct TRINITY_DLL_DECL mob_arcane_sphereAI : public ScriptedAI +{ + mob_arcane_sphereAI(Creature *c) : ScriptedAI(c) {Reset();} + + uint32 DespawnTimer; + uint32 ChangeTargetTimer; + + void Reset() + { + DespawnTimer = 30000; + ChangeTargetTimer = 6000 + rand()%6000; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->setFaction(14); + DoCast(m_creature, SPELL_ARCANE_SPHERE_PASSIVE, true); + } + + + void EnterCombat(Unit* who) {} + + + void UpdateAI(const uint32 diff) + { + if (DespawnTimer < diff) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + else DespawnTimer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (ChangeTargetTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + m_creature->AddThreat(target, 1.0f); + m_creature->TauntApply(target); + AttackStart(target); + } + + ChangeTargetTimer = 5000 + rand()%10000; + }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/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp new file mode 100644 index 00000000000..e0123a5367b --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_priestess_delrissa.cpp @@ -0,0 +1,1339 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_magisters_terrace.h" + +struct Speech +{ + int32 id; +}; + +static Speech LackeyDeath[]= +{ + {-1585013}, + {-1585014}, + {-1585015}, + {-1585016}, +}; + +static Speech PlayerDeath[]= +{ + {-1585017}, + {-1585018}, + {-1585019}, + {-1585020}, + {-1585021}, +}; + +enum +{ + 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 TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI +{ + boss_priestess_delrissaAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Heroic = c->GetMap()->IsHeroic(); + memset(&m_auiLackeyGUID, 0, sizeof(m_auiLackeyGUID)); + LackeyEntryList.clear(); + } + + ScriptedInstance* pInstance; + bool Heroic; + + 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, m_creature); + + for(uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) + { + if (Unit* pAdd = Unit::GetUnit(*m_creature, 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 (!m_creature->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::iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr) + { + if (Creature* pAdd = m_creature->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0)) + m_auiLackeyGUID[j] = pAdd->GetGUID(); + + ++j; + } + } + else + { + for(std::vector::iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr) + { + Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[j]); + + //object already removed, not exist + if (!pAdd) + { + if (Creature* pAdd = m_creature->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, m_creature); + + if (PlayersKilled < 4) + ++PlayersKilled; + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (!pInstance) + return; + + if (pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) == MAX_ACTIVE_LACKEY) + pInstance->SetData(DATA_DELRISSA_EVENT, DONE); + else + { + if (m_creature->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE)) + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ResetTimer < diff) + { + float x, y, z, o; + m_creature->GetHomePosition(x, y, z, o); + if (m_creature->GetPositionZ() >= z+10) + { + EnterEvadeMode(); + return; + } + ResetTimer = 5000; + }else ResetTimer -= diff; + + if (HealTimer < diff) + { + uint32 health = m_creature->GetHealth(); + Unit* target = m_creature; + for(uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) + { + if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[i])) + { + if (pAdd->isAlive() && pAdd->GetHealth() < health) + target = pAdd; + } + } + + DoCast(target, SPELL_FLASH_HEAL); + HealTimer = 15000; + }else HealTimer -= diff; + + if (RenewTimer < diff) + { + Unit* target = m_creature; + + if (rand()%2 == 1) + { + if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) + { + if (pAdd->isAlive()) + target = pAdd; + } + } + DoCast(target,Heroic ? SPELL_RENEW_HEROIC : SPELL_RENEW_NORMAL); + RenewTimer = 5000; + }else RenewTimer -= diff; + + if (ShieldTimer < diff) + { + Unit* target = m_creature; + + if (rand()%2 == 1) + { + if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) + { + if (pAdd->isAlive() && !pAdd->HasAura(SPELL_SHIELD)) + target = pAdd; + } + } + + DoCast(target, SPELL_SHIELD); + ShieldTimer = 7500; + }else ShieldTimer -= diff; + + if (DispelTimer < diff) + { + Unit* target = NULL; + bool friendly = false; + + if (rand()%2 == 1) + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + else + { + friendly = true; + + if (rand()%2 == 1) + target = m_creature; + else + { + if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) + { + if (pAdd->isAlive()) + target = pAdd; + } + } + } + + if (target) + DoCast(target, SPELL_DISPEL_MAGIC); + + DispelTimer = 12000; + }else DispelTimer -= diff; + + if (SWPainTimer < diff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, Heroic ? SPELL_SW_PAIN_HEROIC : SPELL_SW_PAIN_NORMAL); + + SWPainTimer = 10000; + }else SWPainTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_priestess_delrissa(Creature* pCreature) +{ + return new boss_priestess_delrissaAI(pCreature); +} + +enum +{ + SPELL_HEALING_POTION = 15503 +}; + +//all 8 possible lackey use this common +struct TRINITY_DLL_DECL 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 = 5000 + rand()%15000; + + // 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(*m_creature, pInstance->GetData64(DATA_DELRISSA))) + { + 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(*m_creature, m_auiLackeyGUIDs[i])) + { + if (!pAdd->getVictim() && pAdd != m_creature) + { + pWho->SetInCombatWith(pAdd); + pAdd->AddThreat(pWho, 0.0f); + } + } + } + + if (Creature* pDelrissa = Unit::GetCreature(*m_creature, 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(*m_creature, 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(*m_creature, pInstance->GetData64(DATA_DELRISSA)))) + Delrissa->AI()->KilledUnit(victim); + } + + void AcquireGUIDs() + { + if (!pInstance) + return; + + if (Creature* Delrissa = (Unit::GetCreature(*m_creature, 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 && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)) + { + DoCast(m_creature, SPELL_HEALING_POTION); + UsedPotion = true; + } + + if (ResetThreatTimer < diff) + { + DoResetThreat(); + ResetThreatTimer = 5000 + rand()%15000; + }else ResetThreatTimer -= diff; + } +}; + +enum +{ + SPELL_KIDNEY_SHOT = 27615, + SPELL_GOUGE = 12540, + SPELL_KICK = 27613, + SPELL_VANISH = 44290, + SPELL_BACKSTAB = 15657, + SPELL_EVISCERATE = 27611 +}; + +struct TRINITY_DLL_DECL 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; + m_creature->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(m_creature, SPELL_VANISH); + + Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0); + + DoResetThreat(); + + if (pUnit) + m_creature->AddThreat(pUnit, 1000.0f); + + InVanish = true; + Vanish_Timer = 30000; + Wait_Timer = 10000; + }else Vanish_Timer -= diff; + + if (InVanish) + { + if (Wait_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BACKSTAB, true); + DoCast(m_creature->getVictim(), SPELL_KIDNEY_SHOT, true); + m_creature->SetVisibility(VISIBILITY_ON); // ...? Hacklike + InVanish = false; + }else Wait_Timer -= diff; + } + + if (Gouge_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_GOUGE); + Gouge_Timer = 5500; + }else Gouge_Timer -= diff; + + if (Kick_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_KICK); + Kick_Timer = 7000; + }else Kick_Timer -= diff; + + if (Eviscerate_Timer < diff) + { + DoCast(m_creature->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 +{ + 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 TRINITY_DLL_DECL 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(m_creature,SPELL_SUMMON_IMP); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + boss_priestess_lackey_commonAI::UpdateAI(diff); + + if (Immolate_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_IMMOLATE); + Immolate_Timer = 6000; + }else Immolate_Timer -= diff; + + if (Shadow_Bolt_Timer < diff) + { + DoCast(m_creature->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 +{ + SPELL_KNOCKDOWN = 11428, + SPELL_SNAP_KICK = 46182 +}; + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_KNOCKDOWN); + Knockdown_Timer = 6000; + }else Knockdown_Timer -= diff; + + if (Snap_Kick_Timer < diff) + { + DoCast(m_creature->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 +{ + 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 TRINITY_DLL_DECL 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* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, SPELL_POLYMORPH); + Polymorph_Timer = 20000; + } + }else Polymorph_Timer -= diff; + + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 35) && !HasIceBlocked) + { + DoCast(m_creature, 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(m_creature->getVictim(), SPELL_ICE_LANCE); + Ice_Lance_Timer = 12000; + }else Ice_Lance_Timer -= diff; + + if (Cone_of_Cold_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CONE_OF_COLD); + Cone_of_Cold_Timer = 10000; + }else Cone_of_Cold_Timer -= diff; + + if (Frostbolt_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FROSTBOLT); + Frostbolt_Timer = 8000; + }else Frostbolt_Timer -= diff; + + if (Blink_Timer < diff) + { + bool InMeleeRange = false; + std::list& t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + if (Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid())) + { + //if in melee range + if (target->IsWithinDistInMap(m_creature, 5)) + { + InMeleeRange = true; + break; + } + } + } + + //if anybody is in melee range than escape by blink + if (InMeleeRange) + DoCast(m_creature, SPELL_BLINK); + + Blink_Timer = 8000; + }else Blink_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_yazzai(Creature* pCreature) +{ + return new boss_yazzaiAI(pCreature); +} + +enum +{ + 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 TRINITY_DLL_DECL 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(m_creature, 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 = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + if (Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid())) + { + //if in melee range + if (target->IsWithinDistInMap(m_creature, 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(m_creature->getVictim(),SPELL_DISARM); + Disarm_Timer = 6000; + }else Disarm_Timer -= diff; + + if (Hamstring_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_HAMSTRING); + Hamstring_Timer = 4500; + }else Hamstring_Timer -= diff; + + if (Mortal_Strike_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + Mortal_Strike_Timer = 4500; + }else Mortal_Strike_Timer -= diff; + + if (Piercing_Howl_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_PIERCING_HOWL); + Piercing_Howl_Timer = 10000; + }else Piercing_Howl_Timer -= diff; + + if (Frightening_Shout_Timer < diff) + { + DoCast(m_creature->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 +{ + 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 TRINITY_DLL_DECL 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(*m_creature,m_uiPetGUID); + if (!pPet) + m_creature->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 (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) + { + if (Wing_Clip_Timer < diff) + { + DoCast(m_creature->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 m_creature) + GameObject* pGo = m_creature->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(m_creature->getVictim(), SPELL_FREEZING_TRAP); + Freezing_Trap_Timer = 15000; + } + }else Freezing_Trap_Timer -= diff; + + DoMeleeAttackIfReady(); + } + else + { + if (Concussive_Shot_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CONCUSSIVE_SHOT); + Concussive_Shot_Timer = 8000; + }else Concussive_Shot_Timer -= diff; + + if (Multi_Shot_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT); + Multi_Shot_Timer = 10000; + }else Multi_Shot_Timer -= diff; + + if (Aimed_Shot_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_AIMED_SHOT); + Aimed_Shot_Timer = 6000; + }else Aimed_Shot_Timer -= diff; + + if (Shoot_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SHOOT); + Shoot_Timer = 2500; + }else Shoot_Timer -= diff; + } + } +}; + +CreatureAI* GetAI_garaxxas(Creature* pCreature) +{ + return new boss_garaxxasAI(pCreature); +} + +enum +{ + 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 TRINITY_DLL_DECL 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) + { + switch(rand()%3) + { + case 0: DoCast(m_creature, SPELL_WINDFURY_TOTEM); break; + case 1: DoCast(m_creature, SPELL_FIRE_NOVA_TOTEM); break; + case 2: DoCast(m_creature, SPELL_EARTHBIND_TOTEM); break; + } + ++Totem_Amount; + Totem_Timer = Totem_Amount*2000; + }else Totem_Timer -= diff; + + if (War_Stomp_Timer < diff) + { + DoCast(m_creature, 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(m_creature->getVictim(), SPELL_FROST_SHOCK); + Frost_Shock_Timer = 7000; + }else Frost_Shock_Timer -= diff; + + if (Healing_Wave_Timer < diff) + { + // std::vector::iterator itr = Group.begin() + rand()%Group.size(); + // uint64 guid = (*itr)->guid; + // if (guid) + // { + // Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid); + // if (pAdd && pAdd->isAlive()) + // { + DoCast(m_creature, 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 +{ + 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 TRINITY_DLL_DECL 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(m_creature->getVictim(), SPELL_GOBLIN_DRAGON_GUN); + Goblin_Dragon_Gun_Timer = 10000; + }else Goblin_Dragon_Gun_Timer -= diff; + + if (Rocket_Launch_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ROCKET_LAUNCH); + Rocket_Launch_Timer = 9000; + }else Rocket_Launch_Timer -= diff; + + if (Fel_Iron_Bomb_Timer < diff) + { + DoCast(m_creature->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(*m_creature, 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(m_creature, 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 TRINITY_DLL_DECL 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(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp new file mode 100644 index 00000000000..161852ed99d --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_selin_fireheart.cpp @@ -0,0 +1,370 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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); + } + } + Heroic = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool Heroic; + + 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::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) + { + //Unit* pUnit = Unit::GetUnit(*m_creature, FelCrystals[i]); + Unit* pUnit = Unit::GetUnit(*m_creature, *itr); + if (pUnit) + { + if (!pUnit->isAlive()) + CAST_CRE(pUnit)->Respawn(); // Let MaNGOS 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::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) + { + pCrystal = NULL; + //pCrystal = Unit::GetUnit(*m_creature, FelCrystals[i]); + pCrystal = Unit::GetUnit(*m_creature, *itr); + if (pCrystal && pCrystal->isAlive()) + { + // select nearest + if (!CrystalChosen || m_creature->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, m_creature); + DoScriptText(EMOTE_CRYSTAL, m_creature); + + 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, m_creature->GetObjectSize(), CONTACT_DISTANCE); + + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->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::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) + { + //Creature* pCrystal = (Unit::GetCreature(*m_creature, FelCrystals[i])); + Creature* pCrystal = (Unit::GetCreature(*m_creature, *itr)); + if (pCrystal && pCrystal->isAlive()) + pCrystal->DealDamage(pCrystal, pCrystal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), false); + //Close the encounter door, open it in JustDied/Reset + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type == POINT_MOTION_TYPE && id == 1) + { + Unit* CrystalChosen = Unit::GetUnit(*m_creature, 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(m_creature, 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, m_creature); + + 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 = m_creature->GetMaxPower(POWER_MANA); + if (maxPowerMana && ((m_creature->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 (Heroic) + { + if (DrainManaTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_DRAIN_MANA); + DrainManaTimer = 10000; + }else DrainManaTimer -= diff; + } + } + + if (FelExplosionTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(m_creature, SPELL_FEL_EXPLOSION); + FelExplosionTimer = 2000; + } + }else FelExplosionTimer -= diff; + + // If below 10% mana, start recharging + maxPowerMana = m_creature->GetMaxPower(POWER_MANA); + if (maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10)) + { + if (DrainCrystalTimer < diff) + { + SelectNearestCrystal(); + if (Heroic) 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, m_creature); + + Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID); + if (CrystalChosen && CrystalChosen->isAlive()) + // Use Deal Damage to kill it, not setDeathState. + CrystalChosen->DealDamage(CrystalChosen, CrystalChosen->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + CrystalGUID = 0; + + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(m_creature->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 TRINITY_DLL_DECL 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 = (m_creature->GetInstanceData())) + { + Creature* Selin = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SELIN))); + if (Selin && Selin->isAlive()) + { + if (CAST_AI(boss_selin_fireheartAI, Selin->AI())->CrystalGUID == m_creature->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/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp new file mode 100644 index 00000000000..642d49f68ae --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/boss_vexallus.cpp @@ -0,0 +1,228 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_magisters_terrace.h" + +enum +{ + 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 TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI +{ + boss_vexallusAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); Heroic = c->GetMap()->IsHeroic(); + Heroic = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool Heroic; + + 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, m_creature); + } + + void JustDied(Unit *victim) + { + if (pInstance) + pInstance->SetData(DATA_VEXALLUS_EVENT, DONE); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + + 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,m_creature->GetGUID()); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!Enraged) + { + //used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25% + if ((m_creature->GetHealth()*100 / m_creature->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, m_creature); + DoScriptText(EMOTE_DISCHARGE_ENERGY, m_creature); + + if (Heroic) + { + m_creature->CastSpell(m_creature,H_SPELL_SUMMON_PURE_ENERGY1,false); + m_creature->CastSpell(m_creature,H_SPELL_SUMMON_PURE_ENERGY2,false); + } + else + m_creature->CastSpell(m_creature,SPELL_SUMMON_PURE_ENERGY,false); + + //below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in Mangos + m_creature->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (Heroic) + m_creature->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); + } + + if (ChainLightningTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, Heroic ? SPELL_H_CHAIN_LIGHTNING : SPELL_CHAIN_LIGHTNING); + + ChainLightningTimer = 8000; + }else ChainLightningTimer -= diff; + + if (ArcaneShockTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (target) + DoCast(target, Heroic ? SPELL_H_ARCANE_SHOCK : SPELL_ARCANE_SHOCK); + + ArcaneShockTimer = 8000; + }else ArcaneShockTimer -= diff; + } + else + { + if (OverloadTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_OVERLOAD); + + OverloadTimer = 2000; + }else OverloadTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_vexallus(Creature* pCreature) +{ + return new boss_vexallusAI (pCreature); +}; + +struct TRINITY_DLL_DECL mob_pure_energyAI : public ScriptedAI +{ + mob_pure_energyAI(Creature *c) : ScriptedAI(c) {} + + void Reset() { } + + void JustDied(Unit* slayer) + { + if (Unit *temp = m_creature->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/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/def_magisters_terrace.h b/src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/def_magisters_terrace.h new file mode 100644 index 00000000000..d6419ea409c --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/def_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/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/instance_magisters_terrace.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/instance_magisters_terrace.cpp new file mode 100644 index 00000000000..4b7a68b9a61 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/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 "precompiled.h" +#include "def_magisters_terrace.h" + +#define MAX_ENCOUNTER 4 + +/* +0 - Selin Fireheart +1 - Vexallus +2 - Priestess Delrissa +3 - Kael'thas Sunstrider +*/ + +struct TRINITY_DLL_DECL 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::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/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/magisters_terrace.cpp new file mode 100644 index 00000000000..d9b33bbf4fc --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/magisters_terrace/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 "precompiled.h" + +/*###### +## npc_kalecgos +######*/ + +enum +{ + 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 TRINITY_DLL_DECL 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 (m_creature->GetEntry() != NPC_KAEL) + m_creature->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 = m_creature->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) + { + m_creature->CastSpell(m_creature,SPELL_ORB_KILL_CREDIT,false); + DoWorkaroundForQuestCredit(); + + // Transform and update entry, now ready for quest/read gossip + m_creature->CastSpell(m_creature,SPELL_TRANSFORM_TO_KAEL,false); + m_creature->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/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_baron_geddon.cpp new file mode 100644 index 00000000000..bd8fd74a66a --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/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 "precompiled.h" + +#define EMOTE_SERVICE -1409000 + +#define SPELL_INFERNO 19695 +#define SPELL_IGNITEMANA 19659 +#define SPELL_LIVINGBOMB 20475 +#define SPELL_ARMAGEDDOM 20479 + +struct TRINITY_DLL_DECL 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 (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 2) + { + m_creature->InterruptNonMeleeSpells(true); + DoCast(m_creature,SPELL_ARMAGEDDOM); + DoScriptText(EMOTE_SERVICE, m_creature); + return; + } + + //Inferno_Timer + if (Inferno_Timer < diff) + { + DoCast(m_creature,SPELL_INFERNO); + Inferno_Timer = 45000; + }else Inferno_Timer -= diff; + + //IgniteMana_Timer + if (IgniteMana_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_IGNITEMANA); + + IgniteMana_Timer = 30000; + }else IgniteMana_Timer -= diff; + + //LivingBomb_Timer + if (LivingBomb_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,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/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_garr.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_garr.cpp new file mode 100644 index 00000000000..0dbfab63044 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/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 "precompiled.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 TRINITY_DLL_DECL 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(m_creature,SPELL_ANTIMAGICPULSE); + AntiMagicPulse_Timer = 10000 + rand()%5000; + }else AntiMagicPulse_Timer -= diff; + + //MagmaShackles_Timer + if (MagmaShackles_Timer < diff) + { + DoCast(m_creature,SPELL_MAGMASHACKLES); + MagmaShackles_Timer = 8000 + rand()%4000; + }else MagmaShackles_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL 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* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_IMMOLATE); + + Immolate_Timer = 5000 + rand()%5000; + }else Immolate_Timer -= diff; + + //Cast Erruption and let them die + if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.10) + { + DoCast(m_creature->getVictim(),SPELL_ERUPTION); + m_creature->setDeathState(JUST_DIED); + m_creature->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/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_gehennas.cpp new file mode 100644 index 00000000000..9b965b38375 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_gehennas.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_Gehennas +SD%Complete: 90 +SDComment: Adds MC NYI +SDCategory: Molten Core +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_SHADOWBOLT 19728 +#define SPELL_RAINOFFIRE 19717 +#define SPELL_GEHENNASCURSE 19716 + +struct TRINITY_DLL_DECL 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* bTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(bTarget,SPELL_SHADOWBOLT); + ShadowBolt_Timer = 7000; + }else ShadowBolt_Timer -= diff; + + //RainOfFire_Timer + if (RainOfFire_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_RAINOFFIRE); + + RainOfFire_Timer = 4000 + rand()%8000; + }else RainOfFire_Timer -= diff; + + //GehennasCurse_Timer + if (GehennasCurse_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_GEHENNASCURSE); + GehennasCurse_Timer = 22000 + rand()%8000; + }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/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_golemagg.cpp new file mode 100644 index 00000000000..800a838aabc --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/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 "precompiled.h" +#include "def_molten_core.h" + +enum +{ + 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 TRINITY_DLL_DECL 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; + + m_creature->CastSpell(m_creature, 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 && m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*10) + { + DoCast(m_creature, SPELL_ENRAGE); + m_bEnraged = true; + } + + // Earthquake + if (m_bEnraged) + { + if (m_uiEarthquakeTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_EARTHQUAKE); + m_uiEarthquakeTimer = 3*IN_MILISECONDS; + } + else + m_uiEarthquakeTimer -= uiDiff; + } + + /* + // Golemagg's Trust + if (m_uiBuffTimer < uiDiff) + { + DoCast(m_creature, SPELL_GOLEMAGG_TRUST); + m_uiBuffTimer = 2.5*IN_MILISECONDS; + } + else + m_uiBuffTimer -= uiDiff; + */ + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL 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 (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*50) + { + if (m_pInstance) + { + if (Creature* pGolemagg = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_GOLEMAGG))) + { + if (pGolemagg->isAlive()) + { + DoScriptText(EMOTE_LOWHP, m_creature); + m_creature->SetHealth(m_creature->GetMaxHealth()); + } + else + uiDamage = m_creature->GetHealth(); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + // Mangle + if (m_uiMangleTimer < uiDiff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_lucifron.cpp new file mode 100644 index 00000000000..0b902d30be5 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/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 "precompiled.h" + +#define SPELL_IMPENDINGDOOM 19702 +#define SPELL_LUCIFRONCURSE 19703 +#define SPELL_SHADOWSHOCK 20603 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_IMPENDINGDOOM); + ImpendingDoom_Timer = 20000; + }else ImpendingDoom_Timer -= diff; + + //Lucifron's curse timer + if (LucifronCurse_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_LUCIFRONCURSE); + LucifronCurse_Timer = 15000; + }else LucifronCurse_Timer -= diff; + + //Shadowshock + if (ShadowShock_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_magmadar.cpp new file mode 100644 index 00000000000..4e7e8497d9a --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/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 "precompiled.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 TRINITY_DLL_DECL 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; + + m_creature->CastSpell(m_creature,SPELL_MAGMASPIT,true); + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Frenzy_Timer + if (Frenzy_Timer < diff) + { + DoScriptText(EMOTE_FRENZY, m_creature); + DoCast(m_creature,SPELL_FRENZY); + Frenzy_Timer = 15000; + }else Frenzy_Timer -= diff; + + //Panic_Timer + if (Panic_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_PANIC); + Panic_Timer = 35000; + }else Panic_Timer -= diff; + + //Lavabomb_Timer + if (Lavabomb_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,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/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp new file mode 100644 index 00000000000..a62afe260a6 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_majordomo_executus.cpp @@ -0,0 +1,139 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.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 TRINITY_DLL_DECL boss_majordomoAI : public ScriptedAI +{ + boss_majordomoAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + 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, m_creature); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Cast Ageis if less than 50% hp + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) + { + DoCast(m_creature,SPELL_AEGIS); + } + + //MagicReflection_Timer + // if (MagicReflection_Timer < diff) + // { + // DoCast(m_creature, SPELL_MAGICREFLECTION); + + //60 seconds until we should cast this agian + // MagicReflection_Timer = 30000; + // }else MagicReflection_Timer -= diff; + + //DamageReflection_Timer + // if (DamageReflection_Timer < diff) + // { + // DoCast(m_creature, SPELL_DAMAGEREFLECTION); + + //60 seconds until we should cast this agian + // DamageReflection_Timer = 30000; + // }else DamageReflection_Timer -= diff; + + //Blastwave_Timer + if (Blastwave_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_ragnaros.cpp new file mode 100644 index 00000000000..d665362e3b6 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_ragnaros.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_Ragnaros +SD%Complete: 75 +SDComment: Intro Dialog and event NYI +SDCategory: Molten Core +EndScriptData */ + +#include "precompiled.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 TRINITY_DLL_DECL 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; + Creature *Summoned; + 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; + + m_creature->CastSpell(m_creature,SPELL_MELTWEAPON,true); + HasAura = true; + } + + void KilledUnit(Unit* victim) + { + if (rand()%5) + return; + + DoScriptText(SAY_KILL, m_creature); + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (WasBanished && Attack_Timer < diff) + { + //Become unbanished again + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCast(m_creature,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(m_creature->getVictim(),SPELL_WRATHOFRAGNAROS); + + if (rand()%2 == 0) + { + DoScriptText(SAY_WRATH, m_creature); + } + + WrathOfRagnaros_Timer = 30000; + }else WrathOfRagnaros_Timer -= diff; + + //HandOfRagnaros_Timer + if (HandOfRagnaros_Timer < diff) + { + DoCast(m_creature,SPELL_HANDOFRAGNAROS); + + if (rand()%2==0) + { + DoScriptText(SAY_HAND, m_creature); + } + + HandOfRagnaros_Timer = 25000; + }else HandOfRagnaros_Timer -= diff; + + //LavaBurst_Timer + if (LavaBurst_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_LAVABURST); + LavaBurst_Timer = 10000; + }else LavaBurst_Timer -= diff; + + //Erruption_Timer + if (LavaBurst_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ERRUPTION); + Erruption_Timer = 20000 + rand()%25000; + }else Erruption_Timer -= diff; + + //ElementalFire_Timer + if (ElementalFire_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ELEMENTALFIRE); + ElementalFire_Timer = 10000 + rand()%4000; + }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. + + m_creature->InterruptNonMeleeSpells(false); + //Root self + DoCast(m_creature,23973); + m_creature->setFaction(35); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); + + if (!HasSubmergedOnce) + { + DoScriptText(SAY_REINFORCEMENTS1, m_creature); + + // summon 10 elementals + for(uint8 i = 0; i < 9; ++i) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (Creature* pSummoned = m_creature->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(m_creature,SPELL_RAGSUBMERGE); + Attack_Timer = 90000; + + } + else + { + DoScriptText(SAY_REINFORCEMENTS2, m_creature); + + for(uint8 i = 0; i < 9; ++i) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (Creature* pSummoned = m_creature->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000)) + pSummoned->AI()->AttackStart(pTarget); + } + } + + WasBanished = true; + DoCast(m_creature,SPELL_RAGSUBMERGE); + Attack_Timer = 90000; + } + + Submerge_Timer = 180000; + }else Submerge_Timer -= diff; + + //If we are within range melee the target + if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + //Make sure our attack is ready and we arn't currently casting + if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) + { + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + } + else + { + //MagmaBurst_Timer + if (MagmaBurst_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MAGMABURST); + + if (!HasYelledMagmaBurst) + { + //Say our dialog + DoScriptText(SAY_MAGMABURST, m_creature); + 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/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp new file mode 100644 index 00000000000..928cbf70fc3 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_shazzrah.cpp @@ -0,0 +1,124 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" + +#define SPELL_ARCANEEXPLOSION 19712 +#define SPELL_SHAZZRAHCURSE 19713 +#define SPELL_DEADENMAGIC 19714 +#define SPELL_COUNTERSPELL 19715 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_ARCANEEXPLOSION); + ArcaneExplosion_Timer = 5000 + rand()%4000; + }else ArcaneExplosion_Timer -= diff; + + //ShazzrahCurse_Timer + if (ShazzrahCurse_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) DoCast(target,SPELL_SHAZZRAHCURSE); + + ShazzrahCurse_Timer = 25000 + rand()%5000; + }else ShazzrahCurse_Timer -= diff; + + //DeadenMagic_Timer + if (DeadenMagic_Timer < diff) + { + DoCast(m_creature,SPELL_DEADENMAGIC); + DeadenMagic_Timer = 35000; + }else DeadenMagic_Timer -= diff; + + //Countspell_Timer + if (Countspell_Timer < diff) + { + DoCast(m_creature->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. + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (target) + { + DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); + DoCast(target,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/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp new file mode 100644 index 00000000000..56cf7fe31e3 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/boss_sulfuron_harbinger.cpp @@ -0,0 +1,214 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL boss_sulfuronAI : public ScriptedAI +{ + boss_sulfuronAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 Darkstrike_Timer; + uint32 DemoralizingShout_Timer; + uint32 Inspire_Timer; + uint32 Knockdown_Timer; + uint32 Flamespear_Timer; + ScriptedInstance *pInstance; + + 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(m_creature->getVictim(),SPELL_DEMORALIZINGSHOUT); + DemoralizingShout_Timer = 15000 + rand()%5000; + }else DemoralizingShout_Timer -= diff; + + //Inspire_Timer + if (Inspire_Timer < diff) + { + Creature* target = NULL; + std::list pList = DoFindFriendlyMissingBuff(45.0f,SPELL_INSPIRE); + if (!pList.empty()) + { + std::list::iterator i = pList.begin(); + advance(i, (rand()%pList.size())); + target = (*i); + } + + if (target) + DoCast(target,SPELL_INSPIRE); + + DoCast(m_creature,SPELL_INSPIRE); + + Inspire_Timer = 20000 + rand()%6000; + }else Inspire_Timer -= diff; + + //Knockdown_Timer + if (Knockdown_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN); + Knockdown_Timer = 12000 + rand()%3000; + }else Knockdown_Timer -= diff; + + //Flamespear_Timer + if (Flamespear_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) DoCast(target,SPELL_FLAMESPEAR); + + Flamespear_Timer = 12000 + rand()%4000; + }else Flamespear_Timer -= diff; + + //DarkStrike_Timer + if (Darkstrike_Timer < diff) + { + DoCast(m_creature, SPELL_DARKSTRIKE); + Darkstrike_Timer = 15000 + rand()%3000; + }else Darkstrike_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL mob_flamewaker_priestAI : public ScriptedAI +{ + mob_flamewaker_priestAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 Heal_Timer; + uint32 ShadowWordPain_Timer; + uint32 Immolate_Timer; + + ScriptedInstance *pInstance; + + 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* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) DoCast(target,SPELL_SHADOWWORDPAIN); + + ShadowWordPain_Timer = 18000+rand()%8000; + }else ShadowWordPain_Timer -= diff; + + //Immolate_Timer + if (Immolate_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) DoCast(target,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/bindings/scripts/scripts/eastern_kingdoms/molten_core/def_molten_core.h b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/def_molten_core.h new file mode 100644 index 00000000000..5874d8b9408 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/def_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/bindings/scripts/scripts/eastern_kingdoms/molten_core/instance_molten_core.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/instance_molten_core.cpp new file mode 100644 index 00000000000..2ea052f0a90 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/instance_molten_core.cpp @@ -0,0 +1,268 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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/bindings/scripts/scripts/eastern_kingdoms/molten_core/molten_core.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/molten_core.cpp new file mode 100644 index 00000000000..7af3bcce6b6 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/molten_core/molten_core.cpp @@ -0,0 +1,89 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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 "precompiled.h" +#include "simple_ai.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 = 0; + switch(rand()%6) + { + case 0 : RandDebuff = SPELL_GROUND_STOMP; break; + case 1 : RandDebuff = SPELL_ANCIENT_DREAD; break; + case 2 : RandDebuff = SPELL_CAUTERIZING_FLAMES; break; + case 3 : RandDebuff = SPELL_WITHERING_HEAT; break; + case 4 : RandDebuff = SPELL_ANCIENT_DESPAIR; break; + case 5 : RandDebuff = SPELL_ANCIENT_HYSTERIA; break; + } + + 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/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp new file mode 100644 index 00000000000..363b4ccab27 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/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 "precompiled.h" + +enum +{ + SAY_AGGRO = -1189019, + SAY_SPECIALAE = -1189020, + + SPELL_POLYMORPH = 13323, + SPELL_AOESILENCE = 8988, + SPELL_ARCANEEXPLOSION = 9433, + SPELL_FIREAOE = 9435, + SPELL_ARCANEBUBBLE = 9438, +}; + +struct TRINITY_DLL_DECL 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, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (bShielded && bCanDetonate) + { + DoCast(m_creature,SPELL_FIREAOE); + bCanDetonate = false; + } + + if (m_creature->HasAura(SPELL_ARCANEBUBBLE)) + return; + + //If we are <50% hp cast Arcane Bubble + if (!bShielded && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50) + { + //wait if we already casting + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + DoScriptText(SAY_SPECIALAE, m_creature); + DoCast(m_creature,SPELL_ARCANEBUBBLE); + + bCanDetonate = true; + bShielded = true; + } + + if (Polymorph_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,SPELL_POLYMORPH); + + Polymorph_Timer = 20000; + }else Polymorph_Timer -= diff; + + //AoESilence_Timer + if (AoESilence_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_AOESILENCE); + AoESilence_Timer = 15000 + rand()%5000; + }else AoESilence_Timer -= diff; + + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp new file mode 100644 index 00000000000..e133d52b41b --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/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 "precompiled.h" + +#define SPELL_CALLOFTHEGRAVE 17831 +#define SPELL_TERRIFY 7399 +#define SPELL_SOULSIPHON 7290 + +struct TRINITY_DLL_DECL 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 (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false)) + { + //SoulSiphon_Timer + if (SoulSiphon_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SOULSIPHON); + return; + + SoulSiphon_Timer = 20000; + }else SoulSiphon_Timer -= diff; + } + + //CallOfTheGrave_Timer + if (CallOftheGrave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CALLOFTHEGRAVE); + CallOftheGrave_Timer = 30000; + }else CallOftheGrave_Timer -= diff; + + //Terrify_Timer + if (Terrify_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp new file mode 100644 index 00000000000..84febc690d1 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/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 "precompiled.h" + +enum +{ + SAY_AGGRO = -1189016, + SAY_HEALTH = -1189017, + SAY_KILL = -1189018, + + SPELL_FLAMESHOCK = 8053, + SPELL_SHADOWBOLT = 1106, + SPELL_FLAMESPIKE = 8814, + SPELL_FIRENOVA = 16079, +}; + +struct TRINITY_DLL_DECL 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, m_creature); + } + + void KilledUnit(Unit* Victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //If we are <35% hp + if (!HpYell && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 35)) + { + DoScriptText(SAY_HEALTH, m_creature); + HpYell = true; + } + + //FlameShock_Timer + if (FlameShock_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FLAMESHOCK); + FlameShock_Timer = 10000 + rand()%5000; + }else FlameShock_Timer -= diff; + + //FlameSpike_Timer + if (FlameSpike_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FLAMESPIKE); + FlameSpike_Timer = 30000; + }else FlameSpike_Timer -= diff; + + //FireNova_Timer + if (FireNova_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FIRENOVA); + FireNova_Timer = 40000; + }else FireNova_Timer -= diff; + + //ShadowBolt_Timer + if (ShadowBolt_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp new file mode 100644 index 00000000000..36b4002d48a --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_headless_horseman.cpp @@ -0,0 +1,866 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "SpellMgr.h" +#include "def_scarlet_monastery.h" + +#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 +}; + +struct Summon +{ + const std::string text; +}; + +static Summon Text[]= +{ + {"Horseman rise..."}, + {"Your time is nigh..."}, + {"You felt death once..."}, + {"Now, know demise!"} +}; + +struct TRINITY_DLL_DECL 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) + { + Creaturetype = _type; + switch(Creaturetype) + { + 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(m_creature,spell); + } + + void SpellHit(Unit* caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_WISP_FLIGHT_PORT && Creaturetype == 4) + m_creature->SetDisplayId(2027); + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || Creaturetype != 1 || !who->isTargetableForAttack()) + return; + + if (m_creature->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) + { + m_creature->RemoveAurasDueToSpell(SPELL_SMOKE); + if (spell2) + DoCast(m_creature,spell2); + delay = 0; + }else delay -= diff; + } + } +}; + +struct TRINITY_DLL_DECL 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 = 15000 + rand()%16 * 1000; + } + + void EnterCombat(Unit *who) {} + void SaySound(int32 textEntry, Unit *target = 0) + { + DoScriptText(textEntry, m_creature, target); + //DoCast(m_creature,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 (((m_creature->GetHealth() - damage)*100)/m_creature->GetMaxHealth() < 67) + Disappear();break; + case 2: + if (((m_creature->GetHealth() - damage)*100)/m_creature->GetMaxHealth() < 34) + Disappear();break; + case 3: + if (damage >= m_creature->GetHealth()) + { + die = true; + withbody = true; + wait = 300; + damage = m_creature->GetHealth() - m_creature->GetMaxHealth()/100; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->StopMoving(); + //m_creature->GetMotionMaster()->MoveIdle(); + DoCast(m_creature,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(); + m_creature->RemoveAllAuras(); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoCast(m_creature,SPELL_HEAD_LANDS,true); + DoCast(m_creature,SPELL_HEAD,false); + SaySound(SAY_LOST_HEAD); + m_creature->GetMotionMaster()->Clear(false); + m_creature->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 (!m_creature->getVictim()) return; + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveFleeing(m_creature->getVictim()); + }else wait -= diff; + if (laugh < diff) + { + laugh = 15000 + (rand()%16)*1000; + DoPlaySoundToSet(m_creature, RandomLaugh[rand()%3]); + //DoCast(m_creature,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); + m_creature->MonsterTextEmote("laughs",NULL); + } else laugh -= diff; + + } else { + + if (die) { + if (wait < diff) + { + die = false; + Unit *body = Unit::GetUnit((*m_creature),bodyGUID); + if (body) + body->DealDamage(body, body->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->setDeathState(JUST_DIED); + } else wait -= diff; + } + } + } +}; + +struct TRINITY_DLL_DECL 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; + } +/* SpellEntry *confl = GET_SPELL(SPELL_CONFLAGRATION); + if (confl) + confl->EffectTriggerSpell[1] = 22587; + + SpellEntry *speed = GET_SPELL(22587); + if (speed) + { + 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 = 16000 + rand()%5 * 1000; + cleave = 2000; + regen = 1000; + burn = 6000; + count = 0; + say_timer = 3000; + + withhead = true; + returned = true; + burned = false; + IsFlying = false; + DoCast(m_creature,SPELL_HEAD); + if (headGUID){ + Unit* Head = Unit::GetUnit((*m_creature), headGUID); + if (Head){ + Head->SetVisibility(VISIBILITY_OFF); + Head->setDeathState(JUST_DIED); + } + headGUID = 0; + } + + if (pInstance) + pInstance->SetData(DATA_HORSEMAN_EVENT, 0); + } + + void FlyMode() + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_HOVER); + m_creature->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) + return; + if (i != id) + return; + wp_reached = true; + + switch (id) + { + case 0: + m_creature->SetVisibility(VISIBILITY_ON);break; + case 1: { + Creature *smoke = m_creature->SummonCreature(HELPER,Spawn[1].x,Spawn[1].y,Spawn[1].z,0,TEMPSUMMON_TIMED_DESPAWN,20000); + if (smoke) + CAST_AI(mob_wisp_invisAI, smoke->AI())->SetType(3); + DoCast(m_creature,SPELL_RHYME_BIG); + break;} + case 6: + if (pInstance) + pInstance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject + break; + case 19: + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_HOVER);break; + case 20: { + Phase = 1; + IsFlying = false; + wp_reached = false; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + SaySound(SAY_ENTRANCE); + Unit *plr = Unit::GetUnit((*m_creature),PlayerGUID); + if (plr) + 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); + else { //maybe possible when player dies from conflagration + Creature *Head = Unit::GetCreature((*m_creature), headGUID); + if (Head) + CAST_AI(mob_headAI, Head->AI())->SaySound(SAY_PLAYER_DEATH); + } + } + } + + void SaySound(int32 textEntry, Unit *target = 0) + { + DoScriptText(textEntry, m_creature, target); + laugh += 4000; + } + + Player* SelectRandomPlayer(float range = 0.0f, bool checkLoS = true) + { + Map* pMap = m_creature->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::iterator j; + + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if ((m_creature->IsWithinLOSInMap(i->getSource()) || !checkLoS) && m_creature->getVictim() != i->getSource() && + m_creature->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) + if (unit->HasAura(SPELL_CONFLAGRATION)) + SaySound(SAY_CONFLAGRATION,unit); + } + + void JustDied(Unit* killer) + { + m_creature->StopMoving(); + //m_creature->GetMotionMaster()->MoveIdle(); test + SaySound(SAY_DEATH); + Creature *flame = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000); + if (flame) + flame->CastSpell(flame,SPELL_BODY_FLAME,false); + Creature *wisp = DoSpawnCreature(WISP_INVIS,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000); + if (wisp) + 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; + m_creature->RemoveAllAuras(); + m_creature->SetName("Headless Horseman"); + m_creature->SetHealth(m_creature->GetMaxHealth()); + SaySound(SAY_REJOINED); + DoCast(m_creature,SPELL_HEAD); + caster->GetMotionMaster()->Clear(false); + caster->GetMotionMaster()->MoveFollow(m_creature,6,rand()%6); + //DoResetThreat();//not sure if need + std::list::iterator itr; + for(itr = caster->getThreatManager().getThreatList().begin(); itr != caster->getThreatManager().getThreatList().end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); + if (pUnit && pUnit->isAlive() && pUnit != caster) + m_creature->AddThreat(pUnit,caster->getThreatManager().getThreat(pUnit)); + } + } + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= m_creature->GetHealth() && withhead) + { + withhead = false; + returned = false; + damage = m_creature->GetHealth() - m_creature->GetMaxHealth()/100; + m_creature->RemoveAllAuras(); + m_creature->SetName("Headless Horseman, Unhorsed"); + + if (!headGUID) + headGUID = DoSpawnCreature(HEAD,rand()%6,rand()%6,0,0,TEMPSUMMON_DEAD_DESPAWN,0)->GetGUID(); + Unit* Head = Unit::GetUnit((*m_creature), headGUID); + if (Head && Head->isAlive()) + { + Head->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + //Head->CastSpell(Head,SPELL_HEAD_INVIS,false); + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_IMMUNE,true); + DoCast(m_creature,SPELL_BODY_REGEN,true); + m_creature->CastSpell(Head, SPELL_FLYING_HEAD,true); + DoCast(m_creature,SPELL_CONFUSE,false); //test + done_by->ProcDamageAndSpell(m_creature,PROC_FLAG_KILL,PROC_FLAG_KILLED,PROC_EX_NONE,0); + whirlwind = 4000 + (rand()%5)*1000; + 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].text,0); + else { + DoCast(m_creature,SPELL_RHYME_BIG); + if (plr) + { + plr->Say(Text[count].text,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; + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MovePoint(id,FlightPoint[id].x,FlightPoint[id].y,FlightPoint[id].z); + } + } + } + break; + case 1: + if (burned) break; + if (burn < diff) + { + Creature *flame = m_creature->SummonCreature(HELPER,Spawn[0].x,Spawn[0].y,Spawn[0].z,0,TEMPSUMMON_TIMED_DESPAWN,17000); + if (flame) + CAST_AI(mob_wisp_invisAI, flame->AI())->SetType(2); + burned = true; + }else burn -= diff; + break; + case 2: + if (conflagrate < diff) + { + Unit *plr = SelectRandomPlayer(30.0f); + if (plr) + m_creature->CastSpell(plr,SPELL_CONFLAGRATION,false); + conflagrate = 10000 + rand()%7 * 1000; + }else conflagrate -= diff; + break; + case 3: + if (summonadds < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_SUMMON_PUMPKIN); + SaySound(SAY_SPROUTING_PUMPKINS); + summonadds = 25000 + rand()%11 *1000; + }else summonadds -= diff; + break; + } + + if (laugh < diff) { + laugh = 11000 + rand()%12 * 1000; + m_creature->MonsterTextEmote("laughs",NULL); + DoPlaySoundToSet(m_creature, RandomLaugh[rand()%3]); + } else laugh -= diff; + + if (UpdateVictim()) + { + DoMeleeAttackIfReady(); + if (cleave < diff) { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + cleave = 2000*(1 + rand()%3); //1 cleave per 2.0-6.0sec + } else cleave -= diff; + } + + } else { + + if (regen < diff) + { + regen = 1000; //"body calls head" + if (m_creature->GetHealth()/m_creature->GetMaxHealth() == 1 && !returned) + { + if (Phase > 1) --Phase; + else Phase = 1; + Creature* Head = Unit::GetCreature((*m_creature), 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 = 4000 + rand()%5 * 1000; + if (rand()%2) { + m_creature->RemoveAurasDueToSpell(SPELL_CONFUSE); + DoCast(m_creature,SPELL_WHIRLWIND,true); + DoCast(m_creature,SPELL_CONFUSE); + }else + m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND); + }else whirlwind -= diff; + } + } +}; + +void mob_headAI::Disappear() +{ + if (withbody) + return; + if (bodyGUID) + { + Creature *body = Unit::GetCreature((*m_creature), bodyGUID); + if (body && body->isAlive()) + { + withbody = true; + m_creature->RemoveAllAuras(); + body->RemoveAurasDueToSpell(SPELL_IMMUNE);//hack, SpellHit doesn't calls if body has immune aura + DoCast(body,SPELL_FLYING_HEAD); + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->GetMotionMaster()->MoveIdle(); + CAST_AI(boss_headless_horsemanAI, body->AI())->returned = true; + } + } +} + +struct TRINITY_DLL_DECL mob_pulsing_pumpkinAI : public ScriptedAI +{ + mob_pulsing_pumpkinAI(Creature *c) : ScriptedAI(c) {} + + bool sprouted; + uint64 debuffGUID; + + void Reset() + { + float x, y, z; + m_creature->GetPosition(x, y, z); //this visual aura some under ground + m_creature->GetMap()->CreatureRelocation(m_creature, 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(m_creature->GetDisplayId()); + debuff->CastSpell(debuff,SPELL_PUMPKIN_AURA_GREEN,false); + CAST_AI(mob_wisp_invisAI, debuff->AI())->SetType(1); + debuffGUID = debuff->GetGUID(); + } + sprouted = false; + DoCast(m_creature,SPELL_PUMPKIN_AURA,true); + DoCast(m_creature,SPELL_SPROUTING); + m_creature->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; + m_creature->RemoveAllAuras(); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED); + DoCast(m_creature,SPELL_SPROUT_BODY,true); + m_creature->UpdateEntry(PUMPKIN_FIEND); + DoStartMovement(m_creature->getVictim()); + } + } + + void Despawn() + { + if (!debuffGUID) return; + Unit *debuff = Unit::GetUnit((*m_creature),debuffGUID); + if (debuff) + debuff->SetVisibility(VISIBILITY_OFF); + debuffGUID = 0; + } + + void JustDied(Unit *killer) {if (!sprouted) Despawn();} + + void MoveInLineOfSight(Unit *who) + { + if (!who || !who->isTargetableForAttack() || !m_creature->IsHostileTo(who) || m_creature->getVictim()) + return; + + m_creature->AddThreat(who,0.0f); + if (sprouted) + DoStartMovement(who); + } + + void UpdateAI(const uint32 diff) + { + if (sprouted) + if (UpdateVictim()) + DoMeleeAttackIfReady(); + } +}; + +bool GOHello_go_loosely_turned_soil(Player* pPlayer, GameObject* soil) +{ +/* 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); + Creature *horseman = soil->SummonCreature(HH_MOUNTED,FlightPoint[20].x,FlightPoint[20].y,FlightPoint[20].z,0,TEMPSUMMON_MANUAL_DESPAWN,0); + if (horseman) + { + 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/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp new file mode 100644 index 00000000000..5a1c8e6d364 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.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: Boss_Herod +SD%Complete: 95 +SDComment: Should in addition spawn Myrmidons in the hallway outside +SDCategory: Scarlet Monastery +EndScriptData */ + +#include "precompiled.h" +#include "escortAI.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 TRINITY_DLL_DECL 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, m_creature); + DoCast(m_creature,SPELL_RUSHINGCHARGE); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void JustDied(Unit* killer) + { + for(uint8 i = 0; i < 20; ++i) + m_creature->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 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false)) + { + DoScriptText(EMOTE_ENRAGE, m_creature); + DoScriptText(SAY_ENRAGE, m_creature); + DoCast(m_creature,SPELL_FRENZY); + Enrage = true; + } + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 12000; + }else Cleave_Timer -= diff; + + // Whirlwind_Timer + if (Whirlwind_Timer < diff) + { + DoScriptText(SAY_WHIRLWIND, m_creature); + DoCast(m_creature->getVictim(),SPELL_WHIRLWIND); + Whirlwind_Timer = 30000; + }else Whirlwind_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_herod(Creature* pCreature) +{ + return new boss_herodAI(pCreature); +} + +struct TRINITY_DLL_DECL 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/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp new file mode 100644 index 00000000000..d94a55bfad5 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/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 "precompiled.h" + +enum +{ + SPELL_CURSEOFBLOOD = 8282, + SPELL_DISPELMAGIC = 15090, + SPELL_FEAR = 12096, + SPELL_HEAL = 12039, + SPELL_POWERWORDSHIELD = 11647, + SPELL_SLEEP = 8399 +}; + +struct TRINITY_DLL_DECL 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 (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 25 && !m_creature->IsNonMeleeSpellCasted(false) && Heal_Timer < diff) + { + DoCast(m_creature,SPELL_HEAL); + Heal_Timer = 30000; + }else Heal_Timer -= diff; + + //Fear_Timer + if (Fear_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,SPELL_FEAR); + + Fear_Timer = 40000; + }else Fear_Timer -= diff; + + //Sleep_Timer + if (Sleep_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO,0)) + DoCast(target,SPELL_SLEEP); + + Sleep_Timer = 30000; + }else Sleep_Timer -= diff; + + //PowerWordShield_Timer + if (!PowerWordShield && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 25) + { + DoCast(m_creature,SPELL_POWERWORDSHIELD); + PowerWordShield = true; + } + + //Dispel_Timer + if (Dispel_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_DISPELMAGIC); + + DispelMagic_Timer = 30000; + }else DispelMagic_Timer -= diff; + + //CurseOfBlood_Timer + if (CurseOfBlood_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_houndmaster_loksey.cpp new file mode 100644 index 00000000000..7d5b6a2dbd2 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/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 "precompiled.h" + +enum +{ + SAY_AGGRO = -1189021, + SPELL_SUMMONSCARLETHOUND = 17164, + SPELL_BLOODLUST = 6742 +}; + +struct TRINITY_DLL_DECL 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, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (BloodLust_Timer < diff) + { + DoCast(m_creature,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/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_interrogator_vishas.cpp new file mode 100644 index 00000000000..cfbc0518826 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/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 "precompiled.h" +#include "def_scarlet_monastery.h" + +enum +{ + SAY_AGGRO = -1189011, + SAY_HEALTH1 = -1189012, + SAY_HEALTH2 = -1189013, + SAY_KILL = -1189014, + SAY_TRIGGER_VORREL = -1189015, + + SPELL_SHADOWWORDPAIN = 2767, +}; + +struct TRINITY_DLL_DECL boss_interrogator_vishasAI : public ScriptedAI +{ + boss_interrogator_vishasAI(Creature *c) : ScriptedAI(c) + { + pInstance = m_creature->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + bool Yell30; + bool Yell60; + uint32 ShadowWordPain_Timer; + + void Reset() + { + ShadowWordPain_Timer = 5000; + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* Victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void JustDied(Unit* Killer) + { + if (!pInstance) + return; + + //Any other actions to do with vorrel? setStandState? + if (Unit *vorrel = Unit::GetUnit(*m_creature,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 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 60)) + { + DoScriptText(SAY_HEALTH1, m_creature); + Yell60 = true; + } + + if (!Yell30 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 30)) + { + DoScriptText(SAY_HEALTH2, m_creature); + Yell30 = true; + } + + //ShadowWordPain_Timer + if (ShadowWordPain_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp new file mode 100644 index 00000000000..95a421fed13 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_mograine_and_whitemane.cpp @@ -0,0 +1,360 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_scarlet_monastery.h" + +enum +{ + //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 TRINITY_DLL_DECL 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 + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + if (m_pInstance) + if (m_creature->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, m_creature); + DoCast(m_creature,SPELL_RETRIBUTIONAURA); + + m_creature->CallForHelp(VISIBLE_RANGE); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_MO_KILL, m_creature); + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (uiDamage < m_creature->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((*m_creature), 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); + + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MoveIdle(); + + m_creature->SetHealth(0); + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + m_creature->ClearComboPointHolders(); + m_creature->RemoveAllAuras(); + m_creature->ClearAllReactives(); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->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, m_creature); + 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((*m_creature), m_pInstance->GetData64(DATA_WHITEMANE))) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoCast(Whitemane, SPELL_LAYONHANDS); + + m_uiCrusaderStrike_Timer = 10000; + m_uiHammerOfJustice_Timer = 10000; + + if (m_creature->getVictim()) + m_creature->GetMotionMaster()->MoveChase(m_creature->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(m_creature->getVictim(),SPELL_CRUSADERSTRIKE); + m_uiCrusaderStrike_Timer = 10000; + }else m_uiCrusaderStrike_Timer -= uiDiff; + + //m_uiHammerOfJustice_Timer + if (m_uiHammerOfJustice_Timer < uiDiff) + { + DoCast(m_creature->getVictim(),SPELL_HAMMEROFJUSTICE); + m_uiHammerOfJustice_Timer = 60000; + }else m_uiHammerOfJustice_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL 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 (m_creature->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, m_creature); + } + + void KilledUnit(Unit* pVictim) + { + DoScriptText(SAY_WH_KILL, m_creature); + } + + 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((*m_creature), m_pInstance->GetData64(DATA_MOGRAINE))) + { + DoCast(Mograine, SPELL_SCARLETRESURRECTION); + DoScriptText(SAY_WH_RESSURECT, m_creature); + m_bCanResurrect = false; + } + } + else m_uiWait_Timer -= uiDiff; + } + + //Cast Deep sleep when health is less than 50% + if (!m_bCanResurrectCheck && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCast(m_creature->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 (m_creature->GetHealth() <= m_creature->GetMaxHealth()*0.75f) + pTarget = m_creature; + + if (m_pInstance) + { + if (Creature* pMograine = Unit::GetCreature((*m_creature), 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(m_creature,SPELL_POWERWORDSHIELD); + m_uiPowerWordShield_Timer = 15000; + }else m_uiPowerWordShield_Timer -= uiDiff; + + //m_uiHolySmite_Timer + if (m_uiHolySmite_Timer < uiDiff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_scorn.cpp new file mode 100644 index 00000000000..fa54e594783 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/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 "precompiled.h" + +#define SPELL_LICHSLAP 28873 +#define SPELL_FROSTBOLTVOLLEY 8398 +#define SPELL_MINDFLAY 17313 +#define SPELL_FROSTNOVA 15531 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_LICHSLAP); + LichSlap_Timer = 45000; + }else LichSlap_Timer -= diff; + + //FrostboltVolley_Timer + if (FrostboltVolley_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FROSTBOLTVOLLEY); + FrostboltVolley_Timer = 20000; + }else FrostboltVolley_Timer -= diff; + + //MindFlay_Timer + if (MindFlay_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MINDFLAY); + MindFlay_Timer = 20000; + }else MindFlay_Timer -= diff; + + //FrostNova_Timer + if (FrostNova_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/def_scarlet_monastery.h b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/def_scarlet_monastery.h new file mode 100644 index 00000000000..2b6399ae3e4 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/def_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/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/instance_scarlet_monastery.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/instance_scarlet_monastery.cpp new file mode 100644 index 00000000000..04a63a82319 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/instance_scarlet_monastery.cpp @@ -0,0 +1,156 @@ +/* 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 "precompiled.h" +#include "def_scarlet_monastery.h" +#include "sc_creature.h" + +#define ENTRY_PUMPKIN_SHRINE 186267 +#define ENTRY_HORSEMAN 23682 +#define ENTRY_HEAD 23775 +#define ENTRY_PUMPKIN 23694 + +#define MAX_ENCOUNTER 1 + +struct TRINITY_DLL_DECL 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: + if (data == DONE) + { + for(std::set::iterator itr = HorsemanAdds.begin(); itr != HorsemanAdds.end(); ++itr) + { + Creature* add = instance->GetCreature(*itr); + if (add && add->isAlive()) + add->DealDamage(add, add->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + 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]; + + 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/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.cpp new file mode 100644 index 00000000000..a5f32d9bde1 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_darkmaster_gandling.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_Darkmaster_Gandling +SD%Complete: 75 +SDComment: Doors missing in instance script. +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" +#include "def_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 TRINITY_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI +{ + boss_darkmaster_gandlingAI(Creature *c) : ScriptedAI(c) + { + pInstance = m_creature->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 ArcaneMissiles_Timer; + uint32 ShadowShield_Timer; + uint32 Curse_Timer; + uint32 Teleport_Timer; + + Creature *Summoned; + + 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(m_creature->getVictim(),SPELL_ARCANEMISSILES); + ArcaneMissiles_Timer = 8000; + }else ArcaneMissiles_Timer -= diff; + + //ShadowShield_Timer + if (ShadowShield_Timer < diff) + { + DoCast(m_creature,SPELL_SHADOWSHIELD); + ShadowShield_Timer = 14000 + rand()%14000; + }else ShadowShield_Timer -= diff; + + //Curse_Timer + if (Curse_Timer < diff) + { + DoCast(m_creature->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 (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 3) + { + if (Teleport_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + if (DoGetThreat(target)) + DoModifyThreatPercent(target, -100); + + switch(rand()%6) + { + case 0: + DoTeleportPlayer(target, 250.0696,0.3921,84.8408,3.149); + Summoned = m_creature->SummonCreature(16119,254.2325,0.3417,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + Summoned = m_creature->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + Summoned = m_creature->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + break; + case 1: + DoTeleportPlayer(target, 181.4220,-91.9481,84.8410,1.608); + Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + break; + case 2: + DoTeleportPlayer(target, 95.1547,-1.8173,85.2289,0.043); + Summoned = m_creature->SummonCreature(16119,100.9404,-1.8016,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + Summoned = m_creature->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + Summoned = m_creature->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + break; + case 3: + DoTeleportPlayer(target, 250.0696,0.3921,72.6722,3.149); + Summoned = m_creature->SummonCreature(16119,240.34481,0.7368,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + Summoned = m_creature->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + Summoned = m_creature->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + break; + case 4: + DoTeleportPlayer(target, 181.4220,-91.9481,70.7734,1.608); + Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + break; + case 5: + DoTeleportPlayer(target, 106.1541,-1.8994,75.3663,0.043); + Summoned = m_creature->SummonCreature(16119,115.3945,-1.5555,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + Summoned = m_creature->SummonCreature(16119,257.7133,1.8066,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + Summoned = m_creature->SummonCreature(16119,258.6702,-5.1001,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); + if (Summoned) + (Summoned->AI())->AttackStart(target); + 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/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.cpp new file mode 100644 index 00000000000..d4c19cc6dd6 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_death_knight_darkreaver.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: Boss_Death_knight_darkreaver +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" + +struct TRINITY_DLL_DECL boss_death_knight_darkreaverAI : public ScriptedAI +{ + boss_death_knight_darkreaverAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (m_creature->GetHealth() <= damage) + { + m_creature->CastSpell(m_creature,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/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp new file mode 100644 index 00000000000..badea0761e4 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp @@ -0,0 +1,111 @@ +/* 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 "precompiled.h" +#include "def_scholomance.h" + +#define EMOTE_GENERIC_FRENZY_KILL -1000001 + +#define SPELL_REND 18106 +#define SPELL_CLEAVE 15584 +#define SPELL_FRENZY 28371 + +struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI +{ + boss_theolenkrastinovAI(Creature *c) : ScriptedAI(c) {} + + uint32 Rend_Timer; + uint32 Cleave_Timer; + uint32 Frenzy_Timer; + + void Reset() + { + Rend_Timer = 8000; + Cleave_Timer = 9000; + Frenzy_Timer =0; + } + + void JustDied(Unit *killer) + { + ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; + if (pInstance) + { + pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0); + + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) + m_creature->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; + + //Rend_Timer + if (Rend_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_REND); + Rend_Timer = 10000; + }else Rend_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 10000; + }else Cleave_Timer -= diff; + + //Frenzy_Timer + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26) + { + if (Frenzy_Timer < diff) + { + DoCast(m_creature,SPELL_FRENZY); + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); + + Frenzy_Timer = 8000; + }else Frenzy_Timer -= diff; + } + + 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/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_illucia_barov.cpp new file mode 100644 index 00000000000..0fd36025676 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_scholomance.h" + +#define SPELL_CURSEOFAGONY 18671 +#define SPELL_SHADOWSHOCK 20603 +#define SPELL_SILENCE 15487 +#define SPELL_FEAR 6215 + +struct TRINITY_DLL_DECL 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 = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; + if (pInstance) + { + pInstance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0); + + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) + m_creature->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(m_creature->getVictim(),SPELL_CURSEOFAGONY); + CurseOfAgony_Timer = 30000; + }else CurseOfAgony_Timer -= diff; + + //ShadowShock_Timer + if (ShadowShock_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) DoCast(target,SPELL_SHADOWSHOCK); + + ShadowShock_Timer = 12000; + }else ShadowShock_Timer -= diff; + + //Silence_Timer + if (Silence_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SILENCE); + Silence_Timer = 14000; + }else Silence_Timer -= diff; + + //Fear_Timer + if (Fear_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_instructor_malicia.cpp new file mode 100644 index 00000000000..b7ae2422c92 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_scholomance.h" + +#define SPELL_CALLOFGRAVES 17831 +#define SPELL_CORRUPTION 11672 +#define SPELL_FLASHHEAL 10917 +#define SPELL_RENEW 10929 +#define SPELL_HEALINGTOUCH 9889 + +struct TRINITY_DLL_DECL 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 = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; + if (pInstance) + { + pInstance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0); + + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) + m_creature->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(m_creature->getVictim(),SPELL_CALLOFGRAVES); + CallOfGraves_Timer = 65000; + }else CallOfGraves_Timer -= diff; + + //Corruption_Timer + if (Corruption_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) DoCast(target,SPELL_CORRUPTION); + + Corruption_Timer = 24000; + }else Corruption_Timer -= diff; + + //Renew_Timer + if (Renew_Timer < diff) + { + DoCast(m_creature, SPELL_RENEW); + Renew_Timer = 10000; + }else Renew_Timer -= diff; + + //FlashHeal_Timer + if (FlashHeal_Timer < diff) + { + DoCast(m_creature,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(m_creature,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/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp new file mode 100644 index 00000000000..9996479177f --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_jandice_barov.cpp @@ -0,0 +1,223 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with 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 "precompiled.h" + +#define SPELL_CURSEOFBLOOD 24673 +//#define SPELL_ILLUSION 17773 + +//Spells of Illusion of Jandice Barov +#define SPELL_CLEAVE 15584 + +struct TRINITY_DLL_DECL boss_jandicebarovAI : public ScriptedAI +{ + boss_jandicebarovAI(Creature *c) : ScriptedAI(c) {} + + uint32 CurseOfBlood_Timer; + uint32 Illusion_Timer; + //uint32 Illusioncounter; + uint32 Invisible_Timer; + bool Invisible; + int Rand; + int RandX; + int RandY; + Creature* Summoned; + + 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) + { + Rand = rand()%10; + switch (rand()%2) + { + case 0: RandX = 0 - Rand; break; + case 1: RandX = 0 + Rand; break; + } + Rand = 0; + Rand = rand()%10; + switch (rand()%2) + { + case 0: RandY = 0 - Rand; break; + case 1: RandY = 0 + Rand; break; + } + Rand = 0; + Summoned = DoSpawnCreature(11439, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); + if (Summoned) + (Summoned->AI())->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + if (Invisible && Invisible_Timer < diff) + { + //Become visible again + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->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(m_creature->getVictim(),SPELL_CURSEOFBLOOD); + + //45 seconds + CurseOfBlood_Timer = 30000; + }else CurseOfBlood_Timer -= diff; + + //Illusion_Timer + if (!Invisible && Illusion_Timer < diff) + { + + //Inturrupt any spell casting + m_creature->InterruptNonMeleeSpells(false); + m_creature->setFaction(35); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetDisplayId(11686); // Invisible Model + DoModifyThreatPercent(m_creature->getVictim(),-99); + + //Summon 10 Illusions attacking random gamers + Unit* target = NULL; + for(uint8 i = 0; i < 10; ++i) + { + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + SummonIllusions(target); + } + 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(m_creature->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 TRINITY_DLL_DECL mob_illusionofjandicebarovAI : public ScriptedAI +{ + mob_illusionofjandicebarovAI(Creature *c) : ScriptedAI(c) {} + + uint32 Cleave_Timer; + + void Reset() + { + Cleave_Timer = 2000 + rand()%6000; + m_creature->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(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_kormok.cpp new file mode 100644 index 00000000000..c67a49926f9 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_kormok.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_Kormok +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_SHADOWBOLTVOLLEY 20741 +#define SPELL_BONESHIELD 27688 + +struct TRINITY_DLL_DECL boss_kormokAI : public ScriptedAI +{ + boss_kormokAI(Creature *c) : ScriptedAI(c) {} + + uint32 ShadowVolley_Timer; + uint32 BoneShield_Timer; + uint32 Minion_Timer; + uint32 Mage_Timer; + bool Mages; + int Rand1; + int Rand1X; + int Rand1Y; + int Rand2; + int Rand2X; + int Rand2Y; + Creature* SummonedMinions; + Creature* SummonedMages; + + void Reset() + { + ShadowVolley_Timer = 10000; + BoneShield_Timer = 2000; + Minion_Timer = 15000; + Mage_Timer = 0; + Mages = false; + } + + void EnterCombat(Unit *who) + { + } + + void SummonMinion(Unit* victim) + { + Rand1 = rand()%8; + switch (rand()%2) + { + case 0: Rand1X = 0 - Rand1; break; + case 1: Rand1X = 0 + Rand1; break; + } + Rand1 = 0; + Rand1 = rand()%8; + switch (rand()%2) + { + case 0: Rand1Y = 0 - Rand1; break; + case 1: Rand1Y = 0 + Rand1; break; + } + Rand1 = 0; + SummonedMinions = DoSpawnCreature(16119, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); + if (SummonedMinions) + (SummonedMinions->AI())->AttackStart(victim); + } + + void SummonMages(Unit* victim) + { + Rand2 = rand()%10; + switch (rand()%2) + { + case 0: Rand2X = 0 - Rand2; break; + case 1: Rand2X = 0 + Rand2; break; + } + Rand2 = 0; + Rand2 = rand()%10; + switch (rand()%2) + { + case 0: Rand2Y = 0 - Rand2; break; + case 1: Rand2Y = 0 + Rand2; break; + } + Rand2 = 0; + SummonedMages = DoSpawnCreature(16120, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); + if (SummonedMages) + (SummonedMages->AI())->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //ShadowVolley_Timer + if (ShadowVolley_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY); + ShadowVolley_Timer = 15000; + }else ShadowVolley_Timer -= diff; + + //BoneShield_Timer + if (BoneShield_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_BONESHIELD); + BoneShield_Timer = 45000; + }else BoneShield_Timer -= diff; + + //Minion_Timer + if (Minion_Timer < diff) + { + //Cast + SummonMinion(m_creature->getVictim()); + SummonMinion(m_creature->getVictim()); + SummonMinion(m_creature->getVictim()); + SummonMinion(m_creature->getVictim()); + + Minion_Timer = 12000; + }else Minion_Timer -= diff; + + //Summon 2 Bone Mages + if (!Mages && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26) + { + //Cast + SummonMages(m_creature->getVictim()); + SummonMages(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_lord_alexei_barov.cpp new file mode 100644 index 00000000000..f8b21ebfd55 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_scholomance.h" + +#define SPELL_IMMOLATE 20294 // Old ID was 15570 +#define SPELL_VEILOFSHADOW 17820 + +struct TRINITY_DLL_DECL boss_lordalexeibarovAI : public ScriptedAI +{ + boss_lordalexeibarovAI(Creature *c) : ScriptedAI(c) {} + + uint32 Immolate_Timer; + uint32 VeilofShadow_Timer; + + void Reset() + { + Immolate_Timer = 7000; + VeilofShadow_Timer = 15000; + + m_creature->LoadCreaturesAddon(); + } + + void JustDied(Unit *killer) + { + ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; + if (pInstance) + { + pInstance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0); + + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) + m_creature->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* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) DoCast(target,SPELL_IMMOLATE); + + Immolate_Timer = 12000; + }else Immolate_Timer -= diff; + + //VeilofShadow_Timer + if (VeilofShadow_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_lorekeeper_polkelt.cpp new file mode 100644 index 00000000000..489e8bbc1cb --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_scholomance.h" + +#define SPELL_VOLATILEINFECTION 24928 +#define SPELL_DARKPLAGUE 18270 +#define SPELL_CORROSIVEACID 23313 +#define SPELL_NOXIOUSCATALYST 18151 + +struct TRINITY_DLL_DECL 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 = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; + if (pInstance) + { + pInstance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0); + + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) + m_creature->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(m_creature->getVictim(),SPELL_VOLATILEINFECTION); + VolatileInfection_Timer = 32000; + }else VolatileInfection_Timer -= diff; + + //Darkplague_Timer + if (Darkplague_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_DARKPLAGUE); + Darkplague_Timer = 8000; + }else Darkplague_Timer -= diff; + + //CorrosiveAcid_Timer + if (CorrosiveAcid_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CORROSIVEACID); + CorrosiveAcid_Timer = 25000; + }else CorrosiveAcid_Timer -= diff; + + //NoxiousCatalyst_Timer + if (NoxiousCatalyst_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.cpp new file mode 100644 index 00000000000..105beb13375 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_ras_frostwhisper.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_Ras_Frostwhisper +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.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 TRINITY_DLL_DECL 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; + + m_creature->CastSpell(m_creature,SPELL_ICEARMOR,true); + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //IceArmor_Timer + if (IceArmor_Timer < diff) + { + DoCast(m_creature, SPELL_ICEARMOR); + IceArmor_Timer = 180000; + }else IceArmor_Timer -= diff; + + //Frostbolt_Timer + if (Frostbolt_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) DoCast(target,SPELL_FROSTBOLT); + + Frostbolt_Timer = 8000; + }else Frostbolt_Timer -= diff; + + //Freeze_Timer + if (Freeze_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FREEZE); + Freeze_Timer = 24000; + }else Freeze_Timer -= diff; + + //Fear_Timer + if (Fear_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FEAR); + Fear_Timer = 30000; + }else Fear_Timer -= diff; + + //ChillNova_Timer + if (ChillNova_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CHILLNOVA); + ChillNova_Timer = 14000; + }else ChillNova_Timer -= diff; + + //FrostVolley_Timer + if (FrostVolley_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_the_ravenian.cpp new file mode 100644 index 00000000000..ea355c401a3 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_scholomance.h" + +#define SPELL_TRAMPLE 15550 +#define SPELL_CLEAVE 20691 +#define SPELL_SUNDERINCLEAVE 25174 +#define SPELL_KNOCKAWAY 10101 + +struct TRINITY_DLL_DECL 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 = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; + if (pInstance) + { + pInstance->SetData(DATA_THERAVENIAN_DEATH, 0); + + if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) + m_creature->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(m_creature->getVictim(),SPELL_TRAMPLE); + Trample_Timer = 10000; + }else Trample_Timer -= diff; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 7000; + }else Cleave_Timer -= diff; + + //SunderingCleave_Timer + if (SunderingCleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SUNDERINCLEAVE); + SunderingCleave_Timer = 20000; + }else SunderingCleave_Timer -= diff; + + //KnockAway_Timer + if (KnockAway_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp new file mode 100644 index 00000000000..9d343d26a7e --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.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_Vectus +SD%Complete: 100 +SDComment: +SDCategory: Scholomance +EndScriptData */ + +#include "precompiled.h" + +#define EMOTE_GENERIC_FRENZY_KILL -1000001 + +#define SPELL_FIRESHIELD 19626 +#define SPELL_BLASTWAVE 13021 +#define SPELL_FRENZY 28371 + +struct TRINITY_DLL_DECL boss_vectusAI : public ScriptedAI +{ + boss_vectusAI(Creature *c) : ScriptedAI(c) {} + + uint32 FireShield_Timer; + uint32 BlastWave_Timer; + uint32 Frenzy_Timer; + + void Reset() + { + FireShield_Timer = 2000; + BlastWave_Timer = 14000; + Frenzy_Timer = 0; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //FireShield_Timer + if (FireShield_Timer < diff) + { + DoCast(m_creature, SPELL_FIRESHIELD); + FireShield_Timer = 90000; + }else FireShield_Timer -= diff; + + //BlastWave_Timer + if (BlastWave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_BLASTWAVE); + BlastWave_Timer = 12000; + }else BlastWave_Timer -= diff; + + //Frenzy_Timer + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25) + { + if (Frenzy_Timer < diff) + { + DoCast(m_creature,SPELL_FRENZY); + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); + + Frenzy_Timer = 24000; + }else Frenzy_Timer -= diff; + } + + 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/bindings/scripts/scripts/eastern_kingdoms/scholomance/def_scholomance.h b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/def_scholomance.h new file mode 100644 index 00000000000..83ce26c9687 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/def_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/bindings/scripts/scripts/eastern_kingdoms/scholomance/instance_scholomance.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/instance_scholomance.cpp new file mode 100644 index 00000000000..282d6e9705a --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/def_shadowfang_keep.h b/src/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/def_shadowfang_keep.h new file mode 100644 index 00000000000..8383a5c3950 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/def_shadowfang_keep.h @@ -0,0 +1,13 @@ +/* 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 + +#define TYPE_FREE_NPC 1 +#define TYPE_RETHILGORE 2 +#define TYPE_FENRUS 3 +#define TYPE_NANDOS 4 +#endif + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/instance_shadowfang_keep.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/instance_shadowfang_keep.cpp new file mode 100644 index 00000000000..5c3cf162b94 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/instance_shadowfang_keep.cpp @@ -0,0 +1,208 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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 "precompiled.h" +#include "def_shadowfang_keep.h" + +#define MAX_ENCOUNTER 4 + +enum +{ + SAY_BOSS_DIE_AD = -1033007, + SAY_BOSS_DIE_AS = -1033008, + + NPC_ASH = 3850, + NPC_ADA = 3849, + + 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 +}; + +struct TRINITY_DLL_DECL 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 DoorCourtyardGUID; + uint64 DoorSorcererGUID; + uint64 DoorArugalGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + uiAshGUID = 0; + uiAdaGUID = 0; + + DoorCourtyardGUID = 0; + DoorSorcererGUID = 0; + DoorArugalGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case NPC_ASH: uiAshGUID = pCreature->GetGUID(); break; + case NPC_ADA: uiAdaGUID = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case GO_COURTYARD_DOOR: + DoorCourtyardGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + DoUseDoorOrButton(DoorCourtyardGUID); + break; + case GO_SORCERER_DOOR: + DoorSorcererGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + DoUseDoorOrButton(DoorSorcererGUID); + break; + case GO_ARUGAL_DOOR: + DoorArugalGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + DoUseDoorOrButton(DoorArugalGUID); + 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: + if (data == DONE) + DoUseDoorOrButton(DoorSorcererGUID); + 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; + } +}; + +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/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp new file mode 100644 index 00000000000..5f9d42ea65e --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.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: 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 "precompiled.h" +#include "escortAI.h" +#include "def_shadowfang_keep.h" + +/*###### +## npc_shadowfang_prisoner +######*/ + +enum +{ + 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 +}; + +#define GOSSIP_ITEM_DOOR "Thanks, I'll follow you to the door." + +struct TRINITY_DLL_DECL 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, m_creature); + else + DoScriptText(SAY_FREE_AD, m_creature); + break; + case 10: + if (uiNpcEntry == NPC_ASH) + DoScriptText(SAY_OPEN_DOOR_AS, m_creature); + else + DoScriptText(SAY_OPEN_DOOR_AD, m_creature); + break; + case 11: + if (uiNpcEntry == NPC_ASH) + DoCast(m_creature, SPELL_UNLOCK); + break; + case 12: + if (uiNpcEntry == NPC_ASH) + DoScriptText(SAY_POST_DOOR_AS, m_creature); + else + DoScriptText(SAY_POST1_DOOR_AD, m_creature); + + if (pInstance) + pInstance->SetData(TYPE_FREE_NPC, DONE); + break; + case 13: + if (uiNpcEntry != NPC_ASH) + DoScriptText(SAY_POST2_DOOR_AD, m_creature); + 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(pCreature->GetNpcTextId(), 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; +} + +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(); +} + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp new file mode 100644 index 00000000000..b83637650bb --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_baron_rivendare.cpp @@ -0,0 +1,191 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Baron_Rivendare +SD%Complete: 70 +SDComment: aura applied/defined in database +SDCategory: Stratholme +EndScriptData */ + +#include "precompiled.h" +#include "def_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 TRINITY_DLL_DECL boss_baron_rivendareAI : public ScriptedAI +{ + boss_baron_rivendareAI(Creature *c) : ScriptedAI(c) + { + pInstance = m_creature->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 ShadowBolt_Timer; + uint32 Cleave_Timer; + uint32 MortalStrike_Timer; + // uint32 RaiseDead_Timer; + uint32 SummonSkeletons_Timer; + Creature *Summoned; + + 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* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + 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* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT); + + ShadowBolt_Timer = 10000; + }else ShadowBolt_Timer -= diff; + + //Cleave + if (Cleave_Timer < diff) + { + DoCast(m_creature->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(m_creature->getVictim(),SPELL_MORTALSTRIKE); + MortalStrike_Timer = 10000 + (rand()%15000); + }else MortalStrike_Timer -= diff; + + //RaiseDead + // if (RaiseDead_Timer < diff) + // { + // DoCast(m_creature,SPELL_RAISEDEAD); + // RaiseDead_Timer = 45000; + // }else RaiseDead_Timer -= diff; + + //SummonSkeletons + if (SummonSkeletons_Timer < diff) + { + m_creature->SummonCreature(11197,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->SummonCreature(11197,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,29000); + m_creature->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/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_baroness_anastari.cpp new file mode 100644 index 00000000000..157c3f166c3 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_stratholme.h" + +#define SPELL_BANSHEEWAIL 16565 +#define SPELL_BANSHEECURSE 16867 +#define SPELL_SILENCE 18327 +//#define SPELL_POSSESS 17244 + +struct TRINITY_DLL_DECL boss_baroness_anastariAI : public ScriptedAI +{ + boss_baroness_anastariAI(Creature *c) : ScriptedAI(c) + { + pInstance = m_creature->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(m_creature->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(m_creature->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(m_creature->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* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target)DoCast(target,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/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp new file mode 100644 index 00000000000..9d934e87627 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_cannon_master_willey.cpp @@ -0,0 +1,221 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with 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 "precompiled.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 TRINITY_DLL_DECL 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) + { + m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->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(m_creature->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(m_creature->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(m_creature->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: + m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 1: + m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 2: + m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 3: + m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 4: + m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 5: + m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 6: + m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 7: + m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); + break; + case 8: + m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); + m_creature->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/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_dathrohan_balnazzar.cpp new file mode 100644 index 00000000000..00506ad880c --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" + +enum +{ + //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 TRINITY_DLL_DECL 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 (m_creature->GetEntry() == NPC_BALNAZZAR) + m_creature->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(m_creature->getVictim(),SPELL_MINDBLAST); + m_uiMindBlast_Timer = 15000 + rand()%5000; + }else m_uiMindBlast_Timer -= uiDiff; + + //CrusadersHammer + if (m_uiCrusadersHammer_Timer < uiDiff) + { + DoCast(m_creature->getVictim(),SPELL_CRUSADERSHAMMER); + m_uiCrusadersHammer_Timer = 12000; + }else m_uiCrusadersHammer_Timer -= uiDiff; + + //CrusaderStrike + if (m_uiCrusaderStrike_Timer < uiDiff) + { + DoCast(m_creature->getVictim(),SPELL_CRUSADERSTRIKE); + m_uiCrusaderStrike_Timer = 15000; + }else m_uiCrusaderStrike_Timer -= uiDiff; + + //HolyStrike + if (m_uiHolyStrike_Timer < uiDiff) + { + DoCast(m_creature->getVictim(),SPELL_HOLYSTRIKE); + m_uiHolyStrike_Timer = 15000; + }else m_uiHolyStrike_Timer -= uiDiff; + + //BalnazzarTransform + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + //restore hp, mana and stun + DoCast(m_creature,SPELL_BALNAZZARTRANSFORM); + m_creature->UpdateEntry(NPC_BALNAZZAR); + m_bTransformed = true; + } + } + else + { + //MindBlast + if (m_uiMindBlast_Timer < uiDiff) + { + DoCast(m_creature->getVictim(),SPELL_MINDBLAST); + m_uiMindBlast_Timer = 15000 + rand()%5000; + }else m_uiMindBlast_Timer -= uiDiff; + + //ShadowShock + if (m_uiShadowShock_Timer < uiDiff) + { + DoCast(m_creature->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(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.cpp new file mode 100644 index 00000000000..fc922a4e39a --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_magistrate_barthilas.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_Magistrate_Barthilas +SD%Complete: 70 +SDComment: +SDCategory: Stratholme +EndScriptData */ + +#include "precompiled.h" +#include "def_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 TRINITY_DLL_DECL boss_magistrate_barthilasAI : public ScriptedAI +{ + boss_magistrate_barthilasAI(Creature *c) : ScriptedAI(c) + { + pInstance = m_creature->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + 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 (m_creature->isAlive()) + m_creature->SetDisplayId(MODEL_NORMAL); + else + m_creature->SetDisplayId(MODEL_HUMAN); + } + + void MoveInLineOfSight(Unit *who) + { + //nothing to see here yet + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustDied(Unit* Killer) + { + m_creature->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; + m_creature->CastSpell(m_creature,SPELL_FURIOUS_ANGER,false); + }else FuriousAnger_Timer -= diff; + + //DrainingBlow + if (DrainingBlow_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_DRAININGBLOW); + DrainingBlow_Timer = 15000; + }else DrainingBlow_Timer -= diff; + + //CrowdPummel + if (CrowdPummel_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CROWDPUMMEL); + CrowdPummel_Timer = 15000; + }else CrowdPummel_Timer -= diff; + + //MightyBlow + if (MightyBlow_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_maleki_the_pallid.cpp new file mode 100644 index 00000000000..358e54cd39c --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_stratholme.h" + +#define SPELL_FROSTBOLT 17503 +#define SPELL_DRAINLIFE 20743 +#define SPELL_DRAIN_MANA 17243 +#define SPELL_ICETOMB 16869 + +struct TRINITY_DLL_DECL boss_maleki_the_pallidAI : public ScriptedAI +{ + boss_maleki_the_pallidAI(Creature *c) : ScriptedAI(c) + { + pInstance = m_creature->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(m_creature->getVictim(),SPELL_FROSTBOLT); + Frostbolt_Timer = 3500; + }else Frostbolt_Timer -= diff; + + //IceTomb + if (IceTomb_Timer < diff) + { + if (rand()%100 < 65) + DoCast(m_creature->getVictim(),SPELL_ICETOMB); + IceTomb_Timer = 28000; + }else IceTomb_Timer -= diff; + + //DrainLife + if (DrainLife_Timer < diff) + { + if (rand()%100 < 55) + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp new file mode 100644 index 00000000000..cd007273cd7 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_nerubenkan.cpp @@ -0,0 +1,139 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with 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 "precompiled.h" +#include "def_stratholme.h" + +#define SPELL_ENCASINGWEBS 4962 +#define SPELL_PIERCEARMOR 6016 +#define SPELL_CRYPT_SCARABS 31602 +#define SPELL_RAISEUNDEADSCARAB 17235 + +struct TRINITY_DLL_DECL boss_nerubenkanAI : public ScriptedAI +{ + boss_nerubenkanAI(Creature *c) : ScriptedAI(c) + { + pInstance = m_creature->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 EncasingWebs_Timer; + uint32 PierceArmor_Timer; + uint32 CryptScarabs_Timer; + uint32 RaiseUndeadScarab_Timer; + int Rand; + int RandX; + int RandY; + Creature* Summoned; + + 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* victim) + { + Rand = rand()%10; + switch (rand()%2) + { + case 0: RandX = 0 - Rand; break; + case 1: RandX = 0 + Rand; break; + } + Rand = 0; + Rand = rand()%10; + switch (rand()%2) + { + case 0: RandY = 0 - Rand; break; + case 1: RandY = 0 + Rand; break; + } + Rand = 0; + Summoned = DoSpawnCreature(10876, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000); + if (Summoned) + (Summoned->AI())->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //EncasingWebs + if (EncasingWebs_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ENCASINGWEBS); + EncasingWebs_Timer = 30000; + }else EncasingWebs_Timer -= diff; + + //PierceArmor + if (PierceArmor_Timer < diff) + { + if (rand()%100 < 75) + DoCast(m_creature->getVictim(),SPELL_PIERCEARMOR); + PierceArmor_Timer = 35000; + }else PierceArmor_Timer -= diff; + + //CryptScarabs_Timer + if (CryptScarabs_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CRYPT_SCARABS); + CryptScarabs_Timer = 20000; + }else CryptScarabs_Timer -= diff; + + //RaiseUndeadScarab + if (RaiseUndeadScarab_Timer < diff) + { + RaiseUndeadScarab(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_order_of_silver_hand.cpp new file mode 100644 index 00000000000..b9b07ad3cbb --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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(m_creature->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(m_creature->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,m_creature->GetGUID()); + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (HolyLight_Timer < diff) + { + if (m_creature->GetHealth()*5 < m_creature->GetMaxHealth()) + { + DoCast(m_creature, SPELL_HOLY_LIGHT); + HolyLight_Timer = 20000; + } + }else HolyLight_Timer -= diff; + + if (DivineShield_Timer < diff) + { + if (m_creature->GetHealth()*20 < m_creature->GetMaxHealth()) + { + DoCast(m_creature, 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/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_postmaster_malown.cpp new file mode 100644 index 00000000000..9fd7e550b4f --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.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 TRINITY_DLL_DECL 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(m_creature->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(m_creature->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(m_creature->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(m_creature->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(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_ramstein_the_gorger.cpp new file mode 100644 index 00000000000..6659e2dfdb1 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" + #include "def_stratholme.h" + +#define SPELL_TRAMPLE 5568 +#define SPELL_KNOCKOUT 17307 + + #define C_MINDLESS_UNDEAD 11030 + +struct TRINITY_DLL_DECL boss_ramstein_the_gorgerAI : public ScriptedAI +{ + boss_ramstein_the_gorgerAI(Creature *c) : ScriptedAI(c) + { + pInstance = m_creature->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 = m_creature->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(m_creature->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(m_creature,SPELL_TRAMPLE); + Trample_Timer = 7000; + }else Trample_Timer -= diff; + + //Knockout + if (Knockout_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/boss_timmy_the_cruel.cpp new file mode 100644 index 00000000000..27eb2672b33 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" + +#define SAY_SPAWN "TIMMY!" + +#define SPELL_RAVENOUSCLAW 17470 + +struct TRINITY_DLL_DECL 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) + { + m_creature->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(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/stratholme/def_stratholme.h b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/def_stratholme.h new file mode 100644 index 00000000000..b9246091a7c --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/def_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/bindings/scripts/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp new file mode 100644 index 00000000000..c37b1a904f7 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/instance_stratholme.cpp @@ -0,0 +1,423 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance +{ + instance_stratholme(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + 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) + { + UpdateGoState(portGauntletGUID,0,false); + UpdateGoState(portSlaugtherGUID,0,false); + 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(); break; + case GO_ZIGGURAT2: ziggurat2GUID = pGo->GetGUID(); break; + case GO_ZIGGURAT3: ziggurat3GUID = pGo->GetGUID(); break; + case GO_ZIGGURAT4: + ziggurat4GUID = pGo->GetGUID(); + if (TYPE_BARON == DONE || TYPE_RAMSTEIN == DONE) + HandleGameObject(0, true, pGo); + break; + case GO_ZIGGURAT5: + ziggurat5GUID = pGo->GetGUID(); + if (TYPE_BARON == DONE || TYPE_RAMSTEIN == DONE) + HandleGameObject(0, true, pGo); + break; + case GO_PORT_GAUNTLET: portGauntletGUID = pGo->GetGUID(); break; + case GO_PORT_SLAUGTHER: portSlaugtherGUID = pGo->GetGUID(); 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; + 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. + break; + case DONE: + 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; + } + Encounter[0] = data; + break; + case TYPE_BARONESS: + Encounter[1] = data; + if (data == IN_PROGRESS) + UpdateGoState(ziggurat1GUID,GO_STATE_ACTIVE,false); + if (data == IN_PROGRESS) //change to DONE when crystals implemented + StartSlaugtherSquare(); + break; + case TYPE_NERUB: + Encounter[2] = data; + if (data == IN_PROGRESS) + UpdateGoState(ziggurat2GUID,GO_STATE_ACTIVE,false); + if (data == IN_PROGRESS) //change to DONE when crystals implemented + StartSlaugtherSquare(); + break; + case TYPE_PALLID: + Encounter[3] = data; + if (data == IN_PROGRESS) + UpdateGoState(ziggurat3GUID,GO_STATE_ACTIVE,false); + if (data == IN_PROGRESS) //change to DONE when crystals implemented + StartSlaugtherSquare(); + break; + case TYPE_RAMSTEIN: + if (data == IN_PROGRESS) + { + if (Encounter[4] != IN_PROGRESS) + UpdateGoState(portGauntletGUID,GO_STATE_READY,false); + + uint32 count = abomnationGUID.size(); + for(std::set::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 == 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); + } + 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]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (Encounter[i] == IN_PROGRESS) + Encounter[i] = 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); + + UpdateGoState(ziggurat4GUID,GO_STATE_ACTIVE,false); + UpdateGoState(ziggurat5GUID,GO_STATE_ACTIVE,false); + 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/bindings/scripts/scripts/eastern_kingdoms/stratholme/stratholme.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/stratholme.cpp new file mode 100644 index 00000000000..ea8fe41fef0 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/stratholme/stratholme.cpp @@ -0,0 +1,290 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL mob_freed_soulAI : public ScriptedAI +{ + mob_freed_soulAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + switch (rand()%4) + { + case 0: DoScriptText(SAY_ZAPPED0, m_creature); break; + case 1: DoScriptText(SAY_ZAPPED1, m_creature); break; + case 2: DoScriptText(SAY_ZAPPED2, m_creature); break; + case 3: DoScriptText(SAY_ZAPPED3, m_creature); break; + } + } + + 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 TRINITY_DLL_DECL 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) + m_creature->SummonCreature(ENTRY_FREED, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000); + } + + void UpdateAI(const uint32 diff) + { + if (Tagged) + { + if (Die_Timer < diff) + { + if (Unit* temp = Unit::GetUnit(*m_creature,Tagger)) + temp->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + }else Die_Timer -= diff; + } + } +}; + +CreatureAI* GetAI_mob_restless_soul(Creature* pCreature) +{ + return new mob_restless_soulAI (pCreature); +} + +/*###### +## mobs_spectral_ghostly_citizen +######*/ + +enum +{ + SPELL_HAUNTING_PHANTOM = 16336, + SPELL_SLAP = 6754 +}; + +struct TRINITY_DLL_DECL 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) + { + float x,y,z; + m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),20.0f,x,y,z); + + //100%, 50%, 33%, 25% chance to spawn + uint32 j = urand(1,i); + if (j==1) + m_creature->SummonCreature(ENTRY_RESTLESS,x,y,z,0,TEMPSUMMON_CORPSE_DESPAWN,600000); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (Tagged) + { + if (Die_Timer < diff) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + }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 (m_creature->IsWithinDistInMap(pPlayer, 5)) + m_creature->CastSpell(pPlayer,SPELL_SLAP,false); + else + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE); + break; + case TEXTEMOTE_WAVE: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); + break; + case TEXTEMOTE_BOW: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); + break; + case TEXTEMOTE_KISS: + m_creature->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/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp new file mode 100644 index 00000000000..980fe656b4a --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_brutallus.cpp @@ -0,0 +1,326 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI +{ + boss_brutallusAI(Creature *c) : ScriptedAI(c){ + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + Unit* Madrigosa; + + 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; + Intro = true; //for debug + + m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Madrigosa = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_MADRIGOSA)); + //Creature* boss = Unit::GetCreature((*m_creature),AzgalorGUID); + if (!Madrigosa) error_log("Madrigosa ist nicht zu finden"); + + if (Intro && Madrigosa){ + if (!Madrigosa->isAlive()) + EndIntro(); + else error_log("Madrigosa is Tod"); + } + else + EndIntro(); + + if (pInstance) + pInstance->SetData(DATA_BRUTALLUS_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + DoScriptText(YELL_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_BRUTALLUS_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%3) + { + case 0: DoScriptText(YELL_KILL1, m_creature); break; + case 1: DoScriptText(YELL_KILL2, m_creature); break; + case 2: DoScriptText(YELL_KILL3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(YELL_DEATH, m_creature); + + if (pInstance){ + pInstance->SetData(DATA_BRUTALLUS_EVENT, DONE); + float x,y,z; + m_creature->GetPosition(x,y,z); + m_creature->SummonCreature(FELMYST, x,y, z+30, m_creature->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 0); + } + } + + void StartIntro() + { + if (!Intro) + return; + if (Madrigosa){ + Madrigosa->setDeathState(ALIVE); + Madrigosa->setActive(true); + IsIntro = true; + } + error_log("Starte das Intro"); + } + + void EndIntro() + { + error_log("Beende das Intro"); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Intro = false; + IsIntro = false; + } + + void DoIntro() + { + if (!Madrigosa) + return; + + switch(IntroPhase) + { + case 0: + DoScriptText(YELL_MADR_ICE_BARRIER, Madrigosa); + IntroPhaseTimer = 5000; + ++IntroPhase; + break; + case 1: + m_creature->SetInFront(Madrigosa); + Madrigosa->SetInFront(m_creature); + DoScriptText(YELL_MADR_INTRO, Madrigosa, m_creature); + IntroPhaseTimer = 9000; + ++IntroPhase; + break; + case 2: + DoScriptText(YELL_INTRO, m_creature, Madrigosa); + IntroPhaseTimer = 13000; + ++IntroPhase; + break; + case 3: + DoCast(m_creature, SPELL_INTRO_FROST_BLAST); + Madrigosa->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + IntroFrostBoltTimer = 3000; + IntroPhaseTimer = 28000; + ++IntroPhase; + break; + case 4: + DoScriptText(YELL_INTRO_BREAK_ICE, m_creature); + IntroPhaseTimer = 6000; + ++IntroPhase; + break; + case 5: + Madrigosa->CastSpell(m_creature, SPELL_INTRO_ENCAPSULATE_CHANELLING, false); + DoScriptText(YELL_MADR_TRAP, Madrigosa); + DoCast(m_creature, SPELL_INTRO_ENCAPSULATE); + IntroPhaseTimer = 11000; + ++IntroPhase; + break; + case 6: + m_creature->SetSpeed(MOVE_RUN, 4.0f, true); + DoScriptText(YELL_INTRO_CHARGE, m_creature); + IntroPhaseTimer = 3000; + ++IntroPhase; + break; + case 7: + m_creature->DealDamage(Madrigosa, Madrigosa->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, true); + DoScriptText(YELL_MADR_DEATH, Madrigosa); + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->AttackStop(); + m_creature->SetSpeed(MOVE_RUN, 1.0f, true); + IntroPhaseTimer = 3000; + ++IntroPhase; + break; + case 8: + DoScriptText(YELL_INTRO_KILL_MADRIGOSA, m_creature); + m_creature->SetOrientation(0.14); + Madrigosa->setDeathState(CORPSE); + IntroPhaseTimer = 5000; + ++IntroPhase; + break; + case 9: + DoScriptText(YELL_INTRO_TAUNT, m_creature); + IntroPhaseTimer = 5000; + ++IntroPhase; + break; + case 10: + EndIntro(); + break; + } + } + + void MoveInLineOfSight(Unit *who){ + if (pInstance && Intro) + pInstance->SetData(DATA_BRUTALLUS_EVENT, SPECIAL); + } + + void UpdateAI(const uint32 diff) + { + if (Intro && !IsIntro) + StartIntro(); + + if (IsIntro) + { + if (IntroPhaseTimer < diff){ + DoIntro(); + }else IntroPhaseTimer -= diff; + + if (IntroPhase == 3 + 1){ + if (IntroFrostBoltTimer < diff){ + if (Madrigosa){ + Madrigosa->CastSpell(m_creature, SPELL_INTRO_FROSTBOLT, false); + IntroFrostBoltTimer = 2000; + } + }else IntroFrostBoltTimer -= diff; + } + } + + if (!UpdateVictim() || IsIntro) + return; + + if (SlashTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_METEOR_SLASH); + SlashTimer = 11000; + }else SlashTimer -= diff; + + if (StompTimer < diff) + { + switch(rand()%3) + { + case 0: DoScriptText(YELL_LOVE1, m_creature); break; + case 1: DoScriptText(YELL_LOVE2, m_creature); break; + case 2: DoScriptText(YELL_LOVE3, m_creature); break; + } + DoCast(m_creature->getVictim(), SPELL_STOMP); + StompTimer = 30000; + }else StompTimer -= diff; + + if (BurnTimer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + target->CastSpell(target, SPELL_BURN, true); + BurnTimer = 60000; + }else BurnTimer -= diff; + + if (BerserkTimer < diff && !Enraged) + { + DoScriptText(YELL_BERSERK, m_creature); + DoCast(m_creature, 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/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp new file mode 100644 index 00000000000..86ed15ad653 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_eredar_twins.cpp @@ -0,0 +1,761 @@ +/* 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 "precompiled.h" +#include "def_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 +}; + +enum Creatures +{ + GRAND_WARLOCK_ALYTHESS = 25166, + MOB_SHADOW_IMAGE = 25214, + LADY_SACROLASH = 25165 +}; + +struct TRINITY_DLL_DECL 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((*m_creature),pInstance->GetData64(DATA_ALYTHESS)); + if (Temp) + if (Temp->isDead()) + { + CAST_CRE(Temp)->Respawn(); + }else + { + if (Temp->getVictim()) + { + m_creature->getThreatManager().addThreat(Temp->getVictim(),0.0f); + } + } + } + + if (!m_creature->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((*m_creature),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) + { + switch (rand()%2) + { + case 0: DoScriptText(YELL_SAC_KILL_1, m_creature); break; + case 1: DoScriptText(YELL_SAC_KILL_2, m_creature); break; + } + } + } + + void JustDied(Unit* Killer) + { + // only if ALY death + if (SisterDeath) + { + DoScriptText(SAY_SAC_DEAD, m_creature); + + if (pInstance) + pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE); + } + else + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + + void SpellHitTarget(Unit* target,const SpellEntry* spell) + { + switch(spell->Id) + { + case SPELL_SHADOW_BLADES: + case SPELL_SHADOW_NOVA: + case SPELL_CONFOUNDING_BLOW: + case SPELL_SHADOW_FURY: + HandleTouchedSpells(target, SPELL_DARK_TOUCHED); + break; + case SPELL_CONFLAGRATION: + HandleTouchedSpells(target, SPELL_FLAME_TOUCHED); + break; + } + } + + void HandleTouchedSpells(Unit* target, uint32 TouchedType) + { + switch(TouchedType) + { + case SPELL_FLAME_TOUCHED: + if (!target->HasAura(SPELL_DARK_FLAME)) + { + if (target->HasAura(SPELL_DARK_TOUCHED)) + { + target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED); + target->CastSpell(target, SPELL_DARK_FLAME, true); + }else target->CastSpell(target, SPELL_FLAME_TOUCHED, true); + } + break; + case SPELL_DARK_TOUCHED: + if (!target->HasAura(SPELL_DARK_FLAME)) + { + if (target->HasAura(SPELL_FLAME_TOUCHED)) + { + target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); + target->CastSpell(target, SPELL_DARK_FLAME, true); + }else target->CastSpell(target, SPELL_DARK_TOUCHED, true); + } + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!SisterDeath) + { + if (pInstance) + { + Unit* Temp = NULL; + Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS)); + if (Temp && Temp->isDead()) + { + DoScriptText(YELL_SISTER_ALYTHESS_DEAD, m_creature); + DoCast(m_creature,SPELL_EMPOWER); + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + SisterDeath = true; + } + } + } + + if (!UpdateVictim()) + return; + + if (SisterDeath) + { + if (ConflagrationTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + DoCast(target, SPELL_CONFLAGRATION); + ConflagrationTimer = 30000+(rand()%5000); + } + }else ConflagrationTimer -= diff; + } + else + { + if (ShadownovaTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + DoCast(target, SPELL_SHADOW_NOVA); + + if (!SisterDeath) + { + if (target) + DoScriptText(EMOTE_SHADOW_NOVA, m_creature, target); + DoScriptText(YELL_SHADOW_NOVA, m_creature); + } + ShadownovaTimer = 30000+(rand()%5000); + } + }else ShadownovaTimer -=diff; + } + + if (ConfoundingblowTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + DoCast(target, SPELL_CONFOUNDING_BLOW); + ConfoundingblowTimer = 20000 + (rand()%5000); + } + }else ConfoundingblowTimer -=diff; + + if (ShadowimageTimer < diff) + { + Unit* target = NULL; + Creature* temp = NULL; + for(uint8 i = 0;i<3; ++i) + { + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + temp = DoSpawnCreature(MOB_SHADOW_IMAGE,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN,10000); + if (temp && target) + temp->AI()->AttackStart(target); + } + ShadowimageTimer = 20000; + }else ShadowimageTimer -=diff; + + if (ShadowbladesTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(m_creature, SPELL_SHADOW_BLADES); + ShadowbladesTimer = 10000; + } + }else ShadowbladesTimer -=diff; + + if (EnrageTimer < diff && !Enraged) + { + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + DoScriptText(YELL_ENRAGE, m_creature); + DoCast(m_creature,SPELL_ENRAGE); + Enraged = true; + }else EnrageTimer -= diff; + + if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) + { + //If we are within range melee the target + if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + HandleTouchedSpells(m_creature->getVictim(), SPELL_DARK_TOUCHED); + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + } + } +}; + +CreatureAI* GetAI_boss_sacrolash(Creature* pCreature) +{ + return new boss_sacrolashAI (pCreature); +}; + +struct TRINITY_DLL_DECL 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((*m_creature),pInstance->GetData64(DATA_SACROLASH)); + if (Temp) + if (Temp->isDead()) + { + CAST_CRE(Temp)->Respawn(); + }else + { + if (Temp->getVictim()) + { + m_creature->getThreatManager().addThreat(Temp->getVictim(),0.0f); + } + } + } + + if (!m_creature->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((*m_creature),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 (!m_creature->isInCombat()) + { + Scripted_NoMovementAI::AttackStart(who); + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) + { + if (!m_creature->isInCombat()) + { + DoStartNoMovement(who); + } + } + } + else if (IntroStepCounter == 10 && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 30)) + { + IntroStepCounter = 0; + } + } + + void KilledUnit(Unit *victim) + { + if (rand()%4 == 0) + { + switch (rand()%2) + { + case 0: DoScriptText(YELL_ALY_KILL_1, m_creature); break; + case 1: DoScriptText(YELL_ALY_KILL_2, m_creature); break; + } + } + } + + void JustDied(Unit* Killer) + { + if (SisterDeath) + { + DoScriptText(YELL_ALY_DEAD, m_creature); + + if (pInstance) + pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE); + } + else + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + + void SpellHitTarget(Unit* target,const SpellEntry* spell) + { + switch(spell->Id) + { + + case SPELL_BLAZE: + target->CastSpell(target, SPELL_BLAZE_SUMMON, true); + case SPELL_CONFLAGRATION: + case SPELL_FLAME_SEAR: + HandleTouchedSpells(target, SPELL_FLAME_TOUCHED); + break; + case SPELL_SHADOW_NOVA: + HandleTouchedSpells(target, SPELL_DARK_TOUCHED); + break; + } + } + + void HandleTouchedSpells(Unit* target, uint32 TouchedType) + { + switch(TouchedType) + { + case SPELL_FLAME_TOUCHED: + if (!target->HasAura(SPELL_DARK_FLAME)) + { + if (target->HasAura(SPELL_DARK_TOUCHED)) + { + target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED); + target->CastSpell(target, SPELL_DARK_FLAME, true); + }else + { + target->CastSpell(target, SPELL_FLAME_TOUCHED, true); + } + } + break; + case SPELL_DARK_TOUCHED: + if (!target->HasAura(SPELL_DARK_FLAME)) + { + if (target->HasAura(SPELL_FLAME_TOUCHED)) + { + target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); + target->CastSpell(target, SPELL_DARK_FLAME, true); + }else target->CastSpell(target, SPELL_DARK_TOUCHED, true); + } + break; + } + } + + uint32 IntroStep(uint32 step) + { + Creature* Sacrolash = Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_SACROLASH)); + 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, m_creature); return 1000; + case 3: + if (Sacrolash) + DoScriptText(YELL_INTRO_SAC_3, Sacrolash); + return 2000; + case 4: DoScriptText(YELL_INTRO_ALY_4, m_creature); return 1000; + case 5: + if (Sacrolash) + DoScriptText(YELL_INTRO_SAC_5, Sacrolash); + return 2000; + case 6: DoScriptText(YELL_INTRO_ALY_6, m_creature); return 1000; + case 7: + if (Sacrolash) + DoScriptText(YELL_INTRO_SAC_7, Sacrolash); + return 3000; + case 8: DoScriptText(YELL_INTRO_ALY_8, m_creature); 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((*m_creature),pInstance->GetData64(DATA_SACROLASH)); + if (Temp && Temp->isDead()) + { + DoScriptText(YELL_SISTER_SACROLASH_DEAD, m_creature); + DoCast(m_creature, SPELL_EMPOWER); + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + SisterDeath = true; + } + } + } + + if (!UpdateVictim()) + return; + + if (SisterDeath) + { + if (ShadownovaTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + DoCast(target, SPELL_SHADOW_NOVA); + ShadownovaTimer= 30000+(rand()%5000); + } + }else ShadownovaTimer -=diff; + } + else + { + if (ConflagrationTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + DoCast(target, SPELL_CONFLAGRATION); + ConflagrationTimer = 30000+(rand()%5000); + + if (!SisterDeath) + { + if (target) + DoScriptText(EMOTE_CONFLAGRATION, m_creature, target); + DoScriptText(YELL_CANFLAGRATION, m_creature); + } + + BlazeTimer = 4000; + } + }else ConflagrationTimer -= diff; + } + + if (FlamesearTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(m_creature, SPELL_FLAME_SEAR); + FlamesearTimer = 15000; + } + }else FlamesearTimer -=diff; + + if (PyrogenicsTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(m_creature, SPELL_PYROGENICS,true); + PyrogenicsTimer = 15000; + } + }else PyrogenicsTimer -= diff; + + if (BlazeTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(m_creature->getVictim(), SPELL_BLAZE); + BlazeTimer = 3800; + } + }else BlazeTimer -= diff; + + if (EnrageTimer < diff && !Enraged) + { + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + DoScriptText(YELL_BERSERK, m_creature); + DoCast(m_creature, SPELL_ENRAGE); + Enraged = true; + }else EnrageTimer -= diff; + } +}; + +CreatureAI* GetAI_boss_alythess(Creature* pCreature) +{ + return new boss_alythessAI (pCreature); +}; + +struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI +{ + mob_shadow_imageAI(Creature *c) : ScriptedAI(c) {} + + uint32 ShadowfuryTimer; + uint32 KillTimer; + uint32 DarkstrikeTimer; + + void Reset() + { + ShadowfuryTimer = 5000 + (rand()%15000); + DarkstrikeTimer = 3000; + KillTimer = 15000; + } + + void EnterCombat(Unit *who){} + + void SpellHitTarget(Unit* target,const SpellEntry* spell) + { + switch(spell->Id) + { + + case SPELL_SHADOW_FURY: + case SPELL_DARK_STRIKE: + if (!target->HasAura(SPELL_DARK_FLAME)) + { + if (target->HasAura(SPELL_FLAME_TOUCHED)) + { + target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); + target->CastSpell(target, SPELL_DARK_FLAME, true); + }else target->CastSpell(target,SPELL_DARK_TOUCHED,true); + } + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->HasAura(SPELL_IMAGE_VISUAL)) + DoCast(m_creature, SPELL_IMAGE_VISUAL); + + if (KillTimer < diff) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + KillTimer = 9999999; + }else KillTimer -=diff; + + if (!UpdateVictim()) + return; + + if (ShadowfuryTimer < diff) + { + DoCast(m_creature, SPELL_SHADOW_FURY); + ShadowfuryTimer = 10000; + }else ShadowfuryTimer -=diff; + + if (DarkstrikeTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + //If we are within range melee the target + if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp new file mode 100644 index 00000000000..8402f077fdd --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_felmyst.cpp @@ -0,0 +1,623 @@ +/* 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 "precompiled.h" +#include "def_sunwell_plateau.h" + +enum Quotes +{ + 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 Creatures +{ + MOB_FELMYST = 25038, + //MOB_BRUTALLUS = + //MOB_KALECGOS = + MOB_DEAD = 25268, + MOB_MADRIGOSA = 25160, + MOB_FELMYST_VISUAL = 25041, + MOB_FLIGHT_LEFT = 25357, + MOB_FLIGHT_RIGHT = 25358, + MOB_DEATH_CLOUD = 25703, + MOB_VAPOR = 25265, + MOB_VAPOR_TRAIL = 25267 +}; + +enum PhaseFelmyst +{ + PHASE_NULL = 0, + PHASE_GROUND = 1, + PHASE_FLIGHT = 2, +}; + +enum EventFelmyst +{ + EVENT_NULL = 0, + EVENT_BERSERK = 1, + + EVENT_CLEAVE = 2, + EVENT_CORROSION = 3, + EVENT_GAS_NOVA = 4, + EVENT_ENCAPSULATE = 5, + EVENT_FLIGHT = 6, + + EVENT_FLIGHT_SEQUENCE = 2, + EVENT_SUMMON_DEAD = 3, + EVENT_SUMMON_FOG = 4 +}; + +static EventFelmyst MaxTimer[]= +{ + EVENT_NULL, + EVENT_FLIGHT, + EVENT_SUMMON_FOG, +}; + +struct TRINITY_DLL_DECL 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; + EventFelmyst Event; + uint32 Timer[EVENT_FLIGHT + 1]; + + uint32 FlightCount; + uint32 BreathCount; + + float BreathX, BreathY; + + void Reset() + { + Phase = PHASE_NULL; + Event = EVENT_NULL; + Timer[EVENT_BERSERK] = 600000; + FlightCount = 0; + + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); + m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); + + DespawnSummons(MOB_VAPOR_TRAIL); + m_creature->setActive(false); + + if (pInstance) + pInstance->SetData(DATA_FELMYST_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + m_creature->setActive(true); + DoZoneInCombat(); + m_creature->CastSpell(m_creature, AURA_SUNWELL_RADIANCE, true); + m_creature->CastSpell(m_creature, 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) + { + switch(rand()%2) + { + case 0: DoScriptText(YELL_KILL1, m_creature); break; + case 1: DoScriptText(YELL_KILL2, m_creature); break; + } + } + + void JustRespawned() + { + DoScriptText(YELL_BIRTH, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(YELL_DEATH, m_creature); + + 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); + Unit* summon = m_creature->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (summon) + { + summon->SetMaxHealth(caster->GetMaxHealth()); + summon->SetHealth(caster->GetMaxHealth()); + summon->CastSpell(summon, SPELL_FOG_CHARM, true); + summon->CastSpell(summon, SPELL_FOG_CHARM2, true); + } + m_creature->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(SelectUnit(SELECT_TARGET_RANDOM, 0)); + DoZoneInCombat(summon); + summon->CastSpell(summon, SPELL_DEAD_PASSIVE, true); + } + } + + void MovementInform(uint32, uint32) + { + Timer[EVENT_FLIGHT_SEQUENCE] = 1; + } + + void DamageTaken(Unit*, uint32 &damage) + { + if (Phase != PHASE_GROUND && damage >= m_creature->GetHealth()) + damage = 0; + } + + void EnterPhase(PhaseFelmyst NextPhase) + { + switch(NextPhase) + { + case PHASE_GROUND: + Timer[EVENT_CLEAVE] = 5000 + rand()%5 * 1000; + Timer[EVENT_CORROSION] = 10000 + rand()%10 * 1000; + Timer[EVENT_GAS_NOVA] = 15000 + rand()%5 * 1000; + Timer[EVENT_ENCAPSULATE] = 20000 + rand()%5 * 1000; + Timer[EVENT_FLIGHT] = 60000; + break; + case PHASE_FLIGHT: + Timer[EVENT_FLIGHT_SEQUENCE] = 1000; + Timer[EVENT_SUMMON_DEAD] = 0; + Timer[EVENT_SUMMON_FOG] = 0; + FlightCount = 0; + BreathCount = 0; + break; + default: + break; + } + Phase = NextPhase; + } + + void HandleFlightSequence() + { + switch(FlightCount) + { + case 0: + //m_creature->AttackStop(); + error_log("prevent fly phase"); + m_creature->GetMotionMaster()->Clear(false); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + m_creature->StopMoving(); + DoScriptText(YELL_TAKEOFF, m_creature); + Timer[EVENT_FLIGHT_SEQUENCE] = 2000; + break; + case 1: + error_log("Move to Fly point"); + m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+1, m_creature->GetPositionY(), m_creature->GetPositionZ()+10); + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 2:{ + error_log("Summon Vapor case 2"); + Unit* target; + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); + if (!target) target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)); + if (target) + { + Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); + if (Vapor) + { + Vapor->AI()->AttackStart(target); + m_creature->InterruptNonMeleeSpells(false); + m_creature->CastSpell(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug + Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true); + } + } + else + { + EnterEvadeMode(); + return; + } + Timer[EVENT_FLIGHT_SEQUENCE] = 10000; + break;} + case 3: { + DespawnSummons(MOB_VAPOR_TRAIL); + error_log("Summon Vapor case3"); + //m_creature->CastSpell(m_creature, SPELL_VAPOR_SELECT); need core support + Unit* target; + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); + if (!target) target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)); + if (target) + { + //target->CastSpell(target, SPELL_VAPOR_SUMMON, true); need core support + Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); + if (Vapor) + { + Vapor->AI()->AttackStart(target); + m_creature->InterruptNonMeleeSpells(false); + m_creature->CastSpell(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug + Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true); + } + } + else + { + EnterEvadeMode(); + return; + } + Timer[EVENT_FLIGHT_SEQUENCE] = 10000; + break;} + case 4: + DespawnSummons(MOB_VAPOR_TRAIL); + Timer[EVENT_FLIGHT_SEQUENCE] = 1; + break; + case 5:{ + Unit* target; + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); + if (!target) target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)); + if (target) + { + BreathX = target->GetPositionX(); + BreathY = target->GetPositionY(); + float x, y, z; + target->GetContactPoint(m_creature, x, y, z, 70); + m_creature->GetMotionMaster()->MovePoint(0, x, y, z+10); + }else + { + EnterEvadeMode(); + return; + } + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break;} + case 6: + m_creature->SetOrientation(m_creature->GetAngle(BreathX, BreathY)); + m_creature->StopMoving(); + //DoTextEmote("takes a deep breath.", NULL); + Timer[EVENT_FLIGHT_SEQUENCE] = 10000; + break; + case 7: + m_creature->CastSpell(m_creature, SPELL_FOG_BREATH, true); + { + float x, y, z; + m_creature->GetPosition(x, y, z); + x = 2 * BreathX - x; + y = 2 * BreathY - y; + m_creature->GetMotionMaster()->MovePoint(0, x, y, z); + } + Timer[EVENT_SUMMON_FOG] = 1; + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 8: + m_creature->RemoveAurasDueToSpell(SPELL_FOG_BREATH); + BreathCount++; + Timer[EVENT_SUMMON_FOG] = 0; + Timer[EVENT_FLIGHT_SEQUENCE] = 1; + if (BreathCount < 3) FlightCount = 4; + break; + case 9: + if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0)) + { + float x, y, z; + target->GetContactPoint(m_creature, x, y, z); + m_creature->GetMotionMaster()->MovePoint(0, x, y, z); + } + else + { + EnterEvadeMode(); + return; + } + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 10: + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->StopMoving(); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + EnterPhase(PHASE_GROUND); + m_creature->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0)); + break; + default: + break; + } + FlightCount++; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (Phase == PHASE_FLIGHT && !m_creature->IsInEvadeMode()) + EnterEvadeMode(); + return; + } + + Event = EVENT_NULL; + for(uint32 i = 1; i <= MaxTimer[Phase]; ++i) + { + if (Timer[i]) + if (Timer[i] <= diff) + { + if (!Event) + Event = (EventFelmyst)i; + }else Timer[i] -= diff; + } + + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + if (Phase == PHASE_GROUND) + { + switch(Event) + { + case EVENT_BERSERK: + DoScriptText(YELL_BERSERK, m_creature); + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + Timer[EVENT_BERSERK] = 10000; + break; + case EVENT_CLEAVE: + m_creature->CastSpell(m_creature->getVictim(), SPELL_CLEAVE, false); + Timer[EVENT_CLEAVE] = 5000 + rand()%5 * 1000; + break; + case EVENT_CORROSION: + m_creature->CastSpell(m_creature->getVictim(), SPELL_CORROSION, false); + Timer[EVENT_CORROSION] = 20000 + rand()%10 * 1000; + break; + case EVENT_GAS_NOVA: + m_creature->CastSpell(m_creature, SPELL_GAS_NOVA, false); + Timer[EVENT_GAS_NOVA] = 20000 + rand()%5 * 1000; + break; + case EVENT_ENCAPSULATE: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true)) + { + m_creature->CastSpell(target, SPELL_ENCAPSULATE_CHANNEL, false); + Timer[EVENT_ENCAPSULATE] = 25000 + rand()%5 * 1000; + }break; + case EVENT_FLIGHT: + EnterPhase(PHASE_FLIGHT); + break; + default: + DoMeleeAttackIfReady(); + break; + } + } + + if (Phase == PHASE_FLIGHT) + { + switch(Event) + { + case EVENT_BERSERK: + DoScriptText(YELL_BERSERK, m_creature); + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + Timer[EVENT_BERSERK] = 0; + break; + case EVENT_FLIGHT_SEQUENCE: + HandleFlightSequence(); + break; + case EVENT_SUMMON_FOG: + { + float x, y, z; + m_creature->GetPosition(x, y, z); + m_creature->UpdateGroundPositionZ(x, y, z); + if (Creature *Fog = m_creature->SummonCreature(MOB_VAPOR_TRAIL, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 10000)) + { + Fog->RemoveAurasDueToSpell(SPELL_TRAIL_TRIGGER); + Fog->CastSpell(Fog, SPELL_FOG_TRIGGER, true); + } + } + Timer[EVENT_SUMMON_FOG] = 1000; + break; + default: + break; + } + } + } + + void DespawnSummons(uint32 entry) + { + std::list templist; + float x, y, z; + m_creature->GetPosition(x, y, z); + + { + CellPair pair(Trinity::ComputeCellPair(x, y)); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, 100); + Trinity::CreatureListSearcher searcher(m_creature, templist, check); + + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + + CellLock cell_lock(cell, pair); + cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap())); + } + + for(std::list::iterator i = templist.begin(); i != templist.end(); ++i) + { + if (entry == MOB_VAPOR_TRAIL && Phase == PHASE_FLIGHT) + { + (*i)->GetPosition(x, y, z); + m_creature->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 TRINITY_DLL_DECL mob_felmyst_vaporAI : public ScriptedAI +{ + mob_felmyst_vaporAI(Creature *c) : ScriptedAI(c) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetSpeed(MOVE_RUN, 0.8); + } + void Reset() {} + void EnterCombat(Unit* who) + { + DoZoneInCombat(); + //m_creature->CastSpell(m_creature, SPELL_VAPOR_FORCE, true); core bug + } + void UpdateAI(const uint32 diff) + { + if (!m_creature->getVictim()) + AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } +}; + +struct TRINITY_DLL_DECL mob_felmyst_trailAI : public ScriptedAI +{ + mob_felmyst_trailAI(Creature *c) : ScriptedAI(c) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->CastSpell(m_creature, SPELL_TRAIL_TRIGGER, true); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + m_creature->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/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp new file mode 100644 index 00000000000..874330c0212 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_kalecgos.cpp @@ -0,0 +1,693 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with 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 "precompiled.h" +#include "def_sunwell_plateau.h" + +enum Quotes +{ + //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, + + //Shattrowar + 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 SpellIds +{ + 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 Creatures +{ + MOB_KALECGOS = 24850, + MOB_KALEC = 24891, + MOB_SATHROVARR = 24892 +}; + +#define GO_FAILED "You are unable to use this currently." + +#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 + +uint32 WildMagic[]= { 44978, 45001, 45002, 45004, 45006, 45010 }; + +struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI +{ + boss_kalecgosAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + SathGUID = 0; + DoorGUID = 0; + } + + ScriptedInstance *pInstance; + + uint32 ArcaneBuffetTimer; + uint32 FrostBreathTimer; + uint32 WildMagicTimer; + uint32 SpectralBlastTimer; + uint32 TailLashTimer; + uint32 CheckTimer; + uint32 TalkTimer; + uint32 TalkSequence; + + bool isFriendly; + bool isEnraged; + bool isBanished; + + uint64 SathGUID; + uint64 DoorGUID; + + void Reset() + { + if (pInstance) + { + SathGUID = pInstance->GetData64(DATA_SATHROVARR); + DoorGUID = pInstance->GetData64(DATA_GO_FORCEFIELD); + + if (GameObject *Door = pInstance->instance->GetGameObject(pInstance->GetData64(DoorGUID))) + Door->SetLootState(GO_JUST_DEACTIVATED); + } + + Unit *Sath = Unit::GetUnit(*m_creature,SathGUID); + if (Sath) CAST_CRE(Sath)->AI()->EnterEvadeMode(); + + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); + + ArcaneBuffetTimer = 8000; + FrostBreathTimer = 15000; + WildMagicTimer = 10000; + TailLashTimer = 25000; + SpectralBlastTimer = 20000+(rand()%5000); + CheckTimer = SpectralBlastTimer+20000; //after spectral blast + + TalkTimer = 0; + TalkSequence = 0; + isFriendly = false; + isEnraged = false; + isBanished = false; + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= m_creature->GetHealth() && done_by != m_creature) + damage = 0; + } + + void EnterCombat(Unit* who) + { + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_EVIL_AGGRO, m_creature); + if (GameObject *Door = pInstance->instance->GetGameObject(pInstance->GetData64(DoorGUID))) + Door->SetLootState(GO_ACTIVATED); + DoZoneInCombat(); + + if (pInstance) + pInstance->SetData(DATA_KALECGOS_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_EVIL_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_EVIL_SLAY2, m_creature); break; + } + } + + void MovementInform(uint32 type,uint32 id) + { + m_creature->SetVisibility(VISIBILITY_OFF); + if (isFriendly) + m_creature->setDeathState(JUST_DIED); + else + { + m_creature->GetMotionMaster()->MoveTargetedHome(); + TalkTimer = 30000; + } + } + + void GoodEnding() + { + switch(TalkSequence) + { + case 1: + m_creature->setFaction(35); + TalkTimer = 1000; + break; + case 2: + DoScriptText(SAY_GOOD_PLRWIN, m_creature); + TalkTimer = 10000; + break; + case 3: + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MovePoint(0,FLY_X,FLY_Y,FLY_Z); + TalkTimer = 600000; + break; + default: + break; + } + } + + void BadEnding() + { + switch(TalkSequence) + { + case 1: + DoScriptText(SAY_EVIL_ENRAGE, m_creature); + TalkTimer = 3000; + break; + case 2: + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MovePoint(0,FLY_X,FLY_Y,FLY_Z); + TalkTimer = 600000; + break; + case 3: + EnterEvadeMode(); + break; + default: + break; + } + } + + void UpdateAI(const uint32 diff); +}; + +struct TRINITY_DLL_DECL 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() + { + if (pInstance) + KalecgosGUID = pInstance->GetData64(DATA_KALECGOS_DRAGON); + + if (KalecGUID) + { + if (Unit* Kalec = Unit::GetUnit(*m_creature, KalecGUID)) + Kalec->setDeathState(JUST_DIED); + KalecGUID = 0; + } + + ShadowBoltTimer = 7000 + rand()%3 * 1000; + AgonyCurseTimer = 20000; + CorruptionStrikeTimer = 13000; + CheckTimer = 1000; + ResetThreat = 1000; + isEnraged = false; + isBanished = false; + + if (pInstance) + pInstance->SetData(DATA_KALECGOS_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit* who) + { + Creature *Kalec = m_creature->SummonCreature(MOB_KALEC, m_creature->GetPositionX() + 10, m_creature->GetPositionY() + 5, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0); + if (Kalec) + { + KalecGUID = Kalec->GetGUID(); + m_creature->CombatStart(Kalec); + m_creature->AddThreat(Kalec, 100.0f); + } + DoScriptText(SAY_SATH_AGGRO, m_creature); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= m_creature->GetHealth() && done_by != m_creature) + damage = 0; + } + + void KilledUnit(Unit *target) + { + if (target->GetGUID() == KalecGUID) + { + TeleportAllPlayersBack(); + if (Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID)) + { + CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->TalkTimer = 1; + CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->isFriendly = false; + } + EnterEvadeMode(); + return; + } + switch(rand()%2) + { + case 0: DoScriptText(SAY_SATH_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SATH_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *killer) + { + DoScriptText(SAY_SATH_DEATH, m_creature); + m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), DRAGON_REALM_Z, m_creature->GetOrientation()); + TeleportAllPlayersBack(); + if (Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID)) + { + CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->TalkTimer = 1; + CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->isFriendly = true; + } + + if (pInstance) + pInstance->SetData(DATA_KALECGOS_EVENT, DONE); + } + + void TeleportAllPlayersBack() + { + Map* pMap = m_creature->GetMap(); + if (!pMap->IsDungeon()) return; + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + Map::PlayerList::const_iterator i; + for(i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->HasAura(AURA_SPECTRAL_REALM)) + i_pl->RemoveAurasDueToSpell(AURA_SPECTRAL_REALM); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (CheckTimer < diff) + { + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !isEnraged) + { + Unit* Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID); + if (Kalecgos) + { + Kalecgos->CastSpell(Kalecgos, SPELL_ENRAGE, true); + CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->isEnraged = true; + } + DoCast(m_creature, SPELL_ENRAGE, true); + isEnraged = true; + } + + if (!isBanished && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1) + { + if (Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID)) + { + if (CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->isBanished) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + else + { + DoCast(m_creature, SPELL_BANISH); + isBanished = true; + } + } + else + { + m_creature->MonsterTextEmote("is unable to find Kalecgos", NULL); + EnterEvadeMode(); + return; + } + } + CheckTimer = 1000; + }else CheckTimer -= diff; + + if (ResetThreat < diff) + { + if ((m_creature->getVictim()->HasAura(AURA_SPECTRAL_EXHAUSTION)) && (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER)) + { + for(std::list::iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr) + { + if (((*itr)->getUnitGuid()) == (m_creature->getVictim()->GetGUID())) + { + (*itr)->removeReference(); + break; + } + } + } + ResetThreat = 1000; + }else ResetThreat -= diff; + + if (ShadowBoltTimer < diff) + { + DoScriptText(SAY_SATH_SPELL1, m_creature); + DoCast(m_creature, SPELL_SHADOW_BOLT); + ShadowBoltTimer = 7000+(rand()%3000); + }else ShadowBoltTimer -= diff; + + if (AgonyCurseTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (!target) target = m_creature->getVictim(); + DoCast(target, SPELL_AGONY_CURSE); + AgonyCurseTimer = 20000; + }else AgonyCurseTimer -= diff; + + if (CorruptionStrikeTimer < diff) + { + DoScriptText(SAY_SATH_SPELL2, m_creature); + DoCast(m_creature->getVictim(), SPELL_CORRUPTION_STRIKE); + CorruptionStrikeTimer = 13000; + }else CorruptionStrikeTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL 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 EnterCombat(Unit* who) {} + + 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 (!UpdateVictim()) + return; + + if (YellTimer < diff) + { + switch(YellSequence) + { + case 0: + DoScriptText(SAY_GOOD_AGGRO, m_creature); + YellSequence++; + break; + case 1: + if ((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 50) + { + DoScriptText(SAY_GOOD_NEAR_DEATH, m_creature); + YellSequence++; + } + break; + case 2: + if ((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 10) + { + DoScriptText(SAY_GOOD_NEAR_DEATH2, m_creature); + YellSequence++; + } + break; + default: + break; + } + YellTimer = 5000; + } + + if (RevitalizeTimer < diff) + { + DoCast(m_creature, SPELL_REVITALIZE); + RevitalizeTimer = 5000; + }else RevitalizeTimer -= diff; + + if (HeroicStrikeTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_HEROIC_STRIKE); + HeroicStrikeTimer = 2000; + }else HeroicStrikeTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +void boss_kalecgosAI::UpdateAI(const uint32 diff) +{ + if (TalkTimer) + { + if (!TalkSequence) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(); + if (GameObject *Door = pInstance->instance->GetGameObject(pInstance->GetData64(DoorGUID))) + Door->SetLootState(GO_JUST_DEACTIVATED); + TalkSequence++; + } + if (TalkTimer <= diff) + { + if (isFriendly) + GoodEnding(); + else + BadEnding(); + TalkSequence++; + }else TalkTimer -= diff; + } + else + { + if (!UpdateVictim()) + return; + + if (CheckTimer < diff) + { + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !isEnraged) + { + Unit* Sath = Unit::GetUnit(*m_creature, SathGUID); + if (Sath) + { + Sath->CastSpell(Sath, SPELL_ENRAGE, true); + CAST_AI(boss_sathrovarrAI, CAST_CRE(Sath)->AI())->isEnraged = true; + } + DoCast(m_creature, SPELL_ENRAGE, true); + isEnraged = true; + } + + if (!isBanished && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1) + { + if (Unit *Sath = Unit::GetUnit(*m_creature, SathGUID)) + { + if (CAST_AI(boss_sathrovarrAI, CAST_CRE(Sath)->AI())->isBanished) + { + Sath->DealDamage(Sath, Sath->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + else + { + DoCast(m_creature, SPELL_BANISH); + isBanished = true; + } + } + 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) + { + //this is a hack. we need to find a victim without aura in core + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target && target != m_creature->getVictim() && target->isAlive() && !target->HasAura(AURA_SPECTRAL_EXHAUSTION)) + { + DoCast(target, SPELL_SPECTRAL_BLAST); + SpectralBlastTimer = 20000+(rand()%5000); + } + else + { + SpectralBlastTimer = 1000; + } + }else SpectralBlastTimer -= diff; + + DoMeleeAttackIfReady(); + } +} + +bool GOkalecgos_teleporter(Player* pPlayer, GameObject* pGo) +{ + if (pPlayer->HasAura(AURA_SPECTRAL_EXHAUSTION)) + 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/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp new file mode 100644 index 00000000000..ec5f1d71988 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_kiljaeden.cpp @@ -0,0 +1,1311 @@ +/* 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: 70 +SDComment: Phase4, Phase5, Shadow Spike, Armageddon +SDCategory: Sunwell_Plateau +EndScriptData */ + +//TODO rewrite Amagedon +//TODO Remove blue visual from Orbs on reset and if it is used + +#include "precompiled.h" +#include "def_sunwell_plateau.h" +#include + +/*** Speech and sounds***/ +enum Speeches +{ + // 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 SpellIds +{ + /* 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_SINISTER_REFLECTION = 45785, // Summon shadow copies of 5 raid members that fight against KJ's enemies + 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 +}; + +enum CreatureIds +{ + 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 +}; + +/*** GameObjects ***/ +#define GAMEOBJECT_ORB_OF_THE_BLUE_DRAGONFLIGHT 188415 + +/*** 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_KALEC_JOIN = 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 +float DeceiverLocations[3][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 (?) +}; + +float OrbLocations[4][5] = { + (1694.48, 674.29, 28.0502, 4.86985), + (1745.68, 621.823, 28.0505, 2.93777), + (1704.14, 583.591, 28.1696, 1.59003), + (1653.12, 635.41, 28.0932, 0.0977725), +}; + +struct Speech +{ + int32 textid; + uint32 pCreature, timer; +}; +// TODO: Timers +static Speech Sacrifice[]= +{ + {SAY_KALECGOS_AWAKEN, CREATURE_KALECGOS, 5000}, + {SAY_ANVEENA_IMPRISONED, CREATURE_ANVEENA, 5000}, + {SAY_KALECGOS_LETGO, CREATURE_KALECGOS, 8000}, + {SAY_ANVEENA_LOST, CREATURE_ANVEENA, 5000}, + {SAY_KALECGOS_FOCUS, CREATURE_KALECGOS, 7000}, + {SAY_ANVEENA_KALEC, CREATURE_ANVEENA, 2000}, + {SAY_KALECGOS_FATE, CREATURE_KALECGOS, 3000}, + {SAY_ANVEENA_GOODBYE, CREATURE_ANVEENA, 6000}, + {SAY_KALECGOS_GOODBYE, CREATURE_KALECGOS, 12000}, + {SAY_KJ_PHASE5, CREATURE_KILJAEDEN, 8000}, + {SAY_KALECGOS_ENCOURAGE, CREATURE_KALECGOS, 5000} +}; + +class AllOrbsInGrid +{ +public: + AllOrbsInGrid() {} + bool operator() (GameObject* pGo) + { + if (pGo->GetEntry() == GAMEOBJECT_ORB_OF_THE_BLUE_DRAGONFLIGHT) + return true; + return false; + } +}; + +bool GOHello_go_orb_of_the_blue_flight(Player* pPlayer, GameObject* pGo) +{ + if (pGo->GetUInt32Value(GAMEOBJECT_FACTION) == 35){ + ScriptedInstance* pInstance = pGo->GetInstanceData(); + float x,y,z; + //float dx,dy,dz; + pGo->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, true); + pGo->SetUInt32Value(GAMEOBJECT_FACTION, 0); + Creature* Kalec = Unit::GetCreature(*pPlayer, pInstance->GetData64(DATA_KALECGOS_KJ)); + //Kalec->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); + pGo->GetPosition(x,y,z); + // this won't work. need rewritten + /* + for(uint8 i = 0; i < 4; ++i) + { + if (DynamicObject* Dyn = Kalec->GetDynObject(SPELL_RING_OF_BLUE_FLAMES)) + { + Dyn->GetPosition(dx,dy,dz); + if (x == dx && dy == y && dz == z) + { + Dyn->Delete(); + break; + } + } + } + */ + pGo->Refresh(); + } + return true; +} + +//AI for Kalecgos +struct TRINITY_DLL_DECL boss_kalecgos_kjAI : public ScriptedAI +{ + boss_kalecgos_kjAI(Creature* c) : ScriptedAI(c){ + pInstance = c->GetInstanceData(); + } + + GameObject* Orb[4]; + ScriptedInstance* pInstance; + uint8 OrbsEmpowered; + uint8 EmpowerCount; + + bool Searched; + + void InitializeAI(){ + for(uint8 i = 0; i < 4; ++i) + Orb[i] = NULL; + FindOrbs(); + OrbsEmpowered = 0; + EmpowerCount = 0; + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->setActive(true); + Searched = false; + FindOrbs(); + } + + void Reset(){} + + void FindOrbs() + { + CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + std::list orbList; + AllOrbsInGrid check; + Trinity::GameObjectListSearcher searcher(me, orbList, check); + TypeContainerVisitor, GridTypeMapContainer> visitor(searcher); + CellLock cell_lock(cell, pair); + cell_lock->Visit(cell_lock, visitor, *(m_creature->GetMap())); + if (orbList.empty()) + return; + uint8 i = 0; + for(std::list::iterator itr = orbList.begin(); itr != orbList.end(); ++itr, ++i){ + Orb[i] = pInstance->instance->GetGameObject(pInstance->GetData64((*itr)->GetGUID())); + } + } + + void ResetOrbs(){ + m_creature->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); + for(uint8 i = 0; i < 4; ++i) + if (Orb[i]) Orb[i]->SetUInt32Value(GAMEOBJECT_FACTION, 0); + } + + void EmpowerOrb(bool all) + { + if (!Orb[OrbsEmpowered]) + return; + uint8 random = rand()%3; + if (all){ + m_creature->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); + for(uint8 i = 0; i < 4; ++i){ + if (!Orb[i]) return; + Orb[i]->CastSpell(m_creature, SPELL_RING_OF_BLUE_FLAMES); + Orb[i]->SetUInt32Value(GAMEOBJECT_FACTION, 35); + Orb[i]->setActive(true); + Orb[i]->Refresh(); + } + } + else + { + // this won't work + /* + float x,y,z, dx,dy,dz; + Orb[random]->GetPosition(x,y,z); + for(uint8 i = 0; i < 4; ++i){ + DynamicObject* Dyn = m_creature->GetDynObject(SPELL_RING_OF_BLUE_FLAMES); + if (Dyn){ + Dyn->GetPosition(dx,dy,dz); + if (x == dx && dy == y && dz == z){ + Dyn->Delete(); + break; + } + } + }*/ + Orb[random]->CastSpell(m_creature, SPELL_RING_OF_BLUE_FLAMES); + Orb[random]->SetUInt32Value(GAMEOBJECT_FACTION, 35); + Orb[random]->setActive(true); + Orb[random]->Refresh(); + ++OrbsEmpowered; + } + ++EmpowerCount; + + switch(EmpowerCount){ + case 1: DoScriptText(SAY_KALEC_ORB_READY1, m_creature); break; + case 2: DoScriptText(SAY_KALEC_ORB_READY2, m_creature); break; + case 3: DoScriptText(SAY_KALEC_ORB_READY3, m_creature); break; + case 4: DoScriptText(SAY_KALEC_ORB_READY4, m_creature); break; + } + } + + void UpdateAI(const uint32 diff){ + if (!Searched){ + FindOrbs(); + Searched = true; + } + + if (OrbsEmpowered == 4) OrbsEmpowered = 0; + } +}; + +CreatureAI* GetAI_boss_kalecgos_kj(Creature* pCreature) +{ + return new boss_kalecgos_kjAI (pCreature); +} + +//AI for Kil'jaeden +struct TRINITY_DLL_DECL boss_kiljaedenAI : public Scripted_NoMovementAI +{ + boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), Summons(m_creature){ + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + SummonList Summons; + Creature* Kalec; + Unit* randomPlayer; + + uint8 Phase; + uint8 ActiveTimers; + + uint32 Timer[10]; + uint32 WaitTimer; + + /* Boolean */ + bool IsKalecJoined; + bool IsInDarkness; + bool TimerIsDeactiveted[10]; + bool IsWaiting; + bool OrbActivated; + + void Reset() + { + // TODO: Fix timers + Timer[TIMER_KALEC_JOIN] = 26000; + + //Phase 2 Timer + Timer[TIMER_SOUL_FLAY] = 20000; + Timer[TIMER_LEGION_LIGHTNING] = 40000; + Timer[TIMER_FIRE_BLOOM] = 30000; + Timer[TIMER_SUMMON_SHILEDORB] = 45000; + + //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; + + Phase = PHASE_DECEIVERS; + + IsKalecJoined = false; + IsInDarkness = false; + IsWaiting = false; + OrbActivated = false; + + Kalec = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KALECGOS_KJ))); + ChangeTimers(false, 0); + } + + void ChangeTimers(bool status, uint32 WTimer){ + for(uint8 i = 0; i < 10; ++i) + TimerIsDeactiveted[i] = status; + TimerIsDeactiveted[TIMER_KALEC_JOIN] = IsKalecJoined; + + if (WTimer > 0){ + IsWaiting = true; + WaitTimer = WTimer; + } + + if (OrbActivated) TimerIsDeactiveted[TIMER_ORBS_EMPOWER] = true; + if (Timer[TIMER_SHADOW_SPIKE] == 0) TimerIsDeactiveted[TIMER_SHADOW_SPIKE] = true; + if (Phase == PHASE_SACRIFICE) TimerIsDeactiveted[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); + }else{ + summoned->SetLevel(m_creature->getLevel()); + } + summoned->setFaction(m_creature->getFaction()); + Summons.Summon(summoned); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_KJ_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_KILJAEDEN_EVENT, DONE); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KJ_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_KJ_SLAY2, m_creature); break; + } + } + + void EnterEvadeMode() + { + Scripted_NoMovementAI::EnterEvadeMode(); + Summons.DespawnAll(); + + // Reset the controller + if (pInstance){ + Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))); + if (Control) + CAST_AI(Scripted_NoMovementAI, Control->AI())->Reset(); + } + } + + void EnterCombat(Unit* who){ + DoZoneInCombat(); + DoScriptText(SAY_KJ_EMERGE, m_creature); + } + + void CastSinisterReflection() + { + switch(rand()%2){ + case 0: DoScriptText(SAY_KJ_REFLECTION1, m_creature); break; + case 1: DoScriptText(SAY_KJ_REFLECTION2, m_creature); break; + } + DoCast(m_creature, SPELL_SINISTER_REFLECTION, true); + for(uint8 i = 0; i < 4; ++i){ + float x,y,z; + Unit* target; + for(uint8 z = 0; z < 6; ++z){ + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (!target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break; + } + target->GetPosition(x,y,z); + Creature* SinisterReflection = m_creature->SummonCreature(CREATURE_SINISTER_REFLECTION, x,y,z,0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (SinisterReflection) + SinisterReflection->AI()->AttackStart(target); + } + } + + 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 && !TimerIsDeactiveted[t]){ + switch(t){ + case TIMER_KALEC_JOIN: + if (Kalec){ + DoScriptText(SAY_KALECGOS_JOIN, Kalec); + IsKalecJoined = true; + TimerIsDeactiveted[TIMER_KALEC_JOIN] = true; + } + break; + case TIMER_SOUL_FLAY: + if (!m_creature->IsNonMeleeSpellCasted(false)){ + m_creature->CastSpell(m_creature->getVictim(), SPELL_SOUL_FLAY, false); + m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_SOUL_FLAY_SLOW, true); + Timer[TIMER_SOUL_FLAY] = 3500; + } + break; + case TIMER_LEGION_LIGHTNING: + if (!m_creature->IsNonMeleeSpellCasted(false)){ + m_creature->RemoveAurasDueToSpell(SPELL_SOUL_FLAY); + for(uint8 z = 0; z < 6; ++z){ + randomPlayer = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (!randomPlayer->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break; + } + if (randomPlayer)DoCast(randomPlayer, 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 (!m_creature->IsNonMeleeSpellCasted(false)){ + m_creature->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]); + m_creature->SummonCreature(CREATURE_SHIELD_ORB, sx, sy, SHIELD_ORB_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + } + Timer[TIMER_SUMMON_SHILEDORB] = 30000+rand()%30*1000; // 30-60seconds cooldown + Timer[TIMER_SOUL_FLAY] = 2000; + break; + case TIMER_SHADOW_SPIKE: //Phase 3 + if (!m_creature->IsNonMeleeSpellCasted(false)){ + DoCastAOE(SPELL_SHADOW_SPIKE, false); + Timer[TIMER_SHADOW_SPIKE] = 0; + TimerIsDeactiveted[TIMER_SHADOW_SPIKE] = true; + ChangeTimers(true, 30000); + } + 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 (!m_creature->IsNonMeleeSpellCasted(false)){ + // Begins to channel for 8 seconds, then deals 50'000 damage to all raid members. + if (!IsInDarkness){ + DoScriptText(EMOTE_KJ_DARKNESS, m_creature); + DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS, false); + ChangeTimers(true, 9000); + Timer[TIMER_DARKNESS] = 8750; + TimerIsDeactiveted[TIMER_DARKNESS] = false; + if (Phase == PHASE_SACRIFICE) TimerIsDeactiveted[TIMER_ARMAGEDDON] = false; + IsInDarkness = true; + }else{ + Timer[TIMER_DARKNESS] = (Phase == PHASE_SACRIFICE) ? 20000 + rand()%15000 : 40000 + rand()%30000; + IsInDarkness = false; + DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE); + switch(rand()%3){ + case 0: DoScriptText(SAY_KJ_DARKNESS1, m_creature); break; + case 1: DoScriptText(SAY_KJ_DARKNESS2, m_creature); break; + case 2: DoScriptText(SAY_KJ_DARKNESS3, m_creature); break; + } + } + Timer[TIMER_SOUL_FLAY] = 9000; + } + break; + case TIMER_ORBS_EMPOWER: //Phase 3 + if (Phase == PHASE_SACRIFICE){ + if (Kalec)CAST_AI(boss_kalecgos_kjAI, Kalec->AI())->EmpowerOrb(true); + }else if (Kalec)CAST_AI(boss_kalecgos_kjAI, Kalec->AI())->EmpowerOrb(false); + Timer[TIMER_ORBS_EMPOWER]= (Phase == PHASE_SACRIFICE) ? 45000 : 35000; + OrbActivated = true; + TimerIsDeactiveted[TIMER_ORBS_EMPOWER] = true; + break; + case TIMER_ARMAGEDDON: //Phase 4 + Unit* target; + for(uint8 z = 0; z < 6; ++z){ + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (!target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break; + } + if (target){ + float x, y, z; + target->GetPosition(x, y, z); + m_creature->SummonCreature(CREATURE_ARMAGEDDON_TARGET, x,y,z,0, TEMPSUMMON_TIMED_DESPAWN,15000); + } + Timer[TIMER_ARMAGEDDON] = 2000; // No, I'm not kidding + break; + } + break; + } + } + //Time runs over! + for(uint8 i = 0; i < ActiveTimers; ++i) + if (!TimerIsDeactiveted[i]){ + Timer[i] -= diff; + if (((int32)Timer[i]) < 0) Timer[i] = 0; + } + + //Phase 3 + if (Phase <= PHASE_NORMAL){ + if (Phase == PHASE_NORMAL && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 85)){ + CastSinisterReflection(); + DoScriptText(SAY_KJ_PHASE3, m_creature); + Phase = PHASE_DARKNESS; + OrbActivated = false; + ActiveTimers = 9; + } + else return; + } + + //Phase 4 + if (Phase <= PHASE_DARKNESS){ + if (Phase == PHASE_DARKNESS && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 55)){ + DoScriptText(SAY_KJ_PHASE4, m_creature); + Phase = PHASE_ARMAGEDDON; + OrbActivated = false; + ActiveTimers = 10; + } + else return; + } + + //Phase 5 specific spells all we can + if (Phase <= PHASE_ARMAGEDDON){ + if (Phase == PHASE_ARMAGEDDON && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)){ + Phase = PHASE_SACRIFICE; + Creature* Anveena = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_ANVEENA))); + if (Anveena)Anveena->CastSpell(m_creature, SPELL_SACRIFICE_OF_ANVEENA, false); + OrbActivated = false; + ChangeTimers(true, 10000);// He shouldn't cast spells for ~10 seconds after Anveena's sacrifice. This will be done within Anveena's script + } + else return; + } + +} +}; + +CreatureAI* GetAI_boss_kiljaeden(Creature* pCreature) +{ + return new boss_kiljaedenAI (pCreature); +} + +//AI for Kil'jaeden Event Controller +struct TRINITY_DLL_DECL mob_kiljaeden_controllerAI : public Scripted_NoMovementAI +{ + mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), Summons(m_creature){ + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + Creature* KalecKJ; + SummonList Summons; + + bool SummonedDeceivers; + bool KiljaedenDeath; + + uint32 RandomSayTimer; + uint32 Phase; + uint8 DeceiverDeathCount; + + void InitializeAI(){ + KalecKJ = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KALECGOS_KJ)); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->addUnitState(UNIT_STAT_STUNNED); + } + + void Reset(){ + Phase = PHASE_DECEIVERS; + if (KalecKJ)CAST_AI(boss_kalecgos_kjAI, KalecKJ->AI())->ResetOrbs(); + DeceiverDeathCount = 0; + SummonedDeceivers = false; + KiljaedenDeath = false; + RandomSayTimer = 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); + CAST_AI(boss_kiljaedenAI, summoned->AI())->Phase=PHASE_NORMAL; + summoned->AddThreat(m_creature->getVictim(), 1.0f); + break; + } + Summons.Summon(summoned); + } + + void UpdateAI(const uint32 diff) + { + if (RandomSayTimer < diff && pInstance->GetData(DATA_MURU_EVENT) != DONE && pInstance->GetData(DATA_KILJAEDEN_EVENT) == NOT_STARTED){ + switch(rand()%5){ + case 0: DoScriptText(SAY_KJ_OFFCOMBAT1, m_creature); break; + case 1: DoScriptText(SAY_KJ_OFFCOMBAT2, m_creature); break; + case 2: DoScriptText(SAY_KJ_OFFCOMBAT3, m_creature); break; + case 3: DoScriptText(SAY_KJ_OFFCOMBAT4, m_creature); break; + case 4: DoScriptText(SAY_KJ_OFFCOMBAT5, m_creature); break; + } + RandomSayTimer = 30000; + }else RandomSayTimer -= diff; + + if (!SummonedDeceivers){ + for(uint8 i = 0; i < 3; ++i) + m_creature->SummonCreature(CREATURE_HAND_OF_THE_DECEIVER, DeceiverLocations[i][0], DeceiverLocations[i][1], FLOOR_Z, DeceiverLocations[i][2], TEMPSUMMON_DEAD_DESPAWN, 0); + + DoSpawnCreature(CREATURE_ANVEENA, 0, 0, 40, 0, TEMPSUMMON_DEAD_DESPAWN, 0); + DoCast(m_creature, SPELL_ANVEENA_ENERGY_DRAIN); + SummonedDeceivers = true; + } + + if (DeceiverDeathCount > 2 && Phase == PHASE_DECEIVERS){ + m_creature->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 Hand of the Deceiver +struct TRINITY_DLL_DECL 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 = 8000 + rand()%6000; // 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(m_creature->getFaction()); + summoned->SetLevel(m_creature->getLevel()); + } + + void EnterCombat(Unit* who){ + if (pInstance){ + pInstance->SetData(DATA_KILJAEDEN_EVENT, IN_PROGRESS); + Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))); + if (Control) + Control->AddThreat(who, 1.0f); + } + m_creature->InterruptNonMeleeSpells(true); + } + + void JustDied(Unit* killer){ + if (!pInstance) + return; + + Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))); + if (Control) + CAST_AI(mob_kiljaeden_controllerAI, Control->AI())->DeceiverDeathCount++; + } + + void UpdateAI(const uint32 diff){ + if (!me->isInCombat()) + DoCast(m_creature, SPELL_SHADOW_CHANNELING); + + if (!UpdateVictim()) + return; + + // Gain Shadow Infusion at 20% health + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) && !m_creature->HasAura(SPELL_SHADOW_INFUSION, 0)) + DoCast(m_creature, SPELL_SHADOW_INFUSION, true); + + // Shadow Bolt Volley - Shoots Shadow Bolts at all enemies within 30 yards, for ~2k Shadow damage. + if (ShadowBoltVolleyTimer < diff){ + DoCast(m_creature->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){ + Creature* Portal = DoSpawnCreature(CREATURE_FELFIRE_PORTAL, 0, 0,0, 0, TEMPSUMMON_TIMED_DESPAWN, 20000); + if (Portal) + { + std::list::iterator itr; + for(itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr) + { + Unit* pUnit = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (pUnit) + Portal->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 TRINITY_DLL_DECL mob_felfire_portalAI : public Scripted_NoMovementAI +{ + mob_felfire_portalAI(Creature* c) : Scripted_NoMovementAI(c) {} + + uint32 SpawnFiendTimer; + + void InitializeAI(){ + SpawnFiendTimer = 5000; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + // TODO: Timers + void Reset() { + + } + + void JustSummoned(Creature* summoned) + { + summoned->setFaction(m_creature->getFaction()); + summoned->SetLevel(m_creature->getLevel()); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (SpawnFiendTimer < diff) + { + Creature* Fiend = DoSpawnCreature(CREATURE_VOLATILE_FELFIRE_FIEND, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000); + if (Fiend) + Fiend->AddThreat(SelectUnit(SELECT_TARGET_RANDOM,0), 100000.0f); + SpawnFiendTimer = 4000 + rand()%4000; + }else SpawnFiendTimer -= diff; + } +}; + +CreatureAI* GetAI_mob_felfire_portal(Creature* pCreature) +{ + return new mob_felfire_portalAI (pCreature); +} + +//AI for Felfire Fiend +struct TRINITY_DLL_DECL mob_volatile_felfire_fiendAI : public ScriptedAI +{ + mob_volatile_felfire_fiendAI(Creature* c) : ScriptedAI(c) {} + + uint32 ExplodeTimer; + + bool LockedTarget; + + void Reset() + { + ExplodeTimer = 2000; + LockedTarget = false; + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage > m_creature->GetHealth()) + DoCast(m_creature, SPELL_FELFIRE_FISSION, true); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!LockedTarget){ + m_creature->AddThreat(m_creature->getVictim(), 10000000.0f); + LockedTarget = true; + } + + if (ExplodeTimer){ + if (ExplodeTimer < diff) + ExplodeTimer = 0; + else ExplodeTimer -= diff; + } + else if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 3)) // Explode if it's close enough to it's target + { + DoCast(m_creature->getVictim(), SPELL_FELFIRE_FISSION); + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } +}; + +CreatureAI* GetAI_mob_volatile_felfire_fiend(Creature* pCreature) +{ + return new mob_volatile_felfire_fiendAI (pCreature); +} + +//AI for Armageddon target +struct TRINITY_DLL_DECL mob_armageddonAI : public Scripted_NoMovementAI +{ + mob_armageddonAI(Creature* c) : Scripted_NoMovementAI(c) {} + + uint8 Spell; + uint32 Timer; + + void Reset(){ + Spell = 0; + Timer = 0; + } + + void UpdateAI(const uint32 diff) + { + if (Timer < diff){ + switch(Spell){ + case 0: + DoCast(m_creature, SPELL_ARMAGEDDON_VISUAL, true); + ++Spell; + break; + case 1: + DoCast(m_creature, SPELL_ARMAGEDDON_VISUAL2, true); + Timer = 9000; + ++Spell; + break; + case 2: + DoCast(m_creature, SPELL_ARMAGEDDON_TRIGGER, true); + ++Spell; + Timer = 5000; + break; + case 3: + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + break; + } + }else Timer -=diff; + } +}; + +CreatureAI* GetAI_mob_armageddon(Creature* pCreature) +{ + return new mob_armageddonAI (pCreature); +} + +//AI for Shield Orbs +struct TRINITY_DLL_DECL mob_shield_orbAI : public ScriptedAI +{ + mob_shield_orbAI(Creature* c) : ScriptedAI(c) { + pInstance = c->GetInstanceData(); + } + + bool PointReached; + bool Clockwise; + uint32 Timer; + uint32 CheckTimer; + ScriptedInstance* pInstance; + float x, y, r, c, mx, my; + + void InitializeAI(){ + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + PointReached = true; + Timer = 500+ rand()%500; + CheckTimer = 1000; + r = 17; + c = 0; + mx = ShieldOrbLocations[0][0]; + my = ShieldOrbLocations[0][1]; + if (rand()%2 == 0)Clockwise = true; + else Clockwise = false; + } + + void Reset(){} + + void UpdateAI(const uint32 diff){ + if (PointReached){ + if (Clockwise){ + y = my - r * sin(c); + x = mx - r * cos(c); + }else{ + y = my + r * sin(c); + x = mx + r * cos(c); + } + PointReached = false; + CheckTimer = 1000; + m_creature->GetMotionMaster()->MovePoint(1,x, y, SHIELD_ORB_Z); + c += 3.1415926535/32; + if (c > 2*3.1415926535) c = 0; + }else{ + if (CheckTimer < diff){ + DoTeleportTo(x,y,SHIELD_ORB_Z); + PointReached = true; + }else CheckTimer -= diff; + + } + + if (Timer < diff){ + Unit* random = (Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID))); + if (random)DoCast(random, SPELL_SHADOW_BOLT, false); + Timer = 500+ rand()%500; + }else Timer -= diff; + } + + void MovementInform(uint32 type, uint32 id){ + if (type != POINT_MOTION_TYPE) + return; + + PointReached = true; + } +}; + +CreatureAI* GetAI_mob_shield_orb(Creature* pCreature) +{ + return new mob_shield_orbAI (pCreature); +} + +//AI for Sinister Reflection +struct TRINITY_DLL_DECL mob_sinster_reflectionAI : public ScriptedAI +{ + mob_sinster_reflectionAI(Creature* c) : ScriptedAI(c) {} + + uint8 Class; + uint32 Timer[3]; + + void Reset(){ + Timer[0] = 0; + Timer[1] = 0; + Timer[2] = 0; + Class = 0; + } + + void UpdateAI(const uint32 diff){ + + if (Class == 0){ + Class = m_creature->getVictim()->getClass(); + switch(Class){ + case CLASS_DRUID: + break; + case CLASS_HUNTER: + break; + case CLASS_MAGE: + break; + case CLASS_WARLOCK: + break; + case CLASS_WARRIOR: + m_creature->SetCanDualWield(true); + break; + case CLASS_PALADIN: + break; + case CLASS_PRIEST: + break; + case CLASS_SHAMAN: + m_creature->SetCanDualWield(true); + break; + case CLASS_ROGUE: + m_creature->SetCanDualWield(true); + break; + } + } + + switch(Class){ + case CLASS_DRUID: + if (Timer[1] < diff){ + DoCast(m_creature->getVictim(), SPELL_SR_MOONFIRE, false); + Timer[1] = 3000; + } + DoMeleeAttackIfReady(); + break; + case CLASS_HUNTER: + if (Timer[1] < diff){ + DoCast(m_creature->getVictim(), SPELL_SR_MULTI_SHOT, false); + Timer[1] = 9000; + } + if (Timer[2] < diff){ + DoCast(m_creature->getVictim(), SPELL_SR_SHOOT, false); + Timer[2] = 5000; + } + if (m_creature->IsWithinMeleeRange(m_creature->getVictim(), 6)){ + if (Timer[3] < diff){ + DoCast(m_creature->getVictim(), SPELL_SR_MULTI_SHOT, false); + Timer[3] = 7000; + } + DoMeleeAttackIfReady(); + } + break; + case CLASS_MAGE: + if (Timer[1] < diff){ + DoCast(m_creature->getVictim(), SPELL_SR_FIREBALL, false); + Timer[1] = 3000; + } + DoMeleeAttackIfReady(); + break; + case CLASS_WARLOCK: + if (Timer[1] < diff){ + DoCast(m_creature->getVictim(), SPELL_SR_SHADOW_BOLT, false); + Timer[1] = 4000; + } + if (Timer[2] < diff){ + DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_SR_CURSE_OF_AGONY, true); + Timer[2] = 3000; + } + DoMeleeAttackIfReady(); + break; + case CLASS_WARRIOR: + if (Timer[1] < diff){ + DoCast(m_creature->getVictim(), SPELL_SR_WHIRLWIND, false); + Timer[1] = 10000; + } + DoMeleeAttackIfReady(); + break; + case CLASS_PALADIN: + if (Timer[1] < diff){ + DoCast(m_creature->getVictim(), SPELL_SR_HAMMER_OF_JUSTICE, false); + Timer[1] = 7000; + } + if (Timer[2] < diff){ + DoCast(m_creature->getVictim(), SPELL_SR_HOLY_SHOCK, false); + Timer[2] = 3000; + } + DoMeleeAttackIfReady(); + break; + case CLASS_PRIEST: + if (Timer[1] < diff){ + DoCast(m_creature->getVictim(), SPELL_SR_HOLY_SMITE, false); + Timer[1] = 5000; + } + if (Timer[2] < diff){ + DoCast(m_creature, SPELL_SR_RENEW, false); + Timer[2] = 7000; + } + DoMeleeAttackIfReady(); + break; + case CLASS_SHAMAN: + if (Timer[1] < diff){ + DoCast(m_creature->getVictim(), SPELL_SR_EARTH_SHOCK, false); + Timer[1] = 5000; + } + DoMeleeAttackIfReady(); + break; + case CLASS_ROGUE: + if (Timer[1] < diff){ + DoCast(m_creature->getVictim(), SPELL_SR_HEMORRHAGE, true); + Timer[1] = 5000; + } + DoMeleeAttackIfReady(); + break; + } + debug_log("Sinister-Timer"); + for(uint8 i = 0; i < 3; ++i) + Timer[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/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp new file mode 100644 index 00000000000..003080002d1 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/boss_muru.cpp @@ -0,0 +1,668 @@ +/* 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 "precompiled.h" +#include "def_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 Creatures +{ + 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, + BOSS_MURU = 25741, + BOSS_ENTROPIUS = 25840 +}; + +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 TRINITY_DLL_DECL boss_entropiusAI : public ScriptedAI +{ + boss_entropiusAI(Creature *c) : ScriptedAI(c), Summons(m_creature) + { + 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(m_creature, 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); + m_creature->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 && !m_creature->HasAura(SPELL_ENRAGE, 0)) + { + DoCast(m_creature,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 TRINITY_DLL_DECL boss_muruAI : public Scripted_NoMovementAI +{ + boss_muruAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature) + { + 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; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->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 > m_creature->GetHealth() && Phase == 1) + { + damage = 0; + Phase = 2; + m_creature->RemoveAllAuras(); + DoCast(m_creature, SPELL_OPEN_ALL_PORTALS, false); + m_creature->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: + m_creature->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] GetData(DATA_MURU_EVENT)) + { + case NOT_STARTED: + Reset(); + break; + case DONE: + Phase = 4; + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + break; + } + Timer[TIMER_PHASE] = 3000; + }else Timer[TIMER_PHASE] -= diff; + return; + } + + if (EnrageTimer < diff && !m_creature->HasAura(SPELL_ENRAGE, 0)) + { + DoCast(m_creature, 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) + m_creature->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) + m_creature->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: + m_creature->RemoveAllAuras(); + DoCast(m_creature, 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 TRINITY_DLL_DECL npc_muru_portalAI : public Scripted_NoMovementAI +{ + npc_muru_portalAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + SummonList Summons; + Creature* Muru; + + bool SummonSentinel; + bool InAction; + + uint32 SummonTimer; + + void Reset() + { + SummonTimer = 5000; + + InAction = false; + SummonSentinel = false; + + m_creature->addUnitState(UNIT_STAT_STUNNED); + + Summons.DespawnAll(); + } + + void JustSummoned(Creature* summoned) + { + Player* Target = Unit::GetPlayer(pInstance->GetData64(DATA_PLAYER_GUID)); + if (Target) + summoned->AI()->AttackStart(Target); + + Summons.Summon(summoned); + } + + void SpellHit(Unit* caster, const SpellEntry* Spell) + { + float x,y,z,o; + m_creature->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->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 TRINITY_DLL_DECL npc_dark_fiendAI : public ScriptedAI +{ + npc_dark_fiendAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 WaitTimer; + bool InAction; + + void Reset() + { + WaitTimer = 2000; + InAction = false; + + m_creature->addUnitState(UNIT_STAT_STUNNED); + } + + void SpellHit(Unit* caster, const SpellEntry* Spell) + { + for(uint8 i = 0; i < 3; ++i) + if (Spell->Effect[i] == 38) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (WaitTimer < diff) + { + if (!InAction) + { + m_creature->clearUnitState(UNIT_STAT_STUNNED); + DoCastAOE(SPELL_DARKFIEND_SKIN, false); + AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)); + InAction = true; + WaitTimer = 500; + } + else + { + + if (m_creature->IsWithinDist(m_creature->getVictim(), 5)) + { + DoCastAOE(SPELL_DARKFIEND_AOE, false); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + } + WaitTimer = 500; + } + }else WaitTimer -= diff; + } +}; + +CreatureAI* GetAI_npc_dark_fiend(Creature* pCreature) +{ + return new npc_dark_fiendAI (pCreature); +} + +struct TRINITY_DLL_DECL npc_void_sentinelAI : public ScriptedAI +{ + npc_void_sentinelAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 PulseTimer; + uint32 VoidBlastTimer; + + void Reset() + { + PulseTimer = 3000; + VoidBlastTimer = 45000; //is this a correct timer? + + float x,y,z,o; + m_creature->GetHomePosition(x,y,z,o); + DoTeleportTo(x,y,71); + } + + void JustDied(Unit* killer) + { + for (uint8 i = 0; i < 8; ++i){ + m_creature->SummonCreature(CREATURE_VOID_SPAWN, m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->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(m_creature->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 TRINITY_DLL_DECL 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; + + m_creature->addUnitState(UNIT_STAT_STUNNED); + DoCastAOE(SPELL_BLACKHOLE_SPAWN, true); + } + + void UpdateAI(const uint32 diff) + { + if (SpellTimer < diff) + { + Unit* Victim = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)); + switch(NeedForAHack) + { + case 0: + m_creature->clearUnitState(UNIT_STAT_STUNNED); + DoCastAOE(SPELL_BLACKHOLE_GROW, false); + if (Victim) + AttackStart(Victim); + SpellTimer = 700; + NeedForAHack = 2; + break; + case 1: + m_creature->AddAura(SPELL_BLACKHOLE_GROW, m_creature); + NeedForAHack = 2; + SpellTimer = 600; + break; + case 2: + SpellTimer = 400; + NeedForAHack = 3; + m_creature->RemoveAura(SPELL_BLACKHOLE_GROW, 1); + break; + case 3: + SpellTimer = 400+rand()%500; + NeedForAHack = 1; + Unit* Temp = m_creature->getVictim(); + if (!Temp) + return; + if (Temp->GetPositionZ() > 73 && Victim) + AttackStart(Victim); + } + }else SpellTimer -= diff; + + if (DespawnTimer < diff) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + }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/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/def_sunwell_plateau.h b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/def_sunwell_plateau.h new file mode 100644 index 00000000000..ca8c014d9df --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/def_sunwell_plateau.h @@ -0,0 +1,37 @@ +/* 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 ***/ +#define DATA_KALECGOS_EVENT 1 +#define DATA_BRUTALLUS_EVENT 2 +#define DATA_FELMYST_EVENT 3 +#define DATA_EREDAR_TWINS_EVENT 4 +#define DATA_MURU_EVENT 5 +#define DATA_KILJAEDEN_EVENT 6 + +/*** Creatures ***/ +#define DATA_KALECGOS_DRAGON 7 +#define DATA_KALECGOS_HUMAN 8 +#define DATA_SATHROVARR 9 +#define DATA_BRUTALLUS 10 +#define DATA_MADRIGOSA 11 +#define DATA_FELMYST 12 +#define DATA_ALYTHESS 13 +#define DATA_SACROLASH 14 +#define DATA_MURU 15 +#define DATA_KILJAEDEN 16 +#define DATA_KILJAEDEN_CONTROLLER 17 +#define DATA_ANVEENA 18 +#define DATA_KALECGOS_KJ 19 + +/*** GameObjects ***/ +#define DATA_GO_FORCEFIELD 20 + +/*** Misc ***/ +#define DATA_PLAYER_GUID 27 +#endif + diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp new file mode 100644 index 00000000000..8b763e9d7b7 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/instance_sunwell_plateau.cpp @@ -0,0 +1,274 @@ +/* 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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; + + /** GameObjects **/ + uint64 ForceField; // Kalecgos Encounter + 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; + + /*** GameObjects ***/ + ForceField = 0; + FireBarrier = 0; + MurusGate[0] = 0; + MurusGate[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 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: 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/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.cpp new file mode 100644 index 00000000000..e68717857cb --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/sunwell_plateau/sunwell_plateau.cpp @@ -0,0 +1,66 @@ +/* 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 "precompiled.h" +#include "def_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/bindings/scripts/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp new file mode 100644 index 00000000000..43628a6565e --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/uldaman/boss_archaedas.cpp @@ -0,0 +1,493 @@ +/* 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 3 prople click 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 "precompiled.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 TRINITY_DLL_DECL boss_archaedasAI : public ScriptedAI +{ + boss_archaedasAI(Creature *c) : ScriptedAI(c) + { + pInstance = (m_creature->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 + m_creature->setFaction(35); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + + } + + void ActivateMinion (uint64 guid, bool flag) + { + Unit *minion = Unit::GetUnit(*m_creature, guid); + + if (minion && minion->isAlive()) + { + DoCast (minion, SPELL_AWAKEN_VAULT_WALKER, flag); + minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN,true); + } + } + + + void EnterCombat(Unit *who) + { + m_creature->setFaction (14); + m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->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)) { + m_creature->MonsterYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature,SOUND_AGGRO); + Awaken_Timer = 4000; + wakingUp = true; + } + } + + void KilledUnit(Unit *victim) + { + m_creature->MonsterYell(SAY_KILL,LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, 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(*m_creature, 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 && m_creature->GetHealth()*100 / m_creature->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 + m_creature->MonsterYell(SAY_SUMMON,LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_SUMMON); + guardiansAwake = true; + } + + //If we are <33 summon the vault walkers + if (!vaultWalkersAwake && m_creature->GetHealth()*100 / m_creature->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 + m_creature->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_SUMMON2); + vaultWalkersAwake = true; + } + + + if (Tremor_Timer < diff) + { + //Cast + DoCast(m_creature->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 TRINITY_DLL_DECL mob_archaedas_minionsAI : public ScriptedAI +{ + mob_archaedas_minionsAI(Creature *c) : ScriptedAI(c) + { + pInstance = (m_creature->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; + + m_creature->setFaction(35); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + m_creature->RemoveAllAuras(); + } + + void EnterCombat(Unit *who) + { + m_creature->setFaction (14); + m_creature->RemoveAllAuras(); + m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->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(*m_creature, 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 3 people to activate the Archaedas script +SDCategory: Uldaman +EndScriptData */ + + +#define OBJECT_ALTAR_OF_ARCHAEDAS 133234 + +#define NUMBER_NEEDED_TO_ACTIVATE 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 + uint32 count=0; + Unit *pTarget; + for (uint32 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 "precompiled.h" + +#define SPELL_SELF_DESTRUCT 9874 + +struct TRINITY_DLL_DECL mob_stonekeepersAI : public ScriptedAI +{ + mob_stonekeepersAI(Creature *c) : ScriptedAI(c) + { + pInstance = (m_creature->GetInstanceData()); + } + + ScriptedInstance* pInstance; + + void Reset() + { + m_creature->setFaction(35); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); + m_creature->RemoveAllAuras(); + } + + void EnterCombat(Unit *who) + { + m_creature->setFaction (14); + m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->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 (m_creature, 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 3 people 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 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 + uint32 count=0; + Unit *pTarget; + for (uint32 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/bindings/scripts/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/uldaman/boss_ironaya.cpp new file mode 100644 index 00000000000..17e32e7178a --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" + +#define SAY_AGGRO -1070000 + +#define SPELL_ARCINGSMASH 8374 +#define SPELL_KNOCKAWAY 10101 +#define SPELL_WSTOMP 11876 + +struct TRINITY_DLL_DECL 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, m_creature); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //If we are <50% hp do knockaway ONCE + if (!hasCastedKnockaway && m_creature->GetHealth()*2 < m_creature->GetMaxHealth()) + { + m_creature->CastSpell(m_creature->getVictim(),SPELL_KNOCKAWAY, true); + + // current aggro target is knocked away pick new target + Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + + if (!Target || Target == m_creature->getVictim()) + Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); + + if (Target) + m_creature->TauntApply(Target); + + //Shouldn't cast this agian + hasCastedKnockaway = true; + } + + //Arcing_Timer + if (Arcing_Timer < diff) + { + DoCast(m_creature,SPELL_ARCINGSMASH); + Arcing_Timer = 13000; + }else Arcing_Timer -= diff; + + if (!hasCastedWstomp && m_creature->GetHealth()*4 < m_creature->GetMaxHealth()) + { + DoCast(m_creature,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/bindings/scripts/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp new file mode 100644 index 00000000000..21b639e2449 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/uldaman/instance_uldaman.cpp @@ -0,0 +1,306 @@ +/* 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 "precompiled.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 TRINITY_DLL_DECL 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::iterator i = stoneKeeper.begin(); i != stoneKeeper.end(); ++i) + { + Creature *target = instance->GetCreature(*i); + if (!target || !target->isAlive() || target->getFaction()==14) + continue; + target->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); + target->setFaction(14); + target->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::iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) + { + Creature *target = instance->GetCreature(*i); + if (!target || !target->isAlive() || target->getFaction()==14) + continue; + archaedas->CastSpell(target, SPELL_AWAKEN_VAULT_WALKER, true); + target->CastSpell(target, 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::iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) + { + Creature *target = instance->GetCreature(*i); + if (!target || target->isDead() || target->getFaction()!=14) + continue; + target->setDeathState(JUST_DIED); + target->RemoveCorpse(); + } + + // Vault Walkers + for(std::vector::iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i) + { + Creature *target = instance->GetCreature(*i); + if (!target || target->isDead() || target->getFaction()!=14) + continue; + target->setDeathState(JUST_DIED); + target->RemoveCorpse(); + } + + // Earthen Guardians + for(std::vector::iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i) + { + Creature *target = instance->GetCreature(*i); + if (!target || target->isDead() || target->getFaction()!=14) + continue; + target->setDeathState(JUST_DIED); + target->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::iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) + { + Creature *target = instance->GetCreature(*i); + if (target && target->isDead()) + { + target->Respawn(); + target->GetMotionMaster()->MoveTargetedHome(); + SetFrozenState(target); + } + } + + // Vault Walkers + for(std::vector::iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i) + { + Creature *target = instance->GetCreature(*i); + if (target && target->isDead()) + { + target->Respawn(); + target->GetMotionMaster()->MoveTargetedHome(); + SetFrozenState(target); + } + } + + // Earthen Guardians + for(std::vector::iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i) + { + Creature *target = instance->GetCreature(*i); + if (target && target->isDead()) + { + target->Respawn(); + target->GetMotionMaster()->MoveTargetedHome(); + SetFrozenState(target); + } + } + } + + 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/bindings/scripts/scripts/eastern_kingdoms/uldaman/uldaman.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/uldaman/uldaman.cpp new file mode 100644 index 00000000000..730dcac211a --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/uldaman/uldaman.cpp @@ -0,0 +1,188 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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 "precompiled.h" + +/*###### +## mob_jadespine_basilisk +######*/ + +#define SPELL_CSLUMBER 3636 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_CSLUMBER); + m_creature->CastSpell(m_creature->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 == m_creature->getVictim()) + Target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (Target) + m_creature->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 +######*/ + +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, "Who are the Earthen?", 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, "What is a \"subterranean being matrix\"?", 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, "What are the anomalies you speak of?", 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, "What is a resilient foundation of construction?", 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, "So... the Earthen were made out of stone?", 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, "Anything else I should know about the Earthen?", 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, "I think I understand the Creators' design intent for the Earthen now. What are the Earthen's anomalies that you spoke of earlier?", 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, "What high-stress environments would cause the Earthen to destabilize?", 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, "What happens when the Earthen destabilize?", 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, "Troggs?! Are the troggs you mention the same as the ones in the world today?", 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, "You mentioned two results when the Earthen destabilize. What is the second?", 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, "Dwarves!!! Now you're telling me that dwarves originally came from the Earthen?!", 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, "These dwarves are the same ones today, yes? Do the dwarves maintain any other links to the Earthen?", 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, "Who are the Creators?", 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, "This is a lot to think about.", 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, "I will access the discs now.", 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/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp new file mode 100644 index 00000000000..fb369aee5e4 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_akilzon.cpp @@ -0,0 +1,456 @@ +/* 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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 = (10+rand()%10)*1000; //10 to 20 seconds (bosskillers) + GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers) + CallLighting_Timer = (10+rand()%10)*1000; //totaly random timer. can't find any info on this + ElectricalStorm_Timer = 60*1000; //60 seconds(bosskillers) + Enrage_Timer = 10*60*1000; //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) + { + m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); + //DoZoneInCombat(); + if (pInstance) + pInstance->SetData(DATA_AKILZONEVENT, IN_PROGRESS); + } + + void JustDied(Unit* Killer) + { + m_creature->MonsterYell(SAY_ONDEATH,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature, SOUND_ONDEATH); + if (pInstance) + pInstance->SetData(DATA_AKILZONEVENT, DONE); + DespawnSummons(); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: + m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); + break; + case 1: + m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); + break; + } + } + + void DespawnSummons() + { + for (uint8 i = 0; i < 8; ++i) + { + Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]); + if (bird && bird->isAlive()) + { + bird->SetVisibility(VISIBILITY_OFF); + bird->setDeathState(JUST_DIED); + } + } + } + + void SetWeather(uint32 weather, float grade) + { + Map* pMap = m_creature->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(m_creature->GetPositionX(), m_creature->GetPositionY())); + Cell cell(p); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + std::list tempUnitMap; + + { + Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(m_creature, m_creature, 999); + Trinity::UnitListSearcher searcher(m_creature, tempUnitMap, u_check); + + TypeContainerVisitor, WorldTypeMapContainer > world_unit_searcher(searcher); + TypeContainerVisitor, GridTypeMapContainer > grid_unit_searcher(searcher); + + CellLock cell_lock(cell, p); + cell_lock->Visit(cell_lock, world_unit_searcher, *(m_creature->GetMap())); + cell_lock->Visit(cell_lock, grid_unit_searcher, *(m_creature->GetMap())); + } + //dealdamege + for(std::list::iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) + { + if (!Cloud->IsWithinDist(*i, 6, false)) + { + Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, m_creature->GetGUID()); + } + } + // visual + float x,y,z; + z = m_creature->GetPositionZ(); + for(uint8 i = 0; i < 5+rand()%5; ++i) + { + x = 343+rand()%60; + y = 1380+rand()%60; + if (Unit *trigger = m_creature->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; + m_creature->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* target = Unit::GetUnit(*m_creature, CloudGUID); + if (!target || !target->isAlive()) + { + EnterEvadeMode(); + return; + } + else if (Unit* Cyclone = Unit::GetUnit(*m_creature, CycloneGUID)) + Cyclone->CastSpell(target, 25160, true); // keep casting or... + + if (StormSequenceTimer < diff) { + HandleStormSequence(target); + }else StormSequenceTimer -= diff; + return; + } + + if (Enrage_Timer < diff) { + m_creature->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_ONENRAGE); + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + Enrage_Timer = 600000; + }else Enrage_Timer -= diff; + + if (StaticDisruption_Timer < diff) { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!target) target = m_creature->getVictim(); + TargetGUID = target->GetGUID(); + m_creature->CastSpell(target, SPELL_STATIC_DISRUPTION, false); + m_creature->SetInFront(m_creature->getVictim()); + StaticDisruption_Timer = (10+rand()%8)*1000; // < 20s + + /*if (float dist = m_creature->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f) dist = 5.0f; + SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/ + }else StaticDisruption_Timer -= diff; + + if (GustOfWind_Timer < diff) { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!target) target = m_creature->getVictim(); + DoCast(target, SPELL_GUST_OF_WIND); + GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers) + } else GustOfWind_Timer -= diff; + + if (CallLighting_Timer < diff) { + DoCast(m_creature->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* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true); + if (!target) + { + EnterEvadeMode(); + return; + } + target->CastSpell(target, 44007, true);//cloud visual + m_creature->CastSpell(target, SPELL_ELECTRICAL_STORM, false);//storm cyclon + visual + float x,y,z; + target->GetPosition(x,y,z); + if (target) + { + target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + target->SendMonsterMove(x,y,m_creature->GetPositionZ()+15,0); + } + Unit *Cloud = m_creature->SummonTrigger(x, y, m_creature->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) + { + m_creature->MonsterYell(SAY_ONSUMMON, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_ONSUMMON); + + float x, y, z; + m_creature->GetPosition(x, y, z); + + for (uint8 i = 0; i < 8; ++i) + { + Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]); + if (!bird)//they despawned on die + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + x = target->GetPositionX() + 10 - rand()%20; + y = target->GetPositionY() + 10 - rand()%20; + z = target->GetPositionZ() + 6 + rand()%5 + 10; + if (z > 95) z = 95 - rand()%5; + } + Creature *pCreature = m_creature->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (pCreature) + { + pCreature->AddThreat(m_creature->getVictim(), 1.0f); + pCreature->AI()->AttackStart(m_creature->getVictim()); + BirdGUIDs[i] = pCreature->GetGUID(); + } + } + } + SummonEagles_Timer = 999999; + } else SummonEagles_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL 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; + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + } + + void EnterCombat(Unit *who) {DoZoneInCombat();} + + void MoveInLineOfSight(Unit* who) {} + + void MovementInform(uint32, uint32) + { + arrived = true; + if (TargetGUID) + { + if (Unit* target = Unit::GetUnit(*m_creature, TargetGUID)) + m_creature->CastSpell(target, SPELL_EAGLE_SWOOP, true); + TargetGUID = 0; + m_creature->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* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + float x, y, z; + if (EagleSwoop_Timer) + { + x = target->GetPositionX() + 10 - rand()%20; + y = target->GetPositionY() + 10 - rand()%20; + z = target->GetPositionZ() + 10 + rand()%5; + if (z > 95) z = 95 - rand()%5; + } + else + { + target->GetContactPoint(m_creature, x, y, z); + z += 2; + m_creature->SetSpeed(MOVE_RUN, 5.0f); + TargetGUID = target->GetGUID(); + } + m_creature->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/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp new file mode 100644 index 00000000000..d8c83039b2f --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_halazzi.cpp @@ -0,0 +1,403 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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(m_creature, SPELL_DUAL_WIELD, true); + + Phase = PHASE_NONE; + EnterPhase(PHASE_LYNX); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS); + + m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_AGGRO); + + EnterPhase(PHASE_LYNX); + } + + void JustSummoned(Creature* summon) + { + summon->AI()->AttackStart(m_creature->getVictim()); + if (summon->GetEntry() == MOB_SPIRIT_LYNX) + LynxGUID = summon->GetGUID(); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= m_creature->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) + { + m_creature->CastSpell(m_creature, SPELL_TRANSFORM_MERGE, true); + m_creature->Attack(m_creature->getVictim(), true); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + if (Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID)) + { + Lynx->SetVisibility(VISIBILITY_OFF); + Lynx->setDeathState(JUST_DIED); + } + m_creature->SetMaxHealth(600000); + m_creature->SetHealth(600000 - 150000 * TransformCount); + FrenzyTimer = 16000; + SaberlashTimer = 20000; + ShockTimer = 10000; + TotemTimer = 12000; + break; + case PHASE_SPLIT: + m_creature->MonsterYell(YELL_SPLIT, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_SPLIT); + m_creature->CastSpell(m_creature, SPELL_TRANSFORM_SPLIT, true); + break; + case PHASE_HUMAN: + //DoCast(m_creature, SPELL_SUMMON_LYNX, true); + DoSpawnCreature(MOB_SPIRIT_LYNX, 5,5,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0); + m_creature->SetMaxHealth(400000); + m_creature->SetHealth(400000); + ShockTimer = 10000; + TotemTimer = 12000; + break; + case PHASE_MERGE: + if (Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID)) + { + m_creature->MonsterYell(YELL_MERGE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_MERGE); + Lynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Lynx->GetMotionMaster()->Clear(); + Lynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveFollow(Lynx, 0, 0); + TransformCount++; + }break; + default: + break; + } + Phase = NextPhase; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (BerserkTimer < diff) + { + m_creature->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_BERSERK); + DoCast(m_creature, 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 + //m_creature->CastSpell(m_creature, 41296, true); + m_creature->CastSpell(m_creature->getVictim(), SPELL_SABER_LASH, true); + //m_creature->RemoveAurasDueToSpell(41296); + SaberlashTimer = 30000; + }else SaberlashTimer -= diff; + + if (FrenzyTimer < diff) + { + DoCast(m_creature, SPELL_FRENZY); + FrenzyTimer = (10+rand()%5)*1000; + }else FrenzyTimer -= diff; + + if (Phase == PHASE_LYNX) + if (CheckTimer < diff) + { + if (m_creature->GetHealth() * 4 < m_creature->GetMaxHealth() * (3 - TransformCount)) + EnterPhase(PHASE_SPLIT); + CheckTimer = 1000; + }else CheckTimer -= diff; + } + + if (Phase == PHASE_HUMAN || Phase == PHASE_ENRAGE) + { + if (TotemTimer < diff) + { + DoCast(m_creature, SPELL_SUMMON_TOTEM); + TotemTimer = 20000; + }else TotemTimer -= diff; + + if (ShockTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (target->IsNonMeleeSpellCasted(false)) + DoCast(target,SPELL_EARTHSHOCK); + else + DoCast(target,SPELL_FLAMESHOCK); + ShockTimer = 10000 + rand()%5000; + } + }else ShockTimer -= diff; + + if (Phase == PHASE_HUMAN) + if (CheckTimer < diff) + { + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20)/*m_creature->GetHealth() * 10 < m_creature->GetMaxHealth()*/) + EnterPhase(PHASE_MERGE); + else + { + Unit *Lynx = Unit::GetUnit(*m_creature, 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(*m_creature, LynxGUID); + if (Lynx) + { + Lynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0); + m_creature->GetMotionMaster()->MoveFollow(Lynx, 0, 0); + if (m_creature->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(rand()%2) + { + case 0: + m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_KILL_ONE); + break; + + case 1: + m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_KILL_TWO); + break; + } + } + + void JustDied(Unit* Killer) + { + if (pInstance) + pInstance->SetData(DATA_HALAZZIEVENT, DONE); + + m_creature->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_DEATH); + } +}; + +// Spirits Lynx AI + +struct TRINITY_DLL_DECL boss_spiritlynxAI : public ScriptedAI +{ + boss_spiritlynxAI(Creature *c) : ScriptedAI(c) {} + + uint32 FrenzyTimer; + uint32 shredder_timer; + + void Reset() + { + FrenzyTimer = (30+rand()%20)*1000; //frenzy every 30-50 seconds + shredder_timer = 4000; + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= m_creature->GetHealth()) + damage = 0; + } + + void AttackStart(Unit *who) + { + if (!m_creature->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(m_creature, SPELL_LYNX_FRENZY); + FrenzyTimer = (30+rand()%20)*1000; + }else FrenzyTimer -= diff; + + if (shredder_timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_hexlord.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_hexlord.cpp new file mode 100644 index 00000000000..3ccd0ec129f --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_hexlord.cpp @@ -0,0 +1,912 @@ +/* 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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 TRINITY_DLL_DECL 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; + + Unit* SoulDrainTarget; + + 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(); + + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 46916); + m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + } + + void EnterCombat(Unit* who) + { + if (pInstance) + pInstance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS); + + DoZoneInCombat(); + m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_YELL_AGGRO); + + for(uint8 i = 0; i < 4; ++i) + { + Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]); + if (Temp && Temp->isAlive()) + CAST_CRE(Temp)->AI()->AttackStart(m_creature->getVictim()); + else + { + EnterEvadeMode(); + break; + } + } + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: + m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_ONE); + break; + case 1: + m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_TWO); + break; + } + } + + void JustDied(Unit* victim) + { + if (pInstance) + pInstance->SetData(DATA_HEXLORDEVENT, DONE); + + m_creature->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_YELL_DEATH); + + for(uint8 i = 0; i < 4 ; ++i) + { + Unit* Temp = Unit::GetUnit((*m_creature),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::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((*m_creature), AddGUID[i])); + if (!pCreature || !pCreature->isAlive()) + { + if (pCreature) pCreature->setDeathState(DEAD); + pCreature = m_creature->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(m_creature, Pos_X[i], POS_Y, POS_Z, ORIENT); + pCreature->StopMoving(); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ResetTimer < diff) + { + if (m_creature->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) + { + Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]); + if (Temp && Temp->isAlive() && !Temp->getVictim()) + CAST_CRE(Temp)->AI()->AttackStart(m_creature->getVictim()); + } + CheckAddState_Timer = 5000; + }else CheckAddState_Timer -= diff; + + if (DrainPower_Timer < diff) + { + m_creature->CastSpell(m_creature, SPELL_DRAIN_POWER, true); + m_creature->MonsterYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_YELL_DRAIN_POWER); + DrainPower_Timer = 40000 + rand()%15000; // 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 + { + m_creature->CastSpell(m_creature, SPELL_SPIRIT_BOLTS, false); + m_creature->MonsterYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, 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* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 70, true); + Unit *trigger = DoSpawnCreature(MOB_TEMP_TRIGGER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000); + if (!target || !trigger) + { + EnterEvadeMode(); + return; + } + else + { + trigger->SetDisplayId(11686); + trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + trigger->CastSpell(target, SPELL_SIPHON_SOUL, true); + trigger->GetMotionMaster()->MoveChase(m_creature); + + //m_creature->CastSpell(target, SPELL_SIPHON_SOUL, true); + //m_creature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, target->GetGUID()); + //m_creature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL); + + PlayerGUID = target->GetGUID(); + PlayerAbility_Timer = 8000 + rand()%2000; + PlayerClass = target->getClass() - 1; + if (PlayerClass == 10) PlayerClass = 9; // druid + if (PlayerClass == 4 && target->HasSpell(15473)) PlayerClass = 5; // shadow priest + SiphonSoul_Timer = 99999; // buff lasts 30 sec + } + }else SiphonSoul_Timer -= diff; + + if (PlayerAbility_Timer < diff) + { + //Unit* target = Unit::GetUnit(*m_creature, PlayerGUID); + //if (target && target->isAlive()) + { + UseAbility(); + PlayerAbility_Timer = 8000 + rand()%2000; + } + }else PlayerAbility_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + void UseAbility() + { + uint32 random = rand()%3; + Unit *target = NULL; + switch(PlayerAbility[PlayerClass][random].target) + { + case ABILITY_TARGET_SELF: + target = m_creature; + break; + case ABILITY_TARGET_VICTIM: + target = m_creature->getVictim(); + break; + case ABILITY_TARGET_ENEMY: + default: + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + break; + case ABILITY_TARGET_HEAL: + target = DoSelectLowestHpFriendly(50, 0); + break; + case ABILITY_TARGET_BUFF: + { + std::list templist = DoFindFriendlyMissingBuff(50, PlayerAbility[PlayerClass][random].spell); + if (!templist.empty()) target = *(templist.begin()); + } + break; + } + if (target) + m_creature->CastSpell(target, PlayerAbility[PlayerClass][random].spell, false); + } +}; + +#define SPELL_BLOODLUST 43578 +#define SPELL_CLEAVE 15496 + +struct TRINITY_DLL_DECL 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* target = *(templist.begin())) + m_creature->CastSpell(target, SPELL_BLOODLUST, false); + } + bloodlust_timer = 12000; + }else bloodlust_timer -= diff; + + if (cleave_timer < diff) + { + m_creature->CastSpell(m_creature->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 TRINITY_DLL_DECL 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 (m_creature->Attack(who, false)) + { + m_creature->GetMotionMaster()->MoveChase(who, 20); + m_creature->AddThreat(who, 0.0f); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (flashheal_timer < diff) + { + Unit* target = DoSelectLowestHpFriendly(99, 30000); + if (target) + { + if (target->IsWithinDistInMap(m_creature, 50)) + m_creature->CastSpell(target,SPELL_FLASH_HEAL, false); + else + { + // bugged + //m_creature->GetMotionMaster()->Clear(); + //m_creature->GetMotionMaster()->MoveChase(target, 20); + } + } + else + { + if (rand()%2) + { + if (target = DoSelectLowestHpFriendly(50, 0)) + m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false); + } + else if (target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false); + } + flashheal_timer = 2500; + }else flashheal_timer -= diff; + + /*if (dispelmagic_timer < diff) + { + if (rand()%2) + { + Unit* target = SelectTarget(); + + m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false); + } + else + m_creature->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 TRINITY_DLL_DECL 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 (m_creature->Attack(who, false)) + { + m_creature->GetMotionMaster()->MoveChase(who, 20); + m_creature->AddThreat(who, 0.0f); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (firebolt_timer < diff) + { + m_creature->CastSpell(m_creature->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 TRINITY_DLL_DECL 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) + { + m_creature->CastSpell(m_creature->getVictim(),SPELL_THUNDERCLAP, false); + thunderclap_timer = 12000; + }else thunderclap_timer -= diff; + + if (flamebreath_timer < diff) + { + m_creature->CastSpell(m_creature->getVictim(),SPELL_FLAME_BREATH, false); + flamebreath_timer = 12000; + }else flamebreath_timer -= diff; + + boss_hexlord_addAI::UpdateAI(diff); + } +}; + +#define SPELL_PSYCHIC_WAIL 43590 + +struct TRINITY_DLL_DECL 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) + { + m_creature->CastSpell(m_creature->getVictim(),SPELL_PSYCHIC_WAIL, false); + psychicwail_timer = 12000; + }else psychicwail_timer -= diff; + + boss_hexlord_addAI::UpdateAI(diff); + } +}; + +#define SPELL_VENOM_SPIT 43579 + +struct TRINITY_DLL_DECL 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 (m_creature->Attack(who, false)) + { + m_creature->GetMotionMaster()->MoveChase(who, 20); + m_creature->AddThreat(who, 0.0f); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (venomspit_timer < diff) + { + if (Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0)) + m_creature->CastSpell(victim,SPELL_VENOM_SPIT, false); + venomspit_timer = 2500; + }else venomspit_timer -= diff; + + boss_hexlord_addAI::UpdateAI(diff); + } +}; + +//Fenstalker +#define SPELL_VOLATILE_INFECTION 43586 + +struct TRINITY_DLL_DECL 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 + m_creature->getVictim()->CastSpell(m_creature->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 TRINITY_DLL_DECL 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) + { + m_creature->CastSpell(m_creature->getVictim(),SPELL_MIGHTY_BLOW, false); + mightyblow_timer = 12000; + } + if (coldstare_timer < diff) + { + if (Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0)) + m_creature->CastSpell(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/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp new file mode 100644 index 00000000000..46a6c0dac59 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_janalai.cpp @@ -0,0 +1,704 @@ + /* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +*(at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with 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 "precompiled.h" +#include "def_zulaman.h" +#include "GridNotifiers.h" + +enum +{ + 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 TRINITY_DLL_DECL 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, m_creature); + + if (pInstance) + pInstance->SetData(DATA_JANALAIEVENT, DONE); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_JANALAIEVENT, IN_PROGRESS); + + DoScriptText(SAY_AGGRO, m_creature); +// DoZoneInCombat(); + } + + void DamageDeal(Unit* target, uint32 &damage) + { + if (isFlameBreathing) + { + if (!m_creature->HasInArc(M_PI/6, target)) + 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 = m_creature->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 = m_creature->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 =(rand()%(area_dx))-(area_dx/2); + dy =(rand()%(area_dy))-(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; + m_creature->GetPosition(x, y, z); + + { + CellPair pair(Trinity::ComputeCellPair(x, y)); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_EGG, 100); + Trinity::CreatureListSearcher searcher(m_creature, templist, check); + + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + + CellLock cell_lock(cell, pair); + cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap())); + } + + //error_log("Eggs %d at middle", templist.size()); + if (!templist.size()) + return false; + + for(std::list::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; + m_creature->GetPosition(x, y, z); + + { + CellPair pair(Trinity::ComputeCellPair(x, y)); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_FIRE_BOMB, 100); + Trinity::CreatureListSearcher searcher(m_creature, templist, check); + + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + + CellLock cell_lock(cell, pair); + cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap())); + } + for(std::list::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((*m_creature), 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 = 20000+rand()%20000; + m_creature->RemoveAurasDueToSpell(SPELL_FIRE_BOMB_CHANNEL); + if (EnrageTimer <= 10000) + EnrageTimer = 0; + else + EnrageTimer -= 10000; + } + } + + void UpdateAI(const uint32 diff) + { + if (isFlameBreathing) + { + if (!m_creature->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 && m_creature->GetHealth() * 4 < m_creature->GetMaxHealth()) + EnrageTimer = 0; + + if (EnrageTimer < diff) + { + if (!enraged) + { + m_creature->CastSpell(m_creature, SPELL_ENRAGE, true); + enraged = true; + EnrageTimer = 300000; + } + else + { + DoScriptText(SAY_BERSERK, m_creature); + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + EnrageTimer = 300000; + } + }else EnrageTimer -= diff; + + if (BombTimer < diff) + { + DoScriptText(SAY_FIRE_BOMBS, m_creature); + + m_creature->AttackStop(); + m_creature->GetMotionMaster()->Clear(); + DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]); + m_creature->StopMoving(); + m_creature->CastSpell(m_creature, SPELL_FIRE_BOMB_CHANNEL, false); + //DoTeleportPlayer(m_creature, JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2], 0); + //m_creature->CastSpell(m_creature, SPELL_TELE_TO_CENTER, true); + + FireWall(); + SpawnBombs(); + isBombing = true; + BombSequenceTimer = 100; + + //Teleport every Player into the middle + Map* pMap = m_creature->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); + } + //m_creature->CastSpell(Temp, SPELL_SUMMON_PLAYERS, true); // core bug, spell does not work if too far + return; + }else BombTimer -= diff; + + if (!noeggs) + { + if (100 * m_creature->GetHealth() < 35 * m_creature->GetMaxHealth()) + { + DoScriptText(SAY_ALL_EGGS, m_creature); + + m_creature->AttackStop(); + m_creature->GetMotionMaster()->Clear(); + DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]); + m_creature->StopMoving(); + m_creature->CastSpell(m_creature, SPELL_HATCH_ALL, false); + HatchAllEggs(2); + noeggs = true; + } + else if (HatcherTimer < diff) + { + if (HatchAllEggs(0)) + { + DoScriptText(SAY_SUMMON_HATCHER, m_creature); + m_creature->SummonCreature(MOB_AMANI_HATCHER,hatcherway[0][0][0],hatcherway[0][0][1],hatcherway[0][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); + m_creature->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* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + m_creature->AttackStop(); + m_creature->GetMotionMaster()->Clear(); + m_creature->CastSpell(target, SPELL_FLAME_BREATH, false); + m_creature->StopMoving(); + isFlameBreathing = true; + } + FireBreathTimer = 8000; + }else FireBreathTimer -= diff; + } +}; + +CreatureAI* GetAI_boss_janalaiAI(Creature* pCreature) +{ + return new boss_janalaiAI(pCreature); +} + +struct TRINITY_DLL_DECL 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) + m_creature->CastSpell(m_creature, 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 TRINITY_DLL_DECL 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() + { + side =(m_creature->GetPositionY() < 1150); + waypoint = 0; + isHatching = false; + hasChangedSide = false; + WaitTimer = 1; + HatchNum = 0; + } + + bool HatchEggs(uint32 num) + { + std::list templist; + float x, y, z; + m_creature->GetPosition(x, y, z); + + { + CellPair pair(Trinity::ComputeCellPair(x, y)); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Trinity::AllCreaturesOfEntryInRange check(m_creature, 23817, 50); + Trinity::CreatureListSearcher searcher(m_creature, templist, check); + + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + + CellLock cell_lock(cell, pair); + cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap())); + } + + //error_log("Eggs %d at %d", templist.size(), side); + + for(std::list::iterator i = templist.begin(); i != templist.end() && num > 0; ++i) + { + if ((*i)->GetDisplayId() != 11686) + { + (*i)->CastSpell(*i, SPELL_HATCH_EGG, false); + num--; + } + } + + if (num) + return false; // no more templist + else + return true; + } + + 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)) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->setDeathState(JUST_DIED); + return; + } + + if (!isHatching) + { + if (WaitTimer) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->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 + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->setDeathState(JUST_DIED); + } + }else WaitTimer -= diff; + } + } +}; + +CreatureAI* GetAI_mob_amanishi_hatcherAI(Creature* pCreature) +{ + return new mob_amanishi_hatcherAI(pCreature); +} + +struct TRINITY_DLL_DECL mob_hatchlingAI : public ScriptedAI +{ + mob_hatchlingAI(Creature *c) : ScriptedAI(c) + { + pInstance =c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + uint32 BuffetTimer; + + void Reset() + { + BuffetTimer = 7000; + if (m_creature->GetPositionY() > 1150) + m_creature->GetMotionMaster()->MovePoint(0, hatcherway[0][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[0][3][2]); + else + m_creature->GetMotionMaster()->MovePoint(0,hatcherway[1][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[1][3][2]); + + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + } + + void EnterCombat(Unit *who) {/*DoZoneInCombat();*/} + + void UpdateAI(const uint32 diff) + { + if (!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS)) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->setDeathState(JUST_DIED); + return; + } + + if (!UpdateVictim()) + return; + + if (BuffetTimer < diff) + { + m_creature->CastSpell(m_creature->getVictim(), SPELL_FLAMEBUFFET, false); + BuffetTimer = 10000; + }else BuffetTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_hatchlingAI(Creature* pCreature) +{ + return new mob_hatchlingAI(pCreature); +} + +struct TRINITY_DLL_DECL 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); + m_creature->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/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp new file mode 100644 index 00000000000..817e652706e --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_nalorakk.cpp @@ -0,0 +1,453 @@ + /* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + inMove = false; + waitTimer = 0; + m_creature->SetSpeed(MOVE_RUN,2); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + }else + { + (*m_creature).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; + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); + } + + void SendAttacker(Unit* target) + { + std::list templist; + float x, y, z; + m_creature->GetPosition(x, y, z); + + { + CellPair pair(Trinity::ComputeCellPair(x, y)); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Trinity::AllFriendlyCreaturesInGrid check(m_creature); + Trinity::CreatureListSearcher searcher(m_creature, templist, check); + + TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); + + CellLock cell_lock(cell, pair); + cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap())); + } + + if (!templist.size()) + return; + + for(std::list::iterator i = templist.begin(); i != templist.end(); ++i) + { + if ((*i) && m_creature->IsWithinDistInMap((*i),25)) + { + (*i)->SetNoCallAssistance(true); + (*i)->AI()->AttackStart(target); + } + } + } + + void AttackStart(Unit* who) + { + if (!MoveEvent) + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit *who) + { + if (!MoveEvent) + { + ScriptedAI::MoveInLineOfSight(who); + } + else + { + if (m_creature->IsHostileTo(who)) + { + if (!inMove) + { + switch(MovePhase) + { + case 0: + if (m_creature->IsWithinDistInMap(who, 50)) + { + m_creature->MonsterYell(YELL_NALORAKK_WAVE1, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE1); + + (*m_creature).GetMotionMaster()->MovePoint(1,NalorakkWay[1][0],NalorakkWay[1][1],NalorakkWay[1][2]); + MovePhase ++; + inMove = true; + + SendAttacker(who); + } + break; + case 2: + if (m_creature->IsWithinDistInMap(who, 40)) + { + m_creature->MonsterYell(YELL_NALORAKK_WAVE2, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE2); + + (*m_creature).GetMotionMaster()->MovePoint(3,NalorakkWay[3][0],NalorakkWay[3][1],NalorakkWay[3][2]); + MovePhase ++; + inMove = true; + + SendAttacker(who); + } + break; + case 5: + if (m_creature->IsWithinDistInMap(who, 40)) + { + m_creature->MonsterYell(YELL_NALORAKK_WAVE3, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE3); + + (*m_creature).GetMotionMaster()->MovePoint(6,NalorakkWay[6][0],NalorakkWay[6][1],NalorakkWay[6][2]); + MovePhase ++; + inMove = true; + + SendAttacker(who); + } + break; + case 7: + if (m_creature->IsWithinDistInMap(who, 50)) + { + SendAttacker(who); + + m_creature->MonsterYell(YELL_NALORAKK_WAVE4, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE4); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + MoveEvent = false; + } + break; + } + } + } + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS); + + m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_YELL_AGGRO); + DoZoneInCombat(); + } + + void JustDied(Unit* Killer) + { + if (pInstance) + pInstance->SetData(DATA_NALORAKKEVENT, DONE); + + m_creature->MonsterYell(YELL_DEATH,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature, SOUND_YELL_DEATH); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: + m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_ONE); + break; + case 1: + m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, 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: + m_creature->SetOrientation(3.1415*2); + inMove = false; + return; + case 1: + case 3: + case 4: + case 6: + MovePhase ++; + waitTimer = 1; + inMove = true; + return; + case 5: + m_creature->SetOrientation(3.1415*0.5); + inMove = false; + return; + case 7: + m_creature->SetOrientation(3.1415*0.5); + inMove = false; + return; + } + + } + } + + void UpdateAI(const uint32 diff) + { + if (waitTimer) + { + if (inMove) + if (waitTimer < diff) + { + (*m_creature).GetMotionMaster()->MovementExpired(); + (*m_creature).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(m_creature, SPELL_BERSERK, true); + m_creature->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_YELL_BERSERK); + Berserk_Timer = 600000; + }else Berserk_Timer -= diff; + + if (ShapeShift_Timer < diff) + { + if (inBearForm) + { + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); + m_creature->MonsterYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_YELL_TOTROLL); + m_creature->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 + { + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0); + m_creature->MonsterYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_YELL_TOBEAR); + DoCast(m_creature, 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(m_creature->getVictim(), SPELL_BRUTALSWIPE); + BrutalSwipe_Timer = 7000 + rand()%5000; + }else BrutalSwipe_Timer -= diff; + + if (Mangle_Timer < diff) + { + if (m_creature->getVictim() && !m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT)) + { + DoCast(m_creature->getVictim(), SPELL_MANGLE); + Mangle_Timer = 1000; + } + else Mangle_Timer = 10000 + rand()%5000; + }else Mangle_Timer -= diff; + + if (Surge_Timer < diff) + { + m_creature->MonsterYell(YELL_SURGE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_YELL_SURGE); + Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true); + if (target) + DoCast(target, SPELL_SURGE); + Surge_Timer = 15000 + rand()%5000; + }else Surge_Timer -= diff; + } + else + { + if (LaceratingSlash_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_LACERATINGSLASH); + LaceratingSlash_Timer = 18000 + rand()%5000; + }else LaceratingSlash_Timer -= diff; + + if (RendFlesh_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_RENDFLESH); + RendFlesh_Timer = 5000 + rand()%5000; + }else RendFlesh_Timer -= diff; + + if (DeafeningRoar_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp new file mode 100644 index 00000000000..a0c2bec4428 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/boss_zuljin.cpp @@ -0,0 +1,624 @@ +/* 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI +{ + boss_zuljinAI(Creature *c) : ScriptedAI(c), Summons(m_creature) + { + 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 = m_creature->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(); + + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 47174); + //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674); + //m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_ZULJINEVENT, IN_PROGRESS); + + DoZoneInCombat(); + + m_creature->MonsterYell(YELL_INTRO,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature, SOUND_INTRO); + SpawnAdds(); + EnterPhase(0); + } + + void KilledUnit(Unit* victim) + { + if (Intro_Timer) + return; + + switch(rand()%2) + { + case 0: + m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_KILL_ONE); + break; + case 1: + m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_KILL_TWO); + break; + } + } + + void JustDied(Unit* Killer) + { + if (pInstance) + pInstance->SetData(DATA_ZULJINEVENT, DONE); + + m_creature->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_DEATH); + Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE); + + if (Unit *Temp = Unit::GetUnit(*m_creature, 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 (!m_creature->IsNonMeleeSpellCasted(false)) + { + if (m_creature->isAttackReady() && m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + if (Phase == 1 && !Overpower_Timer) + { + uint32 health = m_creature->getVictim()->GetHealth(); + m_creature->AttackerStateUpdate(m_creature->getVictim()); + if (m_creature->getVictim() && health == m_creature->getVictim()->GetHealth()) + { + m_creature->CastSpell(m_creature->getVictim(), SPELL_OVERPOWER, false); + Overpower_Timer = 5000; + } + }else m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + } + } + + void SpawnAdds() + { + Creature *pCreature = NULL; + for(uint8 i = 0; i < 4; ++i) + { + pCreature = m_creature->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(*m_creature, 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(); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); + m_creature->RemoveAurasDueToSpell(Transform[Phase].unaura); + DoCast(m_creature, Transform[Phase].spell); + m_creature->MonsterYell(Transform[Phase].text, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, Transform[Phase].sound); + if (Phase > 0) + { + if (Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[Phase - 1])) + Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); + } + if (Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[NextPhase - 1])) + Temp->CastSpell(m_creature, SPELL_SIPHON_SOUL, false); // should m cast on temp + if (NextPhase == 2) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->CastSpell(m_creature, 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 + m_creature->AI()->AttackStart(m_creature->getVictim()); + if (NextPhase == 3) + { + m_creature->RemoveAurasDueToSpell(SPELL_ENERGY_STORM); + Summons.DespawnEntry(CREATURE_FEATHER_VORTEX); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + break; + default: + break; + } + Phase = NextPhase; + } + + void UpdateAI(const uint32 diff) + { + if (!TankGUID) + { + if (!UpdateVictim()) + return; + + if (m_creature->GetHealth() < health_20 * (4 - Phase)) + EnterPhase(Phase + 1); + } + + if (Berserk_Timer < diff) + { + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + m_creature->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_BERSERK); + Berserk_Timer = 60000; + }else Berserk_Timer -= diff; + + switch (Phase) + { + case 0: + if (Intro_Timer) + { + if (Intro_Timer <= diff) + { + m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_AGGRO); + Intro_Timer = 0; + }else Intro_Timer -= diff; + } + + if (Whirlwind_Timer < diff) + { + DoCast(m_creature, SPELL_WHIRLWIND); + Whirlwind_Timer = 15000 + rand()%5000; + }else Whirlwind_Timer -= diff; + + if (Grievous_Throw_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + m_creature->CastSpell(target, SPELL_GRIEVOUS_THROW, false); + Grievous_Throw_Timer = 10000; + }else Grievous_Throw_Timer -= diff; + break; + + case 1: + if (Creeping_Paralysis_Timer < diff) + { + DoCast(m_creature, 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* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + TankGUID = m_creature->getVictim()->GetGUID(); + m_creature->SetSpeed(MOVE_RUN, 5.0f); + AttackStart(target); // 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* target = m_creature->getVictim(); + if (!target || !target->isTargetableForAttack()) target = Unit::GetUnit(*m_creature, TankGUID); + if (!target || !target->isTargetableForAttack()) target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + { + AttackStart(target); + if (m_creature->IsWithinMeleeRange(target)) + { + m_creature->CastSpell(target, SPELL_CLAW_RAGE_DAMAGE, true); + Claw_Counter++; + if (Claw_Counter == 12) + { + Claw_Rage_Timer = 15000 + rand()%5000; + m_creature->SetSpeed(MOVE_RUN, 1.2f); + AttackStart(Unit::GetUnit(*m_creature, TankGUID)); + TankGUID = 0; + return; + } + else + Claw_Loop_Timer = 500; + } + } + else + { + EnterEvadeMode(); // if (target) + return; + } + }else Claw_Loop_Timer -= diff; + } //if (TankGUID) + }else Claw_Rage_Timer -= diff; + + if (Lynx_Rush_Timer <= diff) + { + if (!TankGUID) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + TankGUID = m_creature->getVictim()->GetGUID(); + m_creature->SetSpeed(MOVE_RUN, 5.0f); + AttackStart(target); // change victim + Lynx_Rush_Timer = 0; + Claw_Counter = 0; + } + } + else if (!Lynx_Rush_Timer) + { + Unit* target = m_creature->getVictim(); + if (!target || !target->isTargetableForAttack()) + { + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + AttackStart(target); + } + if (target) + { + if (m_creature->IsWithinMeleeRange(target)) + { + m_creature->CastSpell(target, SPELL_LYNX_RUSH_DAMAGE, true); + Claw_Counter++; + if (Claw_Counter == 9) + { + Lynx_Rush_Timer = 15000 + rand()%5000; + m_creature->SetSpeed(MOVE_RUN, 1.2f); + AttackStart(Unit::GetUnit(*m_creature, TankGUID)); + TankGUID = 0; + } + else + AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + else + { + EnterEvadeMode(); // if (target) + return; + } + } //if (TankGUID) + }else Lynx_Rush_Timer -= diff; + + break; + case 4: + if (Flame_Whirl_Timer < diff) + { + DoCast(m_creature, SPELL_FLAME_WHIRL); + Flame_Whirl_Timer = 12000; + }Flame_Whirl_Timer -= diff; + + if (Pillar_Of_Fire_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_SUMMON_PILLAR); + Pillar_Of_Fire_Timer = 10000; + }else Pillar_Of_Fire_Timer -= diff; + + if (Flame_Breath_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + m_creature->SetInFront(target); + DoCast(m_creature, 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 TRINITY_DLL_DECL feather_vortexAI : public ScriptedAI +{ + feather_vortexAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + + void EnterCombat(Unit* target) {} + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_ZAP_INFORM) + m_creature->CastSpell(caster, SPELL_ZAP_DAMAGE, true); + } + + void UpdateAI(const uint32 diff) + { + //if the vortex reach the target, it change his target to another player + if (m_creature->IsWithinMeleeRange(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/zulaman/def_zulaman.h b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/def_zulaman.h new file mode 100644 index 00000000000..6fb0ef173bd --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/def_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/bindings/scripts/scripts/eastern_kingdoms/zulaman/instance_zulaman.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/instance_zulaman.cpp new file mode 100644 index 00000000000..74186442d9e --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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; + + uint64 HexLordGateGUID = 0; + uint64 ZulJinGateGUID = 0; + uint64 AkilzonDoorGUID = 0; + uint64 HalazziDoorGUID = 0; + uint64 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/bindings/scripts/scripts/eastern_kingdoms/zulaman/zulaman.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulaman/zulaman.cpp new file mode 100644 index 00000000000..86cb3196ab7 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_zulaman.h" + +/*###### +## npc_forest_frog +######*/ + +#define SPELL_REMOVE_AMANI_CURSE 43732 +#define SPELL_PUSH_MOJO 43923 +#define ENTRY_FOREST_FROG 24396 + +struct TRINITY_DLL_DECL 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()%11) + { + case 0: cEntry = 24024; break; //Kraz + case 1: cEntry = 24397; break; //Mannuth + case 2: cEntry = 24403; break; //Deez + case 3: cEntry = 24404; break; //Galathryn + case 4: cEntry = 24405; break; //Adarrah + case 5: cEntry = 24406; break; //Fudgerick + case 6: cEntry = 24407; break; //Darwen + case 7: cEntry = 24445; break; //Mitzi + case 8: cEntry = 24448; break; //Christian + case 9: cEntry = 24453; break; //Brennan + case 10: 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) m_creature->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 && m_creature->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 TRINITY_DLL_DECL 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(m_creature->GetGUID(), LOOT_CORPSE); + } + void UpdateAI(const uint32 diff) + { + if (IsLoot) m_creature->CastSpell(m_creature, 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(pCreature->GetNpcTextId(), 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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp new file mode 100644 index 00000000000..3358255e0bc --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_arlokk.cpp @@ -0,0 +1,274 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_zulgurub.h" + +bool GOHello_go_gong_of_bethekk(Player* pPlayer, GameObject* pGo) +{ + if (ScriptedInstance* m_pInstance = (ScriptedInstance*)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 false; +} + +enum +{ + 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 TRINITY_DLL_DECL 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; + + 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; + + m_pMarkedTarget = NULL; + + m_creature->SetDisplayId(MODEL_ID_NORMAL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_ARLOKK, NOT_STARTED); + + //we should be summoned, so despawn + m_creature->ForcedDespawn(); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + m_creature->SetDisplayId(MODEL_ID_NORMAL); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + if (m_pInstance) + m_pInstance->SetData(TYPE_ARLOKK, DONE); + } + + void DoSummonPhanters() + { + if (m_pMarkedTarget) + DoScriptText(SAY_FEAST_PANTHER, m_creature, m_pMarkedTarget); + + m_creature->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998, -1649.6734, 41.4800, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + m_creature->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970, -1606.4840, 41.2979, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + } + + void JustSummoned(Creature* pSummoned) + { + if (m_pMarkedTarget) + pSummoned->AI()->AttackStart(m_pMarkedTarget); + + ++m_uiSummonCount; + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + if (!m_bIsPhaseTwo) + { + if (m_uiShadowWordPain_Timer < uiDiff) + { + DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN); + m_uiShadowWordPain_Timer = 15000; + } + else + m_uiShadowWordPain_Timer -= uiDiff; + + if (m_uiMark_Timer < uiDiff) + { + m_pMarkedTarget = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (m_pMarkedTarget) + DoCast(m_pMarkedTarget, SPELL_MARK); + else + error_log("TSCR: boss_arlokk could not accuire m_pMarkedTarget."); + + m_uiMark_Timer = 15000; + } + else + m_uiMark_Timer -= uiDiff; + } + else + { + //Cleave_Timer + if (m_uiCleave_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleave_Timer = 16000; + } + else + m_uiCleave_Timer -= uiDiff; + + //Gouge_Timer + if (m_uiGouge_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_GOUGE); + + if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) + m_creature->getThreatManager().modifyThreatPercent(m_creature->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 + m_creature->SetDisplayId(MODEL_ID_BLANK); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + m_creature->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 + m_creature->SetDisplayId(MODEL_ID_PANTHER); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); + m_creature->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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_gahzranka.cpp new file mode 100644 index 00000000000..ab2b4c81704 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" + +#define SPELL_FROSTBREATH 16099 +#define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon... +#define SPELL_SLAM 24326 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_FROSTBREATH); + Frostbreath_Timer = 7000 + rand()%4000; + }else Frostbreath_Timer -= diff; + + //MassiveGeyser_Timer + if (MassiveGeyser_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MASSIVEGEYSER); + DoResetThreat(); + + MassiveGeyser_Timer = 22000 + rand()%10000; + }else MassiveGeyser_Timer -= diff; + + //Slam_Timer + if (Slam_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_grilek.cpp new file mode 100644 index 00000000000..696bcded32d --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_zulgurub.h" + +#define SPELL_AVARTAR 24646 //The Enrage Spell +#define SPELL_GROUNDTREMOR 6524 + +struct TRINITY_DLL_DECL 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(m_creature, SPELL_AVARTAR); + Unit* target = NULL; + + target = SelectUnit(SELECT_TARGET_RANDOM,1); + + if (DoGetThreat(m_creature->getVictim())) + DoModifyThreatPercent(m_creature->getVictim(),-50); + if (target) + AttackStart(target); + + Avartar_Timer = 25000 + rand()%10000; + }else Avartar_Timer -= diff; + + //GroundTremor_Timer + if (GroundTremor_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_hakkar.cpp new file mode 100644 index 00000000000..2fb48ae3a5d --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //BloodSiphon_Timer + if (BloodSiphon_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_BLOODSIPHON); + BloodSiphon_Timer = 90000; + }else BloodSiphon_Timer -= diff; + + //CorruptedBlood_Timer + if (CorruptedBlood_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CORRUPTEDBLOOD); + CorruptedBlood_Timer = 30000 + rand()%15000; + }else CorruptedBlood_Timer -= diff; + + //CauseInsanity_Timer + /*if (CauseInsanity_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_CAUSEINSANITY); + + CauseInsanity_Timer = 35000 + rand()%8000; + }else CauseInsanity_Timer -= diff;*/ + + //WillOfHakkar_Timer + if (WillOfHakkar_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_WILLOFHAKKAR); + + WillOfHakkar_Timer = 25000 + rand()%10000; + }else WillOfHakkar_Timer -= diff; + + if (!Enraged && Enrage_Timer < diff) + { + DoCast(m_creature, 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(m_creature->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(m_creature->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(m_creature->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(m_creature,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(m_creature,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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.cpp new file mode 100644 index 00000000000..05ab262c21c --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_hazzarah.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_Hazzarah +SD%Complete: 100 +SDComment: +SDCategory: Zul'Gurub +EndScriptData */ + +#include "precompiled.h" +#include "def_zulgurub.h" + +#define SPELL_MANABURN 26046 +#define SPELL_SLEEP 24664 + +struct TRINITY_DLL_DECL boss_hazzarahAI : public ScriptedAI +{ + boss_hazzarahAI(Creature *c) : ScriptedAI(c) {} + + uint32 ManaBurn_Timer; + uint32 Sleep_Timer; + uint32 Illusions_Timer; + Creature* Illusion; + + 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(m_creature->getVictim(),SPELL_MANABURN); + ManaBurn_Timer = 8000 + rand()%8000; + }else ManaBurn_Timer -= diff; + + //Sleep_Timer + if (Sleep_Timer < diff) + { + DoCast(m_creature->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* target = NULL; + for(uint8 i = 0; i < 3; ++i) + { + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (!target) + return; + + Illusion = m_creature->SummonCreature(15163,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000); + if (Illusion) + (Illusion->AI())->AttackStart(target); + } + + 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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_jeklik.cpp new file mode 100644 index 00000000000..5b295f35623 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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, m_creature); + DoCast(m_creature,SPELL_BAT_FORM); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_JEKLIK, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (m_creature->getVictim() && m_creature->isAlive()) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 50)) + { + if (Charge_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoCast(target,SPELL_CHARGE); + AttackStart(target); + } + + Charge_Timer = 15000 + rand()%15000; + }else Charge_Timer -= diff; + + if (SonicBurst_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SONICBURST); + SonicBurst_Timer = 8000 + rand()%5000; + }else SonicBurst_Timer -= diff; + + if (Screech_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SCREECH); + Screech_Timer = 18000 + rand()%8000; + }else Screech_Timer -= diff; + + if (SpawnBats_Timer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + + Creature* Bat = NULL; + Bat = m_creature->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (target && Bat) Bat ->AI()->AttackStart(target); + + Bat = m_creature->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (target && Bat) Bat ->AI()->AttackStart(target); + + Bat = m_creature->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (target && Bat) Bat ->AI()->AttackStart(target); + + Bat = m_creature->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (target && Bat) Bat ->AI()->AttackStart(target); + + Bat = m_creature->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (target && Bat) Bat ->AI()->AttackStart(target); + Bat = m_creature->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (target && Bat) Bat ->AI()->AttackStart(target); + + SpawnBats_Timer = 60000; + }else SpawnBats_Timer -= diff; + } + else + { + if (PhaseTwo) + { + if (PhaseTwo && ShadowWordPain_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoCast(target, SPELL_SHADOW_WORD_PAIN); + ShadowWordPain_Timer = 12000 + rand()%6000; + } + }ShadowWordPain_Timer -=diff; + + if (MindFlay_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_MIND_FLAY); + MindFlay_Timer = 16000; + }MindFlay_Timer -=diff; + + if (ChainMindFlay_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature->getVictim(), SPELL_CHAIN_MIND_FLAY); + ChainMindFlay_Timer = 15000 + rand()%15000; + }ChainMindFlay_Timer -=diff; + + if (GreaterHeal_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_GREATERHEAL); + GreaterHeal_Timer = 25000 + rand()%10000; + }GreaterHeal_Timer -=diff; + + if (SpawnFlyingBats_Timer < diff) + { + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (!target) + return; + + Creature* FlyingBat = m_creature->SummonCreature(14965, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (FlyingBat) + FlyingBat->AI()->AttackStart(target); + + SpawnFlyingBats_Timer = 10000 + rand()%5000; + }else SpawnFlyingBats_Timer -=diff; + } + else + { + m_creature->SetDisplayId(15219); + DoResetThreat(); + PhaseTwo = true; + } + } + + DoMeleeAttackIfReady(); + } + } +}; + +//Flying Bat +struct TRINITY_DLL_DECL 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; + + m_creature->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 *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, 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) + { + m_creature->setDeathState(JUST_DIED); + m_creature->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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp new file mode 100644 index 00000000000..e1c5e0ea7c5 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_jindo.cpp @@ -0,0 +1,275 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI +{ + boss_jindoAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + 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, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //BrainWashTotem_Timer + if (BrainWashTotem_Timer < diff) + { + DoCast(m_creature, SPELL_BRAINWASHTOTEM); + BrainWashTotem_Timer = 18000 + rand()%8000; + }else BrainWashTotem_Timer -= diff; + + //HealingWard_Timer + if (HealingWard_Timer < diff) + { + //DoCast(m_creature, SPELL_POWERFULLHEALINGWARD); + m_creature->SummonCreature(14987, m_creature->GetPositionX()+3, m_creature->GetPositionY()-2, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000); + HealingWard_Timer = 14000 + rand()%6000; + }else HealingWard_Timer -= diff; + + //Hex_Timer + if (Hex_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_HEX); + + if (DoGetThreat(m_creature->getVictim())) + DoModifyThreatPercent(m_creature->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* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoCast(target, SPELL_DELUSIONSOFJINDO); + + Creature *Shade = m_creature->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Shade) + Shade->AI()->AttackStart(target); + } + + 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* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + DoTeleportPlayer(target, -11583.7783,-1249.4278,77.5471,4.745); + + if (DoGetThreat(m_creature->getVictim())) + DoModifyThreatPercent(target,-100); + + Creature *Skeletons; + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Skeletons) + Skeletons->AI()->AttackStart(target); + } + + Teleport_Timer = 15000 + rand()%8000; + }else Teleport_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Healing Ward +struct TRINITY_DLL_DECL 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((*m_creature), pInstance->GetData64(DATA_JINDO)); + if (pJindo) + DoCast(pJindo, SPELL_HEAL); + } + Heal_Timer = 3000; + }else Heal_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Shade of Jindo +struct TRINITY_DLL_DECL mob_shade_of_jindoAI : public ScriptedAI +{ + mob_shade_of_jindoAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 ShadowShock_Timer; + + ScriptedInstance *pInstance; + + void Reset() + { + ShadowShock_Timer = 1000; + m_creature->CastSpell(m_creature, SPELL_INVISIBLE,true); + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI (const uint32 diff) + { + + //ShadowShock_Timer + if (ShadowShock_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_mandokir.cpp new file mode 100644 index 00000000000..892e1cdf8b4 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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(m_creature, 23243); + } + + void KilledUnit(Unit* victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + { + ++KillCount; + + if (KillCount == 3) + { + DoScriptText(SAY_DING_KILL, m_creature); + + if (m_pInstance) + { + uint64 JindoGUID = m_pInstance->GetData64(DATA_JINDO); + if (JindoGUID) + { + if (Unit* jTemp = Unit::GetUnit(*m_creature,JindoGUID)) + { + if (jTemp->isAlive()) + DoScriptText(SAY_GRATS_JINDO, jTemp); + } + } + } + DoCast(m_creature, SPELL_LEVEL_UP, true); + KillCount = 0; + } + } + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (m_creature->getVictim() && m_creature->isAlive()) + { + if (!CombatStart) + { + //At combat Start Mandokir is mounted so we must unmount it first + m_creature->Unmount(); + + //And summon his raptor + m_creature->SummonCreature(14988, m_creature->getVictim()->GetPositionX(), m_creature->getVictim()->GetPositionY(), m_creature->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(*m_creature, WatchTarget); + + if (pUnit && ( + targetX != pUnit->GetPositionX() || + targetY != pUnit->GetPositionY() || + targetZ != pUnit->GetPositionZ() || + pUnit->isInCombat())) + { + if (m_creature->IsWithinMeleeRange(pUnit)) + { + DoCast(pUnit,24316); + } + else + { + DoCast(pUnit,SPELL_CHARGE); + //m_creature->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, m_creature, 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(*m_creature, WatchTarget); + if (pUnit) + { + targetX = pUnit->GetPositionX(); + targetY = pUnit->GetPositionY(); + targetZ = pUnit->GetPositionZ(); + } + endWatch = false; + } + + if (!someWatched) + { + //Cleave + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 7000; + }else Cleave_Timer -= diff; + + //Whirlwind + if (Whirlwind_Timer < diff) + { + DoCast(m_creature,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::iterator i = m_creature->getThreatManager().getThreatList().begin(); + for(; i != m_creature->getThreatManager().getThreatList().end(); ++i) + { + Unit* pUnit = Unit::GetUnit(*m_creature, (*i)->getUnitGuid()); + if (pUnit && m_creature->IsWithinMeleeRange(pUnit)) + TargetInRange++; + } + + if (TargetInRange > 3) + DoCast(m_creature->getVictim(),SPELL_FEAR); + + Fear_Timer = 4000; + }else Fear_Timer -=diff; + + //Mortal Strike if target below 50% hp + if (m_creature->getVictim() && m_creature->getVictim()->GetHealth() < m_creature->getVictim()->GetMaxHealth()*0.5) + { + if (MortalStrike_Timer < diff) + { + DoCast(m_creature->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(m_creature, SPELL_ENRAGE); + RaptorDead = true; + } + } + } + + Check_Timer = 1000; + }else Check_Timer -= diff; + + DoMeleeAttackIfReady(); + } + } +}; + +//Ohgan +struct TRINITY_DLL_DECL 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(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_marli.cpp new file mode 100644 index 00000000000..595716f1487 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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; + + Creature *Spider; + 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, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + if (m_pInstance) + m_pInstance->SetData(TYPE_MARLI, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (m_creature->getVictim() && m_creature->isAlive()) + { + if (PoisonVolley_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_POISONVOLLEY); + PoisonVolley_Timer = 10000 + rand()%10000; + }else PoisonVolley_Timer -= diff; + + if (!PhaseTwo && Aspect_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ASPECT_OF_MARLI); + Aspect_Timer = 13000 + rand()%5000; + }else Aspect_Timer -= diff; + + if (!Spawned && SpawnStartSpiders_Timer < diff) + { + DoScriptText(SAY_SPIDER_SPAWN, m_creature); + + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (!target) + return; + + Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Spider) + Spider->AI()->AttackStart(target); + Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Spider) + Spider->AI()->AttackStart(target); + Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Spider) + Spider->AI()->AttackStart(target); + Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Spider) + Spider->AI()->AttackStart(target); + + Spawned = true; + }else SpawnStartSpiders_Timer -= diff; + + if (SpawnSpider_Timer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (!target) + return; + + Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Spider) + Spider->AI()->AttackStart(target); + SpawnSpider_Timer = 12000 + rand()%5000; + }else SpawnSpider_Timer -= diff; + + if (!PhaseTwo && Transform_Timer < diff) + { + DoScriptText(SAY_TRANSFORM, m_creature); + DoCast(m_creature,SPELL_SPIDER_FORM); + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); + m_creature->UpdateDamagePhysical(BASE_ATTACK); + DoCast(m_creature->getVictim(),SPELL_ENVOLWINGWEB); + + if (DoGetThreat(m_creature->getVictim())) + DoModifyThreatPercent(m_creature->getVictim(),-100); + + PhaseTwo = true; + Transform_Timer = 35000 + rand()%25000; + }else Transform_Timer -= diff; + + if (PhaseTwo) + { + if (Charge_Timer < diff) + { + Unit* target = NULL; + int i = 0 ; + while (i < 3) // max 3 tries to get a random target with power_mana + { + ++i; //not aggro leader + target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target) + if (target->getPowerType() == POWER_MANA) + i=3; + } + if (target) + { + DoCast(target, SPELL_CHARGE); + //m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); + //m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); + AttackStart(target); + } + + Charge_Timer = 8000; + }else Charge_Timer -= diff; + + if (TransformBack_Timer < diff) + { + m_creature->SetDisplayId(15220); + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); + m_creature->UpdateDamagePhysical(BASE_ATTACK); + + PhaseTwo = false; + TransformBack_Timer = 25000 + rand()%15000; + }else TransformBack_Timer -= diff; + + } + + DoMeleeAttackIfReady(); + } + } +}; + +//Spawn of Marli +struct TRINITY_DLL_DECL 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(m_creature,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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_renataki.cpp new file mode 100644 index 00000000000..608897ad18d --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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) + { + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); + m_creature->SetDisplayId(11686); + + m_creature->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* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + { + DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); + DoCast(target,SPELL_AMBUSH); + } + + Ambushed = true; + Ambush_Timer = 3000; + }else Ambush_Timer -= diff; + } + + if (Ambushed) + { + if (Visible_Timer < diff) + { + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); + + m_creature->SetDisplayId(15268); + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); + + m_creature->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* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + + if (DoGetThreat(m_creature->getVictim())) + DoModifyThreatPercent(m_creature->getVictim(),-50); + + if (target) + AttackStart(target); + + Aggro_Timer = 7000 + rand()%13000; + }else Aggro_Timer -= diff; + + if (!Invisible) + if (ThousandBlades_Timer < diff) + { + DoCast(m_creature->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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_thekal.cpp new file mode 100644 index 00000000000..4c40702b691 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + 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((*m_creature), 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((*m_creature), 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(m_creature->getVictim(),SPELL_MORTALCLEAVE); + MortalCleave_Timer = 15000 + rand()%5000; + }else MortalCleave_Timer -= diff; + + if (!PhaseTwo && Silence_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SILENCE); + Silence_Timer = 20000 + rand()%5000; + }else Silence_Timer -= diff; + + if (!PhaseTwo && !WasDead && m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); + m_creature->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(m_creature,SPELL_TIGER_FORM); + m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetHealth(int(m_creature->GetMaxHealth()*1.0)); + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40))); + m_creature->UpdateDamagePhysical(BASE_ATTACK); + DoResetThreat(); + PhaseTwo = true; + }else Resurrect_Timer -= diff; + } + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() == 100) && WasDead) + { + WasDead = false; + } + + if (PhaseTwo) + { + if (Charge_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoCast(target,SPELL_CHARGE); + DoResetThreat(); + AttackStart(target); + } + + Charge_Timer = 15000 + rand()%7000; + }else Charge_Timer -= diff; + + if (Frenzy_Timer < diff) + { + DoCast(m_creature,SPELL_FRENZY); + Frenzy_Timer = 30000; + }else Frenzy_Timer -= diff; + + if (ForcePunch_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SILENCE); + ForcePunch_Timer = 16000 + rand()%5000; + }else ForcePunch_Timer -= diff; + + if (SummonTigers_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SUMMONTIGERS); + SummonTigers_Timer = 10000 + rand()%4000; + }else SummonTigers_Timer -= diff; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11) && !Enraged) + { + DoCast(m_creature, SPELL_ENRAGE); + Enraged = true; + } + } + + DoMeleeAttackIfReady(); + + } +}; + +//Zealot Lor'Khan +struct TRINITY_DLL_DECL 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); + + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + m_creature->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(m_creature,SPELL_SHIELD); + Shield_Timer = 61000; + }else Shield_Timer -= diff; + + //BloodLust_Timer + if (BloodLust_Timer < diff) + { + DoCast(m_creature,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((*m_creature), m_pInstance->GetData64(DATA_THEKAL)); + Unit *pZath = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_ZATH)); + + if (!pThekal || !pZath) + return; + + switch(rand()%2) + { + case 0: + if (m_creature->IsWithinMeleeRange(pThekal)) + DoCast(pThekal, SPELL_GREATERHEAL); + break; + case 1: + if (m_creature->IsWithinMeleeRange(pZath)) + DoCast(pZath, SPELL_GREATERHEAL); + break; + } + } + + GreaterHeal_Timer = 15000+rand()%5000; + }else GreaterHeal_Timer -= diff; + + //Disarm_Timer + if (Disarm_Timer < diff) + { + DoCast(m_creature->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((*m_creature), 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((*m_creature), 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 (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); + m_creature->setFaction(35); + m_creature->AttackStop(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_LORKHAN, SPECIAL); + + FakeDeath = true; + } + + DoMeleeAttackIfReady(); + } +}; + +//Zealot Zath +struct TRINITY_DLL_DECL 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); + + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->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(m_creature->getVictim(),SPELL_SWEEPINGSTRIKES); + SweepingStrikes_Timer = 22000+rand()%4000; + }else SweepingStrikes_Timer -= diff; + + //SinisterStrike_Timer + if (SinisterStrike_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SINISTERSTRIKE); + SinisterStrike_Timer = 8000+rand()%8000; + }else SinisterStrike_Timer -= diff; + + //Gouge_Timer + if (Gouge_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_GOUGE); + + if (DoGetThreat(m_creature->getVictim())) + DoModifyThreatPercent(m_creature->getVictim(),-100); + + Gouge_Timer = 17000+rand()%10000; + }else Gouge_Timer -= diff; + + //Kick_Timer + if (Kick_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KICK); + Kick_Timer = 15000+rand()%10000; + }else Kick_Timer -= diff; + + //Blind_Timer + if (Blind_Timer < diff) + { + DoCast(m_creature->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((*m_creature), 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((*m_creature), 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 (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); + m_creature->setFaction(35); + m_creature->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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp new file mode 100644 index 00000000000..1376db2d259 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_venoxis.cpp @@ -0,0 +1,200 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 "precompiled.h" +#include "def_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 TRINITY_DLL_DECL 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, m_creature); + if (m_pInstance) + m_pInstance->SetData(TYPE_VENOXIS, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 50)) + { + if (Dispell_Timer < diff) + { + DoCast(m_creature, SPELL_DISPELL); + Dispell_Timer = 15000 + rand()%15000; + }else Dispell_Timer -= diff; + + if (Renew_Timer < diff) + { + DoCast(m_creature, SPELL_RENEW); + Renew_Timer = 20000 + rand()%10000; + }else Renew_Timer -= diff; + + if (HolyWrath_Timer < diff) + { + DoCast(m_creature->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* target = SelectUnit(SELECT_TARGET_TOPAGGRO,i)) + if (m_creature->IsWithinMeleeRange(target)) + TargetInRange++; + } + + if (TargetInRange > 1) + { + DoCast(m_creature->getVictim(),SPELL_HOLY_NOVA); + HolyNova_Timer = 1000; + } + else + { + HolyNova_Timer = 2000; + } + + }else HolyNova_Timer -= diff; + + if (HolyFire_Timer < diff && TargetInRange < 3) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_HOLY_FIRE); + + HolyFire_Timer = 8000; + }else HolyFire_Timer -= diff; + } + else + { + if (!PhaseTwo) + { + DoScriptText(SAY_TRANSFORM, m_creature); + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_SNAKE_FORM); + m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); + const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 25))); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 25))); + m_creature->UpdateDamagePhysical(BASE_ATTACK); + DoResetThreat(); + PhaseTwo = true; + } + + if (PhaseTwo && PoisonCloud_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_POISON_CLOUD); + PoisonCloud_Timer = 15000; + }PoisonCloud_Timer -=diff; + + if (PhaseTwo && VenomSpit_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_VENOMSPIT); + + VenomSpit_Timer = 15000 + rand()%5000; + }else VenomSpit_Timer -= diff; + + if (PhaseTwo && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11)) + { + if (!InBerserk) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, 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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/boss_wushoolay.cpp new file mode 100644 index 00000000000..f0dbbda947a --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_zulgurub.h" + +#define SPELL_LIGHTNINGCLOUD 25033 +#define SPELL_LIGHTNINGWAVE 24819 + +struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_LIGHTNINGCLOUD); + LightningCloud_Timer = 15000 + rand()%5000; + }else LightningCloud_Timer -= diff; + + //LightningWave_Timer + if (LightningWave_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) DoCast(target,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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/def_zulgurub.h b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/def_zulgurub.h new file mode 100644 index 00000000000..3aab5b24b56 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/def_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 +{ + 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/bindings/scripts/scripts/eastern_kingdoms/zulgurub/instance_zulgurub.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/zulgurub/instance_zulgurub.cpp new file mode 100644 index 00000000000..03b3e64c5e6 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/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 "precompiled.h" +#include "def_zulgurub.h" + +struct TRINITY_DLL_DECL 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/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp deleted file mode 100644 index a9cf7b7391f..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/blackrock_depths.cpp +++ /dev/null @@ -1,1294 +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 "precompiled.h" -#include "escortAI.h" -#include "def_blackrock_depths.h" - -/*###### -+## go_shadowforge_brazier -+######*/ - -bool GOHello_go_shadowforge_brazier(Player* pPlayer, GameObject* pGo) -{ - if (ScriptedInstance* pInstance = (ScriptedInstance*)pGo->GetInstanceData()) - { - if (pInstance->GetData(TYPE_LYCEUM) == IN_PROGRESS) - pInstance->SetData(TYPE_LYCEUM, DONE); - else - pInstance->SetData(TYPE_LYCEUM, IN_PROGRESS); - } - return false; -} - -/*###### -## npc_grimstone -######*/ - -enum -{ - 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, AreaTriggerEntry *at) -{ - ScriptedInstance* pInstance = (pPlayer->GetInstanceData()); - - 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 -######*/ - -//TODO: implement quest part of event (different end boss) -struct TRINITY_DLL_DECL 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() - { - m_creature->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 = m_creature->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 = m_creature->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(-1000000, m_creature);//2 - CanWalk = false; - Event_Timer = 5000; - break; - case 1: - DoScriptText(-1000000, m_creature);//4 - CanWalk = false; - Event_Timer = 5000; - break; - case 2: - CanWalk = false; - break; - case 3: - DoScriptText(-1000000, m_creature);//5 - break; - case 4: - DoScriptText(-1000000, m_creature);//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(*m_creature,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(*m_creature,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(-1000000, m_creature);//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; - m_creature->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: - m_creature->SetVisibility(VISIBILITY_ON); - HandleGameObject(DATA_ARENA1, false); - DoScriptText(-1000000, m_creature);//4 - CanWalk = true; - Event_Timer = 0; - break; - case 8: - HandleGameObject(DATA_ARENA2, true); - Event_Timer = 5000; - break; - case 9: - m_creature->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 -######*/ - -#define SPELL_THUNDERCLAP 8732 -#define SPELL_FIREBALLVOLLEY 22425 -#define SPELL_MIGHTYBLOW 14099 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_THUNDERCLAP); - ThunderClap_Timer = 10000; - }else ThunderClap_Timer -= diff; - - //FireballVolley_Timer - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51) - { - if (FireballVolley_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FIREBALLVOLLEY); - FireballVolley_Timer = 15000; - }else FireballVolley_Timer -= diff; - } - - //MightyBlow_Timer - if (MightyBlow_Timer < diff) - { - DoCast(m_creature->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 -######*/ - -#define QUEST_4001 4001 -#define 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 -######*/ - -#define ITEM_THRORIUM_BROTHERHOOD_CONTRACT 18628 -#define ITEM_SULFURON_INGOT 17203 -#define QUEST_A_BINDING_CONTRACT 7604 -#define 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 -######*/ - -#define 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 TRINITY_DLL_DECL npc_dughal_stormwingAI : public npc_escortAI -{ - npc_dughal_stormwingAI(Creature *c) : npc_escortAI(c) {} - - void WaypointReached(uint32 i) - { - switch(i) - { - case 0:m_creature->Say(SAY_DUGHAL_FREE, LANG_UNIVERSAL, PlayerGUID); break; - case 1:pInstance->SetData(DATA_DUGHAL,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; - case 2: - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->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 == m_creature) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->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) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - else - { - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->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 TRINITY_DLL_DECL 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: - m_creature->Say(SAY_WINDSOR_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 7: - m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); - m_creature->Say(SAY_WINDSOR_4_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 10: - m_creature->setFaction(534); - break; - case 12: - m_creature->Say(SAY_WINDSOR_6, LANG_UNIVERSAL, PlayerGUID); - pInstance->SetData(DATA_SUPPLY_ROOM, ENCOUNTER_STATE_IN_PROGRESS); - break; - case 13: - m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK - break; - case 14: - pInstance->SetData(DATA_GATE_SR,0); - m_creature->setFaction(11); - break; - case 16: - m_creature->Say(SAY_WINDSOR_9, LANG_UNIVERSAL, PlayerGUID); - break; - case 17: - m_creature->HandleEmoteCommand(EMOTE_STATE_USESTANDING);//EMOTE_STATE_WORK - break; - case 18: - pInstance->SetData(DATA_GATE_SC,0); - break; - case 19: - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->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(rand()%3) - { - case 0:m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID);break; - case 1:m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID);break; - case 2:m_creature->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) - IsOnHold = false; - if (!pInstance->GetData(DATA_GATE_D) && pInstance->GetData(DATA_DUGHAL) == ENCOUNTER_STATE_NOT_STARTED) - { - m_creature->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) - { - m_creature->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) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - else - { - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->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 TRINITY_DLL_DECL 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: - m_creature->setFaction(11); - m_creature->Say(SAY_REGINALD_WINDSOR_0_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 1: - m_creature->Say(SAY_REGINALD_WINDSOR_0_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 7: - m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); - m_creature->Say(SAY_REGINALD_WINDSOR_5_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 8: - m_creature->Say(SAY_REGINALD_WINDSOR_5_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 11: - m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); - m_creature->Say(SAY_REGINALD_WINDSOR_7_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 12: - m_creature->Say(SAY_REGINALD_WINDSOR_7_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 13: - m_creature->Say(SAY_REGINALD_WINDSOR_7_3, LANG_UNIVERSAL, PlayerGUID); - break; - case 20: - m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); - m_creature->Say(SAY_REGINALD_WINDSOR_13_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 21: - m_creature->Say(SAY_REGINALD_WINDSOR_13_3, LANG_UNIVERSAL, PlayerGUID); - break; - case 23: - m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); - m_creature->Say(SAY_REGINALD_WINDSOR_14_1, LANG_UNIVERSAL, PlayerGUID); - IsOnHold=true; - break; - case 24: - m_creature->Say(SAY_REGINALD_WINDSOR_14_2, LANG_UNIVERSAL, PlayerGUID); - break; - case 31: - m_creature->Say(SAY_REGINALD_WINDSOR_20_1, LANG_UNIVERSAL, PlayerGUID); - break; - case 32: - m_creature->Say(SAY_REGINALD_WINDSOR_20_2, LANG_UNIVERSAL, PlayerGUID); - PlayerStart->GroupEventHappens(QUEST_JAIL_BREAK, m_creature); - pInstance->SetData(DATA_SHILL, ENCOUNTER_STATE_ENDED); - break; - } - } - - void MoveInLineOfSight(Unit *who) - { - if (IsBeingEscorted) - return; - - if (who->GetTypeId() == TYPEID_PLAYER) - { - if (CAST_PLR(who)->GetQuestStatus(4322) == QUEST_STATUS_INCOMPLETE) - { - float Radius = 10.0; - if (m_creature->IsWithinDistInMap(who, Radius)) - { - IsOnHold = false; - Start(true, false, who->GetGUID()); - } - } - } - } - - void EnterCombat(Unit* who) - { - switch(rand()%3) - { - case 0:m_creature->Say(SAY_WINDSOR_AGGRO1, LANG_UNIVERSAL, PlayerGUID);break; - case 1:m_creature->Say(SAY_WINDSOR_AGGRO2, LANG_UNIVERSAL, PlayerGUID);break; - case 2:m_creature->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) - { - IsOnHold = 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); - IsOnHold = 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); - m_creature->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) - { - IsOnHold = false; - pInstance->SetData(DATA_CREST,ENCOUNTER_STATE_ENDED); - } - } - if (pInstance->GetData(DATA_TOBIAS)==ENCOUNTER_STATE_OBJECTIVE_COMPLETED) IsOnHold = 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 TRINITY_DLL_DECL 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 == m_creature) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_ENDED); - } - } - - void WaypointReached(uint32 i) - { - switch(i) - { - case 0:m_creature->Say(SAY_TOBIAS_FREE, LANG_UNIVERSAL, PlayerGUID); break; - case 2: - pInstance->SetData(DATA_TOBIAS,ENCOUNTER_STATE_OBJECTIVE_COMPLETED);break; - case 4: - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->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) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - else - { - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->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 -######*/ - -#define SAY_GOT_BEER -1230000 -#define SPELL_DRUNKEN_RAGE 14872 -#define QUEST_ALE 4295 - -struct TRINITY_DLL_DECL 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 (IsBeingEscorted) - 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: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - break; - case 2: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); - break; - case 3: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ATTACKUNARMED); - break; - case 4: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_KICK); - break; - case 5: - m_creature->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(*m_creature,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/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.cpp deleted file mode 100644 index 1f2147b722c..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_ambassador_flamelash.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_Ambassador_Flamelash -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_FIREBLAST 15573 - -struct TRINITY_DLL_DECL boss_ambassador_flamelashAI : public ScriptedAI -{ - boss_ambassador_flamelashAI(Creature *c) : ScriptedAI(c) {} - - uint32 FireBlast_Timer; - uint32 Spirit_Timer; - int Rand; - int RandX; - int RandY; - Creature* Summoned; - - void Reset() - { - FireBlast_Timer = 2000; - Spirit_Timer = 24000; - } - - void EnterCombat(Unit *who) {} - - void SummonSpirits(Unit* victim) - { - Rand = rand()%10; - switch (rand()%2) - { - case 0: RandX -= Rand; break; - case 1: RandX += Rand; break; - } - Rand = 0; - Rand = rand()%10; - switch (rand()%2) - { - case 0: RandY -= Rand; break; - case 1: RandY += Rand; break; - } - Summoned = DoSpawnCreature(9178, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - if (Summoned) - (Summoned->AI())->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //FireBlast_Timer - if (FireBlast_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FIREBLAST); - FireBlast_Timer = 7000; - }else FireBlast_Timer -= diff; - - //Spirit_Timer - if (Spirit_Timer < diff) - { - SummonSpirits(m_creature->getVictim()); - SummonSpirits(m_creature->getVictim()); - SummonSpirits(m_creature->getVictim()); - SummonSpirits(m_creature->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/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_anubshiah.cpp deleted file mode 100644 index 3ad9458aba4..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define SPELL_SHADOWBOLT 17228 -#define SPELL_CURSEOFTONGUES 15470 -#define SPELL_CURSEOFWEAKNESS 17227 -#define SPELL_DEMONARMOR 11735 -#define SPELL_ENVELOPINGWEB 15471 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_SHADOWBOLT); - ShadowBolt_Timer = 7000; - }else ShadowBolt_Timer -= diff; - - //CurseOfTongues_Timer - if (CurseOfTongues_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_CURSEOFTONGUES); - CurseOfTongues_Timer = 18000; - }else CurseOfTongues_Timer -= diff; - - //CurseOfWeakness_Timer - if (CurseOfWeakness_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS); - CurseOfWeakness_Timer = 45000; - }else CurseOfWeakness_Timer -= diff; - - //DemonArmor_Timer - if (DemonArmor_Timer < diff) - { - DoCast(m_creature,SPELL_DEMONARMOR); - DemonArmor_Timer = 300000; - }else DemonArmor_Timer -= diff; - - //EnvelopingWeb_Timer - if (EnvelopingWeb_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,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/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.cpp deleted file mode 100644 index 2b6e67a7903..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_emperor_dagran_thaurissan.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_Emperor_Dagran_Thaurissan -SD%Complete: 99 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1230001 -#define SAY_SLAY -1230002 - -#define SPELL_HANDOFTHAURISSAN 17492 -#define SPELL_AVATAROFFLAME 15636 - -struct TRINITY_DLL_DECL 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, m_creature); - m_creature->CallForHelp(VISIBLE_RANGE); - } - - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_SLAY, m_creature); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (HandOfThaurissan_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,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(m_creature->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/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp deleted file mode 100644 index 337071c938e..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_general_angerforge.cpp +++ /dev/null @@ -1,168 +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 "precompiled.h" - -#define SPELL_MIGHTYBLOW 14099 -#define SPELL_HAMSTRING 9080 -#define SPELL_CLEAVE 20691 - -struct TRINITY_DLL_DECL 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; - int Rand1; - int Rand1X; - int Rand1Y; - int Rand2; - int Rand2X; - int Rand2Y; - Creature* SummonedAdds; - Creature* SummonedMedics; - - void Reset() - { - MightyBlow_Timer = 8000; - HamString_Timer = 12000; - Cleave_Timer = 16000; - Adds_Timer = 0; - Medics = false; - } - - void EnterCombat(Unit *who) - { - } - - void SummonAdds(Unit* victim) - { - Rand1 = rand()%15; - switch (rand()%2) - { - case 0: Rand1X = 0 - Rand1; break; - case 1: Rand1X = 0 + Rand1; break; - } - Rand1 = 0; - Rand1 = rand()%15; - switch (rand()%2) - { - case 0: Rand1Y = 0 - Rand1; break; - case 1: Rand1Y = 0 + Rand1; break; - } - Rand1 = 0; - SummonedAdds = DoSpawnCreature(8901, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); - if (SummonedAdds) - (SummonedAdds->AI())->AttackStart(victim); - } - - void SummonMedics(Unit* victim) - { - Rand2 = rand()%10; - switch (rand()%2) - { - case 0: Rand2X = 0 - Rand2; break; - case 1: Rand2X = 0 + Rand2; break; - } - Rand2 = 0; - Rand2 = rand()%10; - switch (rand()%2) - { - case 0: Rand2Y = 0 - Rand2; break; - case 1: Rand2Y = 0 + Rand2; break; - } - Rand2 = 0; - SummonedMedics = DoSpawnCreature(8894, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); - if (SummonedMedics) - (SummonedMedics->AI())->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //MightyBlow_Timer - if (MightyBlow_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW); - MightyBlow_Timer = 18000; - }else MightyBlow_Timer -= diff; - - //HamString_Timer - if (HamString_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_HAMSTRING); - HamString_Timer = 15000; - }else HamString_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 9000; - }else Cleave_Timer -= diff; - - //Adds_Timer - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21) - { - if (Adds_Timer < diff) - { - // summon 3 Adds every 25s - SummonAdds(m_creature->getVictim()); - SummonAdds(m_creature->getVictim()); - SummonAdds(m_creature->getVictim()); - - Adds_Timer = 25000; - } else Adds_Timer -= diff; - } - - //Summon Medics - if (!Medics && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21) - { - SummonMedics(m_creature->getVictim()); - SummonMedics(m_creature->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/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp deleted file mode 100644 index a4400e4d663..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_gorosh_the_dervish.cpp +++ /dev/null @@ -1,82 +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 "precompiled.h" - -#define SPELL_WHIRLWIND 15589 -#define SPELL_MORTALSTRIKE 24573 - -struct TRINITY_DLL_DECL 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(m_creature,SPELL_WHIRLWIND); - WhirlWind_Timer = 15000; - }else WhirlWind_Timer -= diff; - - //MortalStrike_Timer - if (MortalStrike_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp deleted file mode 100644 index faaa8f0a069..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_grizzle.cpp +++ /dev/null @@ -1,89 +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 "precompiled.h" - -#define EMOTE_GENERIC_FRENZY_KILL -1000001 - -#define SPELL_GROUNDTREMOR 6524 -#define SPELL_FRENZY 28371 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_GROUNDTREMOR); - GroundTremor_Timer = 8000; - }else GroundTremor_Timer -= diff; - - //Frenzy_Timer - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51) - { - if (Frenzy_Timer < diff) - { - DoCast(m_creature,SPELL_FRENZY); - DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); - - 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/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_high_interrogator_gerstahn.cpp deleted file mode 100644 index c2c97a9ec8a..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define SPELL_SHADOWWORDPAIN 10894 -#define SPELL_MANABURN 10876 -#define SPELL_PSYCHICSCREAM 8122 -#define SPELL_SHADOWSHIELD 22417 - -struct TRINITY_DLL_DECL 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) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target)DoCast(target,SPELL_SHADOWWORDPAIN); - ShadowWordPain_Timer = 7000; - }else ShadowWordPain_Timer -= diff; - - //ManaBurn_Timer - if (ManaBurn_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target)DoCast(target,SPELL_MANABURN); - ManaBurn_Timer = 10000; - }else ManaBurn_Timer -= diff; - - //PsychicScream_Timer - if (PsychicScream_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_PSYCHICSCREAM); - PsychicScream_Timer = 30000; - }else PsychicScream_Timer -= diff; - - //ShadowShield_Timer - if (ShadowShield_Timer < diff) - { - DoCast(m_creature,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/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.cpp deleted file mode 100644 index d0b97116c28..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_magmus.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_Magmus -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Depths -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_FIERYBURST 13900 -#define SPELL_WARSTOMP 24375 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_FIERYBURST); - FieryBurst_Timer = 6000; - }else FieryBurst_Timer -= diff; - - //WarStomp_Timer - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51) - { - if (WarStomp_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_WARSTOMP); - WarStomp_Timer = 8000; - }else WarStomp_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; -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/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.cpp deleted file mode 100644 index 7602a14fbfe..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_moira_bronzebeard.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_Moira_Bronzbeard -SD%Complete: 90 -SDComment: Healing of Emperor NYI -SDCategory: Blackrock Depths -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_HEAL 10917 -#define SPELL_RENEW 10929 -#define SPELL_SHIELD 10901 -#define SPELL_MINDBLAST 10947 -#define SPELL_SHADOWWORDPAIN 10894 -#define SPELL_SMITE 10934 - -struct TRINITY_DLL_DECL boss_moira_bronzebeardAI : public ScriptedAI -{ - boss_moira_bronzebeardAI(Creature *c) : ScriptedAI(c) {} - - uint32 Heal_Timer; - uint32 MindBlast_Timer; - uint32 ShadowWordPain_Timer; - uint32 Smite_Timer; - Unit* PlayerHolder; - Unit* Target; - bool Heal; - - void Reset() - { - Target = NULL; - 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(m_creature->getVictim(),SPELL_MINDBLAST); - MindBlast_Timer = 14000; - }else MindBlast_Timer -= diff; - - //ShadowWordPain_Timer - if (ShadowWordPain_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN); - ShadowWordPain_Timer = 18000; - }else ShadowWordPain_Timer -= diff; - - //Smite_Timer - if (Smite_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp deleted file mode 100644 index d7ee6a6667c..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/boss_tomb_of_seven.cpp +++ /dev/null @@ -1,249 +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 "precompiled.h" -#include "def_blackrock_depths.h" - -enum -{ - SPELL_SMELT_DARK_IRON = 14891, - SPELL_LEARN_SMELT = 14894, - QUEST_SPECTRAL_CHALICE = 4083, - 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_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) >= 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) >= SKILLPOINT_MIN) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TRIBUTE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), 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, "[PH] Continue...", 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 -{ - SPELL_SHADOWBOLTVOLLEY = 15245, - SPELL_IMMOLATE = 12742, - SPELL_CURSEOFWEAKNESS = 12493, - SPELL_DEMONARMOR = 13787, - SPELL_SUMMON_VOIDWALKERS = 15092 -}; - -struct TRINITY_DLL_DECL 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; - int Rand; - int RandX; - int RandY; - Creature* Summoned; - - void Reset() - { - ShadowVolley_Timer = 10000; - Immolate_Timer = 18000; - CurseOfWeakness_Timer = 5000; - DemonArmor_Timer = 16000; - Voidwalkers = false; - - m_creature->setFaction(FACTION_FRIEND); - - // was set before event start, so set again - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - - if (pInstance) - if (pInstance->GetData(DATA_GHOSTKILL) >= 7) - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - else - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - } - - void EnterCombat(Unit *who) - { - } - - void EnterEvadeMode() - { - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - m_creature->LoadCreaturesAddon(); - if (m_creature->isAlive()) - m_creature->GetMotionMaster()->MoveTargetedHome(); - m_creature->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(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY); - ShadowVolley_Timer = 12000; - }else ShadowVolley_Timer -= diff; - - //Immolate_Timer - if (Immolate_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_IMMOLATE); - - Immolate_Timer = 25000; - }else Immolate_Timer -= diff; - - //CurseOfWeakness_Timer - if (CurseOfWeakness_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CURSEOFWEAKNESS); - CurseOfWeakness_Timer = 45000; - }else CurseOfWeakness_Timer -= diff; - - //DemonArmor_Timer - if (DemonArmor_Timer < diff) - { - DoCast(m_creature,SPELL_DEMONARMOR); - DemonArmor_Timer = 300000; - }else DemonArmor_Timer -= diff; - - //Summon Voidwalkers - if (!Voidwalkers && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51) - { - m_creature->CastSpell(m_creature->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!" - -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, "[PH] Continue...", 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_NOT_ATTACKABLE_2); - 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/bindings/scripts/scripts/zone/blackrock_depths/def_blackrock_depths.h b/src/bindings/scripts/scripts/zone/blackrock_depths/def_blackrock_depths.h deleted file mode 100644 index 6ce124a7c3e..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/def_blackrock_depths.h +++ /dev/null @@ -1,38 +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 -{ - 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 -}; -#endif - diff --git a/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp b/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp deleted file mode 100644 index f8993b36124..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_depths/instance_blackrock_depths.cpp +++ /dev/null @@ -1,424 +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 "precompiled.h" -#include "def_blackrock_depths.h" - -#define TIMER_TOMBOFTHESEVEN 15000 - -enum -{ - 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, - - 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_GOLEM_ROOM_N = 170573, - GO_GOLEM_ROOM_S = 170574, - GO_THONE_ROOM = 170575, - - GO_SPECTRAL_CHALICE = 164869, - GO_CHEST_SEVEN = 169243 -}; - -struct TRINITY_DLL_DECL 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 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 GoGolemNGUID; - uint64 GoGolemSGUID; - uint64 GoThoneGUID; - 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; - - 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; - GoGolemNGUID = 0; - GoGolemSGUID = 0; - GoThoneGUID = 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; - } - } - - 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_GOLEM_ROOM_N: GoGolemNGUID = pGo->GetGUID(); break; - case GO_GOLEM_ROOM_S: GoGolemSGUID = pGo->GetGUID(); break; - case GO_THONE_ROOM: GoThoneGUID = 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; - } - 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_NOT_ATTACKABLE_2); - if (Unit* target = boss->SelectNearestTarget(500)) - boss->AI()->AttackStart(target); - } - } - } - - 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(); - }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/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_drakkisath.cpp deleted file mode 100644 index 72bc0aa6bd2..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.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 TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_FIRENOVA); - FireNova_Timer = 10000; - }else FireNova_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 8000; - }else Cleave_Timer -= diff; - - //Confliguration_Timer - if (Confliguration_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CONFLIGURATION); - Confliguration_Timer = 18000; - }else Confliguration_Timer -= diff; - - //Thunderclap_Timer - if (Thunderclap_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp deleted file mode 100644 index 4a6a01af71d..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_gyth.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Gyth -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_CORROSIVEACID 20667 -#define SPELL_FREEZE 18763 -#define SPELL_FLAMEBREATH 20712 - -struct TRINITY_DLL_DECL 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; - Creature *SummonedCreature; - - 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 - m_creature->SetDisplayId(11686); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit *who) - { - } - - void SummonCreatureWithRandomTarget(uint32 creatureId) - { - Unit* Summoned = m_creature->SummonCreature(creatureId, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 240000); - if (Summoned) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - Summoned->AddThreat(target, 1.0f); - } - } - - void UpdateAI(const uint32 diff) - { - //char buf[200]; - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (!RootSelf) - { - //m_creature->m_canMove = true; - DoCast(m_creature, 33356); - RootSelf = true; - } - - if (!bAggro && Line1Count == 0 && Line2Count == 0) - { - if (Aggro_Timer < diff) - { - bAggro = true; - // Visible now! - m_creature->SetDisplayId(9723); - m_creature->setFaction(14); - m_creature->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(m_creature->getVictim(), SPELL_CORROSIVEACID); - CorrosiveAcid_Timer = 7000; - } else CorrosiveAcid_Timer -= diff; - - // Freeze_Timer - if (Freeze_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FREEZE); - Freeze_Timer = 16000; - } else Freeze_Timer -= diff; - - // Flamebreath_Timer - if (Flamebreath_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FLAMEBREATH); - Flamebreath_Timer = 10500; - } else Flamebreath_Timer -= diff; - - //Summon Rend - if (!SummonedRend && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11 - && m_creature->GetHealth() > 0) - { - //summon Rend and Change model to normal Gyth - //Inturrupt any spell casting - m_creature->InterruptNonMeleeSpells(false); - //Gyth model - m_creature->SetDisplayId(9806); - m_creature->SummonCreature(10429, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->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/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_halycon.cpp deleted file mode 100644 index 1727105427b..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.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 TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_CROWDPUMMEL); - CrowdPummel_Timer = 14000; - }else CrowdPummel_Timer -= diff; - - //MightyBlow_Timer - if (MightyBlow_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MIGHTYBLOW); - MightyBlow_Timer = 10000; - }else MightyBlow_Timer -= diff; - - //Summon Gizrul - if (!Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25) - { - m_creature->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/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_highlord_omokk.cpp deleted file mode 100644 index 06dee5b5775..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.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 TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_WARSTOMP); - WarStomp_Timer = 14000; - }else WarStomp_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 8000; - }else Cleave_Timer -= diff; - - //Strike_Timer - if (Strike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_STRIKE); - Strike_Timer = 10000; - }else Strike_Timer -= diff; - - //Rend_Timer - if (Rend_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_REND); - Rend_Timer = 18000; - }else Rend_Timer -= diff; - - //SunderArmor_Timer - if (SunderArmor_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SUNDERARMOR); - SunderArmor_Timer = 25000; - }else SunderArmor_Timer -= diff; - - //KnockAway_Timer - if (KnockAway_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY); - KnockAway_Timer = 12000; - }else KnockAway_Timer -= diff; - - //Slow_Timer - if (Slow_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_mother_smolderweb.cpp deleted file mode 100644 index 0bc2f9d2370..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define SPELL_CRYSTALIZE 16104 -#define SPELL_MOTHERSMILK 16468 -#define SPELL_SUMMON_SPIRE_SPIDERLING 16103 - -struct TRINITY_DLL_DECL 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 (m_creature->GetHealth() <= damage) - m_creature->CastSpell(m_creature,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(m_creature,SPELL_CRYSTALIZE); - Crystalize_Timer = 15000; - }else Crystalize_Timer -= diff; - - //MothersMilk_Timer - if (MothersMilk_Timer < diff) - { - DoCast(m_creature,SPELL_MOTHERSMILK); - MothersMilk_Timer = 5000+rand()%7500; - }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/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp deleted file mode 100644 index 0931db0319a..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_overlord_wyrmthalak.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Overlord_Wyrmthalak -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ - -#include "precompiled.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 TRINITY_DLL_DECL boss_overlordwyrmthalakAI : public ScriptedAI -{ - boss_overlordwyrmthalakAI(Creature *c) : ScriptedAI(c) {} - - uint32 BlastWave_Timer; - uint32 Shout_Timer; - uint32 Cleave_Timer; - uint32 Knockaway_Timer; - bool Summoned; - Creature *SummonedCreature; - - 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(m_creature->getVictim(),SPELL_BLASTWAVE); - BlastWave_Timer = 20000; - }else BlastWave_Timer -= diff; - - //Shout_Timer - if (Shout_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SHOUT); - Shout_Timer = 10000; - }else Shout_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 7000; - }else Cleave_Timer -= diff; - - //Knockaway_Timer - if (Knockaway_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY); - Knockaway_Timer = 14000; - }else Knockaway_Timer -= diff; - - //Summon two Beserks - if (!Summoned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 51) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - - SummonedCreature = m_creature->SummonCreature(9216,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,300000); - if (SummonedCreature) - (SummonedCreature->AI())->AttackStart(target); - SummonedCreature = m_creature->SummonCreature(9268,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,300000); - if (SummonedCreature) - (SummonedCreature->AI())->AttackStart(target); - 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/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp deleted file mode 100644 index dd4479fbeaa..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_pyroguard_emberseer.cpp +++ /dev/null @@ -1,94 +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 "precompiled.h" - -#define SPELL_FIRENOVA 23462 -#define SPELL_FLAMEBUFFET 23341 -#define SPELL_PYROBLAST 17274 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_FIRENOVA); - FireNova_Timer = 6000; - }else FireNova_Timer -= diff; - - //FlameBuffet_Timer - if (FlameBuffet_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FLAMEBUFFET); - FlameBuffet_Timer = 14000; - }else FlameBuffet_Timer -= diff; - - //PyroBlast_Timer - if (PyroBlast_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,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/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_quartermaster_zigris.cpp deleted file mode 100644 index c2db9b7f750..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define SPELL_SHOOT 16496 -#define SPELL_STUNBOMB 16497 -#define SPELL_HEALING_POTION 15504 -#define SPELL_HOOKEDNET 15609 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_SHOOT); - Shoot_Timer = 500; - }else Shoot_Timer -= diff; - - //StunBomb_Timer - if (StunBomb_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_rend_blackhand.cpp deleted file mode 100644 index 2899b05deb6..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define SPELL_WHIRLWIND 26038 -#define SPELL_CLEAVE 20691 -#define SPELL_THUNDERCLAP 23931 //Not sure if he cast this spell - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_WHIRLWIND); - WhirlWind_Timer = 18000; - }else WhirlWind_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 10000; - }else Cleave_Timer -= diff; - - //Thunderclap_Timer - if (Thunderclap_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.cpp deleted file mode 100644 index ae44306cf30..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_shadow_hunter_voshgajin.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_Shadow_Hunter_Voshgajin -SD%Complete: 100 -SDComment: -SDCategory: Blackrock Spire -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_CURSEOFBLOOD 24673 -#define SPELL_HEX 16708 -#define SPELL_CLEAVE 20691 - -struct TRINITY_DLL_DECL 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; - - //m_creature->CastSpell(m_creature,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(m_creature->getVictim(),SPELL_CURSEOFBLOOD); - CurseOfBlood_Timer = 45000; - }else CurseOfBlood_Timer -= diff; - - //Hex_Timer - if (Hex_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_HEX); - Hex_Timer = 15000; - }else Hex_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp deleted file mode 100644 index 802ab32cc80..00000000000 --- a/src/bindings/scripts/scripts/zone/blackrock_spire/boss_the_beast.cpp +++ /dev/null @@ -1,94 +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 "precompiled.h" - -#define SPELL_FLAMEBREAK 16785 -#define SPELL_IMMOLATE 20294 -#define SPELL_TERRIFYINGROAR 14100 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_FLAMEBREAK); - Flamebreak_Timer = 10000; - }else Flamebreak_Timer -= diff; - - //Immolate_Timer - if (Immolate_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_IMMOLATE); - Immolate_Timer = 8000; - }else Immolate_Timer -= diff; - - //TerrifyingRoar_Timer - if (TerrifyingRoar_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp b/src/bindings/scripts/scripts/zone/blackrock_spire/boss_warmaster_voone.cpp deleted file mode 100644 index 2257a290a1b..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.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 TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_SNAPKICK); - Snapkick_Timer = 6000; - }else Snapkick_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 12000; - }else Cleave_Timer -= diff; - - //Uppercut_Timer - if (Uppercut_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_UPPERCUT); - Uppercut_Timer = 14000; - }else Uppercut_Timer -= diff; - - //MortalStrike_Timer - if (MortalStrike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE); - MortalStrike_Timer = 10000; - }else MortalStrike_Timer -= diff; - - //Pummel_Timer - if (Pummel_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_PUMMEL); - Pummel_Timer = 16000; - }else Pummel_Timer -= diff; - - //ThrowAxe_Timer - if (ThrowAxe_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_broodlord_lashlayer.cpp deleted file mode 100644 index 48a2888c1e6..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.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 TRINITY_DLL_DECL 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, m_creature); - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 7000; - }else Cleave_Timer -= diff; - - // BlastWave - if (BlastWave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_BLASTWAVE); - BlastWave_Timer = 8000 + rand()%8000; - }else BlastWave_Timer -= diff; - - //MortalStrike_Timer - if (MortalStrike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MORTALSTRIKE); - MortalStrike_Timer = 25000 + rand()%10000; - }else MortalStrike_Timer -= diff; - - if (KnockBack_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KNOCKBACK); - //Drop 50% aggro - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-50); - - KnockBack_Timer = 15000 + rand()%15000; - }else KnockBack_Timer -= diff; - - if (EnterEvadeIfOutOfCombatArea(diff)) - DoScriptText(SAY_LEASH, m_creature); - - 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/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp deleted file mode 100644 index 7b3e04f9d37..00000000000 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_chromaggus.cpp +++ /dev/null @@ -1,316 +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 "precompiled.h" - -#define EMOTE_FRENZY -1469002 -#define EMOTE_SHIMMER -1469003 - -//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% -#define SPELL_FIRE_VURNALBILTY 22277 -#define SPELL_FROST_VURNALBILTY 22278 -#define SPELL_SHADOW_VURNALBILTY 22279 -#define SPELL_NATURE_VURNALBILTY 22280 -#define SPELL_ARCANE_VURNALBILTY 22281 - -#define SPELL_INCINERATE 23308 //Incinerate 23308,23309 -#define SPELL_TIMELAPSE 23310 //Time lapse 23310, 23311(old threat mod that was removed in 2.01) -#define SPELL_CORROSIVEACID 23313 //Corrosive Acid 23313, 23314 -#define SPELL_IGNITEFLESH 23315 //Ignite Flesh 23315,23316 -#define 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 -#define SPELL_BROODAF_BLUE 23153 //Blue affliction 23153 -#define SPELL_BROODAF_BLACK 23154 //Black affliction 23154 -#define SPELL_BROODAF_RED 23155 //Red affliction 23155 (23168 on death) -#define SPELL_BROODAF_BRONZE 23170 //Bronze Affliction 23170 -#define SPELL_BROODAF_GREEN 23169 //Brood Affliction Green 23169 - -#define SPELL_CHROMATIC_MUT_1 23174 //Spell cast on player if they get all 5 debuffs - -#define SPELL_FRENZY 28371 //The frenzy spell may be wrong -#define SPELL_ENRAGE 28747 - -struct TRINITY_DLL_DECL 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 - srand(time(NULL)); - switch (rand()%20) - { - //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 vurlnability 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 vurlnability spell - if (CurrentVurln_Spell) - m_creature->RemoveAurasDueToSpell(CurrentVurln_Spell); - - //Cast new random vurlnabilty on self - uint32 spell; - switch (rand()%5) - { - case 0: spell = SPELL_FIRE_VURNALBILTY; break; - case 1: spell = SPELL_FROST_VURNALBILTY; break; - case 2: spell = SPELL_SHADOW_VURNALBILTY; break; - case 3: spell = SPELL_NATURE_VURNALBILTY; break; - case 4: spell = SPELL_ARCANE_VURNALBILTY; break; - } - - DoCast(m_creature,spell); - CurrentVurln_Spell = spell; - - DoScriptText(EMOTE_SHIMMER, m_creature); - Shimmer_Timer = 45000; - }else Shimmer_Timer -= diff; - - //Breath1_Timer - if (Breath1_Timer < diff) - { - DoCast(m_creature->getVictim(),Breath1_Spell); - Breath1_Timer = 60000; - }else Breath1_Timer -= diff; - - //Breath2_Timer - if (Breath2_Timer < diff) - { - DoCast(m_creature->getVictim(),Breath2_Spell); - Breath2_Timer = 60000; - }else Breath2_Timer -= diff; - - //Affliction_Timer - if (Affliction_Timer < diff) - { - uint32 SpellAfflict = 0; - - switch (rand()%5) - { - case 0: SpellAfflict = SPELL_BROODAF_BLUE; break; - case 1: SpellAfflict = SPELL_BROODAF_BLACK; break; - case 2: SpellAfflict = SPELL_BROODAF_RED; break; - case 3: SpellAfflict = SPELL_BROODAF_BRONZE; break; - case 4: SpellAfflict = SPELL_BROODAF_GREEN; break; - } - - std::list::iterator i; - - for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end();) - { - Unit* pUnit = NULL; - pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - ++i; - - if (pUnit) - { - //Cast affliction - DoCast(pUnit, SpellAfflict, 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)) - { - //target->RemoveAllAuras(); - //DoCast(target,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(m_creature,SPELL_FRENZY); - DoScriptText(EMOTE_FRENZY, m_creature); - Frenzy_Timer = 10000 + (rand() % 5000); - }else Frenzy_Timer -= diff; - - //Enrage if not already enraged and below 20% - if (!Enraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) - { - DoCast(m_creature,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/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_ebonroc.cpp deleted file mode 100644 index 02f59819516..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define SPELL_SHADOWFLAME 22539 -#define SPELL_WINGBUFFET 18500 -#define SPELL_SHADOWOFEBONROC 23340 -#define SPELL_HEAL 41386 //Thea Heal spell of his Shadow - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_SHADOWFLAME); - ShadowFlame_Timer = 12000 + rand()%3000; - }else ShadowFlame_Timer -= diff; - - //Wing Buffet Timer - if (WingBuffet_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_WINGBUFFET); - WingBuffet_Timer = 25000; - }else WingBuffet_Timer -= diff; - - //Shadow of Ebonroc Timer - if (ShadowOfEbonroc_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SHADOWOFEBONROC); - ShadowOfEbonroc_Timer = 25000 + rand()%10000; - }else ShadowOfEbonroc_Timer -= diff; - - if (m_creature->getVictim()->HasAura(SPELL_SHADOWOFEBONROC)) - { - if (Heal_Timer < diff) - { - DoCast(m_creature, SPELL_HEAL); - Heal_Timer = 1000 + rand()%2000; - }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/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_firemaw.cpp deleted file mode 100644 index bab716acffd..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define SPELL_SHADOWFLAME 22539 -#define SPELL_WINGBUFFET 23339 -#define SPELL_FLAMEBUFFET 23341 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_SHADOWFLAME); - ShadowFlame_Timer = 15000 + rand()%3000; - }else ShadowFlame_Timer -= diff; - - //WingBuffet_Timer - if (WingBuffet_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_WINGBUFFET); - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-75); - - WingBuffet_Timer = 25000; - }else WingBuffet_Timer -= diff; - - //FlameBuffet_Timer - if (FlameBuffet_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_flamegor.cpp deleted file mode 100644 index 5492477193f..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define EMOTE_FRENZY -1469031 - -#define SPELL_SHADOWFLAME 22539 -#define SPELL_WINGBUFFET 23339 -#define SPELL_FRENZY 23342 //This spell periodically triggers fire nova - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_SHADOWFLAME); - ShadowFlame_Timer = 15000 + rand()%7000; - }else ShadowFlame_Timer -= diff; - - //WingBuffet_Timer - if (WingBuffet_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_WINGBUFFET); - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-75); - - WingBuffet_Timer = 25000; - }else WingBuffet_Timer -= diff; - - //Frenzy_Timer - if (Frenzy_Timer < diff) - { - DoScriptText(EMOTE_FRENZY, m_creature); - DoCast(m_creature,SPELL_FRENZY); - Frenzy_Timer = 8000 + (rand()%2000); - }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/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.cpp deleted file mode 100644 index 4ecfda2e329..00000000000 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_nefarian.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_Nefarian -SD%Complete: 80 -SDComment: Some issues with class calls effecting more than one class -SDCategory: Blackwing Lair -EndScriptData */ - -#include "precompiled.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 TRINITY_DLL_DECL 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; - - 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; - } - - void KilledUnit(Unit* Victim) - { - if (rand()%5) - return; - - DoScriptText(SAY_SLAY, m_creature, Victim); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void EnterCombat(Unit *who) - { - switch (rand()%3) - { - case 0: DoScriptText(SAY_XHEALTH, m_creature); break; - case 1: DoScriptText(SAY_AGGRO, m_creature); break; - case 2: DoScriptText(SAY_SHADOWFLAME, m_creature); break; - } - - DoCast(who,SPELL_SHADOWFLAME_INITIAL); - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //ShadowFlame_Timer - if (ShadowFlame_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SHADOWFLAME); - ShadowFlame_Timer = 12000; - }else ShadowFlame_Timer -= diff; - - //BellowingRoar_Timer - if (BellowingRoar_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_BELLOWINGROAR); - BellowingRoar_Timer = 30000; - }else BellowingRoar_Timer -= diff; - - //VeilOfShadow_Timer - if (VeilOfShadow_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_VEILOFSHADOW); - VeilOfShadow_Timer = 15000; - }else VeilOfShadow_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->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(m_creature->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 (rand()%9) - { - case 0: - DoScriptText(SAY_MAGE, m_creature); - DoCast(m_creature,SPELL_MAGE); - break; - case 1: - DoScriptText(SAY_WARRIOR, m_creature); - DoCast(m_creature,SPELL_WARRIOR); - break; - case 2: - DoScriptText(SAY_DRUID, m_creature); - DoCast(m_creature,SPELL_DRUID); - break; - case 3: - DoScriptText(SAY_PRIEST, m_creature); - DoCast(m_creature,SPELL_PRIEST); - break; - case 4: - DoScriptText(SAY_PALADIN, m_creature); - DoCast(m_creature,SPELL_PALADIN); - break; - case 5: - DoScriptText(SAY_SHAMAN, m_creature); - DoCast(m_creature,SPELL_SHAMAN); - break; - case 6: - DoScriptText(SAY_WARLOCK, m_creature); - DoCast(m_creature,SPELL_WARLOCK); - break; - case 7: - DoScriptText(SAY_HUNTER, m_creature); - DoCast(m_creature,SPELL_HUNTER); - break; - case 8: - DoScriptText(SAY_ROGUE, m_creature); - DoCast(m_creature,SPELL_ROGUE); - break; - } - - ClassCall_Timer = 35000 + (rand() % 5000); - }else ClassCall_Timer -= diff; - - //Phase3 begins when we are below X health - if (!Phase3 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) - { - Phase3 = true; - DoScriptText(SAY_RAISE_SKELETONS, m_creature); - } - - 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/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp deleted file mode 100644 index 731e32578d2..00000000000 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_razorgore.cpp +++ /dev/null @@ -1,129 +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 "precompiled.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 TRINITY_DLL_DECL 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, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 7000 + rand()%3000; - }else Cleave_Timer -= diff; - - //WarStomp_Timer - if (WarStomp_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_WARSTOMP); - WarStomp_Timer = 15000 + rand()%10000; - }else WarStomp_Timer -= diff; - - //FireballVolley_Timer - if (FireballVolley_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FIREBALLVOLLEY); - FireballVolley_Timer = 12000 + rand()%3000; - }else FireballVolley_Timer -= diff; - - //Conflagration_Timer - if (Conflagration_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CONFLAGRATION); - //We will remove this threat reduction and add an aura check. - - //if (DoGetThreat(m_creature->getVictim())) - //DoModifyThreatPercent(m_creature->getVictim(),-50); - - Conflagration_Timer = 12000; - }else Conflagration_Timer -= diff; - - // Aura Check. If the gamer is affected by confliguration we attack a random gamer. - if (m_creature->getVictim() && m_creature->getVictim()->HasAura(SPELL_CONFLAGRATION)) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target) - m_creature->TauntApply(target); - } - - 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/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp deleted file mode 100644 index 39fbd1f4be9..00000000000 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_vaelastrasz.cpp +++ /dev/null @@ -1,258 +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 "precompiled.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 TRINITY_DLL_DECL boss_vaelAI : public ScriptedAI -{ - boss_vaelAI(Creature *c) : ScriptedAI(c) - { - c->SetUInt32Value(UNIT_NPC_FLAGS,1); - c->setFaction(35); - c->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - uint64 PlayerGUID; - uint32 SpeachTimer; - uint32 SpeachNum; - uint32 Cleave_Timer; - uint32 FlameBreath_Timer; - uint32 FireNova_Timer; - uint32 BurningAdrenalineCaster_Timer; - uint32 BurningAdrenalineTank_Timer; - uint32 TailSwipe_Timer; - bool HasYelled; - bool DoingSpeach; - - void Reset() - { - PlayerGUID = 0; - SpeachTimer = 0; - SpeachNum = 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; - DoingSpeach = false; - } - - void BeginSpeach(Unit* target) - { - //Stand up and begin speach - PlayerGUID = target->GetGUID(); - - //10 seconds - DoScriptText(SAY_LINE1, m_creature); - - SpeachTimer = 10000; - SpeachNum = 0; - DoingSpeach = true; - } - - void KilledUnit(Unit *victim) - { - if (rand()%5) - return; - - DoScriptText(SAY_KILLTARGET, m_creature, victim); - } - - void EnterCombat(Unit *who) - { - DoCast(m_creature,SPELL_ESSENCEOFTHERED); - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - //Speach - if (DoingSpeach) - { - if (SpeachTimer < diff) - { - switch (SpeachNum) - { - case 0: - //16 seconds till next line - DoScriptText(SAY_LINE2, m_creature); - SpeachTimer = 16000; - SpeachNum++; - 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, m_creature); - SpeachTimer = 10000; - SpeachNum++; - break; - case 2: - m_creature->setFaction(103); - m_creature->SetHealth(int(m_creature->GetMaxHealth()*.3)); - if (PlayerGUID && Unit::GetUnit((*m_creature),PlayerGUID)) - { - AttackStart(Unit::GetUnit((*m_creature),PlayerGUID)); - DoCast(m_creature,SPELL_ESSENCEOFTHERED); - } - SpeachTimer = 0; - DoingSpeach = false; - break; - } - }else SpeachTimer -= diff; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - // Yell if hp lower than 15% - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 15 && !HasYelled) - { - DoScriptText(SAY_HALFLIFE, m_creature); - HasYelled = true; - } - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 15000; - }else Cleave_Timer -= diff; - - //FlameBreath_Timer - if (FlameBreath_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FLAMEBREATH); - FlameBreath_Timer = 4000 + rand()%4000; - }else FlameBreath_Timer -= diff; - - //BurningAdrenalineCaster_Timer - if (BurningAdrenalineCaster_Timer < diff) - { - Unit* target = NULL; - - int i = 0 ; - while (i < 3) // max 3 tries to get a random target with power_mana - { - ++i; - target = SelectUnit(SELECT_TARGET_RANDOM,1);//not aggro leader - if (target) - if (target->getPowerType() == POWER_MANA) - i=3; - } - if (target) // cast on self (see below) - target->CastSpell(target,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 - m_creature->getVictim()->CastSpell(m_creature->getVictim(),SPELL_BURNINGADRENALINE,1); - - BurningAdrenalineTank_Timer = 45000; - }else BurningAdrenalineTank_Timer -= diff; - - //FireNova_Timer - if (FireNova_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FIRENOVA); - FireNova_Timer = 5000; - }else FireNova_Timer -= diff; - - //TailSwipe_Timer - if (TailSwipe_Timer < diff) - { - //Only cast if we are behind - /*if (!m_creature->HasInArc(M_PI, m_creature->getVictim())) - { - DoCast(m_creature->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())->BeginSpeach(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) -{ - 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/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp deleted file mode 100644 index 78ed29fc27e..00000000000 --- a/src/bindings/scripts/scripts/zone/blackwing_lair/boss_victor_nefarius.cpp +++ /dev/null @@ -1,392 +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 "precompiled.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 TRINITY_DLL_DECL boss_victor_nefariusAI : public ScriptedAI -{ - boss_victor_nefariusAI(Creature *c) : ScriptedAI(c) - { - NefarianGUID = 0; - srand(time(NULL)); - switch (rand()%20) - { - 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; - - m_creature->SetUInt32Value(UNIT_NPC_FLAGS,1); - m_creature->setFaction(35); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void BeginEvent(Player* target) - { - DoScriptText(SAY_GAMESBEGIN_2, m_creature); - - //Trinity::Singleton::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin(); - /* - list ::iterator i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin(); - - for (i = MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().begin(); i != MapManager::Instance().GetMap(m_creature->GetMapId(), m_creature)->GetPlayers().end(); ++i) - { - AttackStart((*i)); - } - */ - m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0); - m_creature->setFaction(103); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - AttackStart(target); - } - - 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 && m_creature->IsHostileTo(who)) - { - //Add them to our threat list - m_creature->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) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - DoCast(target,SPELL_SHADOWBOLT); - - ShadowBoltTimer = 3000 + (rand()%7000); - }else ShadowBoltTimer -= diff; - - //FearTimer - if (FearTimer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - DoCast(target,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* target = NULL; - - //1 in 3 chance it will be a chromatic - if (rand()%3 == 0) - CreatureID = CREATURE_CHROMATIC_DRAKANOID; - else CreatureID = DrakType1; - - SpawnedAdds++; - - //Spawn Creature and force it to start attacking a random target - Spawned = m_creature->SummonCreature(CreatureID,ADD_X1,ADD_Y1,ADD_Z1,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target && Spawned) - { - Spawned->AI()->AttackStart(target); - Spawned->setFaction(103); - } - - //1 in 3 chance it will be a chromatic - if (rand()%3 == 0) - CreatureID = CREATURE_CHROMATIC_DRAKANOID; - else CreatureID = DrakType2; - - SpawnedAdds++; - - target = NULL; - Spawned = NULL; - Spawned = m_creature->SummonCreature(CreatureID,ADD_X2,ADD_Y2,ADD_Z2,5.000,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target && Spawned) - { - Spawned->AI()->AttackStart(target); - 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(m_creature->GetMapId(), m_creature)->CreatureRelocation(m_creature,0,0,-5000,0); - - //Inturrupt any spell casting - m_creature->InterruptNonMeleeSpells(false); - - //Root self - DoCast(m_creature,33356); - - //Make super invis - DoCast(m_creature,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); - m_creature->addUnitState(UNIT_STAT_FLEEING); - - //Spawn nef and have him attack a random target - Creature* Nefarian = NULL; - Nefarian = m_creature->SummonCreature(CREATURE_NEFARIAN,NEF_X,NEF_Y,NEF_Z,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,120000); - target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target && Nefarian) - { - Nefarian->AI()->AttackStart(target); - 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((*m_creature),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; - m_creature->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/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp b/src/bindings/scripts/scripts/zone/blackwing_lair/instance_blackwing_lair.cpp deleted file mode 100644 index 97bf717589a..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - diff --git a/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp b/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp deleted file mode 100644 index b631c3b13e7..00000000000 --- a/src/bindings/scripts/scripts/zone/deadmines/deadmines.cpp +++ /dev/null @@ -1,237 +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 "precompiled.h" -#include "def_deadmines.h" -#include "Spell.h" - -#define SOUND_CANNONFIRE 1400 -#define SOUND_DESTROYDOOR 3079 -#define SAY_MR_SMITE_ALARM1 "You there, check out that noise!" -#define SOUND_MR_SMITE_ALARM1 5775 -#define SAY_MR_SMITE_ALARM2 "We're under attack! A vast, ye swabs! Repel the invaders!" -#define SOUND_MR_SMITE_ALARM2 5777 - -#define GO_IRONCLAD_DOOR 16397 -#define GO_DEFIAS_CANNON 16398 -#define GO_DOOR_LEVER 101833 - -#define CANNON_BLAST_TIMER 3000 -#define PIRATES_DELAY_TIMER 1000 - -struct TRINITY_DLL_DECL instance_deadmines : public ScriptedInstance -{ - instance_deadmines(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - GameObject* IronCladDoor; - GameObject* DefiasCannon; - GameObject* DoorLever; - Creature* DefiasPirate1; - Creature* DefiasPirate2; - Creature* DefiasCompanion; - uint32 State; - uint32 CannonBlast_Timer; - uint32 PiratesDelay_Timer; - - void Initialize() - { - IronCladDoor = NULL; - DefiasCannon = NULL; - DoorLever = NULL; - State = CANNON_NOT_USED; - } - - virtual void Update(uint32 diff) - { - if (!IronCladDoor || !DefiasCannon || !DoorLever) - return; - - switch(State) - { - case CANNON_GUNPOWDER_USED: - CannonBlast_Timer = CANNON_BLAST_TIMER; - // it's a hack - Mr. Smite should do that but his too far away - IronCladDoor->SetName("Mr. Smite"); - IronCladDoor->MonsterYell(SAY_MR_SMITE_ALARM1, LANG_UNIVERSAL, 0); - DoPlaySound(IronCladDoor, SOUND_MR_SMITE_ALARM1); - State=CANNON_BLAST_INITIATED; - break; - case CANNON_BLAST_INITIATED: - PiratesDelay_Timer = PIRATES_DELAY_TIMER; - if (CannonBlast_TimerMonsterYell(SAY_MR_SMITE_ALARM2, LANG_UNIVERSAL, 0); - DoPlaySound(IronCladDoor, SOUND_MR_SMITE_ALARM2); - State = PIRATES_ATTACK; - }else - CannonBlast_Timer-=diff; - break; - case PIRATES_ATTACK: - if (PiratesDelay_TimerSummonCreature(657,IronCladDoor->GetPositionX() - 2,IronCladDoor->GetPositionY()-7,IronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); - DefiasPirate2 = IronCladDoor->SummonCreature(657,IronCladDoor->GetPositionX() + 3,IronCladDoor->GetPositionY()-6,IronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); - DefiasCompanion = IronCladDoor->SummonCreature(3450,IronCladDoor->GetPositionX() + 2,IronCladDoor->GetPositionY()-6,IronCladDoor->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 3000); - } - - void MoveCreaturesInside() - { - if (!DefiasPirate1 || !DefiasPirate2 || !DefiasCompanion) - return; - - MoveCreatureInside(DefiasPirate1); - MoveCreatureInside(DefiasPirate2); - MoveCreatureInside(DefiasCompanion); - } - - void MoveCreatureInside(Creature* pCreature) - { - pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pCreature->GetMotionMaster()->MovePoint(0, -102.7,-655.9, pCreature->GetPositionZ()); - } - - void ShootCannon() - { - DefiasCannon->SetGoState(GO_STATE_ACTIVE); - DoPlaySound(DefiasCannon, SOUND_CANNONFIRE); - } - - void BlastOutDoor() - { - IronCladDoor->SetGoState(GO_STATE_ACTIVE_ALTERNATIVE); - DoPlaySound(IronCladDoor, SOUND_DESTROYDOOR); - } - - void LeverStucked() - { - DoorLever->SetUInt32Value(GAMEOBJECT_FLAGS, 4); - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case GO_IRONCLAD_DOOR: - IronCladDoor = pGo; - break; - case GO_DEFIAS_CANNON: - DefiasCannon = pGo; - break; - case GO_DOOR_LEVER: - DoorLever = pGo; - break; - } - } - - void SetData(uint32 type, uint32 data) - { - if (type == EVENT_STATE) - { - if (DefiasCannon && IronCladDoor) - State=data; - } - } - - uint32 GetData(uint32 type) - { - if (type == EVENT_STATE) - return State; - 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); - } -}; - -/*##### -# item_Defias_Gunpowder -#####*/ - -bool ItemUse_item_defias_gunpowder(Player* pPlayer, Item* _Item, SpellCastTargets const& targets) -{ - ScriptedInstance *pInstance = (pPlayer->GetInstanceData()) ? (pPlayer->GetInstanceData()) : NULL; - - 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(_Item->GetEntry(), 1, true); - return true; -} - -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(); - - newscript = new Script; - newscript->Name = "item_defias_gunpowder"; - newscript->pItemUse = &ItemUse_item_defias_gunpowder; - newscript->RegisterSelf(); -} - - diff --git a/src/bindings/scripts/scripts/zone/deadmines/def_deadmines.h b/src/bindings/scripts/scripts/zone/deadmines/def_deadmines.h deleted file mode 100644 index 9b535a9fd80..00000000000 --- a/src/bindings/scripts/scripts/zone/deadmines/def_deadmines.h +++ /dev/null @@ -1,14 +0,0 @@ -#ifndef DEF_DEADMINES_H -#define DEF_DEADMINES_H - -#include "precompiled.h" - -#define CANNON_NOT_USED 1 -#define CANNON_GUNPOWDER_USED 2 -#define CANNON_BLAST_INITIATED 3 -#define PIRATES_ATTACK 4 -#define EVENT_DONE 5 - -#define EVENT_STATE 1 -#endif - diff --git a/src/bindings/scripts/scripts/zone/deadmines/instance_deadmines.cpp b/src/bindings/scripts/scripts/zone/deadmines/instance_deadmines.cpp deleted file mode 100644 index 35bd4cb34b5..00000000000 --- a/src/bindings/scripts/scripts/zone/deadmines/instance_deadmines.cpp +++ /dev/null @@ -1,23 +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: 0 -SDComment: Placeholder -SDCategory: Deadmines -EndScriptData */ - diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_curator.cpp deleted file mode 100644 index 218a1dafc39..00000000000 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_curator.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_Curator -SD%Complete: 100 -SDComment: -SDCategory: Karazhan -EndScriptData */ - -#include "precompiled.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 TRINITY_DLL_DECL 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; - - m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_ARCANE, true); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL1, m_creature); break; - case 1: DoScriptText(SAY_KILL2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //always decrease BerserkTimer - if (BerserkTimer < diff) - { - //if evocate, then break evocate - if (Evocating) - { - if (m_creature->HasAura(SPELL_EVOCATION)) - m_creature->RemoveAurasDueToSpell(SPELL_EVOCATION); - - Evocating = false; - } - - //may not be correct SAY (generic hard enrage) - DoScriptText(SAY_ENRAGE, m_creature); - - m_creature->InterruptNonMeleeSpells(true); - DoCast(m_creature, 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 (m_creature->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* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (AstralFlare && target) - { - AstralFlare->CastSpell(AstralFlare, SPELL_ASTRAL_FLARE_PASSIVE, false); - AstralFlare->AI()->AttackStart(target); - } - - //Reduce Mana by 10% of max health - if (int32 mana = m_creature->GetMaxPower(POWER_MANA)) - { - mana /= 10; - m_creature->ModifyPower(POWER_MANA, -mana); - - //if this get's us below 10%, then we evocate (the 10th should be summoned now) - if (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA) < 10) - { - DoScriptText(SAY_EVOCATE, m_creature); - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_EVOCATION); - Evocating = true; - //no AddTimer cooldown, this will make first flare appear instantly after evocate end, like expected - return; - } - else - { - switch(rand()%4) - { - case 0: DoScriptText(SAY_SUMMON1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON2, m_creature); break; - } - } - } - - AddTimer = 10000; - }else AddTimer -= diff; - - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 15) - { - Enraged = true; - DoCast(m_creature, SPELL_ENRAGE); - DoScriptText(SAY_ENRAGE, m_creature); - } - } - - if (HatefulBoltTimer < diff) - { - if (Enraged) - HatefulBoltTimer = 7000; - else - HatefulBoltTimer = 15000; - - if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) - DoCast(target, 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/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp deleted file mode 100644 index 508e718797d..00000000000 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_maiden_of_virtue.cpp +++ /dev/null @@ -1,150 +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 "precompiled.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 TRINITY_DLL_DECL 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 (rand()%2) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature);break; - case 1: DoScriptText(SAY_SLAY2, m_creature);break; - case 2: DoScriptText(SAY_SLAY3, m_creature);break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Enrage_Timer < diff && !Enraged) - { - DoCast(m_creature, SPELL_BERSERK,true); - Enraged = true; - }else Enrage_Timer -=diff; - - if (Holyground_Timer < diff) - { - DoCast(m_creature, SPELL_HOLYGROUND, true); //Triggered so it doesn't interrupt her at all - Holyground_Timer = 3000; - }else Holyground_Timer -= diff; - - if (Repentance_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_REPENTANCE); - - switch(rand()%2) - { - case 0: DoScriptText(SAY_REPENTANCE1, m_creature);break; - case 1: DoScriptText(SAY_REPENTANCE2, m_creature);break; - } - Repentance_Timer = 25000 + rand()%10000; //A little randomness on that spell - }else Repentance_Timer -= diff; - - if (Holyfire_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_HOLYFIRE); - - Holyfire_Timer = 8000 + rand()%15000; //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* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_HOLYWRATH); - - Holywrath_Timer = 20000+(rand()%5000); //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/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp deleted file mode 100644 index 53b1c2d11b2..00000000000 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_midnight.cpp +++ /dev/null @@ -1,323 +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 "precompiled.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 TRINITY_DLL_DECL 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; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->SetVisibility(VISIBILITY_ON); - } - - void EnterCombat(Unit* who) {} - - void KilledUnit(Unit *victim) - { - if (Phase == 2) - { - if (Unit *pUnit = Unit::GetUnit(*m_creature, Attumen)) - DoScriptText(SAY_MIDNIGHT_KILL, pUnit); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Phase == 1 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 95) - { - Phase = 2; - if (Creature* pAttumen = m_creature->SummonCreature(SUMMON_ATTUMEN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000)) - { - Attumen = pAttumen->GetGUID(); - pAttumen->AI()->AttackStart(m_creature->getVictim()); - SetMidnight(pAttumen, m_creature->GetGUID()); - switch(rand()%3) - { - case 0: DoScriptText(SAY_APPEAR1, pAttumen); break; - case 1: DoScriptText(SAY_APPEAR2, pAttumen); break; - case 2: DoScriptText(SAY_APPEAR3, pAttumen); break; - } - } - } - else if (Phase == 2 && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 25) - { - if (Unit *pAttumen = Unit::GetUnit(*m_creature, Attumen)) - Mount(pAttumen); - } - else if (Phase ==3) - { - if (Mount_Timer) - { - if (Mount_Timer <= diff) - { - Mount_Timer = 0; - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->GetMotionMaster()->MoveIdle(); - if (Unit *pAttumen = Unit::GetUnit(*m_creature, 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; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - float angle = m_creature->GetAngle(pAttumen); - float distance = m_creature->GetDistance2d(pAttumen); - float newX = m_creature->GetPositionX() + cos(angle)*(distance/2) ; - float newY = m_creature->GetPositionY() + sin(angle)*(distance/2) ; - float newZ = 50; - //m_creature->Relocate(newX,newY,newZ,angle); - //m_creature->SendMonsterMove(newX, newY, newZ, 0, true, 1000); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MovePoint(0, newX, newY, newZ); - distance += 10; - newX = m_creature->GetPositionX() + cos(angle)*(distance/2) ; - newY = m_creature->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 TRINITY_DLL_DECL boss_attumenAI : public ScriptedAI -{ - boss_attumenAI(Creature *c) : ScriptedAI(c) - { - Phase = 1; - - CleaveTimer = 10000 + (rand()%6)*1000; - CurseTimer = 30000; - RandomYellTimer = 30000 + (rand()%31)*1000; //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) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL1, m_creature); break; - case 1: DoScriptText(SAY_KILL2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - if (Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight)) - pMidnight->DealDamage(pMidnight, pMidnight->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - - void UpdateAI(const uint32 diff) - { - if (ResetTimer) - { - if (ResetTimer <= diff) - { - ResetTimer = 0; - Unit *pMidnight = Unit::GetUnit(*m_creature, Midnight); - if (pMidnight) - { - pMidnight->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pMidnight->SetVisibility(VISIBILITY_ON); - } - Midnight = 0; - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } else ResetTimer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE | UNIT_FLAG_NOT_SELECTABLE)) - return; - - if (CleaveTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SHADOWCLEAVE); - CleaveTimer = 10000 + (rand()%6)*1000; - } else CleaveTimer -= diff; - - if (CurseTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_INTANGIBLE_PRESENCE); - CurseTimer = 30000; - } else CurseTimer -= diff; - - if (RandomYellTimer < diff) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_RANDOM1, m_creature); break; - case 1: DoScriptText(SAY_RANDOM2, m_creature); break; - } - RandomYellTimer = 30000 + (rand()%31)*1000; - } else RandomYellTimer -= diff; - - if (m_creature->GetUInt32Value(UNIT_FIELD_DISPLAYID) == MOUNTED_DISPLAYID) - { - if (ChargeTimer < diff) - { - Unit *target; - std::list t_list = m_creature->getThreatManager().getThreatList(); - std::vector target_list; - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (target && !target->IsWithinDist(m_creature, ATTACK_DISTANCE, false)) - target_list.push_back(target); - target = NULL; - } - if (target_list.size()) - target = *(target_list.begin()+rand()%target_list.size()); - - DoCast(target, SPELL_BERSERKER_CHARGE); - ChargeTimer = 20000; - } else ChargeTimer -= diff; - } - else - { - if ((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 25) - { - Creature *pMidnight = Unit::GetCreature(*m_creature, Midnight); - if (pMidnight && pMidnight->GetTypeId() == TYPEID_UNIT) - { - CAST_AI(boss_midnightAI, (pMidnight->AI()))->Mount(m_creature); - m_creature->SetHealth(pMidnight->GetHealth()); - DoResetThreat(); - } - } - } - - DoMeleeAttackIfReady(); - } - - void SpellHit(Unit *source, const SpellEntry *spell) - { - if (spell->Mechanic == MECHANIC_DISARM) - DoScriptText(SAY_DISARMED, m_creature); - } -}; - -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/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp deleted file mode 100644 index 6d871ef04b7..00000000000 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_moroes.cpp +++ /dev/null @@ -1,819 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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 (m_creature->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, m_creature); - AddsAttack(); - DoZoneInCombat(); - } - - void KilledUnit(Unit* victim) - { - switch (rand()%3) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - case 2: DoScriptText(SAY_KILL_3, m_creature); break; - } - } - - void JustDied(Unit* victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(TYPE_MOROES, DONE); - - DeSpawnAdds(); - - //remove aura from spell Garrote when Moroes dies - Map* pMap = m_creature->GetMap(); - if (pMap->IsDungeon()) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - - if (PlayerList.isEmpty()) - return; - - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()->isAlive() && i->getSource()->HasAura(SPELL_GARROTE,0)) - i->getSource()->RemoveAurasDueToSpell(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::iterator itr = AddList.begin(); itr != AddList.end(); ++itr) - { - uint32 entry = *itr; - - pCreature = m_creature->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 = m_creature->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((*m_creature),AddGUID[i]); - if (Temp && Temp->isAlive()) - { - (*Temp).GetMotionMaster()->Clear(true); - Temp->DealDamage(Temp, Temp->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - Temp->RemoveCorpse(); - } - - } - } - } - - void AddsAttack() - { - for(uint8 i = 0; i < 4; ++i) - { - Creature* Temp = NULL; - if (AddGUID[i]) - { - Temp = Creature::GetCreature((*m_creature),AddGUID[i]); - if (Temp && Temp->isAlive()) - { - Temp->AI()->AttackStart(m_creature->getVictim()); - DoZoneInCombat(Temp); - }else - EnterEvadeMode(); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (pInstance && !pInstance->GetData(TYPE_MOROES)) - { - EnterEvadeMode(); - return; - } - - if (!Enrage && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30) - { - DoCast(m_creature, SPELL_FRENZY); - Enrage = true; - } - - if (CheckAdds_Timer < diff) - { - for (uint8 i = 0; i < 4; ++i) - { - Creature* Temp = NULL; - if (AddGUID[i]) - { - Temp = Unit::GetCreature((*m_creature),AddGUID[i]); - if (Temp && Temp->isAlive()) - if (!Temp->getVictim()) - Temp->AI()->AttackStart(m_creature->getVictim()); - } - } - CheckAdds_Timer = 5000; - }else CheckAdds_Timer -= diff; - - if (!Enrage) - { - //Cast Vanish, then Garrote random victim - if (Vanish_Timer < diff) - { - DoCast(m_creature, SPELL_VANISH); - InVanish = true; - Vanish_Timer = 30000; - Wait_Timer = 5000; - }else Vanish_Timer -= diff; - - if (Gouge_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_GOUGE); - Gouge_Timer = 40000; - }else Gouge_Timer -= diff; - - if (Blind_Timer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target && target->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinMeleeRange(target)) - { - DoCast(target, SPELL_BLIND); - - Blind_Timer = 40000; - } - else - Blind_Timer = 1000; - }else Blind_Timer -= diff; - } - - if (InVanish) - { - if (Wait_Timer < diff) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPECIAL_1, m_creature); break; - case 1: DoScriptText(SAY_SPECIAL_2, m_creature); break; - } - - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - target->CastSpell(target, SPELL_GARROTE,true); - - InVanish = false; - }else Wait_Timer -= diff; - } - - if (!InVanish) - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL 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; - - GuestGUID[0] = pInstance->GetData64(DATA_MOROES); - Creature* Moroes = (Unit::GetCreature((*m_creature), GuestGUID[0])); - if (Moroes) - { - for(uint8 i = 0; i < 3; ++i) - { - uint64 GUID = CAST_AI(boss_moroesAI, Moroes->AI())->AddGUID[i]; - if (GUID && GUID != m_creature->GetGUID()) - GuestGUID[i+1] = GUID; - } - } - } - - Unit* SelectTarget() - { - uint64 TempGUID = GuestGUID[rand()%5]; - if (TempGUID) - { - Unit* pUnit = Unit::GetUnit((*m_creature), TempGUID); - if (pUnit && pUnit->isAlive()) - return pUnit; - } - - return m_creature; - } - - 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 TRINITY_DLL_DECL 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(m_creature,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(m_creature->getVictim(),SPELL_MINDFLY); - MindFlay_Timer = 12000; //3sec channeled - }else MindFlay_Timer -= diff; - - if (ManaBurn_Timer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target && (target->getPowerType() == POWER_MANA)) - DoCast(target,SPELL_MANABURN); - ManaBurn_Timer = 5000; //3 sec cast - }else ManaBurn_Timer -= diff; - - if (ShadowWordPain_Timer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - { - DoCast(target,SPELL_SWPAIN); - ShadowWordPain_Timer = 7000; - } - }else ShadowWordPain_Timer -= diff; - } -}; - -#define SPELL_HAMMEROFJUSTICE 13005 -#define SPELL_JUDGEMENTOFCOMMAND 29386 -#define SPELL_SEALOFCOMMAND 29385 - -struct TRINITY_DLL_DECL 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(m_creature,SPELL_SEALOFCOMMAND); - SealOfCommand_Timer = 32000; - JudgementOfCommand_Timer = 29000; - }else SealOfCommand_Timer -= diff; - - if (JudgementOfCommand_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_JUDGEMENTOFCOMMAND); - JudgementOfCommand_Timer = SealOfCommand_Timer + 29000; - }else JudgementOfCommand_Timer -= diff; - - if (HammerOfJustice_Timer < diff) - { - DoCast(m_creature->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 TRINITY_DLL_DECL 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(m_creature,SPELL_PWSHIELD); - PowerWordShield_Timer = 15000; - }else PowerWordShield_Timer -= diff; - - if (GreaterHeal_Timer < diff) - { - Unit* target = SelectTarget(); - - DoCast(target, SPELL_GREATERHEAL); - GreaterHeal_Timer = 17000; - }else GreaterHeal_Timer -= diff; - - if (HolyFire_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_HOLYFIRE); - HolyFire_Timer = 22000; - }else HolyFire_Timer -= diff; - - if (DispelMagic_Timer < diff) - { - if (rand()%2) - { - Unit* target = SelectTarget(); - - DoCast(target, SPELL_DISPELMAGIC); - } - else - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), 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 TRINITY_DLL_DECL 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(m_creature,SPELL_DIVINESHIELD); - DivineShield_Timer = 31000; - }else DivineShield_Timer -= diff; - - if (HolyLight_Timer < diff) - { - Unit* target = SelectTarget(); - - DoCast(target, SPELL_HOLYLIGHT); - HolyLight_Timer = 10000; - }else HolyLight_Timer -= diff; - - if (GreaterBless_Timer < diff) - { - Unit* target = SelectTarget(); - - DoCast(target, SPELL_GREATERBLESSOFMIGHT); - - GreaterBless_Timer = 50000; - }else GreaterBless_Timer -= diff; - - if (Cleanse_Timer < diff) - { - Unit* target = SelectTarget(); - - DoCast(target, SPELL_CLEANSE); - - Cleanse_Timer = 10000; - }else Cleanse_Timer -= diff; - } -}; - -#define SPELL_HAMSTRING 9080 -#define SPELL_MORTALSTRIKE 29572 -#define SPELL_WHIRLWIND 29573 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_HAMSTRING); - Hamstring_Timer = 12000; - }else Hamstring_Timer -= diff; - - if (MortalStrike_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_MORTALSTRIKE); - MortalStrike_Timer = 18000; - }else MortalStrike_Timer -= diff; - - if (WhirlWind_Timer < diff) - { - DoCast(m_creature,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 TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_DISARM); - Disarm_Timer = 12000; - }else Disarm_Timer -= diff; - - if (HeroicStrike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_HEROICSTRIKE); - HeroicStrike_Timer = 10000; - }else HeroicStrike_Timer -= diff; - - if (ShieldBash_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SHIELDBASH); - ShieldBash_Timer = 13000; - }else ShieldBash_Timer -= diff; - - if (ShieldWall_Timer < diff) - { - DoCast(m_creature,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/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp deleted file mode 100644 index fc90ff5b4f0..00000000000 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_netherspite.cpp +++ /dev/null @@ -1,353 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL boss_netherspiteAI : public ScriptedAI -{ - boss_netherspiteAI(Creature* c) : ScriptedAI(c) - { - pInstance = ((ScriptedInstance*)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* target, WorldObject* u2) // the in-line checker - { - if(!u1 || !u2 || !target) - return false; - - float xn, yn, xp, yp, xh, yh; - xn = u1->GetPositionX(); - yn = u1->GetPositionY(); - xp = u2->GetPositionX(); - yp = u2->GetPositionY(); - xh = target->GetPositionX(); - yh = target->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 = m_creature->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(*m_creature, PortalGUID[i])) - { - portal->SetVisibility(VISIBILITY_OFF); - portal->DealDamage(portal, portal->GetMaxHealth()); - portal->RemoveFromWorld(); - } - if(Creature *portal = Unit::GetCreature(*m_creature, BeamerGUID[i])) - { - portal->SetVisibility(VISIBILITY_OFF); - portal->DealDamage(portal, portal->GetMaxHealth()); - portal->RemoveFromWorld(); - } - 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(*m_creature, 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 *target = m_creature; - - if(Map* map = m_creature->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 - && (!target || target->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(m_creature, p, portal)) // on the beam - target = p; - } - } - // buff the target - if(target->GetTypeId() == TYPEID_PLAYER) - target->AddAura(PlayerBuff[j], target); - else - target->AddAura(NetherBuff[j], target); - // cast visual beam on the chosen target if switched - // simple target switching isn't working -> using BeamerGUID to cast (workaround) - if(!current || target != current) - { - BeamTarget[j] = target->GetGUID(); - // remove currently beaming portal - if(Creature *beamer = Unit::GetCreature(*portal, BeamerGUID[j])) - { - beamer->CastSpell(target, PortalBeam[j], false); - beamer->SetVisibility(VISIBILITY_OFF); - beamer->DealDamage(beamer, beamer->GetMaxHealth()); - beamer->RemoveFromWorld(); - 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(target, PortalBeam[j], false); - BeamerGUID[j] = beamer->GetGUID(); - } - } - // aggro target if Red Beam - if(j==RED_PORTAL && m_creature->getVictim() != target && target->GetTypeId() == TYPEID_PLAYER) - m_creature->getThreatManager().addThreat(target, 100000.0f+DoGetThreat(m_creature->getVictim())); - } - } - - void SwitchToPortalPhase() - { - m_creature->RemoveAurasDueToSpell(SPELL_BANISH_ROOT); - m_creature->RemoveAurasDueToSpell(SPELL_BANISH_VISUAL); - SummonPortals(); - PhaseTimer = 60000; - PortalPhase = true; - PortalTimer = 10000; - EmpowermentTimer = 10000; - DoScriptText(EMOTE_PHASE_PORTAL,m_creature); - } - - void SwitchToBanishPhase() - { - m_creature->RemoveAurasDueToSpell(SPELL_EMPOWERMENT); - m_creature->RemoveAurasDueToSpell(SPELL_NETHERBURN_AURA); - DoCast(m_creature,SPELL_BANISH_VISUAL,true); - DoCast(m_creature,SPELL_BANISH_ROOT,true); - DestroyPortals(); - PhaseTimer = 30000; - PortalPhase = false; - DoScriptText(EMOTE_PHASE_BANISH,m_creature); - - for(int i=0; i<3; ++i) - m_creature->RemoveAurasDueToSpell(NetherBuff[i]); - } - - void HandleDoors(bool open) // Massive Door switcher - { - if(GameObject *Door = GameObject::GetGameObject((*m_creature),pInstance->GetData64(DATA_GO_MASSIVE_DOOR))) - 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) - { - m_creature->AddAura(SPELL_NETHER_INFUSION, m_creature); - DoCast(m_creature, 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(m_creature, SPELL_EMPOWERMENT); - m_creature->AddAura(SPELL_NETHERBURN_AURA, m_creature); - EmpowermentTimer = 90000; - }else EmpowermentTimer -= diff; - - if(PhaseTimer < diff) - { - if(!m_creature->IsNonMeleeSpellCasted(false)) - { - SwitchToBanishPhase(); - return; - } - }else PhaseTimer -= diff; - } - else // BANISH PHASE - { - // Netherbreath - if(NetherbreathTimer < diff) - { - if(Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,40,true)) - DoCast(target,SPELL_NETHERBREATH); - NetherbreathTimer = 5000+rand()%2000; - }else NetherbreathTimer -= diff; - - if(PhaseTimer < diff) - { - if(!m_creature->IsNonMeleeSpellCasted(false)) - { - SwitchToPortalPhase(); - return; - } - }else PhaseTimer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_netherspite(Creature *_Creature) -{ - return new boss_netherspiteAI(_Creature); -} - -void AddSC_boss_netherspite() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_netherspite"; - newscript->GetAI = GetAI_boss_netherspite; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp deleted file mode 100644 index cf7d7237042..00000000000 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_nightbane.cpp +++ /dev/null @@ -1,421 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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; - - m_creature->SetSpeed(MOVE_RUN, 2.0f); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->setActive(true); - - if (pInstance->GetData(TYPE_NIGHTBANE) == DONE || pInstance->GetData(TYPE_NIGHTBANE) == IN_PROGRESS) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - } - else - { - if (pInstance) - pInstance->SetData(TYPE_NIGHTBANE, NOT_STARTED); - } - - HandleTerraceDoors(true); - - Flying = false; - Movement = false; - - if (!Intro) - { - m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0); - m_creature->GetMotionMaster()->MoveTargetedHome(); - } - } - - void HandleTerraceDoors(bool open) - { - 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); - m_creature->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; - m_creature->SetHomePosition(IntroWay[7][0],IntroWay[7][1],IntroWay[7][2],0); - return; - } - - WaitTimer = 1; - } - - if (Flying) - { - if (id == 0) - { - m_creature->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(m_creature->getVictim()); - } - - void TakeOff() - { - m_creature->MonsterYell(YELL_FLY_PHASE, LANG_UNIVERSAL, NULL); - - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - (*m_creature).GetMotionMaster()->Clear(false); - (*m_creature).GetMotionMaster()->MovePoint(0,IntroWay[2][0],IntroWay[2][1],IntroWay[2][2]); - - Flying = true; - - FlyTimer = 45000+rand()%15000; //timer wrong between 45 and 60 seconds - ++FlyCount; - - RainofBonesTimer = 5000; //timer wrong (maybe) - RainBones = false; - Skeletons = false; - } - - void UpdateAI(const uint32 diff) - { - if (WaitTimer) - if (WaitTimer < diff) - { - if (Intro) - { - if (MovePhase >= 7) - { - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - m_creature->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]); - } - else - { - m_creature->GetMotionMaster()->MovePoint(MovePhase,IntroWay[MovePhase][0],IntroWay[MovePhase][1],IntroWay[MovePhase][2]); - ++MovePhase; - } - } - - if (Flying) - { - if (MovePhase >= 7) - { - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - m_creature->GetMotionMaster()->MovePoint(8,IntroWay[7][0],IntroWay[7][1],IntroWay[7][2]); - } - else - { - m_creature->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(m_creature->getVictim()); - Movement = false; - } - - if (BellowingRoarTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_BELLOWING_ROAR); - BellowingRoarTimer = 30000+rand()%10000 ; //Timer - }else BellowingRoarTimer -= diff; - - if (SmolderingBreathTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SMOLDERING_BREATH); - SmolderingBreathTimer = 20000;//timer - }else SmolderingBreathTimer -= diff; - - if (CharredEarthTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target,SPELL_CHARRED_EARTH); - CharredEarthTimer = 20000; //timer - }else CharredEarthTimer -= diff; - - if (TailSweepTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - if (!m_creature->HasInArc(M_PI, target)) - DoCast(target,SPELL_TAIL_SWEEP); - TailSweepTimer = 15000;//timer - }else TailSweepTimer -= diff; - - if (SearingCindersTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target,SPELL_SEARING_CINDERS); - SearingCindersTimer = 10000; //timer - }else SearingCindersTimer -= diff; - - uint32 Prozent; - Prozent = (m_creature->GetHealth()*100) / m_creature->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(m_creature->getVictim(), SPELL_SUMMON_SKELETON); - Skeletons = true; - } - } - - if (RainofBonesTimer < diff && !RainBones) // only once at the beginning of phase 2 - { - DoCast(m_creature->getVictim(),SPELL_RAIN_OF_BONES); - RainBones = true; - SmokingBlastTimer = 20000; - }else RainofBonesTimer -= diff; - - if (DistractingAshTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target,SPELL_DISTRACTING_ASH); - DistractingAshTimer = 2000;//timer wrong - }else DistractingAshTimer -= diff; - } - - if (RainBones) - { - if (SmokingBlastTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SMOKING_BLAST); - SmokingBlastTimer = 1500 ; //timer wrong - }else SmokingBlastTimer -= diff; - } - - if (FireballBarrageTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_FARTHEST, 0)) - DoCast(target,SPELL_FIREBALL_BARRAGE); - FireballBarrageTimer = 20000; //Timer - }else FireballBarrageTimer -= diff; - - if (FlyTimer < diff) //landing - { - if (rand()%2 == 0) - m_creature->MonsterYell(YELL_LAND_PHASE_1, LANG_UNIVERSAL, NULL); - else - m_creature->MonsterYell(YELL_LAND_PHASE_2, LANG_UNIVERSAL, NULL); - - (*m_creature).GetMotionMaster()->Clear(false); - m_creature->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/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp deleted file mode 100644 index ba797dc13c2..00000000000 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_prince_malchezaar.cpp +++ /dev/null @@ -1,632 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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(m_creature, 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(*m_creature, malchezaar); - if (pMalchezaar) - CAST_CRE(pMalchezaar)->AI()->KilledUnit(who); - } - - void SpellHit(Unit *who, const SpellEntry *spell) - { - if (spell->Id == SPELL_INFERNAL_RELAY) - { - m_creature->SetDisplayId(m_creature->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID)); - m_creature->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 TRINITY_DLL_DECL 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 = 7500 + rand()%12500; - SunderArmorTimer = 5000 + rand()%5000; - phase = 1; - - if (pInstance) - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), true); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - 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, m_creature); - - if (pInstance) - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_NETHER_DOOR), false); // Open the door leading further in - } - - void InfernalCleanup() - { - //Infernal Cleanup - for(std::vector::iterator itr = infernals.begin(); itr!= infernals.end(); ++itr) - { - Unit *pInfernal = Unit::GetUnit(*m_creature, *itr); - if (pInfernal && 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(*m_creature, axes[i]); - if (axe && axe->isAlive()) - axe->DealDamage(axe, axe->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - axes[i] = 0; - } - } - - void ClearWeapons() - { - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - - //damage - const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, cinfo->mindmg); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, cinfo->maxdmg); - m_creature->UpdateDamagePhysical(BASE_ATTACK); - } - - void EnfeebleHealthEffect() - { - const SpellEntry *info = GetSpellStore()->LookupEntry(SPELL_ENFEEBLE_EFFECT); - if (!info) - return; - - std::list t_list = m_creature->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::iterator itr = t_list.begin(); - std::advance(itr, 1); - for(; itr!= t_list.end(); ++itr) //store the threat list in a different container - { - Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - //only on alive players - if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) - targets.push_back(target); - } - - //cut down to size if we have more than 5 targets - while(targets.size() > 5) - targets.erase(targets.begin()+rand()%targets.size()); - - int i = 0; - for(std::vector::iterator iter = targets.begin(); iter!= targets.end(); ++iter, ++i) - { - Unit *target = *iter; - if (target) - { - enfeeble_targets[i] = target->GetGUID(); - enfeeble_health[i] = target->GetHealth(); - - target->CastSpell(target, SPELL_ENFEEBLE, true, 0, 0, m_creature->GetGUID()); - target->SetHealth(1); - } - } - - } - - void EnfeebleResetHealth() - { - for(uint8 i = 0; i < 5; ++i) - { - Unit *target = Unit::GetUnit(*m_creature, enfeeble_targets[i]); - if (target && target->isAlive()) - target->SetHealth(enfeeble_health[i]); - enfeeble_targets[i] = 0; - enfeeble_health[i] = 0; - } - } - - void SummonInfernal(const uint32 diff) - { - InfernalPoint *point = NULL; - float posX,posY,posZ; - if ((m_creature->GetMapId() != 532) || positions.empty()) - { - m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 60, posX, posY, posZ); - } - else - { - std::vector::iterator itr = positions.begin()+rand()%positions.size(); - point = *itr; - positions.erase(itr); - - posX = point->x; - posY = point->y; - posZ = INFERNAL_Z; - } - - Creature *Infernal = m_creature->SummonCreature(NETHERSPITE_INFERNAL, posX, posY, posZ, 0, TEMPSUMMON_TIMED_DESPAWN, 180000); - - if (Infernal) - { - Infernal->SetDisplayId(INFERNAL_MODEL_INVISIBLE); - Infernal->setFaction(m_creature->getFaction()); - if (point) - CAST_AI(netherspite_infernalAI, Infernal->AI())->point=point; - CAST_AI(netherspite_infernalAI, Infernal->AI())->malchezaar=m_creature->GetGUID(); - - infernals.push_back(Infernal->GetGUID()); - DoCast(Infernal, SPELL_INFERNAL_RELAY); - } - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SUMMON1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (EnfeebleResetTimer) - if (EnfeebleResetTimer <= diff) //Let's not forget to reset that - { - EnfeebleResetHealth(); - EnfeebleResetTimer=0; - }else EnfeebleResetTimer -= diff; - - if (m_creature->hasUnitState(UNIT_STAT_STUNNED)) //While shifting to phase 2 malchezaar stuns himself - return; - - if (m_creature->GetUInt64Value(UNIT_FIELD_TARGET)!=m_creature->getVictim()->GetGUID()) - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->getVictim()->GetGUID()); - - if (phase == 1) - { - if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 60) - { - m_creature->InterruptNonMeleeSpells(false); - - phase = 2; - - //animation - DoCast(m_creature, SPELL_EQUIP_AXES); - - //text - DoScriptText(SAY_AXE_TOSS1, m_creature); - - //passive thrash aura - m_creature->CastSpell(m_creature, SPELL_THRASH_AURA, true); - - //models - SetEquipmentSlots(false, EQUIP_ID_AXE, EQUIP_ID_AXE, EQUIP_NO_CHANGE); - - //damage - const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 2*cinfo->mindmg); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 2*cinfo->maxdmg); - m_creature->UpdateDamagePhysical(BASE_ATTACK); - - m_creature->SetBaseWeaponDamage(OFF_ATTACK, MINDAMAGE, cinfo->mindmg); - m_creature->SetBaseWeaponDamage(OFF_ATTACK, MAXDAMAGE, cinfo->maxdmg); - //Sigh, updating only works on main attack , do it manually .... - m_creature->SetFloatValue(UNIT_FIELD_MINOFFHANDDAMAGE, cinfo->mindmg); - m_creature->SetFloatValue(UNIT_FIELD_MAXOFFHANDDAMAGE, cinfo->maxdmg); - - m_creature->SetAttackTime(OFF_ATTACK, (m_creature->GetAttackTime(BASE_ATTACK)*150)/100); - } - } - else if (phase == 2) - { - if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 30) - { - InfernalTimer = 15000; - - phase = 3; - - ClearWeapons(); - - //remove thrash - m_creature->RemoveAurasDueToSpell(SPELL_THRASH_AURA); - - DoScriptText(SAY_AXE_TOSS2, m_creature); - - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); - for(uint32 i=0; i<2; ++i) - { - Creature *axe = m_creature->SummonCreature(MALCHEZARS_AXE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (axe) - { - axe->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - axe->setFaction(m_creature->getFaction()); - axes[i] = axe->GetGUID(); - if (target) - { - axe->AI()->AttackStart(target); - // axe->getThreatManager().tauntApply(target); //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(target, 10000000.0f); - } - } - } - - if (ShadowNovaTimer > 35000) - ShadowNovaTimer = EnfeebleTimer + 5000; - - return; - } - - if (SunderArmorTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SUNDER_ARMOR); - SunderArmorTimer = 10000 + rand()%8000; - - }else SunderArmorTimer -= diff; - - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_CLEAVE); - Cleave_Timer = 6000 + rand()%6000; - - }else Cleave_Timer -= diff; - } - else - { - if (AxesTargetSwitchTimer < diff) - { - AxesTargetSwitchTimer = 7500 + rand()%12500 ; - - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - { - for(uint8 i = 0; i < 2; ++i) - { - Unit *axe = Unit::GetUnit(*m_creature, axes[i]); - if (axe) - { - float threat = 1000000.0f; - if (axe->getVictim() && DoGetThreat(axe->getVictim())) - { - threat = axe->getThreatManager().getThreat(axe->getVictim()); - axe->getThreatManager().modifyThreatPercent(axe->getVictim(), -100); - } - if (target) - axe->AddThreat(target, threat); - //axe->getThreatManager().tauntFadeOut(axe->getVictim()); - //axe->getThreatManager().tauntApply(target); - } - } - } - } else AxesTargetSwitchTimer -= diff; - - if (AmplifyDamageTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_AMPLIFY_DAMAGE); - AmplifyDamageTimer = 20000 + rand()%10000; - }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(m_creature->getVictim(), SPELL_SHADOWNOVA); - ShadowNovaTimer = phase == 3 ? 31000 : -1; - }else ShadowNovaTimer -= diff; - - if (phase != 2) - { - if (SWPainTimer < diff) - { - Unit* target = NULL; - if (phase == 1) - target = m_creature->getVictim(); // the tank - else //anyone but the tank - target = SelectUnit(SELECT_TARGET_RANDOM, 1); - - if (target) - DoCast(target, 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 (m_creature->IsWithinMeleeRange(m_creature->getVictim()) && !m_creature->IsNonMeleeSpellCasted(false)) - { - //Check for base attack - if (m_creature->isAttackReady() && m_creature->getVictim()) - { - m_creature->AttackerStateUpdate(m_creature->getVictim()); - m_creature->resetAttackTimer(); - } - //Check for offhand attack - if (m_creature->isAttackReady(OFF_ATTACK) && m_creature->getVictim()) - { - m_creature->AttackerStateUpdate(m_creature->getVictim(), OFF_ATTACK); - m_creature->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(*m_creature, malchezaar); - - if (pMalchezaar && pMalchezaar->isAlive()) - CAST_AI(boss_malchezaarAI, CAST_CRE(pMalchezaar)->AI())->Cleanup(m_creature, 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/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp deleted file mode 100644 index d672851315e..00000000000 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_shade_of_aran.cpp +++ /dev/null @@ -1,591 +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 "precompiled.h" -#include "simple_ai.h" -#include "def_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 TRINITY_DLL_DECL 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) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL1, m_creature); break; - case 1: DoScriptText(SAY_KILL2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - { - pInstance->SetData(TYPE_ARAN, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GO_LIBRARY_DOOR), true); - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - - 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 = m_creature->getThreatManager().getThreatList(); - - if (!t_list.size()) - return; - - //store the threat list in a different container - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - //only on alive players - if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) - targets.push_back(target); - } - - //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::iterator itr = targets.begin(); itr!= targets.end(); ++itr) - { - if (*itr) - { - FlameWreathTarget[i] = (*itr)->GetGUID(); - FWTargPosX[i] = (*itr)->GetPositionX(); - FWTargPosY[i] = (*itr)->GetPositionY(); - m_creature->CastSpell((*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 && m_creature->GetMaxPower(POWER_MANA) && (m_creature->GetPower(POWER_MANA)*100 / m_creature->GetMaxPower(POWER_MANA)) < 20) - { - Drinking = true; - m_creature->InterruptNonMeleeSpells(false); - - DoScriptText(SAY_DRINK, m_creature); - - if (!DrinkInturrupted) - { - m_creature->CastSpell(m_creature, SPELL_MASS_POLY, true); - m_creature->CastSpell(m_creature, SPELL_CONJURE, false); - m_creature->CastSpell(m_creature, SPELL_DRINK, false); - m_creature->SetStandState(UNIT_STAND_STATE_SIT); - DrinkInturruptTimer = 10000; - } - } - - //Drink Inturrupt - if (Drinking && DrinkInturrupted) - { - Drinking = false; - m_creature->RemoveAurasDueToSpell(SPELL_DRINK); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->SetPower(POWER_MANA, m_creature->GetMaxPower(POWER_MANA)-32000); - m_creature->CastSpell(m_creature, SPELL_POTION, false); - } - - //Drink Inturrupt Timer - if (Drinking && !DrinkInturrupted) - if (DrinkInturruptTimer >= diff) - DrinkInturruptTimer -= diff; - else - { - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->CastSpell(m_creature, SPELL_POTION, true); - m_creature->CastSpell(m_creature, 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 (!m_creature->IsNonMeleeSpellCasted(false)) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (!target) - 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(target, CurrentNormalSpell); - } - } - NormalCastTimer = 1000; - }else NormalCastTimer -= diff; - - if (SecondarySpellTimer < diff) - { - switch (rand()%2) - { - - case 0: - DoCast(m_creature, SPELL_AOE_CS); - break; - case 1: - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_CHAINSOFICE); - break; - } - SecondarySpellTimer = 5000 + (rand()%15000); - }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[rand()%2]; - - switch (LastSuperSpell) - { - case SUPER_AE: - - if (rand()%2) - DoScriptText(SAY_EXPLOSION1, m_creature); - else - DoScriptText(SAY_EXPLOSION2, m_creature); - - m_creature->CastSpell(m_creature, SPELL_BLINK_CENTER, true); - m_creature->CastSpell(m_creature, SPELL_PLAYERPULL, true); - m_creature->CastSpell(m_creature, SPELL_MASSSLOW, true); - m_creature->CastSpell(m_creature, SPELL_AEXPLOSION, false); - break; - - case SUPER_FLAME: - if (rand()%2) - DoScriptText(SAY_FLAMEWREATH1, m_creature); - else - DoScriptText(SAY_FLAMEWREATH2, m_creature); - - FlameWreathTimer = 20000; - FlameWreathCheckTime = 500; - - FlameWreathTarget[0] = 0; - FlameWreathTarget[1] = 0; - FlameWreathTarget[2] = 0; - - FlameWreathEffect(); - break; - - case SUPER_BLIZZARD: - - if (rand()%2) - DoScriptText(SAY_BLIZZARD1, m_creature); - else - DoScriptText(SAY_BLIZZARD2, m_creature); - - if (Creature* pSpawn = m_creature->SummonCreature(CREATURE_ARAN_BLIZZARD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 25000)) - { - pSpawn->setFaction(m_creature->getFaction()); - pSpawn->CastSpell(pSpawn, SPELL_CIRCULAR_BLIZZARD, false); - } - break; - } - - SuperCastTimer = 35000 + (rand()%5000); - }else SuperCastTimer -= diff; - - if (!ElementalsSpawned && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40) - { - ElementalsSpawned = true; - - for (uint32 i = 0; i < 4; ++i) - { - if (Creature* pUnit = m_creature->SummonCreature(CREATURE_WATER_ELEMENTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 90000)) - { - pUnit->Attack(m_creature->getVictim(), true); - pUnit->setFaction(m_creature->getFaction()); - } - } - - DoScriptText(SAY_ELEMENTALS, m_creature); - } - - if (BerserkTimer < diff) - { - for (uint32 i = 0; i < 5; ++i) - { - if (Creature* pUnit = m_creature->SummonCreature(CREATURE_SHADOW_OF_ARAN, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000)) - { - pUnit->Attack(m_creature->getVictim(), true); - pUnit->setFaction(m_creature->getFaction()); - } - } - - DoScriptText(SAY_TIMEOVER, m_creature); - - BerserkTimer = 60000; - }else BerserkTimer -= diff; - - //Flame Wreath check - if (FlameWreathTimer) - { - if (FlameWreathTimer >= diff) - FlameWreathTimer -= diff; - else FlameWreathTimer = 0; - - if (FlameWreathCheckTime < diff) - { - for (uint32 i = 0; i < 3; ++i) - { - if (!FlameWreathTarget[i]) - continue; - - Unit* pUnit = Unit::GetUnit(*m_creature, FlameWreathTarget[i]); - if (pUnit && !pUnit->IsWithinDist2d(FWTargPosX[i], FWTargPosY[i], 3)) - { - pUnit->CastSpell(pUnit, 20476, true, 0, 0, m_creature->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) || !m_creature->IsNonMeleeSpellCasted(false)) - return; - - //Inturrupt effect - m_creature->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 TRINITY_DLL_DECL 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(m_creature->getVictim(), SPELL_WATERBOLT); - CastTimer = 2000 + (rand()%3000); - }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/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp b/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp deleted file mode 100644 index c824f344942..00000000000 --- a/src/bindings/scripts/scripts/zone/karazhan/boss_terestian_illhoof.cpp +++ /dev/null @@ -1,432 +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 "precompiled.h" -#include "def_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_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 PORTAL_Z 179.434 - -float PortalLocations[2][2]= -{ - {-11249.6933, -1704.61023}, - {-11242.1160, -1713.33325}, -}; - -struct TRINITY_DLL_DECL 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(m_creature); - return; - } - - Creature* Terestian = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_TERESTIAN))); - if (Terestian && !Terestian->getVictim()) - Terestian->AddThreat(who, 1.0f); - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - uint64 TerestianGUID = pInstance->GetData64(DATA_TERESTIAN); - if (TerestianGUID) - { - Unit* Terestian = Unit::GetUnit((*m_creature), TerestianGUID); - if (Terestian && Terestian->isAlive()) - DoCast(Terestian, SPELL_BROKEN_PACT, true); - } - }else ERROR_INST_DATA(m_creature); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (AmplifyTimer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature->getVictim(),SPELL_AMPLIFY_FLAMES); - - AmplifyTimer = 10000 + rand()%10000; - }else AmplifyTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL 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((*m_creature),SacrificeGUID); - if (Sacrifice) - Sacrifice->RemoveAurasDueToSpell(SPELL_SACRIFICE); - } - } -}; - -struct TRINITY_DLL_DECL 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 KilrekGUID; - uint64 PortalGUID[2]; - - uint32 CheckKilrekTimer; - uint32 SacrificeTimer; - uint32 ShadowboltTimer; - uint32 SummonTimer; - uint32 BerserkTimer; - - bool ReSummon; - bool SummonKilrek; - bool SummonedPortals; - bool Berserk; - - void Reset() - { - for(uint8 i = 0; i < 2; ++i) - { - if (PortalGUID[i]) - { - if (Creature* pPortal = Unit::GetCreature(*m_creature, PortalGUID[i])) - pPortal->ForcedDespawn(); - - PortalGUID[i] = 0; - } - } - - CheckKilrekTimer = 5000; - SacrificeTimer = 30000; - ShadowboltTimer = 5000; - SummonTimer = 10000; - BerserkTimer = 600000; - - SummonedPortals = false; - Berserk = false; - ReSummon = false; - - if (pInstance) - pInstance->SetData(TYPE_TERESTIAN, NOT_STARTED); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - { - Creature* Kilrek = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KILREK))); - // Respawn Kil'rek on aggro if Kil'rek is dead. - if (Kilrek && !Kilrek->isAlive()) - { - Kilrek->Respawn(); - } - - // Put Kil'rek in combat against our target so players don't skip him - if (Kilrek && !Kilrek->getVictim()) - Kilrek->AddThreat(who, 1.0f); - - pInstance->SetData(TYPE_TERESTIAN, IN_PROGRESS); - }else ERROR_INST_DATA(m_creature); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *killer) - { - for(uint8 i = 0; i < 2; ++i) - { - if (PortalGUID[i]) - { - if (Creature* pPortal = Unit::GetCreature((*m_creature), PortalGUID[i])) - pPortal->ForcedDespawn(); - - PortalGUID[i] = 0; - } - } - - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(TYPE_TERESTIAN, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (CheckKilrekTimer < diff) - { - - CheckKilrekTimer = 5000; - - if (pInstance) - uint64 KilrekGUID = pInstance->GetData64(DATA_KILREK); - else ERROR_INST_DATA(m_creature); - - Creature* Kilrek = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_KILREK))); - if (SummonKilrek && Kilrek) - { - Kilrek->Respawn(); - if (Kilrek->AI()) - { - Kilrek->AI()->AttackStart(m_creature->getVictim()); - m_creature->RemoveAurasDueToSpell(SPELL_BROKEN_PACT); - } - - SummonKilrek = false; - } - - if (!Kilrek || !Kilrek->isAlive()) - { - SummonKilrek = true; - CheckKilrekTimer = 45000; - } - }else CheckKilrekTimer -= diff; - - if (SacrificeTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) - { - DoCast(target, SPELL_SACRIFICE, true); - Creature* Chains = m_creature->SummonCreature(CREATURE_DEMONCHAINS, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 21000); - if (Chains) - { - CAST_AI(mob_demon_chainAI, Chains->AI())->SacrificeGUID = target->GetGUID(); - Chains->CastSpell(Chains, SPELL_DEMON_CHAINS, true); - switch(rand()%2) - { - case 0: DoScriptText(SAY_SACRIFICE1, m_creature); break; - case 1: DoScriptText(SAY_SACRIFICE2, m_creature); break; - } - 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 (!SummonedPortals) - { - for(uint8 i = 0; i < 2; ++i) - { - Creature* Portal = m_creature->SummonCreature(CREATURE_PORTAL, PortalLocations[i][0], PortalLocations[i][1], PORTAL_Z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (Portal) - PortalGUID[i] = Portal->GetGUID(); - } - SummonedPortals = true; - switch(rand()%2) - { - case 0: DoScriptText(SAY_SUMMON1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON2, m_creature); break; - } - } - uint32 random = rand()%2; - Creature* Imp = m_creature->SummonCreature(CREATURE_FIENDISHIMP, PortalLocations[random][0], PortalLocations[random][1], PORTAL_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 15000); - if (Imp) - { - Imp->AddThreat(m_creature->getVictim(), 1.0f); - Imp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 1)); - } - SummonTimer = 5000; - }else SummonTimer -= diff; - - if (!Berserk) - { - if (BerserkTimer < diff) - { - DoCast(m_creature, SPELL_BERSERK); - Berserk = true; - }else BerserkTimer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -#define SPELL_FIREBOLT 30050 // Blasts a target for 181-209 Fire damage. - -struct TRINITY_DLL_DECL mob_fiendish_impAI : public ScriptedAI -{ - mob_fiendish_impAI(Creature *c) : ScriptedAI(c) {} - - uint32 FireboltTimer; - - void Reset() - { - FireboltTimer = 2000; - - m_creature->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(m_creature->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_demon_chain(Creature* pCreature) -{ - return new mob_demon_chainAI(pCreature); -} - -CreatureAI* GetAI_boss_terestian_illhoof(Creature* pCreature) -{ - return new boss_terestianAI (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_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/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp b/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp deleted file mode 100644 index da6f77e7c20..00000000000 --- a/src/bindings/scripts/scripts/zone/karazhan/bosses_opera.cpp +++ /dev/null @@ -1,1500 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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, m_creature); - } - - void JustReachedHome() - { - m_creature->ForcedDespawn(); - } - - void SummonTito(); // See below - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DOROTHEE_DEATH, m_creature); - - if (pInstance) - SummonCroneIfReady(pInstance, m_creature); - } - - void AttackStart(Unit* who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit* who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void UpdateAI(const uint32 diff) - { - if (AggroTimer) - { - if (AggroTimer <= diff) - { - m_creature->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(m_creature->getVictim(), SPELL_SCREAM); - FearTimer = 30000; - }else FearTimer -= diff; - - if (!SummonedTito) - { - if (SummonTitoTimer < diff) - SummonTito(); - else SummonTitoTimer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL 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((*m_creature), 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(m_creature->getVictim(), SPELL_YIPPING); - YipTimer = 10000; - }else YipTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -void boss_dorotheeAI::SummonTito() -{ - if (Creature* pTito = m_creature->SummonCreature(CREATURE_TITO, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000)) - { - DoScriptText(SAY_DOROTHEE_SUMMON, m_creature); - CAST_AI(mob_titoAI, pTito->AI())->DorotheeGUID = m_creature->GetGUID(); - pTito->AI()->AttackStart(m_creature->getVictim()); - SummonedTito = true; - TitoDied = false; - } -} - -struct TRINITY_DLL_DECL 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 (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit* who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_STRAWMAN_AGGRO, m_creature); - } - - void JustReachedHome() - { - m_creature->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(m_creature, SPELL_BURNING_STRAW, true); - } - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_STRAWMAN_DEATH, m_creature); - - if (pInstance) - SummonCroneIfReady(pInstance, m_creature); - } - - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_STRAWMAN_SLAY, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (AggroTimer) - { - if (AggroTimer <= diff) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer = 0; - }else AggroTimer -= diff; - } - - if (!UpdateVictim()) - return; - - if (BrainBashTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BRAIN_BASH); - BrainBashTimer = 15000; - }else BrainBashTimer -= diff; - - if (BrainWipeTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_BRAIN_WIPE); - BrainWipeTimer = 20000; - }else BrainWipeTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL 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, m_creature); - } - - void JustReachedHome() - { - m_creature->ForcedDespawn(); - } - - void AttackStart(Unit* who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit* who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_TINHEAD_DEATH, m_creature); - - if (pInstance) - SummonCroneIfReady(pInstance, m_creature); - } - - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_TINHEAD_SLAY, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (AggroTimer) - { - if (AggroTimer < diff) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer = 0; - }else AggroTimer -= diff; - } - - if (!UpdateVictim()) - return; - - if (CleaveTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_CLEAVE); - CleaveTimer = 5000; - }else CleaveTimer -= diff; - - if (RustCount < 8) - { - if (RustTimer < diff) - { - RustCount++; - DoScriptText(EMOTE_RUST, m_creature); - DoCast(m_creature, SPELL_RUST); - RustTimer = 6000; - }else RustTimer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL 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 (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void AttackStart(Unit* who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(who); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_ROAR_AGGRO, m_creature); - } - - void JustReachedHome() - { - m_creature->ForcedDespawn(); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_ROAR_DEATH, m_creature); - - if (pInstance) - SummonCroneIfReady(pInstance, m_creature); - } - - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_ROAR_SLAY, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (AggroTimer) - { - if (AggroTimer <= diff) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer = 0; - }else AggroTimer -= diff; - } - - if (!UpdateVictim()) - return; - - if (MangleTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_MANGLE); - MangleTimer = 5000 + rand()%3000; - }else MangleTimer -= diff; - - if (ShredTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SHRED); - ShredTimer = 10000 + rand()%5000; - }else ShredTimer -= diff; - - if (ScreamTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FRIGHTENED_SCREAM); - ScreamTimer = 20000 + rand()%10000; - }else ScreamTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL 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() - { - m_creature->ForcedDespawn(); - } - - void EnterCombat(Unit* who) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_CRONE_AGGRO, m_creature); break; - case 1: DoScriptText(SAY_CRONE_AGGRO2, m_creature); break; - } - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_CRONE_DEATH, m_creature); - - 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 (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - if (CycloneTimer < diff) - { - Creature* Cyclone = DoSpawnCreature(CREATURE_CYCLONE, rand()%10, rand()%10, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 15000); - if (Cyclone) - Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_VISUAL, true); - CycloneTimer = 30000; - }else CycloneTimer -= diff; - - if (ChainLightningTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING); - ChainLightningTimer = 15000; - }else ChainLightningTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL 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 (!m_creature->HasAura(SPELL_KNOCKBACK)) - DoCast(m_creature, SPELL_KNOCKBACK, true); - - if (MoveTimer < diff) - { - float x,y,z; - m_creature->GetPosition(x,y,z); - float PosX, PosY, PosZ; - m_creature->GetRandomPoint(x,y,z,10, PosX, PosY, PosZ); - m_creature->GetMotionMaster()->MovePoint(0, PosX, PosY, PosZ); - MoveTimer = 5000 + rand()%3000; - }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 TRINITY_DLL_DECL 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, m_creature); - } - - void JustReachedHome() - { - m_creature->ForcedDespawn(); - } - - void JustDied(Unit* killer) - { - DoPlaySoundToSet(m_creature, 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) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target && target->GetTypeId() == TYPEID_PLAYER) - { - DoScriptText(SAY_WOLF_HOOD, m_creature); - - DoCast(target, SPELL_LITTLE_RED_RIDING_HOOD, true); - TempThreat = DoGetThreat(target); - if (TempThreat) - DoModifyThreatPercent(target, -100); - HoodGUID = target->GetGUID(); - m_creature->AddThreat(target, 1000000.0f); - ChaseTimer = 20000; - IsChasing = true; - } - } - else - { - IsChasing = false; - - if (Unit* target = Unit::GetUnit((*m_creature), HoodGUID)) - { - HoodGUID = 0; - if (DoGetThreat(target)) - DoModifyThreatPercent(target, -100); - m_creature->AddThreat(target, TempThreat); - TempThreat = 0; - } - - ChaseTimer = 40000; - } - }else ChaseTimer -= diff; - - if (IsChasing) - return; - - if (FearTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_TERRIFYING_HOWL); - FearTimer = 25000 + rand()%10000; - }else FearTimer -= diff; - - if (SwipeTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_WIDE_SWIPE); - SwipeTimer = 25000 + rand()%5000; - }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* target) -{ - target->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - target->SetHealth(target->GetMaxHealth()); - target->SetStandState(UNIT_STAND_STATE_STAND); - target->CastSpell(target, SPELL_RES_VISUAL, true); - if (target->getVictim()) - { - target->GetMotionMaster()->MoveChase(target->getVictim()); - target->AI()->AttackStart(target->getVictim()); - } - else - target->GetMotionMaster()->Initialize(); -}; - -struct TRINITY_DLL_DECL 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(m_creature); - IsFakingDeath = false; - } - - SummonedRomulo = false; - RomuloDead = false; - } - - void EnterCombat(Unit* who) {} - - void AttackStart(Unit* who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit* who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void JustReachedHome() - { - m_creature->ForcedDespawn(); - } - - void SpellHit(Unit* caster, const SpellEntry *Spell) - { - if (Spell->Id == SPELL_DRINK_POISON) - { - DoScriptText(SAY_JULIANNE_DEATH01, m_creature); - DrinkPoisonTimer = 2500; - } - } - - void DamageTaken(Unit* done_by, uint32 &damage); - - void JustDied(Unit* killer) - { - DoScriptText(SAY_JULIANNE_DEATH02, m_creature); - - 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, m_creature); - } - - void UpdateAI(const uint32 diff); -}; - -struct TRINITY_DLL_DECL 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() - { - m_creature->ForcedDespawn(); - } - - void DamageTaken(Unit* done_by, uint32 &damage); - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_ROMULO_AGGRO, m_creature); - if (JulianneGUID) - { - Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)); - if (Julianne && Julianne->getVictim()) - { - m_creature->AddThreat(Julianne->getVictim(), 1.0f); - AttackStart(Julianne->getVictim()); - } - } - } - - void MoveInLineOfSight(Unit* who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_ROMULO_DEATH, m_creature); - - 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, m_creature); - } - - void UpdateAI(const uint32 diff); -}; - -void boss_julianneAI::DamageTaken(Unit* done_by, uint32 &damage) -{ - if (damage < m_creature->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; - - m_creature->InterruptNonMeleeSpells(true); - DoCast(m_creature, SPELL_DRINK_POISON); - - IsFakingDeath = true; - //IS THIS USEFULL? Creature* Julianne = (Unit::GetCreature((*m_creature), 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((*m_creature), 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((*m_creature), RomuloGUID))) - { - PretendToDie(m_creature); - 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 < m_creature->GetHealth()) - return; - - //anything below only used if incoming damage will kill - - if (Phase == PHASE_ROMULO) - { - DoScriptText(SAY_ROMULO_DEATH, m_creature); - PretendToDie(m_creature); - IsFakingDeath = true; - Phase = PHASE_BOTH; - - if (Creature* Julianne = (Unit::GetCreature((*m_creature), 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((*m_creature), 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((*m_creature), JulianneGUID))) - { - PretendToDie(m_creature); - 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, m_creature); - EntryYellTimer = 0; - }else EntryYellTimer -= diff; - } - - if (AggroYellTimer) - { - if (AggroYellTimer <= diff) - { - DoScriptText(SAY_JULIANNE_AGGRO, m_creature); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->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(m_creature); - Phase = PHASE_ROMULO; - SummonRomuloTimer = 10000; - DrinkPoisonTimer = 0; - }else DrinkPoisonTimer -= diff; - } - - if (Phase == PHASE_ROMULO && !SummonedRomulo) - { - if (SummonRomuloTimer < diff) - { - if (Creature* pRomulo = m_creature->SummonCreature(CREATURE_ROMULO, ROMULO_X, ROMULO_Y, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, HOUR*2*IN_MILISECONDS)) - { - RomuloGUID = pRomulo->GetGUID(); - CAST_AI(boss_romuloAI, pRomulo->AI())->JulianneGUID = m_creature->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(m_creature); - Phase = PHASE_BOTH; - IsFakingDeath = false; - - if (m_creature->getVictim()) - AttackStart(m_creature->getVictim()); - - ResurrectSelfTimer = 0; - ResurrectTimer = 1000; - }else ResurrectSelfTimer -= diff; - } - - if (!UpdateVictim() || IsFakingDeath) - return; - - if (RomuloDead) - { - if (ResurrectTimer < diff) - { - Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID)); - if (Romulo && CAST_AI(boss_romuloAI, Romulo->AI())->IsFakingDeath) - { - DoScriptText(SAY_JULIANNE_RESURRECT, m_creature); - Resurrect(Romulo); - CAST_AI(boss_romuloAI, Romulo->AI())->IsFakingDeath = false; - RomuloDead = false; - ResurrectTimer = 10000; - } - }else ResurrectTimer -= diff; - } - - if (BlindingPassionTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_BLINDING_PASSION); - BlindingPassionTimer = 30000 + rand()%15000; - }else BlindingPassionTimer -= diff; - - if (DevotionTimer < diff) - { - DoCast(m_creature, SPELL_DEVOTION); - DevotionTimer = 15000 + rand()%30000; - }else DevotionTimer -= diff; - - if (PowerfulAttractionTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_POWERFUL_ATTRACTION); - PowerfulAttractionTimer = 5000 + rand()%25000; - }else PowerfulAttractionTimer -= diff; - - if (EternalAffectionTimer < diff) - { - if (rand()%2 == 1 && SummonedRomulo) - { - Creature* Romulo = (Unit::GetCreature((*m_creature), RomuloGUID)); - if (Romulo && Romulo->isAlive() && !RomuloDead) - DoCast(Romulo, SPELL_ETERNAL_AFFECTION); - }else DoCast(m_creature, SPELL_ETERNAL_AFFECTION); - - EternalAffectionTimer = 45000 + rand()%15000; - }else EternalAffectionTimer -= diff; - - DoMeleeAttackIfReady(); -} - -void boss_romuloAI::UpdateAI(const uint32 diff) -{ - if (!UpdateVictim() || IsFakingDeath) - return; - - if (JulianneDead) - { - if (ResurrectTimer < diff) - { - Creature* Julianne = (Unit::GetCreature((*m_creature), JulianneGUID)); - if (Julianne && CAST_AI(boss_julianneAI, Julianne->AI())->IsFakingDeath) - { - DoScriptText(SAY_ROMULO_RESURRECT, m_creature); - Resurrect(Julianne); - CAST_AI(boss_julianneAI, Julianne->AI())->IsFakingDeath = false; - JulianneDead = false; - ResurrectTimer = 10000; - } - }else ResurrectTimer -= diff; - } - - if (BackwardLungeTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (target && !m_creature->HasInArc(M_PI, target)) - { - DoCast(target, SPELL_BACKWARD_LUNGE); - BackwardLungeTimer = 15000 + rand()%15000; - } - }else BackwardLungeTimer -= diff; - - if (DaringTimer < diff) - { - DoCast(m_creature, SPELL_DARING); - DaringTimer = 20000 + rand()%20000; - }else DaringTimer -= diff; - - if (DeadlySwatheTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DEADLY_SWATHE); - DeadlySwatheTimer = 15000 + rand()%10000; - }else DeadlySwatheTimer -= diff; - - if (PoisonThrustTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_POISON_THRUST); - PoisonThrustTimer = 10000 + rand()%10000; - }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/bindings/scripts/scripts/zone/karazhan/def_karazhan.h b/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h deleted file mode 100644 index 67cb5e6ece5..00000000000 --- a/src/bindings/scripts/scripts/zone/karazhan/def_karazhan.h +++ /dev/null @@ -1,54 +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 -{ - 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/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp deleted file mode 100644 index 2ee3f3958cf..00000000000 --- a/src/bindings/scripts/scripts/zone/karazhan/instance_karazhan.cpp +++ /dev/null @@ -1,309 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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: m_auiEncounter[11] = uiData; break; - if (m_auiEncounter[11] == DONE) - break; - 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/bindings/scripts/scripts/zone/karazhan/karazhan.cpp b/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp deleted file mode 100644 index 91dd4e44ad3..00000000000 --- a/src/bindings/scripts/scripts/zone/karazhan/karazhan.cpp +++ /dev/null @@ -1,651 +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 "precompiled.h" -#include "def_karazhan.h" -#include "escortAI.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 TRINITY_DLL_DECL 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: - m_creature->CastSpell(m_creature, SPELL_TUXEDO, false); - pInstance->DoUseDoorOrButton(pInstance->GetData64(DATA_GO_STAGEDOORLEFT)); - break; - case 4: - TalkCount = 0; - IsOnHold = true; - - if (Creature* pSpotlight = m_creature->SummonCreature(CREATURE_SPOTLIGHT, - m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->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, m_creature); - } - - 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 = m_creature->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 (IsOnHold) - { - if (TalkTimer < diff) - { - if (TalkCount > 3) - { - if (Creature* pSpotlight = Unit::GetCreature(*m_creature, m_uiSpotlightGUID)) - pSpotlight->ForcedDespawn(); - - IsOnHold = false; - return; - } - - Talk(TalkCount); - ++TalkCount; - } - else - TalkTimer -= diff; - } - - if (PerformanceReady) - { - if (!RaidWiped) - { - if (WipeTimer < diff) - { - Map* pMap = m_creature->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 = (ScriptedInstance*)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 -{ - 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 = (ScriptedInstance*)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(pCreature->GetNpcTextId(), 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 TRINITY_DLL_DECL 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, m_creature->GetGUID()); - (*m_creature).GetMotionMaster()->MovePoint(1,MedivPos[0],MedivPos[1],MedivPos[2]); - Step = 0; - }else - { - m_creature->DealDamage(m_creature,m_creature->GetHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - } - } - void EnterCombat(Unit* who){} - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - if (id == 1) - { - StartEvent(); - m_creature->SetOrientation(MedivPos[3]); - m_creature->SetOrientation(MedivPos[3]); - } - } - - void StartEvent() - { - Step = 1; - EventStarted = true; - Creature* Arcanagos = m_creature->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]); - m_creature->SetOrientation(MedivPos[3]); - YellTimer = 10000; - } - - - uint32 NextStep(uint32 Step) - { - Unit* arca = Unit::GetUnit((*m_creature),ArcanagosGUID); - Map* pMap = m_creature->GetMap(); - switch(Step) - { - case 0: return 9999999; - case 1: - m_creature->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: - m_creature->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: - m_creature->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(m_creature, SPELL_MANA_SHIELD); - return 10000; - case 9: - m_creature->MonsterTextEmote(EMOTE_DIALOG_MEDIVH_7, 0, false); - return 10000; - case 10: - if (arca) - m_creature->CastSpell(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: - m_creature->MonsterYell(SAY_DIALOG_MEDIVH_9, LANG_UNIVERSAL, NULL); - return 10000; - case 14: - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->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((*m_creature),ArcanagosGUID); - - if (FireArcanagosTimer < diff) - { - if (arca) - arca->CastSpell(m_creature, 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/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp deleted file mode 100644 index 2d6b34d64e5..00000000000 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_felblood_kaelthas.cpp +++ /dev/null @@ -1,688 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL boss_felblood_kaelthasAI : public ScriptedAI -{ - boss_felblood_kaelthasAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); Heroic = c->GetMap()->IsHeroic(); - } - - 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 Heroic; - 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, m_creature); - - if (!pInstance) - return; - - pInstance->HandleGameObject(pInstance->GetData64(DATA_KAEL_DOOR), true); - // Open the encounter door - } - - void DamageTaken(Unit* done_by, uint32 &damage) - { - if (damage > m_creature->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 && m_creature->IsWithinDistInMap(who, 40.0)) - { - DoScriptText(SAY_AGGRO, m_creature); - HasTaunted = true; - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void SetThreatList(Creature* SummonedUnit) - { - if (!SummonedUnit) - return; - - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - std::list::iterator i = m_threatlist.begin(); - for(i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - if (pUnit && pUnit->isAlive()) - { - float threat = m_creature->getThreatManager().getThreat(pUnit); - SummonedUnit->AddThreat(pUnit, threat); - } - } - } - - void TeleportPlayersToSelf() - { - float x = KaelLocations[0][0]; - float y = KaelLocations[0][1]; - m_creature->GetMap()->CreatureRelocation(m_creature, x, y, LOCATION_Z, 0.0f); - //m_creature->SendMonsterMove(x, y, LOCATION_Z, 0, 0, 0); // causes some issues... - std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); - for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) - pUnit->CastSpell(pUnit, SPELL_TELEPORT_CENTER, true); - } - DoCast(m_creature, SPELL_TELEPORT_CENTER, true); - } - - void CastGravityLapseKnockUp() - { - std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); - for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) - // Knockback into the air - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_DOT, true, 0, 0, m_creature->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::iterator i = m_creature->getThreatManager().getThreatList().begin(); - for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*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, m_creature->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::iterator i = m_creature->getThreatManager().getThreatList().begin(); - for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*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 (Heroic) - { - if (PyroblastTimer < diff) - { - m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL); - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - DoCast(m_creature, SPELL_SHOCK_BARRIER, true); - DoCast(m_creature->getVictim(), SPELL_PYROBLAST); - PyroblastTimer = 60000; - }else PyroblastTimer -= diff; - } - - if (FireballTimer < diff) - { - DoCast(m_creature->getVictim(), Heroic ? SPELL_FIREBALL_HEROIC : SPELL_FIREBALL_NORMAL); - FireballTimer = 2000 + rand()%4000; - }else FireballTimer -= diff; - - if (PhoenixTimer < diff) - { - - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1); - - uint32 random = rand()%2 + 1; - float x = KaelLocations[random][0]; - float y = KaelLocations[random][1]; - - Creature* Phoenix = m_creature->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(target); - } - - DoScriptText(SAY_PHOENIX, m_creature); - - PhoenixTimer = 60000; - }else PhoenixTimer -= diff; - - if (FlameStrikeTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL); - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - DoCast(target, SPELL_FLAMESTRIKE3, true); - DoScriptText(SAY_FLAMESTRIKE, m_creature); - } - FlameStrikeTimer = 15000 + rand()%10000; - }else FlameStrikeTimer -= diff; - - // Below 50% - if (m_creature->GetMaxHealth() * 0.5 > m_creature->GetHealth()) - { - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); - m_creature->StopMoving(); - m_creature->GetMotionMaster()->Clear(); - m_creature->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, m_creature); - 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, m_creature); - } - - DoCast(m_creature, 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* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - - Creature* Orb = DoSpawnCreature(CREATURE_ARCANE_SPHERE, 5, 5, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Orb && target) - { - //SetThreatList(Orb); - Orb->AddThreat(target, 1.0f); - Orb->AI()->AttackStart(target); - } - - } - - DoCast(m_creature, SPELL_GRAVITY_LAPSE_CHANNEL); - break; - - case 4: - m_creature->InterruptNonMeleeSpells(false); - DoScriptText(SAY_TIRED, m_creature); - DoCast(m_creature, SPELL_POWER_FEEDBACK); - RemoveGravityLapse(); - GravityLapseTimer = 10000; - GravityLapsePhase = 0; - break; - } - }else GravityLapseTimer -= diff; - } - break; - } - } -}; - -struct TRINITY_DLL_DECL mob_felkael_flamestrikeAI : public ScriptedAI -{ - mob_felkael_flamestrikeAI(Creature *c) : ScriptedAI(c) - { - Heroic = c->GetMap()->IsHeroic(); - } - - uint32 FlameStrikeTimer; - bool Heroic; - - void Reset() - { - FlameStrikeTimer = 5000; - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->setFaction(14); - - DoCast(m_creature, SPELL_FLAMESTRIKE2, true); - } - - void EnterCombat(Unit *who) {} - void MoveInLineOfSight(Unit *who) {} - void UpdateAI(const uint32 diff) - { - if (FlameStrikeTimer < diff) - { - DoCast(m_creature, Heroic ? SPELL_FLAMESTRIKE1_HEROIC : SPELL_FLAMESTRIKE1_NORMAL, true); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - }else FlameStrikeTimer -= diff; - } -}; - -struct TRINITY_DLL_DECL 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() - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE + UNIT_FLAG_NON_ATTACKABLE); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->CastSpell(m_creature,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 < m_creature->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; - - m_creature->InterruptNonMeleeSpells(false); - m_creature->SetHealth(0); - m_creature->StopMoving(); - m_creature->ClearComboPointHolders(); - m_creature->RemoveAllAurasOnDeath(); - m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); - m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->ClearAllReactives(); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); - - } - - } - - void JustDied(Unit* slayer) - { - m_creature->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(m_creature, SPELL_REBIRTH_DMG); - Rebirth = true; - } - - if (Rebirth) - { - - if (Death_Timer < diff) - { - m_creature->SummonCreature(CREATURE_PHOENIX_EGG, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); - m_creature->setDeathState(JUST_DIED); - m_creature->RemoveCorpse(); - 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. - uint32 dmg = urand(1650,2050); - m_creature->DealDamage(m_creature, dmg, 0, DOT, SPELL_SCHOOL_MASK_FIRE, NULL, false); - BurnTimer += 2000; - } BurnTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL 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) - { - m_creature->SummonCreature(CREATURE_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - }else HatchTimer -= diff; - - } -}; - -struct TRINITY_DLL_DECL mob_arcane_sphereAI : public ScriptedAI -{ - mob_arcane_sphereAI(Creature *c) : ScriptedAI(c) {Reset();} - - uint32 DespawnTimer; - uint32 ChangeTargetTimer; - - void Reset() - { - DespawnTimer = 30000; - ChangeTargetTimer = 6000 + rand()%6000; - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->setFaction(14); - DoCast(m_creature, SPELL_ARCANE_SPHERE_PASSIVE, true); - } - - - void EnterCombat(Unit* who) {} - - - void UpdateAI(const uint32 diff) - { - if (DespawnTimer < diff) - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - else DespawnTimer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (ChangeTargetTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - m_creature->AddThreat(target, 1.0f); - m_creature->TauntApply(target); - AttackStart(target); - } - - ChangeTargetTimer = 5000 + rand()%10000; - }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/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp deleted file mode 100644 index e0123a5367b..00000000000 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_priestess_delrissa.cpp +++ /dev/null @@ -1,1339 +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 "precompiled.h" -#include "def_magisters_terrace.h" - -struct Speech -{ - int32 id; -}; - -static Speech LackeyDeath[]= -{ - {-1585013}, - {-1585014}, - {-1585015}, - {-1585016}, -}; - -static Speech PlayerDeath[]= -{ - {-1585017}, - {-1585018}, - {-1585019}, - {-1585020}, - {-1585021}, -}; - -enum -{ - 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 TRINITY_DLL_DECL boss_priestess_delrissaAI : public ScriptedAI -{ - boss_priestess_delrissaAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Heroic = c->GetMap()->IsHeroic(); - memset(&m_auiLackeyGUID, 0, sizeof(m_auiLackeyGUID)); - LackeyEntryList.clear(); - } - - ScriptedInstance* pInstance; - bool Heroic; - - 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, m_creature); - - for(uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) - { - if (Unit* pAdd = Unit::GetUnit(*m_creature, 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 (!m_creature->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::iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr) - { - if (Creature* pAdd = m_creature->SummonCreature((*itr), LackeyLocations[j][0], LackeyLocations[j][1], fZLocation, fOrientation, TEMPSUMMON_CORPSE_DESPAWN, 0)) - m_auiLackeyGUID[j] = pAdd->GetGUID(); - - ++j; - } - } - else - { - for(std::vector::iterator itr = LackeyEntryList.begin(); itr != LackeyEntryList.end(); ++itr) - { - Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[j]); - - //object already removed, not exist - if (!pAdd) - { - if (Creature* pAdd = m_creature->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, m_creature); - - if (PlayersKilled < 4) - ++PlayersKilled; - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (!pInstance) - return; - - if (pInstance->GetData(DATA_DELRISSA_DEATH_COUNT) == MAX_ACTIVE_LACKEY) - pInstance->SetData(DATA_DELRISSA_EVENT, DONE); - else - { - if (m_creature->HasFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE)) - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ResetTimer < diff) - { - float x, y, z, o; - m_creature->GetHomePosition(x, y, z, o); - if (m_creature->GetPositionZ() >= z+10) - { - EnterEvadeMode(); - return; - } - ResetTimer = 5000; - }else ResetTimer -= diff; - - if (HealTimer < diff) - { - uint32 health = m_creature->GetHealth(); - Unit* target = m_creature; - for(uint8 i = 0; i < MAX_ACTIVE_LACKEY; ++i) - { - if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[i])) - { - if (pAdd->isAlive() && pAdd->GetHealth() < health) - target = pAdd; - } - } - - DoCast(target, SPELL_FLASH_HEAL); - HealTimer = 15000; - }else HealTimer -= diff; - - if (RenewTimer < diff) - { - Unit* target = m_creature; - - if (rand()%2 == 1) - { - if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) - { - if (pAdd->isAlive()) - target = pAdd; - } - } - DoCast(target,Heroic ? SPELL_RENEW_HEROIC : SPELL_RENEW_NORMAL); - RenewTimer = 5000; - }else RenewTimer -= diff; - - if (ShieldTimer < diff) - { - Unit* target = m_creature; - - if (rand()%2 == 1) - { - if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) - { - if (pAdd->isAlive() && !pAdd->HasAura(SPELL_SHIELD)) - target = pAdd; - } - } - - DoCast(target, SPELL_SHIELD); - ShieldTimer = 7500; - }else ShieldTimer -= diff; - - if (DispelTimer < diff) - { - Unit* target = NULL; - bool friendly = false; - - if (rand()%2 == 1) - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - else - { - friendly = true; - - if (rand()%2 == 1) - target = m_creature; - else - { - if (Unit* pAdd = Unit::GetUnit(*m_creature, m_auiLackeyGUID[rand()%MAX_ACTIVE_LACKEY])) - { - if (pAdd->isAlive()) - target = pAdd; - } - } - } - - if (target) - DoCast(target, SPELL_DISPEL_MAGIC); - - DispelTimer = 12000; - }else DispelTimer -= diff; - - if (SWPainTimer < diff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, Heroic ? SPELL_SW_PAIN_HEROIC : SPELL_SW_PAIN_NORMAL); - - SWPainTimer = 10000; - }else SWPainTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_priestess_delrissa(Creature* pCreature) -{ - return new boss_priestess_delrissaAI(pCreature); -} - -enum -{ - SPELL_HEALING_POTION = 15503 -}; - -//all 8 possible lackey use this common -struct TRINITY_DLL_DECL 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 = 5000 + rand()%15000; - - // 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(*m_creature, pInstance->GetData64(DATA_DELRISSA))) - { - 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(*m_creature, m_auiLackeyGUIDs[i])) - { - if (!pAdd->getVictim() && pAdd != m_creature) - { - pWho->SetInCombatWith(pAdd); - pAdd->AddThreat(pWho, 0.0f); - } - } - } - - if (Creature* pDelrissa = Unit::GetCreature(*m_creature, 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(*m_creature, 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(*m_creature, pInstance->GetData64(DATA_DELRISSA)))) - Delrissa->AI()->KilledUnit(victim); - } - - void AcquireGUIDs() - { - if (!pInstance) - return; - - if (Creature* Delrissa = (Unit::GetCreature(*m_creature, 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 && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)) - { - DoCast(m_creature, SPELL_HEALING_POTION); - UsedPotion = true; - } - - if (ResetThreatTimer < diff) - { - DoResetThreat(); - ResetThreatTimer = 5000 + rand()%15000; - }else ResetThreatTimer -= diff; - } -}; - -enum -{ - SPELL_KIDNEY_SHOT = 27615, - SPELL_GOUGE = 12540, - SPELL_KICK = 27613, - SPELL_VANISH = 44290, - SPELL_BACKSTAB = 15657, - SPELL_EVISCERATE = 27611 -}; - -struct TRINITY_DLL_DECL 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; - m_creature->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(m_creature, SPELL_VANISH); - - Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0); - - DoResetThreat(); - - if (pUnit) - m_creature->AddThreat(pUnit, 1000.0f); - - InVanish = true; - Vanish_Timer = 30000; - Wait_Timer = 10000; - }else Vanish_Timer -= diff; - - if (InVanish) - { - if (Wait_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BACKSTAB, true); - DoCast(m_creature->getVictim(), SPELL_KIDNEY_SHOT, true); - m_creature->SetVisibility(VISIBILITY_ON); // ...? Hacklike - InVanish = false; - }else Wait_Timer -= diff; - } - - if (Gouge_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_GOUGE); - Gouge_Timer = 5500; - }else Gouge_Timer -= diff; - - if (Kick_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_KICK); - Kick_Timer = 7000; - }else Kick_Timer -= diff; - - if (Eviscerate_Timer < diff) - { - DoCast(m_creature->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 -{ - 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 TRINITY_DLL_DECL 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(m_creature,SPELL_SUMMON_IMP); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - boss_priestess_lackey_commonAI::UpdateAI(diff); - - if (Immolate_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_IMMOLATE); - Immolate_Timer = 6000; - }else Immolate_Timer -= diff; - - if (Shadow_Bolt_Timer < diff) - { - DoCast(m_creature->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 -{ - SPELL_KNOCKDOWN = 11428, - SPELL_SNAP_KICK = 46182 -}; - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_KNOCKDOWN); - Knockdown_Timer = 6000; - }else Knockdown_Timer -= diff; - - if (Snap_Kick_Timer < diff) - { - DoCast(m_creature->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 -{ - 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 TRINITY_DLL_DECL 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* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_POLYMORPH); - Polymorph_Timer = 20000; - } - }else Polymorph_Timer -= diff; - - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 35) && !HasIceBlocked) - { - DoCast(m_creature, 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(m_creature->getVictim(), SPELL_ICE_LANCE); - Ice_Lance_Timer = 12000; - }else Ice_Lance_Timer -= diff; - - if (Cone_of_Cold_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_CONE_OF_COLD); - Cone_of_Cold_Timer = 10000; - }else Cone_of_Cold_Timer -= diff; - - if (Frostbolt_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FROSTBOLT); - Frostbolt_Timer = 8000; - }else Frostbolt_Timer -= diff; - - if (Blink_Timer < diff) - { - bool InMeleeRange = false; - std::list& t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - if (Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid())) - { - //if in melee range - if (target->IsWithinDistInMap(m_creature, 5)) - { - InMeleeRange = true; - break; - } - } - } - - //if anybody is in melee range than escape by blink - if (InMeleeRange) - DoCast(m_creature, SPELL_BLINK); - - Blink_Timer = 8000; - }else Blink_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_yazzai(Creature* pCreature) -{ - return new boss_yazzaiAI(pCreature); -} - -enum -{ - 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 TRINITY_DLL_DECL 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(m_creature, 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 = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - if (Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid())) - { - //if in melee range - if (target->IsWithinDistInMap(m_creature, 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(m_creature->getVictim(),SPELL_DISARM); - Disarm_Timer = 6000; - }else Disarm_Timer -= diff; - - if (Hamstring_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_HAMSTRING); - Hamstring_Timer = 4500; - }else Hamstring_Timer -= diff; - - if (Mortal_Strike_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); - Mortal_Strike_Timer = 4500; - }else Mortal_Strike_Timer -= diff; - - if (Piercing_Howl_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_PIERCING_HOWL); - Piercing_Howl_Timer = 10000; - }else Piercing_Howl_Timer -= diff; - - if (Frightening_Shout_Timer < diff) - { - DoCast(m_creature->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 -{ - 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 TRINITY_DLL_DECL 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(*m_creature,m_uiPetGUID); - if (!pPet) - m_creature->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 (m_creature->IsWithinDistInMap(m_creature->getVictim(), ATTACK_DISTANCE)) - { - if (Wing_Clip_Timer < diff) - { - DoCast(m_creature->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 m_creature) - GameObject* pGo = m_creature->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(m_creature->getVictim(), SPELL_FREEZING_TRAP); - Freezing_Trap_Timer = 15000; - } - }else Freezing_Trap_Timer -= diff; - - DoMeleeAttackIfReady(); - } - else - { - if (Concussive_Shot_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_CONCUSSIVE_SHOT); - Concussive_Shot_Timer = 8000; - }else Concussive_Shot_Timer -= diff; - - if (Multi_Shot_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT); - Multi_Shot_Timer = 10000; - }else Multi_Shot_Timer -= diff; - - if (Aimed_Shot_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_AIMED_SHOT); - Aimed_Shot_Timer = 6000; - }else Aimed_Shot_Timer -= diff; - - if (Shoot_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SHOOT); - Shoot_Timer = 2500; - }else Shoot_Timer -= diff; - } - } -}; - -CreatureAI* GetAI_garaxxas(Creature* pCreature) -{ - return new boss_garaxxasAI(pCreature); -} - -enum -{ - 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 TRINITY_DLL_DECL 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) - { - switch(rand()%3) - { - case 0: DoCast(m_creature, SPELL_WINDFURY_TOTEM); break; - case 1: DoCast(m_creature, SPELL_FIRE_NOVA_TOTEM); break; - case 2: DoCast(m_creature, SPELL_EARTHBIND_TOTEM); break; - } - ++Totem_Amount; - Totem_Timer = Totem_Amount*2000; - }else Totem_Timer -= diff; - - if (War_Stomp_Timer < diff) - { - DoCast(m_creature, 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(m_creature->getVictim(), SPELL_FROST_SHOCK); - Frost_Shock_Timer = 7000; - }else Frost_Shock_Timer -= diff; - - if (Healing_Wave_Timer < diff) - { - // std::vector::iterator itr = Group.begin() + rand()%Group.size(); - // uint64 guid = (*itr)->guid; - // if (guid) - // { - // Unit* pAdd = Unit::GetUnit(*m_creature, (*itr)->guid); - // if (pAdd && pAdd->isAlive()) - // { - DoCast(m_creature, 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 -{ - 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 TRINITY_DLL_DECL 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(m_creature->getVictim(), SPELL_GOBLIN_DRAGON_GUN); - Goblin_Dragon_Gun_Timer = 10000; - }else Goblin_Dragon_Gun_Timer -= diff; - - if (Rocket_Launch_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ROCKET_LAUNCH); - Rocket_Launch_Timer = 9000; - }else Rocket_Launch_Timer -= diff; - - if (Fel_Iron_Bomb_Timer < diff) - { - DoCast(m_creature->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(*m_creature, 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(m_creature, 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 TRINITY_DLL_DECL 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(m_creature->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/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp deleted file mode 100644 index 161852ed99d..00000000000 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_selin_fireheart.cpp +++ /dev/null @@ -1,370 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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); - } - } - Heroic = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool Heroic; - - 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::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) - { - //Unit* pUnit = Unit::GetUnit(*m_creature, FelCrystals[i]); - Unit* pUnit = Unit::GetUnit(*m_creature, *itr); - if (pUnit) - { - if (!pUnit->isAlive()) - CAST_CRE(pUnit)->Respawn(); // Let MaNGOS 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::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) - { - pCrystal = NULL; - //pCrystal = Unit::GetUnit(*m_creature, FelCrystals[i]); - pCrystal = Unit::GetUnit(*m_creature, *itr); - if (pCrystal && pCrystal->isAlive()) - { - // select nearest - if (!CrystalChosen || m_creature->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, m_creature); - DoScriptText(EMOTE_CRYSTAL, m_creature); - - 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, m_creature->GetObjectSize(), CONTACT_DISTANCE); - - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->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::iterator itr = Crystals.begin(); itr != Crystals.end(); ++itr) - { - //Creature* pCrystal = (Unit::GetCreature(*m_creature, FelCrystals[i])); - Creature* pCrystal = (Unit::GetCreature(*m_creature, *itr)); - if (pCrystal && pCrystal->isAlive()) - pCrystal->DealDamage(pCrystal, pCrystal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->HandleGameObject(pInstance->GetData64(DATA_SELIN_ENCOUNTER_DOOR), false); - //Close the encounter door, open it in JustDied/Reset - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void MovementInform(uint32 type, uint32 id) - { - if (type == POINT_MOTION_TYPE && id == 1) - { - Unit* CrystalChosen = Unit::GetUnit(*m_creature, 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(m_creature, 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, m_creature); - - 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 = m_creature->GetMaxPower(POWER_MANA); - if (maxPowerMana && ((m_creature->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 (Heroic) - { - if (DrainManaTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_DRAIN_MANA); - DrainManaTimer = 10000; - }else DrainManaTimer -= diff; - } - } - - if (FelExplosionTimer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(m_creature, SPELL_FEL_EXPLOSION); - FelExplosionTimer = 2000; - } - }else FelExplosionTimer -= diff; - - // If below 10% mana, start recharging - maxPowerMana = m_creature->GetMaxPower(POWER_MANA); - if (maxPowerMana && ((m_creature->GetPower(POWER_MANA)*100 / maxPowerMana) < 10)) - { - if (DrainCrystalTimer < diff) - { - SelectNearestCrystal(); - if (Heroic) 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, m_creature); - - Unit* CrystalChosen = Unit::GetUnit(*m_creature, CrystalGUID); - if (CrystalChosen && CrystalChosen->isAlive()) - // Use Deal Damage to kill it, not setDeathState. - CrystalChosen->DealDamage(CrystalChosen, CrystalChosen->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - - CrystalGUID = 0; - - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveChase(m_creature->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 TRINITY_DLL_DECL 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 = (m_creature->GetInstanceData())) - { - Creature* Selin = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_SELIN))); - if (Selin && Selin->isAlive()) - { - if (CAST_AI(boss_selin_fireheartAI, Selin->AI())->CrystalGUID == m_creature->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/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp deleted file mode 100644 index 642d49f68ae..00000000000 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/boss_vexallus.cpp +++ /dev/null @@ -1,228 +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 "precompiled.h" -#include "def_magisters_terrace.h" - -enum -{ - 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 TRINITY_DLL_DECL boss_vexallusAI : public ScriptedAI -{ - boss_vexallusAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); Heroic = c->GetMap()->IsHeroic(); - Heroic = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool Heroic; - - 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, m_creature); - } - - void JustDied(Unit *victim) - { - if (pInstance) - pInstance->SetData(DATA_VEXALLUS_EVENT, DONE); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - - 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,m_creature->GetGUID()); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!Enraged) - { - //used for check, when Vexallus cast adds 85%, 70%, 55%, 40%, 25% - if ((m_creature->GetHealth()*100 / m_creature->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, m_creature); - DoScriptText(EMOTE_DISCHARGE_ENERGY, m_creature); - - if (Heroic) - { - m_creature->CastSpell(m_creature,H_SPELL_SUMMON_PURE_ENERGY1,false); - m_creature->CastSpell(m_creature,H_SPELL_SUMMON_PURE_ENERGY2,false); - } - else - m_creature->CastSpell(m_creature,SPELL_SUMMON_PURE_ENERGY,false); - - //below are workaround summons, remove when summoning spells w/implicitTarget 73 implemented in Mangos - m_creature->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (Heroic) - m_creature->SummonCreature(NPC_PURE_ENERGY, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0); - } - - if (ChainLightningTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, Heroic ? SPELL_H_CHAIN_LIGHTNING : SPELL_CHAIN_LIGHTNING); - - ChainLightningTimer = 8000; - }else ChainLightningTimer -= diff; - - if (ArcaneShockTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - if (target) - DoCast(target, Heroic ? SPELL_H_ARCANE_SHOCK : SPELL_ARCANE_SHOCK); - - ArcaneShockTimer = 8000; - }else ArcaneShockTimer -= diff; - } - else - { - if (OverloadTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_OVERLOAD); - - OverloadTimer = 2000; - }else OverloadTimer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_vexallus(Creature* pCreature) -{ - return new boss_vexallusAI (pCreature); -}; - -struct TRINITY_DLL_DECL mob_pure_energyAI : public ScriptedAI -{ - mob_pure_energyAI(Creature *c) : ScriptedAI(c) {} - - void Reset() { } - - void JustDied(Unit* slayer) - { - if (Unit *temp = m_creature->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/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h b/src/bindings/scripts/scripts/zone/magisters_terrace/def_magisters_terrace.h deleted file mode 100644 index d6419ea409c..00000000000 --- a/src/bindings/scripts/scripts/zone/magisters_terrace/def_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/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/instance_magisters_terrace.cpp deleted file mode 100644 index 4b7a68b9a61..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_magisters_terrace.h" - -#define MAX_ENCOUNTER 4 - -/* -0 - Selin Fireheart -1 - Vexallus -2 - Priestess Delrissa -3 - Kael'thas Sunstrider -*/ - -struct TRINITY_DLL_DECL 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::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/bindings/scripts/scripts/zone/magisters_terrace/magisters_terrace.cpp b/src/bindings/scripts/scripts/zone/magisters_terrace/magisters_terrace.cpp deleted file mode 100644 index d9b33bbf4fc..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -/*###### -## npc_kalecgos -######*/ - -enum -{ - 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 TRINITY_DLL_DECL 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 (m_creature->GetEntry() != NPC_KAEL) - m_creature->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 = m_creature->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) - { - m_creature->CastSpell(m_creature,SPELL_ORB_KILL_CREDIT,false); - DoWorkaroundForQuestCredit(); - - // Transform and update entry, now ready for quest/read gossip - m_creature->CastSpell(m_creature,SPELL_TRANSFORM_TO_KAEL,false); - m_creature->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/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_baron_geddon.cpp deleted file mode 100644 index bd8fd74a66a..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define EMOTE_SERVICE -1409000 - -#define SPELL_INFERNO 19695 -#define SPELL_IGNITEMANA 19659 -#define SPELL_LIVINGBOMB 20475 -#define SPELL_ARMAGEDDOM 20479 - -struct TRINITY_DLL_DECL 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 (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 2) - { - m_creature->InterruptNonMeleeSpells(true); - DoCast(m_creature,SPELL_ARMAGEDDOM); - DoScriptText(EMOTE_SERVICE, m_creature); - return; - } - - //Inferno_Timer - if (Inferno_Timer < diff) - { - DoCast(m_creature,SPELL_INFERNO); - Inferno_Timer = 45000; - }else Inferno_Timer -= diff; - - //IgniteMana_Timer - if (IgniteMana_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_IGNITEMANA); - - IgniteMana_Timer = 30000; - }else IgniteMana_Timer -= diff; - - //LivingBomb_Timer - if (LivingBomb_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,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/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_garr.cpp deleted file mode 100644 index 0dbfab63044..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.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 TRINITY_DLL_DECL 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(m_creature,SPELL_ANTIMAGICPULSE); - AntiMagicPulse_Timer = 10000 + rand()%5000; - }else AntiMagicPulse_Timer -= diff; - - //MagmaShackles_Timer - if (MagmaShackles_Timer < diff) - { - DoCast(m_creature,SPELL_MAGMASHACKLES); - MagmaShackles_Timer = 8000 + rand()%4000; - }else MagmaShackles_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL 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* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_IMMOLATE); - - Immolate_Timer = 5000 + rand()%5000; - }else Immolate_Timer -= diff; - - //Cast Erruption and let them die - if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.10) - { - DoCast(m_creature->getVictim(),SPELL_ERUPTION); - m_creature->setDeathState(JUST_DIED); - m_creature->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/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.cpp deleted file mode 100644 index 9b965b38375..00000000000 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_gehennas.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_Gehennas -SD%Complete: 90 -SDComment: Adds MC NYI -SDCategory: Molten Core -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_SHADOWBOLT 19728 -#define SPELL_RAINOFFIRE 19717 -#define SPELL_GEHENNASCURSE 19716 - -struct TRINITY_DLL_DECL 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* bTarget = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(bTarget,SPELL_SHADOWBOLT); - ShadowBolt_Timer = 7000; - }else ShadowBolt_Timer -= diff; - - //RainOfFire_Timer - if (RainOfFire_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_RAINOFFIRE); - - RainOfFire_Timer = 4000 + rand()%8000; - }else RainOfFire_Timer -= diff; - - //GehennasCurse_Timer - if (GehennasCurse_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_GEHENNASCURSE); - GehennasCurse_Timer = 22000 + rand()%8000; - }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/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_golemagg.cpp deleted file mode 100644 index 800a838aabc..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_molten_core.h" - -enum -{ - 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 TRINITY_DLL_DECL 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; - - m_creature->CastSpell(m_creature, 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 && m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*10) - { - DoCast(m_creature, SPELL_ENRAGE); - m_bEnraged = true; - } - - // Earthquake - if (m_bEnraged) - { - if (m_uiEarthquakeTimer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_EARTHQUAKE); - m_uiEarthquakeTimer = 3*IN_MILISECONDS; - } - else - m_uiEarthquakeTimer -= uiDiff; - } - - /* - // Golemagg's Trust - if (m_uiBuffTimer < uiDiff) - { - DoCast(m_creature, SPELL_GOLEMAGG_TRUST); - m_uiBuffTimer = 2.5*IN_MILISECONDS; - } - else - m_uiBuffTimer -= uiDiff; - */ - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL 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 (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*50) - { - if (m_pInstance) - { - if (Creature* pGolemagg = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_GOLEMAGG))) - { - if (pGolemagg->isAlive()) - { - DoScriptText(EMOTE_LOWHP, m_creature); - m_creature->SetHealth(m_creature->GetMaxHealth()); - } - else - uiDamage = m_creature->GetHealth(); - } - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - // Mangle - if (m_uiMangleTimer < uiDiff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_lucifron.cpp deleted file mode 100644 index 0b902d30be5..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define SPELL_IMPENDINGDOOM 19702 -#define SPELL_LUCIFRONCURSE 19703 -#define SPELL_SHADOWSHOCK 20603 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_IMPENDINGDOOM); - ImpendingDoom_Timer = 20000; - }else ImpendingDoom_Timer -= diff; - - //Lucifron's curse timer - if (LucifronCurse_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_LUCIFRONCURSE); - LucifronCurse_Timer = 15000; - }else LucifronCurse_Timer -= diff; - - //Shadowshock - if (ShadowShock_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_magmadar.cpp deleted file mode 100644 index 4e7e8497d9a..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.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 TRINITY_DLL_DECL 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; - - m_creature->CastSpell(m_creature,SPELL_MAGMASPIT,true); - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Frenzy_Timer - if (Frenzy_Timer < diff) - { - DoScriptText(EMOTE_FRENZY, m_creature); - DoCast(m_creature,SPELL_FRENZY); - Frenzy_Timer = 15000; - }else Frenzy_Timer -= diff; - - //Panic_Timer - if (Panic_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_PANIC); - Panic_Timer = 35000; - }else Panic_Timer -= diff; - - //Lavabomb_Timer - if (Lavabomb_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,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/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp deleted file mode 100644 index a62afe260a6..00000000000 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_majordomo_executus.cpp +++ /dev/null @@ -1,139 +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 "precompiled.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 TRINITY_DLL_DECL boss_majordomoAI : public ScriptedAI -{ - boss_majordomoAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - 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, m_creature); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Cast Ageis if less than 50% hp - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) - { - DoCast(m_creature,SPELL_AEGIS); - } - - //MagicReflection_Timer - // if (MagicReflection_Timer < diff) - // { - // DoCast(m_creature, SPELL_MAGICREFLECTION); - - //60 seconds until we should cast this agian - // MagicReflection_Timer = 30000; - // }else MagicReflection_Timer -= diff; - - //DamageReflection_Timer - // if (DamageReflection_Timer < diff) - // { - // DoCast(m_creature, SPELL_DAMAGEREFLECTION); - - //60 seconds until we should cast this agian - // DamageReflection_Timer = 30000; - // }else DamageReflection_Timer -= diff; - - //Blastwave_Timer - if (Blastwave_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.cpp deleted file mode 100644 index d665362e3b6..00000000000 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_ragnaros.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_Ragnaros -SD%Complete: 75 -SDComment: Intro Dialog and event NYI -SDCategory: Molten Core -EndScriptData */ - -#include "precompiled.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 TRINITY_DLL_DECL 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; - Creature *Summoned; - 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; - - m_creature->CastSpell(m_creature,SPELL_MELTWEAPON,true); - HasAura = true; - } - - void KilledUnit(Unit* victim) - { - if (rand()%5) - return; - - DoScriptText(SAY_KILL, m_creature); - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (WasBanished && Attack_Timer < diff) - { - //Become unbanished again - m_creature->setFaction(14); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoCast(m_creature,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(m_creature->getVictim(),SPELL_WRATHOFRAGNAROS); - - if (rand()%2 == 0) - { - DoScriptText(SAY_WRATH, m_creature); - } - - WrathOfRagnaros_Timer = 30000; - }else WrathOfRagnaros_Timer -= diff; - - //HandOfRagnaros_Timer - if (HandOfRagnaros_Timer < diff) - { - DoCast(m_creature,SPELL_HANDOFRAGNAROS); - - if (rand()%2==0) - { - DoScriptText(SAY_HAND, m_creature); - } - - HandOfRagnaros_Timer = 25000; - }else HandOfRagnaros_Timer -= diff; - - //LavaBurst_Timer - if (LavaBurst_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_LAVABURST); - LavaBurst_Timer = 10000; - }else LavaBurst_Timer -= diff; - - //Erruption_Timer - if (LavaBurst_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ERRUPTION); - Erruption_Timer = 20000 + rand()%25000; - }else Erruption_Timer -= diff; - - //ElementalFire_Timer - if (ElementalFire_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ELEMENTALFIRE); - ElementalFire_Timer = 10000 + rand()%4000; - }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. - - m_creature->InterruptNonMeleeSpells(false); - //Root self - DoCast(m_creature,23973); - m_creature->setFaction(35); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); - - if (!HasSubmergedOnce) - { - DoScriptText(SAY_REINFORCEMENTS1, m_creature); - - // summon 10 elementals - for(uint8 i = 0; i < 9; ++i) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (Creature* pSummoned = m_creature->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(m_creature,SPELL_RAGSUBMERGE); - Attack_Timer = 90000; - - } - else - { - DoScriptText(SAY_REINFORCEMENTS2, m_creature); - - for(uint8 i = 0; i < 9; ++i) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (Creature* pSummoned = m_creature->SummonCreature(12143,pTarget->GetPositionX(), pTarget->GetPositionY(), pTarget->GetPositionZ(),0.0f,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,900000)) - pSummoned->AI()->AttackStart(pTarget); - } - } - - WasBanished = true; - DoCast(m_creature,SPELL_RAGSUBMERGE); - Attack_Timer = 90000; - } - - Submerge_Timer = 180000; - }else Submerge_Timer -= diff; - - //If we are within range melee the target - if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - //Make sure our attack is ready and we arn't currently casting - if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) - { - m_creature->AttackerStateUpdate(m_creature->getVictim()); - m_creature->resetAttackTimer(); - } - } - else - { - //MagmaBurst_Timer - if (MagmaBurst_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MAGMABURST); - - if (!HasYelledMagmaBurst) - { - //Say our dialog - DoScriptText(SAY_MAGMABURST, m_creature); - 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/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp deleted file mode 100644 index 928cbf70fc3..00000000000 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_shazzrah.cpp +++ /dev/null @@ -1,124 +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 "precompiled.h" - -#define SPELL_ARCANEEXPLOSION 19712 -#define SPELL_SHAZZRAHCURSE 19713 -#define SPELL_DEADENMAGIC 19714 -#define SPELL_COUNTERSPELL 19715 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_ARCANEEXPLOSION); - ArcaneExplosion_Timer = 5000 + rand()%4000; - }else ArcaneExplosion_Timer -= diff; - - //ShazzrahCurse_Timer - if (ShazzrahCurse_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_SHAZZRAHCURSE); - - ShazzrahCurse_Timer = 25000 + rand()%5000; - }else ShazzrahCurse_Timer -= diff; - - //DeadenMagic_Timer - if (DeadenMagic_Timer < diff) - { - DoCast(m_creature,SPELL_DEADENMAGIC); - DeadenMagic_Timer = 35000; - }else DeadenMagic_Timer -= diff; - - //Countspell_Timer - if (Countspell_Timer < diff) - { - DoCast(m_creature->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. - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (target) - { - DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); - DoCast(target,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/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp b/src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp deleted file mode 100644 index 56cf7fe31e3..00000000000 --- a/src/bindings/scripts/scripts/zone/molten_core/boss_sulfuron_harbinger.cpp +++ /dev/null @@ -1,214 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL boss_sulfuronAI : public ScriptedAI -{ - boss_sulfuronAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 Darkstrike_Timer; - uint32 DemoralizingShout_Timer; - uint32 Inspire_Timer; - uint32 Knockdown_Timer; - uint32 Flamespear_Timer; - ScriptedInstance *pInstance; - - 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(m_creature->getVictim(),SPELL_DEMORALIZINGSHOUT); - DemoralizingShout_Timer = 15000 + rand()%5000; - }else DemoralizingShout_Timer -= diff; - - //Inspire_Timer - if (Inspire_Timer < diff) - { - Creature* target = NULL; - std::list pList = DoFindFriendlyMissingBuff(45.0f,SPELL_INSPIRE); - if (!pList.empty()) - { - std::list::iterator i = pList.begin(); - advance(i, (rand()%pList.size())); - target = (*i); - } - - if (target) - DoCast(target,SPELL_INSPIRE); - - DoCast(m_creature,SPELL_INSPIRE); - - Inspire_Timer = 20000 + rand()%6000; - }else Inspire_Timer -= diff; - - //Knockdown_Timer - if (Knockdown_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN); - Knockdown_Timer = 12000 + rand()%3000; - }else Knockdown_Timer -= diff; - - //Flamespear_Timer - if (Flamespear_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_FLAMESPEAR); - - Flamespear_Timer = 12000 + rand()%4000; - }else Flamespear_Timer -= diff; - - //DarkStrike_Timer - if (Darkstrike_Timer < diff) - { - DoCast(m_creature, SPELL_DARKSTRIKE); - Darkstrike_Timer = 15000 + rand()%3000; - }else Darkstrike_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL mob_flamewaker_priestAI : public ScriptedAI -{ - mob_flamewaker_priestAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 Heal_Timer; - uint32 ShadowWordPain_Timer; - uint32 Immolate_Timer; - - ScriptedInstance *pInstance; - - 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* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_SHADOWWORDPAIN); - - ShadowWordPain_Timer = 18000+rand()%8000; - }else ShadowWordPain_Timer -= diff; - - //Immolate_Timer - if (Immolate_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,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/bindings/scripts/scripts/zone/molten_core/def_molten_core.h b/src/bindings/scripts/scripts/zone/molten_core/def_molten_core.h deleted file mode 100644 index 5874d8b9408..00000000000 --- a/src/bindings/scripts/scripts/zone/molten_core/def_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/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp b/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp deleted file mode 100644 index 2ea052f0a90..00000000000 --- a/src/bindings/scripts/scripts/zone/molten_core/instance_molten_core.cpp +++ /dev/null @@ -1,268 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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/bindings/scripts/scripts/zone/molten_core/molten_core.cpp b/src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp deleted file mode 100644 index 7af3bcce6b6..00000000000 --- a/src/bindings/scripts/scripts/zone/molten_core/molten_core.cpp +++ /dev/null @@ -1,89 +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 "precompiled.h" -#include "simple_ai.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 = 0; - switch(rand()%6) - { - case 0 : RandDebuff = SPELL_GROUND_STOMP; break; - case 1 : RandDebuff = SPELL_ANCIENT_DREAD; break; - case 2 : RandDebuff = SPELL_CAUTERIZING_FLAMES; break; - case 3 : RandDebuff = SPELL_WITHERING_HEAT; break; - case 4 : RandDebuff = SPELL_ANCIENT_DESPAIR; break; - case 5 : RandDebuff = SPELL_ANCIENT_HYSTERIA; break; - } - - 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/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_arcanist_doan.cpp deleted file mode 100644 index 363b4ccab27..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -enum -{ - SAY_AGGRO = -1189019, - SAY_SPECIALAE = -1189020, - - SPELL_POLYMORPH = 13323, - SPELL_AOESILENCE = 8988, - SPELL_ARCANEEXPLOSION = 9433, - SPELL_FIREAOE = 9435, - SPELL_ARCANEBUBBLE = 9438, -}; - -struct TRINITY_DLL_DECL 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, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (bShielded && bCanDetonate) - { - DoCast(m_creature,SPELL_FIREAOE); - bCanDetonate = false; - } - - if (m_creature->HasAura(SPELL_ARCANEBUBBLE)) - return; - - //If we are <50% hp cast Arcane Bubble - if (!bShielded && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50) - { - //wait if we already casting - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - DoScriptText(SAY_SPECIALAE, m_creature); - DoCast(m_creature,SPELL_ARCANEBUBBLE); - - bCanDetonate = true; - bShielded = true; - } - - if (Polymorph_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,SPELL_POLYMORPH); - - Polymorph_Timer = 20000; - }else Polymorph_Timer -= diff; - - //AoESilence_Timer - if (AoESilence_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_AOESILENCE); - AoESilence_Timer = 15000 + rand()%5000; - }else AoESilence_Timer -= diff; - - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_azshir_the_sleepless.cpp deleted file mode 100644 index e133d52b41b..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define SPELL_CALLOFTHEGRAVE 17831 -#define SPELL_TERRIFY 7399 -#define SPELL_SOULSIPHON 7290 - -struct TRINITY_DLL_DECL 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 (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false)) - { - //SoulSiphon_Timer - if (SoulSiphon_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SOULSIPHON); - return; - - SoulSiphon_Timer = 20000; - }else SoulSiphon_Timer -= diff; - } - - //CallOfTheGrave_Timer - if (CallOftheGrave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CALLOFTHEGRAVE); - CallOftheGrave_Timer = 30000; - }else CallOftheGrave_Timer -= diff; - - //Terrify_Timer - if (Terrify_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_bloodmage_thalnos.cpp deleted file mode 100644 index 84febc690d1..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -enum -{ - SAY_AGGRO = -1189016, - SAY_HEALTH = -1189017, - SAY_KILL = -1189018, - - SPELL_FLAMESHOCK = 8053, - SPELL_SHADOWBOLT = 1106, - SPELL_FLAMESPIKE = 8814, - SPELL_FIRENOVA = 16079, -}; - -struct TRINITY_DLL_DECL 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, m_creature); - } - - void KilledUnit(Unit* Victim) - { - DoScriptText(SAY_KILL, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //If we are <35% hp - if (!HpYell && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 35)) - { - DoScriptText(SAY_HEALTH, m_creature); - HpYell = true; - } - - //FlameShock_Timer - if (FlameShock_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FLAMESHOCK); - FlameShock_Timer = 10000 + rand()%5000; - }else FlameShock_Timer -= diff; - - //FlameSpike_Timer - if (FlameSpike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FLAMESPIKE); - FlameSpike_Timer = 30000; - }else FlameSpike_Timer -= diff; - - //FireNova_Timer - if (FireNova_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FIRENOVA); - FireNova_Timer = 40000; - }else FireNova_Timer -= diff; - - //ShadowBolt_Timer - if (ShadowBolt_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp deleted file mode 100644 index 36b4002d48a..00000000000 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_headless_horseman.cpp +++ /dev/null @@ -1,866 +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 "precompiled.h" -#include "SpellMgr.h" -#include "def_scarlet_monastery.h" - -#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 -}; - -struct Summon -{ - const std::string text; -}; - -static Summon Text[]= -{ - {"Horseman rise..."}, - {"Your time is nigh..."}, - {"You felt death once..."}, - {"Now, know demise!"} -}; - -struct TRINITY_DLL_DECL 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) - { - Creaturetype = _type; - switch(Creaturetype) - { - 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(m_creature,spell); - } - - void SpellHit(Unit* caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_WISP_FLIGHT_PORT && Creaturetype == 4) - m_creature->SetDisplayId(2027); - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || Creaturetype != 1 || !who->isTargetableForAttack()) - return; - - if (m_creature->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) - { - m_creature->RemoveAurasDueToSpell(SPELL_SMOKE); - if (spell2) - DoCast(m_creature,spell2); - delay = 0; - }else delay -= diff; - } - } -}; - -struct TRINITY_DLL_DECL 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 = 15000 + rand()%16 * 1000; - } - - void EnterCombat(Unit *who) {} - void SaySound(int32 textEntry, Unit *target = 0) - { - DoScriptText(textEntry, m_creature, target); - //DoCast(m_creature,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 (((m_creature->GetHealth() - damage)*100)/m_creature->GetMaxHealth() < 67) - Disappear();break; - case 2: - if (((m_creature->GetHealth() - damage)*100)/m_creature->GetMaxHealth() < 34) - Disappear();break; - case 3: - if (damage >= m_creature->GetHealth()) - { - die = true; - withbody = true; - wait = 300; - damage = m_creature->GetHealth() - m_creature->GetMaxHealth()/100; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->StopMoving(); - //m_creature->GetMotionMaster()->MoveIdle(); - DoCast(m_creature,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(); - m_creature->RemoveAllAuras(); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoCast(m_creature,SPELL_HEAD_LANDS,true); - DoCast(m_creature,SPELL_HEAD,false); - SaySound(SAY_LOST_HEAD); - m_creature->GetMotionMaster()->Clear(false); - m_creature->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 (!m_creature->getVictim()) return; - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveFleeing(m_creature->getVictim()); - }else wait -= diff; - if (laugh < diff) - { - laugh = 15000 + (rand()%16)*1000; - DoPlaySoundToSet(m_creature, RandomLaugh[rand()%3]); - //DoCast(m_creature,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); - m_creature->MonsterTextEmote("laughs",NULL); - } else laugh -= diff; - - } else { - - if (die) { - if (wait < diff) - { - die = false; - Unit *body = Unit::GetUnit((*m_creature),bodyGUID); - if (body) - body->DealDamage(body, body->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->setDeathState(JUST_DIED); - } else wait -= diff; - } - } - } -}; - -struct TRINITY_DLL_DECL 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; - } -/* SpellEntry *confl = GET_SPELL(SPELL_CONFLAGRATION); - if (confl) - confl->EffectTriggerSpell[1] = 22587; - - SpellEntry *speed = GET_SPELL(22587); - if (speed) - { - 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 = 16000 + rand()%5 * 1000; - cleave = 2000; - regen = 1000; - burn = 6000; - count = 0; - say_timer = 3000; - - withhead = true; - returned = true; - burned = false; - IsFlying = false; - DoCast(m_creature,SPELL_HEAD); - if (headGUID){ - Unit* Head = Unit::GetUnit((*m_creature), headGUID); - if (Head){ - Head->SetVisibility(VISIBILITY_OFF); - Head->setDeathState(JUST_DIED); - } - headGUID = 0; - } - - if (pInstance) - pInstance->SetData(DATA_HORSEMAN_EVENT, 0); - } - - void FlyMode() - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_HOVER); - m_creature->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) - return; - if (i != id) - return; - wp_reached = true; - - switch (id) - { - case 0: - m_creature->SetVisibility(VISIBILITY_ON);break; - case 1: { - Creature *smoke = m_creature->SummonCreature(HELPER,Spawn[1].x,Spawn[1].y,Spawn[1].z,0,TEMPSUMMON_TIMED_DESPAWN,20000); - if (smoke) - CAST_AI(mob_wisp_invisAI, smoke->AI())->SetType(3); - DoCast(m_creature,SPELL_RHYME_BIG); - break;} - case 6: - if (pInstance) - pInstance->SetData(GAMEOBJECT_PUMPKIN_SHRINE, 0); //hide gameobject - break; - case 19: - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_HOVER);break; - case 20: { - Phase = 1; - IsFlying = false; - wp_reached = false; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - SaySound(SAY_ENTRANCE); - Unit *plr = Unit::GetUnit((*m_creature),PlayerGUID); - if (plr) - 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); - else { //maybe possible when player dies from conflagration - Creature *Head = Unit::GetCreature((*m_creature), headGUID); - if (Head) - CAST_AI(mob_headAI, Head->AI())->SaySound(SAY_PLAYER_DEATH); - } - } - } - - void SaySound(int32 textEntry, Unit *target = 0) - { - DoScriptText(textEntry, m_creature, target); - laugh += 4000; - } - - Player* SelectRandomPlayer(float range = 0.0f, bool checkLoS = true) - { - Map* pMap = m_creature->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::iterator j; - - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if ((m_creature->IsWithinLOSInMap(i->getSource()) || !checkLoS) && m_creature->getVictim() != i->getSource() && - m_creature->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) - if (unit->HasAura(SPELL_CONFLAGRATION)) - SaySound(SAY_CONFLAGRATION,unit); - } - - void JustDied(Unit* killer) - { - m_creature->StopMoving(); - //m_creature->GetMotionMaster()->MoveIdle(); test - SaySound(SAY_DEATH); - Creature *flame = DoSpawnCreature(HELPER,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000); - if (flame) - flame->CastSpell(flame,SPELL_BODY_FLAME,false); - Creature *wisp = DoSpawnCreature(WISP_INVIS,0,0,0,0,TEMPSUMMON_TIMED_DESPAWN,60000); - if (wisp) - 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; - m_creature->RemoveAllAuras(); - m_creature->SetName("Headless Horseman"); - m_creature->SetHealth(m_creature->GetMaxHealth()); - SaySound(SAY_REJOINED); - DoCast(m_creature,SPELL_HEAD); - caster->GetMotionMaster()->Clear(false); - caster->GetMotionMaster()->MoveFollow(m_creature,6,rand()%6); - //DoResetThreat();//not sure if need - std::list::iterator itr; - for(itr = caster->getThreatManager().getThreatList().begin(); itr != caster->getThreatManager().getThreatList().end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); - if (pUnit && pUnit->isAlive() && pUnit != caster) - m_creature->AddThreat(pUnit,caster->getThreatManager().getThreat(pUnit)); - } - } - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= m_creature->GetHealth() && withhead) - { - withhead = false; - returned = false; - damage = m_creature->GetHealth() - m_creature->GetMaxHealth()/100; - m_creature->RemoveAllAuras(); - m_creature->SetName("Headless Horseman, Unhorsed"); - - if (!headGUID) - headGUID = DoSpawnCreature(HEAD,rand()%6,rand()%6,0,0,TEMPSUMMON_DEAD_DESPAWN,0)->GetGUID(); - Unit* Head = Unit::GetUnit((*m_creature), headGUID); - if (Head && Head->isAlive()) - { - Head->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - //Head->CastSpell(Head,SPELL_HEAD_INVIS,false); - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_IMMUNE,true); - DoCast(m_creature,SPELL_BODY_REGEN,true); - m_creature->CastSpell(Head, SPELL_FLYING_HEAD,true); - DoCast(m_creature,SPELL_CONFUSE,false); //test - done_by->ProcDamageAndSpell(m_creature,PROC_FLAG_KILL,PROC_FLAG_KILLED,PROC_EX_NONE,0); - whirlwind = 4000 + (rand()%5)*1000; - 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].text,0); - else { - DoCast(m_creature,SPELL_RHYME_BIG); - if (plr) - { - plr->Say(Text[count].text,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; - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MovePoint(id,FlightPoint[id].x,FlightPoint[id].y,FlightPoint[id].z); - } - } - } - break; - case 1: - if (burned) break; - if (burn < diff) - { - Creature *flame = m_creature->SummonCreature(HELPER,Spawn[0].x,Spawn[0].y,Spawn[0].z,0,TEMPSUMMON_TIMED_DESPAWN,17000); - if (flame) - CAST_AI(mob_wisp_invisAI, flame->AI())->SetType(2); - burned = true; - }else burn -= diff; - break; - case 2: - if (conflagrate < diff) - { - Unit *plr = SelectRandomPlayer(30.0f); - if (plr) - m_creature->CastSpell(plr,SPELL_CONFLAGRATION,false); - conflagrate = 10000 + rand()%7 * 1000; - }else conflagrate -= diff; - break; - case 3: - if (summonadds < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_SUMMON_PUMPKIN); - SaySound(SAY_SPROUTING_PUMPKINS); - summonadds = 25000 + rand()%11 *1000; - }else summonadds -= diff; - break; - } - - if (laugh < diff) { - laugh = 11000 + rand()%12 * 1000; - m_creature->MonsterTextEmote("laughs",NULL); - DoPlaySoundToSet(m_creature, RandomLaugh[rand()%3]); - } else laugh -= diff; - - if (UpdateVictim()) - { - DoMeleeAttackIfReady(); - if (cleave < diff) { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - cleave = 2000*(1 + rand()%3); //1 cleave per 2.0-6.0sec - } else cleave -= diff; - } - - } else { - - if (regen < diff) - { - regen = 1000; //"body calls head" - if (m_creature->GetHealth()/m_creature->GetMaxHealth() == 1 && !returned) - { - if (Phase > 1) --Phase; - else Phase = 1; - Creature* Head = Unit::GetCreature((*m_creature), 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 = 4000 + rand()%5 * 1000; - if (rand()%2) { - m_creature->RemoveAurasDueToSpell(SPELL_CONFUSE); - DoCast(m_creature,SPELL_WHIRLWIND,true); - DoCast(m_creature,SPELL_CONFUSE); - }else - m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND); - }else whirlwind -= diff; - } - } -}; - -void mob_headAI::Disappear() -{ - if (withbody) - return; - if (bodyGUID) - { - Creature *body = Unit::GetCreature((*m_creature), bodyGUID); - if (body && body->isAlive()) - { - withbody = true; - m_creature->RemoveAllAuras(); - body->RemoveAurasDueToSpell(SPELL_IMMUNE);//hack, SpellHit doesn't calls if body has immune aura - DoCast(body,SPELL_FLYING_HEAD); - m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->GetMotionMaster()->MoveIdle(); - CAST_AI(boss_headless_horsemanAI, body->AI())->returned = true; - } - } -} - -struct TRINITY_DLL_DECL mob_pulsing_pumpkinAI : public ScriptedAI -{ - mob_pulsing_pumpkinAI(Creature *c) : ScriptedAI(c) {} - - bool sprouted; - uint64 debuffGUID; - - void Reset() - { - float x, y, z; - m_creature->GetPosition(x, y, z); //this visual aura some under ground - m_creature->GetMap()->CreatureRelocation(m_creature, 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(m_creature->GetDisplayId()); - debuff->CastSpell(debuff,SPELL_PUMPKIN_AURA_GREEN,false); - CAST_AI(mob_wisp_invisAI, debuff->AI())->SetType(1); - debuffGUID = debuff->GetGUID(); - } - sprouted = false; - DoCast(m_creature,SPELL_PUMPKIN_AURA,true); - DoCast(m_creature,SPELL_SPROUTING); - m_creature->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; - m_creature->RemoveAllAuras(); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_STUNNED); - DoCast(m_creature,SPELL_SPROUT_BODY,true); - m_creature->UpdateEntry(PUMPKIN_FIEND); - DoStartMovement(m_creature->getVictim()); - } - } - - void Despawn() - { - if (!debuffGUID) return; - Unit *debuff = Unit::GetUnit((*m_creature),debuffGUID); - if (debuff) - debuff->SetVisibility(VISIBILITY_OFF); - debuffGUID = 0; - } - - void JustDied(Unit *killer) {if (!sprouted) Despawn();} - - void MoveInLineOfSight(Unit *who) - { - if (!who || !who->isTargetableForAttack() || !m_creature->IsHostileTo(who) || m_creature->getVictim()) - return; - - m_creature->AddThreat(who,0.0f); - if (sprouted) - DoStartMovement(who); - } - - void UpdateAI(const uint32 diff) - { - if (sprouted) - if (UpdateVictim()) - DoMeleeAttackIfReady(); - } -}; - -bool GOHello_go_loosely_turned_soil(Player* pPlayer, GameObject* soil) -{ -/* 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); - Creature *horseman = soil->SummonCreature(HH_MOUNTED,FlightPoint[20].x,FlightPoint[20].y,FlightPoint[20].z,0,TEMPSUMMON_MANUAL_DESPAWN,0); - if (horseman) - { - 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/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.cpp deleted file mode 100644 index 5a1c8e6d364..00000000000 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_herod.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: Boss_Herod -SD%Complete: 95 -SDComment: Should in addition spawn Myrmidons in the hallway outside -SDCategory: Scarlet Monastery -EndScriptData */ - -#include "precompiled.h" -#include "escortAI.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 TRINITY_DLL_DECL 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, m_creature); - DoCast(m_creature,SPELL_RUSHINGCHARGE); - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_KILL, m_creature); - } - - void JustDied(Unit* killer) - { - for(uint8 i = 0; i < 20; ++i) - m_creature->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 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false)) - { - DoScriptText(EMOTE_ENRAGE, m_creature); - DoScriptText(SAY_ENRAGE, m_creature); - DoCast(m_creature,SPELL_FRENZY); - Enrage = true; - } - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 12000; - }else Cleave_Timer -= diff; - - // Whirlwind_Timer - if (Whirlwind_Timer < diff) - { - DoScriptText(SAY_WHIRLWIND, m_creature); - DoCast(m_creature->getVictim(),SPELL_WHIRLWIND); - Whirlwind_Timer = 30000; - }else Whirlwind_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_herod(Creature* pCreature) -{ - return new boss_herodAI(pCreature); -} - -struct TRINITY_DLL_DECL 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/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_high_inquisitor_fairbanks.cpp deleted file mode 100644 index d94a55bfad5..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -enum -{ - SPELL_CURSEOFBLOOD = 8282, - SPELL_DISPELMAGIC = 15090, - SPELL_FEAR = 12096, - SPELL_HEAL = 12039, - SPELL_POWERWORDSHIELD = 11647, - SPELL_SLEEP = 8399 -}; - -struct TRINITY_DLL_DECL 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 (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 25 && !m_creature->IsNonMeleeSpellCasted(false) && Heal_Timer < diff) - { - DoCast(m_creature,SPELL_HEAL); - Heal_Timer = 30000; - }else Heal_Timer -= diff; - - //Fear_Timer - if (Fear_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,SPELL_FEAR); - - Fear_Timer = 40000; - }else Fear_Timer -= diff; - - //Sleep_Timer - if (Sleep_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO,0)) - DoCast(target,SPELL_SLEEP); - - Sleep_Timer = 30000; - }else Sleep_Timer -= diff; - - //PowerWordShield_Timer - if (!PowerWordShield && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 25) - { - DoCast(m_creature,SPELL_POWERWORDSHIELD); - PowerWordShield = true; - } - - //Dispel_Timer - if (Dispel_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_DISPELMAGIC); - - DispelMagic_Timer = 30000; - }else DispelMagic_Timer -= diff; - - //CurseOfBlood_Timer - if (CurseOfBlood_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_houndmaster_loksey.cpp deleted file mode 100644 index 7d5b6a2dbd2..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -enum -{ - SAY_AGGRO = -1189021, - SPELL_SUMMONSCARLETHOUND = 17164, - SPELL_BLOODLUST = 6742 -}; - -struct TRINITY_DLL_DECL 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, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (BloodLust_Timer < diff) - { - DoCast(m_creature,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/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_interrogator_vishas.cpp deleted file mode 100644 index cfbc0518826..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_scarlet_monastery.h" - -enum -{ - SAY_AGGRO = -1189011, - SAY_HEALTH1 = -1189012, - SAY_HEALTH2 = -1189013, - SAY_KILL = -1189014, - SAY_TRIGGER_VORREL = -1189015, - - SPELL_SHADOWWORDPAIN = 2767, -}; - -struct TRINITY_DLL_DECL boss_interrogator_vishasAI : public ScriptedAI -{ - boss_interrogator_vishasAI(Creature *c) : ScriptedAI(c) - { - pInstance = m_creature->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - bool Yell30; - bool Yell60; - uint32 ShadowWordPain_Timer; - - void Reset() - { - ShadowWordPain_Timer = 5000; - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void KilledUnit(Unit* Victim) - { - DoScriptText(SAY_KILL, m_creature); - } - - void JustDied(Unit* Killer) - { - if (!pInstance) - return; - - //Any other actions to do with vorrel? setStandState? - if (Unit *vorrel = Unit::GetUnit(*m_creature,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 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 60)) - { - DoScriptText(SAY_HEALTH1, m_creature); - Yell60 = true; - } - - if (!Yell30 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 30)) - { - DoScriptText(SAY_HEALTH2, m_creature); - Yell30 = true; - } - - //ShadowWordPain_Timer - if (ShadowWordPain_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp deleted file mode 100644 index 95a421fed13..00000000000 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_mograine_and_whitemane.cpp +++ /dev/null @@ -1,360 +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 "precompiled.h" -#include "def_scarlet_monastery.h" - -enum -{ - //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 TRINITY_DLL_DECL 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 - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - - if (m_pInstance) - if (m_creature->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, m_creature); - DoCast(m_creature,SPELL_RETRIBUTIONAURA); - - m_creature->CallForHelp(VISIBLE_RANGE); - } - - void KilledUnit(Unit* pVictim) - { - DoScriptText(SAY_MO_KILL, m_creature); - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (uiDamage < m_creature->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((*m_creature), 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); - - m_creature->GetMotionMaster()->MovementExpired(); - m_creature->GetMotionMaster()->MoveIdle(); - - m_creature->SetHealth(0); - - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - m_creature->ClearComboPointHolders(); - m_creature->RemoveAllAuras(); - m_creature->ClearAllReactives(); - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->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, m_creature); - 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((*m_creature), m_pInstance->GetData64(DATA_WHITEMANE))) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - DoCast(Whitemane, SPELL_LAYONHANDS); - - m_uiCrusaderStrike_Timer = 10000; - m_uiHammerOfJustice_Timer = 10000; - - if (m_creature->getVictim()) - m_creature->GetMotionMaster()->MoveChase(m_creature->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(m_creature->getVictim(),SPELL_CRUSADERSTRIKE); - m_uiCrusaderStrike_Timer = 10000; - }else m_uiCrusaderStrike_Timer -= uiDiff; - - //m_uiHammerOfJustice_Timer - if (m_uiHammerOfJustice_Timer < uiDiff) - { - DoCast(m_creature->getVictim(),SPELL_HAMMEROFJUSTICE); - m_uiHammerOfJustice_Timer = 60000; - }else m_uiHammerOfJustice_Timer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL 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 (m_creature->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, m_creature); - } - - void KilledUnit(Unit* pVictim) - { - DoScriptText(SAY_WH_KILL, m_creature); - } - - 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((*m_creature), m_pInstance->GetData64(DATA_MOGRAINE))) - { - DoCast(Mograine, SPELL_SCARLETRESURRECTION); - DoScriptText(SAY_WH_RESSURECT, m_creature); - m_bCanResurrect = false; - } - } - else m_uiWait_Timer -= uiDiff; - } - - //Cast Deep sleep when health is less than 50% - if (!m_bCanResurrectCheck && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - DoCast(m_creature->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 (m_creature->GetHealth() <= m_creature->GetMaxHealth()*0.75f) - pTarget = m_creature; - - if (m_pInstance) - { - if (Creature* pMograine = Unit::GetCreature((*m_creature), 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(m_creature,SPELL_POWERWORDSHIELD); - m_uiPowerWordShield_Timer = 15000; - }else m_uiPowerWordShield_Timer -= uiDiff; - - //m_uiHolySmite_Timer - if (m_uiHolySmite_Timer < uiDiff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/boss_scorn.cpp deleted file mode 100644 index fa54e594783..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define SPELL_LICHSLAP 28873 -#define SPELL_FROSTBOLTVOLLEY 8398 -#define SPELL_MINDFLAY 17313 -#define SPELL_FROSTNOVA 15531 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_LICHSLAP); - LichSlap_Timer = 45000; - }else LichSlap_Timer -= diff; - - //FrostboltVolley_Timer - if (FrostboltVolley_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROSTBOLTVOLLEY); - FrostboltVolley_Timer = 20000; - }else FrostboltVolley_Timer -= diff; - - //MindFlay_Timer - if (MindFlay_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MINDFLAY); - MindFlay_Timer = 20000; - }else MindFlay_Timer -= diff; - - //FrostNova_Timer - if (FrostNova_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h b/src/bindings/scripts/scripts/zone/scarlet_monastery/def_scarlet_monastery.h deleted file mode 100644 index 2b6399ae3e4..00000000000 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/def_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/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp b/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp deleted file mode 100644 index 04a63a82319..00000000000 --- a/src/bindings/scripts/scripts/zone/scarlet_monastery/instance_scarlet_monastery.cpp +++ /dev/null @@ -1,156 +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 "precompiled.h" -#include "def_scarlet_monastery.h" -#include "sc_creature.h" - -#define ENTRY_PUMPKIN_SHRINE 186267 -#define ENTRY_HORSEMAN 23682 -#define ENTRY_HEAD 23775 -#define ENTRY_PUMPKIN 23694 - -#define MAX_ENCOUNTER 1 - -struct TRINITY_DLL_DECL 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: - if (data == DONE) - { - for(std::set::iterator itr = HorsemanAdds.begin(); itr != HorsemanAdds.end(); ++itr) - { - Creature* add = instance->GetCreature(*itr); - if (add && add->isAlive()) - add->DealDamage(add, add->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - 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]; - - 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/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.cpp deleted file mode 100644 index a5f32d9bde1..00000000000 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_darkmaster_gandling.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_Darkmaster_Gandling -SD%Complete: 75 -SDComment: Doors missing in instance script. -SDCategory: Scholomance -EndScriptData */ - -#include "precompiled.h" -#include "def_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 TRINITY_DLL_DECL boss_darkmaster_gandlingAI : public ScriptedAI -{ - boss_darkmaster_gandlingAI(Creature *c) : ScriptedAI(c) - { - pInstance = m_creature->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 ArcaneMissiles_Timer; - uint32 ShadowShield_Timer; - uint32 Curse_Timer; - uint32 Teleport_Timer; - - Creature *Summoned; - - 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(m_creature->getVictim(),SPELL_ARCANEMISSILES); - ArcaneMissiles_Timer = 8000; - }else ArcaneMissiles_Timer -= diff; - - //ShadowShield_Timer - if (ShadowShield_Timer < diff) - { - DoCast(m_creature,SPELL_SHADOWSHIELD); - ShadowShield_Timer = 14000 + rand()%14000; - }else ShadowShield_Timer -= diff; - - //Curse_Timer - if (Curse_Timer < diff) - { - DoCast(m_creature->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 (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 3) - { - if (Teleport_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target && target->GetTypeId() == TYPEID_PLAYER) - { - if (DoGetThreat(target)) - DoModifyThreatPercent(target, -100); - - switch(rand()%6) - { - case 0: - DoTeleportPlayer(target, 250.0696,0.3921,84.8408,3.149); - Summoned = m_creature->SummonCreature(16119,254.2325,0.3417,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - Summoned = m_creature->SummonCreature(16119,257.7133,4.0226,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - Summoned = m_creature->SummonCreature(16119,258.6702,-2.60656,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - break; - case 1: - DoTeleportPlayer(target, 181.4220,-91.9481,84.8410,1.608); - Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,84.8407,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - break; - case 2: - DoTeleportPlayer(target, 95.1547,-1.8173,85.2289,0.043); - Summoned = m_creature->SummonCreature(16119,100.9404,-1.8016,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - Summoned = m_creature->SummonCreature(16119,101.3729,0.4882,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - Summoned = m_creature->SummonCreature(16119,101.4596,-4.4740,85.2289,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - break; - case 3: - DoTeleportPlayer(target, 250.0696,0.3921,72.6722,3.149); - Summoned = m_creature->SummonCreature(16119,240.34481,0.7368,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - Summoned = m_creature->SummonCreature(16119,240.3633,-2.9520,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - Summoned = m_creature->SummonCreature(16119,240.6702,3.34949,72.6722,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - break; - case 4: - DoTeleportPlayer(target, 181.4220,-91.9481,70.7734,1.608); - Summoned = m_creature->SummonCreature(16119,184.0519,-73.5649,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - Summoned = m_creature->SummonCreature(16119,179.5951,-73.7045,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - Summoned = m_creature->SummonCreature(16119,180.6452,-78.2143,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - Summoned = m_creature->SummonCreature(16119,283.2274,-78.1518,70.7734,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - break; - case 5: - DoTeleportPlayer(target, 106.1541,-1.8994,75.3663,0.043); - Summoned = m_creature->SummonCreature(16119,115.3945,-1.5555,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - Summoned = m_creature->SummonCreature(16119,257.7133,1.8066,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - Summoned = m_creature->SummonCreature(16119,258.6702,-5.1001,75.3663,0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,10000); - if (Summoned) - (Summoned->AI())->AttackStart(target); - 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/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.cpp deleted file mode 100644 index d4c19cc6dd6..00000000000 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_death_knight_darkreaver.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: Boss_Death_knight_darkreaver -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "precompiled.h" - -struct TRINITY_DLL_DECL boss_death_knight_darkreaverAI : public ScriptedAI -{ - boss_death_knight_darkreaverAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (m_creature->GetHealth() <= damage) - { - m_creature->CastSpell(m_creature,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/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp deleted file mode 100644 index badea0761e4..00000000000 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_doctor_theolen_krastinov.cpp +++ /dev/null @@ -1,111 +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 "precompiled.h" -#include "def_scholomance.h" - -#define EMOTE_GENERIC_FRENZY_KILL -1000001 - -#define SPELL_REND 18106 -#define SPELL_CLEAVE 15584 -#define SPELL_FRENZY 28371 - -struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI -{ - boss_theolenkrastinovAI(Creature *c) : ScriptedAI(c) {} - - uint32 Rend_Timer; - uint32 Cleave_Timer; - uint32 Frenzy_Timer; - - void Reset() - { - Rend_Timer = 8000; - Cleave_Timer = 9000; - Frenzy_Timer =0; - } - - void JustDied(Unit *killer) - { - ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; - if (pInstance) - { - pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0); - - if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) - m_creature->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; - - //Rend_Timer - if (Rend_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_REND); - Rend_Timer = 10000; - }else Rend_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 10000; - }else Cleave_Timer -= diff; - - //Frenzy_Timer - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26) - { - if (Frenzy_Timer < diff) - { - DoCast(m_creature,SPELL_FRENZY); - DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); - - Frenzy_Timer = 8000; - }else Frenzy_Timer -= diff; - } - - 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/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_illucia_barov.cpp deleted file mode 100644 index 0fd36025676..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_scholomance.h" - -#define SPELL_CURSEOFAGONY 18671 -#define SPELL_SHADOWSHOCK 20603 -#define SPELL_SILENCE 15487 -#define SPELL_FEAR 6215 - -struct TRINITY_DLL_DECL 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 = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; - if (pInstance) - { - pInstance->SetData(DATA_LADYILLUCIABAROV_DEATH, 0); - - if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) - m_creature->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(m_creature->getVictim(),SPELL_CURSEOFAGONY); - CurseOfAgony_Timer = 30000; - }else CurseOfAgony_Timer -= diff; - - //ShadowShock_Timer - if (ShadowShock_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_SHADOWSHOCK); - - ShadowShock_Timer = 12000; - }else ShadowShock_Timer -= diff; - - //Silence_Timer - if (Silence_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SILENCE); - Silence_Timer = 14000; - }else Silence_Timer -= diff; - - //Fear_Timer - if (Fear_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_instructor_malicia.cpp deleted file mode 100644 index b7ae2422c92..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_scholomance.h" - -#define SPELL_CALLOFGRAVES 17831 -#define SPELL_CORRUPTION 11672 -#define SPELL_FLASHHEAL 10917 -#define SPELL_RENEW 10929 -#define SPELL_HEALINGTOUCH 9889 - -struct TRINITY_DLL_DECL 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 = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; - if (pInstance) - { - pInstance->SetData(DATA_INSTRUCTORMALICIA_DEATH, 0); - - if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) - m_creature->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(m_creature->getVictim(),SPELL_CALLOFGRAVES); - CallOfGraves_Timer = 65000; - }else CallOfGraves_Timer -= diff; - - //Corruption_Timer - if (Corruption_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_CORRUPTION); - - Corruption_Timer = 24000; - }else Corruption_Timer -= diff; - - //Renew_Timer - if (Renew_Timer < diff) - { - DoCast(m_creature, SPELL_RENEW); - Renew_Timer = 10000; - }else Renew_Timer -= diff; - - //FlashHeal_Timer - if (FlashHeal_Timer < diff) - { - DoCast(m_creature,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(m_creature,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/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp deleted file mode 100644 index 9996479177f..00000000000 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_jandice_barov.cpp +++ /dev/null @@ -1,223 +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 "precompiled.h" - -#define SPELL_CURSEOFBLOOD 24673 -//#define SPELL_ILLUSION 17773 - -//Spells of Illusion of Jandice Barov -#define SPELL_CLEAVE 15584 - -struct TRINITY_DLL_DECL boss_jandicebarovAI : public ScriptedAI -{ - boss_jandicebarovAI(Creature *c) : ScriptedAI(c) {} - - uint32 CurseOfBlood_Timer; - uint32 Illusion_Timer; - //uint32 Illusioncounter; - uint32 Invisible_Timer; - bool Invisible; - int Rand; - int RandX; - int RandY; - Creature* Summoned; - - 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) - { - Rand = rand()%10; - switch (rand()%2) - { - case 0: RandX = 0 - Rand; break; - case 1: RandX = 0 + Rand; break; - } - Rand = 0; - Rand = rand()%10; - switch (rand()%2) - { - case 0: RandY = 0 - Rand; break; - case 1: RandY = 0 + Rand; break; - } - Rand = 0; - Summoned = DoSpawnCreature(11439, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 60000); - if (Summoned) - (Summoned->AI())->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - if (Invisible && Invisible_Timer < diff) - { - //Become visible again - m_creature->setFaction(14); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->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(m_creature->getVictim(),SPELL_CURSEOFBLOOD); - - //45 seconds - CurseOfBlood_Timer = 30000; - }else CurseOfBlood_Timer -= diff; - - //Illusion_Timer - if (!Invisible && Illusion_Timer < diff) - { - - //Inturrupt any spell casting - m_creature->InterruptNonMeleeSpells(false); - m_creature->setFaction(35); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetDisplayId(11686); // Invisible Model - DoModifyThreatPercent(m_creature->getVictim(),-99); - - //Summon 10 Illusions attacking random gamers - Unit* target = NULL; - for(uint8 i = 0; i < 10; ++i) - { - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - SummonIllusions(target); - } - 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(m_creature->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 TRINITY_DLL_DECL mob_illusionofjandicebarovAI : public ScriptedAI -{ - mob_illusionofjandicebarovAI(Creature *c) : ScriptedAI(c) {} - - uint32 Cleave_Timer; - - void Reset() - { - Cleave_Timer = 2000 + rand()%6000; - m_creature->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(m_creature->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/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_kormok.cpp deleted file mode 100644 index c67a49926f9..00000000000 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_kormok.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_Kormok -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_SHADOWBOLTVOLLEY 20741 -#define SPELL_BONESHIELD 27688 - -struct TRINITY_DLL_DECL boss_kormokAI : public ScriptedAI -{ - boss_kormokAI(Creature *c) : ScriptedAI(c) {} - - uint32 ShadowVolley_Timer; - uint32 BoneShield_Timer; - uint32 Minion_Timer; - uint32 Mage_Timer; - bool Mages; - int Rand1; - int Rand1X; - int Rand1Y; - int Rand2; - int Rand2X; - int Rand2Y; - Creature* SummonedMinions; - Creature* SummonedMages; - - void Reset() - { - ShadowVolley_Timer = 10000; - BoneShield_Timer = 2000; - Minion_Timer = 15000; - Mage_Timer = 0; - Mages = false; - } - - void EnterCombat(Unit *who) - { - } - - void SummonMinion(Unit* victim) - { - Rand1 = rand()%8; - switch (rand()%2) - { - case 0: Rand1X = 0 - Rand1; break; - case 1: Rand1X = 0 + Rand1; break; - } - Rand1 = 0; - Rand1 = rand()%8; - switch (rand()%2) - { - case 0: Rand1Y = 0 - Rand1; break; - case 1: Rand1Y = 0 + Rand1; break; - } - Rand1 = 0; - SummonedMinions = DoSpawnCreature(16119, Rand1X, Rand1Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); - if (SummonedMinions) - (SummonedMinions->AI())->AttackStart(victim); - } - - void SummonMages(Unit* victim) - { - Rand2 = rand()%10; - switch (rand()%2) - { - case 0: Rand2X = 0 - Rand2; break; - case 1: Rand2X = 0 + Rand2; break; - } - Rand2 = 0; - Rand2 = rand()%10; - switch (rand()%2) - { - case 0: Rand2Y = 0 - Rand2; break; - case 1: Rand2Y = 0 + Rand2; break; - } - Rand2 = 0; - SummonedMages = DoSpawnCreature(16120, Rand2X, Rand2Y, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 120000); - if (SummonedMages) - (SummonedMages->AI())->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //ShadowVolley_Timer - if (ShadowVolley_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SHADOWBOLTVOLLEY); - ShadowVolley_Timer = 15000; - }else ShadowVolley_Timer -= diff; - - //BoneShield_Timer - if (BoneShield_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_BONESHIELD); - BoneShield_Timer = 45000; - }else BoneShield_Timer -= diff; - - //Minion_Timer - if (Minion_Timer < diff) - { - //Cast - SummonMinion(m_creature->getVictim()); - SummonMinion(m_creature->getVictim()); - SummonMinion(m_creature->getVictim()); - SummonMinion(m_creature->getVictim()); - - Minion_Timer = 12000; - }else Minion_Timer -= diff; - - //Summon 2 Bone Mages - if (!Mages && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26) - { - //Cast - SummonMages(m_creature->getVictim()); - SummonMages(m_creature->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/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_lord_alexei_barov.cpp deleted file mode 100644 index f8b21ebfd55..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_scholomance.h" - -#define SPELL_IMMOLATE 20294 // Old ID was 15570 -#define SPELL_VEILOFSHADOW 17820 - -struct TRINITY_DLL_DECL boss_lordalexeibarovAI : public ScriptedAI -{ - boss_lordalexeibarovAI(Creature *c) : ScriptedAI(c) {} - - uint32 Immolate_Timer; - uint32 VeilofShadow_Timer; - - void Reset() - { - Immolate_Timer = 7000; - VeilofShadow_Timer = 15000; - - m_creature->LoadCreaturesAddon(); - } - - void JustDied(Unit *killer) - { - ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; - if (pInstance) - { - pInstance->SetData(DATA_LORDALEXEIBAROV_DEATH, 0); - - if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) - m_creature->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* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_IMMOLATE); - - Immolate_Timer = 12000; - }else Immolate_Timer -= diff; - - //VeilofShadow_Timer - if (VeilofShadow_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_lorekeeper_polkelt.cpp deleted file mode 100644 index 489e8bbc1cb..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_scholomance.h" - -#define SPELL_VOLATILEINFECTION 24928 -#define SPELL_DARKPLAGUE 18270 -#define SPELL_CORROSIVEACID 23313 -#define SPELL_NOXIOUSCATALYST 18151 - -struct TRINITY_DLL_DECL 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 = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; - if (pInstance) - { - pInstance->SetData(DATA_LOREKEEPERPOLKELT_DEATH, 0); - - if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) - m_creature->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(m_creature->getVictim(),SPELL_VOLATILEINFECTION); - VolatileInfection_Timer = 32000; - }else VolatileInfection_Timer -= diff; - - //Darkplague_Timer - if (Darkplague_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_DARKPLAGUE); - Darkplague_Timer = 8000; - }else Darkplague_Timer -= diff; - - //CorrosiveAcid_Timer - if (CorrosiveAcid_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CORROSIVEACID); - CorrosiveAcid_Timer = 25000; - }else CorrosiveAcid_Timer -= diff; - - //NoxiousCatalyst_Timer - if (NoxiousCatalyst_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.cpp deleted file mode 100644 index 105beb13375..00000000000 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_ras_frostwhisper.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_Ras_Frostwhisper -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "precompiled.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 TRINITY_DLL_DECL 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; - - m_creature->CastSpell(m_creature,SPELL_ICEARMOR,true); - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //IceArmor_Timer - if (IceArmor_Timer < diff) - { - DoCast(m_creature, SPELL_ICEARMOR); - IceArmor_Timer = 180000; - }else IceArmor_Timer -= diff; - - //Frostbolt_Timer - if (Frostbolt_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,SPELL_FROSTBOLT); - - Frostbolt_Timer = 8000; - }else Frostbolt_Timer -= diff; - - //Freeze_Timer - if (Freeze_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FREEZE); - Freeze_Timer = 24000; - }else Freeze_Timer -= diff; - - //Fear_Timer - if (Fear_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FEAR); - Fear_Timer = 30000; - }else Fear_Timer -= diff; - - //ChillNova_Timer - if (ChillNova_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CHILLNOVA); - ChillNova_Timer = 14000; - }else ChillNova_Timer -= diff; - - //FrostVolley_Timer - if (FrostVolley_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_the_ravenian.cpp deleted file mode 100644 index ea355c401a3..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_scholomance.h" - -#define SPELL_TRAMPLE 15550 -#define SPELL_CLEAVE 20691 -#define SPELL_SUNDERINCLEAVE 25174 -#define SPELL_KNOCKAWAY 10101 - -struct TRINITY_DLL_DECL 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 = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; - if (pInstance) - { - pInstance->SetData(DATA_THERAVENIAN_DEATH, 0); - - if (pInstance->GetData(TYPE_GANDLING) == IN_PROGRESS) - m_creature->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(m_creature->getVictim(),SPELL_TRAMPLE); - Trample_Timer = 10000; - }else Trample_Timer -= diff; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 7000; - }else Cleave_Timer -= diff; - - //SunderingCleave_Timer - if (SunderingCleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SUNDERINCLEAVE); - SunderingCleave_Timer = 20000; - }else SunderingCleave_Timer -= diff; - - //KnockAway_Timer - if (KnockAway_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp b/src/bindings/scripts/scripts/zone/scholomance/boss_vectus.cpp deleted file mode 100644 index 9d343d26a7e..00000000000 --- a/src/bindings/scripts/scripts/zone/scholomance/boss_vectus.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_Vectus -SD%Complete: 100 -SDComment: -SDCategory: Scholomance -EndScriptData */ - -#include "precompiled.h" - -#define EMOTE_GENERIC_FRENZY_KILL -1000001 - -#define SPELL_FIRESHIELD 19626 -#define SPELL_BLASTWAVE 13021 -#define SPELL_FRENZY 28371 - -struct TRINITY_DLL_DECL boss_vectusAI : public ScriptedAI -{ - boss_vectusAI(Creature *c) : ScriptedAI(c) {} - - uint32 FireShield_Timer; - uint32 BlastWave_Timer; - uint32 Frenzy_Timer; - - void Reset() - { - FireShield_Timer = 2000; - BlastWave_Timer = 14000; - Frenzy_Timer = 0; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //FireShield_Timer - if (FireShield_Timer < diff) - { - DoCast(m_creature, SPELL_FIRESHIELD); - FireShield_Timer = 90000; - }else FireShield_Timer -= diff; - - //BlastWave_Timer - if (BlastWave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_BLASTWAVE); - BlastWave_Timer = 12000; - }else BlastWave_Timer -= diff; - - //Frenzy_Timer - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25) - { - if (Frenzy_Timer < diff) - { - DoCast(m_creature,SPELL_FRENZY); - DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); - - Frenzy_Timer = 24000; - }else Frenzy_Timer -= diff; - } - - 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/bindings/scripts/scripts/zone/scholomance/def_scholomance.h b/src/bindings/scripts/scripts/zone/scholomance/def_scholomance.h deleted file mode 100644 index 83ce26c9687..00000000000 --- a/src/bindings/scripts/scripts/zone/scholomance/def_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/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp b/src/bindings/scripts/scripts/zone/scholomance/instance_scholomance.cpp deleted file mode 100644 index 282d6e9705a..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h b/src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h deleted file mode 100644 index 8383a5c3950..00000000000 --- a/src/bindings/scripts/scripts/zone/shadowfang_keep/def_shadowfang_keep.h +++ /dev/null @@ -1,13 +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 - -#define TYPE_FREE_NPC 1 -#define TYPE_RETHILGORE 2 -#define TYPE_FENRUS 3 -#define TYPE_NANDOS 4 -#endif - diff --git a/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp b/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp deleted file mode 100644 index 5c3cf162b94..00000000000 --- a/src/bindings/scripts/scripts/zone/shadowfang_keep/instance_shadowfang_keep.cpp +++ /dev/null @@ -1,208 +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 "precompiled.h" -#include "def_shadowfang_keep.h" - -#define MAX_ENCOUNTER 4 - -enum -{ - SAY_BOSS_DIE_AD = -1033007, - SAY_BOSS_DIE_AS = -1033008, - - NPC_ASH = 3850, - NPC_ADA = 3849, - - 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 -}; - -struct TRINITY_DLL_DECL 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 DoorCourtyardGUID; - uint64 DoorSorcererGUID; - uint64 DoorArugalGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - uiAshGUID = 0; - uiAdaGUID = 0; - - DoorCourtyardGUID = 0; - DoorSorcererGUID = 0; - DoorArugalGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case NPC_ASH: uiAshGUID = pCreature->GetGUID(); break; - case NPC_ADA: uiAdaGUID = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case GO_COURTYARD_DOOR: - DoorCourtyardGUID = pGo->GetGUID(); - if (m_auiEncounter[0] == DONE) - DoUseDoorOrButton(DoorCourtyardGUID); - break; - case GO_SORCERER_DOOR: - DoorSorcererGUID = pGo->GetGUID(); - if (m_auiEncounter[2] == DONE) - DoUseDoorOrButton(DoorSorcererGUID); - break; - case GO_ARUGAL_DOOR: - DoorArugalGUID = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE) - DoUseDoorOrButton(DoorArugalGUID); - 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: - if (data == DONE) - DoUseDoorOrButton(DoorSorcererGUID); - 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; - } -}; - -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/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp b/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.cpp deleted file mode 100644 index 5f9d42ea65e..00000000000 --- a/src/bindings/scripts/scripts/zone/shadowfang_keep/shadowfang_keep.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: 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 "precompiled.h" -#include "escortAI.h" -#include "def_shadowfang_keep.h" - -/*###### -## npc_shadowfang_prisoner -######*/ - -enum -{ - 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 -}; - -#define GOSSIP_ITEM_DOOR "Thanks, I'll follow you to the door." - -struct TRINITY_DLL_DECL 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, m_creature); - else - DoScriptText(SAY_FREE_AD, m_creature); - break; - case 10: - if (uiNpcEntry == NPC_ASH) - DoScriptText(SAY_OPEN_DOOR_AS, m_creature); - else - DoScriptText(SAY_OPEN_DOOR_AD, m_creature); - break; - case 11: - if (uiNpcEntry == NPC_ASH) - DoCast(m_creature, SPELL_UNLOCK); - break; - case 12: - if (uiNpcEntry == NPC_ASH) - DoScriptText(SAY_POST_DOOR_AS, m_creature); - else - DoScriptText(SAY_POST1_DOOR_AD, m_creature); - - if (pInstance) - pInstance->SetData(TYPE_FREE_NPC, DONE); - break; - case 13: - if (uiNpcEntry != NPC_ASH) - DoScriptText(SAY_POST2_DOOR_AD, m_creature); - 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(pCreature->GetNpcTextId(), 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; -} - -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(); -} - diff --git a/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp deleted file mode 100644 index b83637650bb..00000000000 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_baron_rivendare.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Baron_Rivendare -SD%Complete: 70 -SDComment: aura applied/defined in database -SDCategory: Stratholme -EndScriptData */ - -#include "precompiled.h" -#include "def_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 TRINITY_DLL_DECL boss_baron_rivendareAI : public ScriptedAI -{ - boss_baron_rivendareAI(Creature *c) : ScriptedAI(c) - { - pInstance = m_creature->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 ShadowBolt_Timer; - uint32 Cleave_Timer; - uint32 MortalStrike_Timer; - // uint32 RaiseDead_Timer; - uint32 SummonSkeletons_Timer; - Creature *Summoned; - - 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* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(target); - } - - 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* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT); - - ShadowBolt_Timer = 10000; - }else ShadowBolt_Timer -= diff; - - //Cleave - if (Cleave_Timer < diff) - { - DoCast(m_creature->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(m_creature->getVictim(),SPELL_MORTALSTRIKE); - MortalStrike_Timer = 10000 + (rand()%15000); - }else MortalStrike_Timer -= diff; - - //RaiseDead - // if (RaiseDead_Timer < diff) - // { - // DoCast(m_creature,SPELL_RAISEDEAD); - // RaiseDead_Timer = 45000; - // }else RaiseDead_Timer -= diff; - - //SummonSkeletons - if (SummonSkeletons_Timer < diff) - { - m_creature->SummonCreature(11197,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->SummonCreature(11197,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->SummonCreature(11197,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->SummonCreature(11197,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->SummonCreature(11197,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,29000); - m_creature->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/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_baroness_anastari.cpp deleted file mode 100644 index 157c3f166c3..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_stratholme.h" - -#define SPELL_BANSHEEWAIL 16565 -#define SPELL_BANSHEECURSE 16867 -#define SPELL_SILENCE 18327 -//#define SPELL_POSSESS 17244 - -struct TRINITY_DLL_DECL boss_baroness_anastariAI : public ScriptedAI -{ - boss_baroness_anastariAI(Creature *c) : ScriptedAI(c) - { - pInstance = m_creature->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(m_creature->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(m_creature->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(m_creature->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* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target)DoCast(target,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/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp deleted file mode 100644 index 9d934e87627..00000000000 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_cannon_master_willey.cpp +++ /dev/null @@ -1,221 +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 "precompiled.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 TRINITY_DLL_DECL 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) - { - m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->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(m_creature->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(m_creature->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(m_creature->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: - m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 1: - m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 2: - m_creature->SummonCreature(11054,ADD_3X,ADD_3Y,ADD_3Z,ADD_3O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 3: - m_creature->SummonCreature(11054,ADD_4X,ADD_4Y,ADD_4Z,ADD_4O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 4: - m_creature->SummonCreature(11054,ADD_5X,ADD_5Y,ADD_5Z,ADD_5O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 5: - m_creature->SummonCreature(11054,ADD_6X,ADD_6Y,ADD_6Z,ADD_6O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 6: - m_creature->SummonCreature(11054,ADD_7X,ADD_7Y,ADD_7Z,ADD_7O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 7: - m_creature->SummonCreature(11054,ADD_8X,ADD_8Y,ADD_8Z,ADD_8O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_2X,ADD_2Y,ADD_2Z,ADD_2O,TEMPSUMMON_TIMED_DESPAWN,240000); - break; - case 8: - m_creature->SummonCreature(11054,ADD_9X,ADD_9Y,ADD_9Z,ADD_9O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->SummonCreature(11054,ADD_1X,ADD_1Y,ADD_1Z,ADD_1O,TEMPSUMMON_TIMED_DESPAWN,240000); - m_creature->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/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_dathrohan_balnazzar.cpp deleted file mode 100644 index 00506ad880c..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -enum -{ - //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 TRINITY_DLL_DECL 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 (m_creature->GetEntry() == NPC_BALNAZZAR) - m_creature->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(m_creature->getVictim(),SPELL_MINDBLAST); - m_uiMindBlast_Timer = 15000 + rand()%5000; - }else m_uiMindBlast_Timer -= uiDiff; - - //CrusadersHammer - if (m_uiCrusadersHammer_Timer < uiDiff) - { - DoCast(m_creature->getVictim(),SPELL_CRUSADERSHAMMER); - m_uiCrusadersHammer_Timer = 12000; - }else m_uiCrusadersHammer_Timer -= uiDiff; - - //CrusaderStrike - if (m_uiCrusaderStrike_Timer < uiDiff) - { - DoCast(m_creature->getVictim(),SPELL_CRUSADERSTRIKE); - m_uiCrusaderStrike_Timer = 15000; - }else m_uiCrusaderStrike_Timer -= uiDiff; - - //HolyStrike - if (m_uiHolyStrike_Timer < uiDiff) - { - DoCast(m_creature->getVictim(),SPELL_HOLYSTRIKE); - m_uiHolyStrike_Timer = 15000; - }else m_uiHolyStrike_Timer -= uiDiff; - - //BalnazzarTransform - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 40) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - //restore hp, mana and stun - DoCast(m_creature,SPELL_BALNAZZARTRANSFORM); - m_creature->UpdateEntry(NPC_BALNAZZAR); - m_bTransformed = true; - } - } - else - { - //MindBlast - if (m_uiMindBlast_Timer < uiDiff) - { - DoCast(m_creature->getVictim(),SPELL_MINDBLAST); - m_uiMindBlast_Timer = 15000 + rand()%5000; - }else m_uiMindBlast_Timer -= uiDiff; - - //ShadowShock - if (m_uiShadowShock_Timer < uiDiff) - { - DoCast(m_creature->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(m_creature->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/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.cpp deleted file mode 100644 index fc922a4e39a..00000000000 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_magistrate_barthilas.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_Magistrate_Barthilas -SD%Complete: 70 -SDComment: -SDCategory: Stratholme -EndScriptData */ - -#include "precompiled.h" -#include "def_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 TRINITY_DLL_DECL boss_magistrate_barthilasAI : public ScriptedAI -{ - boss_magistrate_barthilasAI(Creature *c) : ScriptedAI(c) - { - pInstance = m_creature->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - 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 (m_creature->isAlive()) - m_creature->SetDisplayId(MODEL_NORMAL); - else - m_creature->SetDisplayId(MODEL_HUMAN); - } - - void MoveInLineOfSight(Unit *who) - { - //nothing to see here yet - - ScriptedAI::MoveInLineOfSight(who); - } - - void JustDied(Unit* Killer) - { - m_creature->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; - m_creature->CastSpell(m_creature,SPELL_FURIOUS_ANGER,false); - }else FuriousAnger_Timer -= diff; - - //DrainingBlow - if (DrainingBlow_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_DRAININGBLOW); - DrainingBlow_Timer = 15000; - }else DrainingBlow_Timer -= diff; - - //CrowdPummel - if (CrowdPummel_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CROWDPUMMEL); - CrowdPummel_Timer = 15000; - }else CrowdPummel_Timer -= diff; - - //MightyBlow - if (MightyBlow_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_maleki_the_pallid.cpp deleted file mode 100644 index 358e54cd39c..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_stratholme.h" - -#define SPELL_FROSTBOLT 17503 -#define SPELL_DRAINLIFE 20743 -#define SPELL_DRAIN_MANA 17243 -#define SPELL_ICETOMB 16869 - -struct TRINITY_DLL_DECL boss_maleki_the_pallidAI : public ScriptedAI -{ - boss_maleki_the_pallidAI(Creature *c) : ScriptedAI(c) - { - pInstance = m_creature->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(m_creature->getVictim(),SPELL_FROSTBOLT); - Frostbolt_Timer = 3500; - }else Frostbolt_Timer -= diff; - - //IceTomb - if (IceTomb_Timer < diff) - { - if (rand()%100 < 65) - DoCast(m_creature->getVictim(),SPELL_ICETOMB); - IceTomb_Timer = 28000; - }else IceTomb_Timer -= diff; - - //DrainLife - if (DrainLife_Timer < diff) - { - if (rand()%100 < 55) - DoCast(m_creature->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/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp deleted file mode 100644 index cd007273cd7..00000000000 --- a/src/bindings/scripts/scripts/zone/stratholme/boss_nerubenkan.cpp +++ /dev/null @@ -1,139 +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 "precompiled.h" -#include "def_stratholme.h" - -#define SPELL_ENCASINGWEBS 4962 -#define SPELL_PIERCEARMOR 6016 -#define SPELL_CRYPT_SCARABS 31602 -#define SPELL_RAISEUNDEADSCARAB 17235 - -struct TRINITY_DLL_DECL boss_nerubenkanAI : public ScriptedAI -{ - boss_nerubenkanAI(Creature *c) : ScriptedAI(c) - { - pInstance = m_creature->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 EncasingWebs_Timer; - uint32 PierceArmor_Timer; - uint32 CryptScarabs_Timer; - uint32 RaiseUndeadScarab_Timer; - int Rand; - int RandX; - int RandY; - Creature* Summoned; - - 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* victim) - { - Rand = rand()%10; - switch (rand()%2) - { - case 0: RandX = 0 - Rand; break; - case 1: RandX = 0 + Rand; break; - } - Rand = 0; - Rand = rand()%10; - switch (rand()%2) - { - case 0: RandY = 0 - Rand; break; - case 1: RandY = 0 + Rand; break; - } - Rand = 0; - Summoned = DoSpawnCreature(10876, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 180000); - if (Summoned) - (Summoned->AI())->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //EncasingWebs - if (EncasingWebs_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ENCASINGWEBS); - EncasingWebs_Timer = 30000; - }else EncasingWebs_Timer -= diff; - - //PierceArmor - if (PierceArmor_Timer < diff) - { - if (rand()%100 < 75) - DoCast(m_creature->getVictim(),SPELL_PIERCEARMOR); - PierceArmor_Timer = 35000; - }else PierceArmor_Timer -= diff; - - //CryptScarabs_Timer - if (CryptScarabs_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CRYPT_SCARABS); - CryptScarabs_Timer = 20000; - }else CryptScarabs_Timer -= diff; - - //RaiseUndeadScarab - if (RaiseUndeadScarab_Timer < diff) - { - RaiseUndeadScarab(m_creature->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/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_order_of_silver_hand.cpp deleted file mode 100644 index b9b07ad3cbb..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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(m_creature->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(m_creature->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,m_creature->GetGUID()); - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (HolyLight_Timer < diff) - { - if (m_creature->GetHealth()*5 < m_creature->GetMaxHealth()) - { - DoCast(m_creature, SPELL_HOLY_LIGHT); - HolyLight_Timer = 20000; - } - }else HolyLight_Timer -= diff; - - if (DivineShield_Timer < diff) - { - if (m_creature->GetHealth()*20 < m_creature->GetMaxHealth()) - { - DoCast(m_creature, 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/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_postmaster_malown.cpp deleted file mode 100644 index 9fd7e550b4f..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.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 TRINITY_DLL_DECL 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(m_creature->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(m_creature->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(m_creature->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(m_creature->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(m_creature->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/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_ramstein_the_gorger.cpp deleted file mode 100644 index 6659e2dfdb1..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - #include "def_stratholme.h" - -#define SPELL_TRAMPLE 5568 -#define SPELL_KNOCKOUT 17307 - - #define C_MINDLESS_UNDEAD 11030 - -struct TRINITY_DLL_DECL boss_ramstein_the_gorgerAI : public ScriptedAI -{ - boss_ramstein_the_gorgerAI(Creature *c) : ScriptedAI(c) - { - pInstance = m_creature->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 = m_creature->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(m_creature->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(m_creature,SPELL_TRAMPLE); - Trample_Timer = 7000; - }else Trample_Timer -= diff; - - //Knockout - if (Knockout_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp b/src/bindings/scripts/scripts/zone/stratholme/boss_timmy_the_cruel.cpp deleted file mode 100644 index 27eb2672b33..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define SAY_SPAWN "TIMMY!" - -#define SPELL_RAVENOUSCLAW 17470 - -struct TRINITY_DLL_DECL 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) - { - m_creature->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(m_creature->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/bindings/scripts/scripts/zone/stratholme/def_stratholme.h b/src/bindings/scripts/scripts/zone/stratholme/def_stratholme.h deleted file mode 100644 index b9246091a7c..00000000000 --- a/src/bindings/scripts/scripts/zone/stratholme/def_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/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp b/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp deleted file mode 100644 index c37b1a904f7..00000000000 --- a/src/bindings/scripts/scripts/zone/stratholme/instance_stratholme.cpp +++ /dev/null @@ -1,423 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL instance_stratholme : public ScriptedInstance -{ - instance_stratholme(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - 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) - { - UpdateGoState(portGauntletGUID,0,false); - UpdateGoState(portSlaugtherGUID,0,false); - 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(); break; - case GO_ZIGGURAT2: ziggurat2GUID = pGo->GetGUID(); break; - case GO_ZIGGURAT3: ziggurat3GUID = pGo->GetGUID(); break; - case GO_ZIGGURAT4: - ziggurat4GUID = pGo->GetGUID(); - if (TYPE_BARON == DONE || TYPE_RAMSTEIN == DONE) - HandleGameObject(0, true, pGo); - break; - case GO_ZIGGURAT5: - ziggurat5GUID = pGo->GetGUID(); - if (TYPE_BARON == DONE || TYPE_RAMSTEIN == DONE) - HandleGameObject(0, true, pGo); - break; - case GO_PORT_GAUNTLET: portGauntletGUID = pGo->GetGUID(); break; - case GO_PORT_SLAUGTHER: portSlaugtherGUID = pGo->GetGUID(); 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; - 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. - break; - case DONE: - 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; - } - Encounter[0] = data; - break; - case TYPE_BARONESS: - Encounter[1] = data; - if (data == IN_PROGRESS) - UpdateGoState(ziggurat1GUID,GO_STATE_ACTIVE,false); - if (data == IN_PROGRESS) //change to DONE when crystals implemented - StartSlaugtherSquare(); - break; - case TYPE_NERUB: - Encounter[2] = data; - if (data == IN_PROGRESS) - UpdateGoState(ziggurat2GUID,GO_STATE_ACTIVE,false); - if (data == IN_PROGRESS) //change to DONE when crystals implemented - StartSlaugtherSquare(); - break; - case TYPE_PALLID: - Encounter[3] = data; - if (data == IN_PROGRESS) - UpdateGoState(ziggurat3GUID,GO_STATE_ACTIVE,false); - if (data == IN_PROGRESS) //change to DONE when crystals implemented - StartSlaugtherSquare(); - break; - case TYPE_RAMSTEIN: - if (data == IN_PROGRESS) - { - if (Encounter[4] != IN_PROGRESS) - UpdateGoState(portGauntletGUID,GO_STATE_READY,false); - - uint32 count = abomnationGUID.size(); - for(std::set::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 == 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); - } - 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]; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (Encounter[i] == IN_PROGRESS) - Encounter[i] = 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); - - UpdateGoState(ziggurat4GUID,GO_STATE_ACTIVE,false); - UpdateGoState(ziggurat5GUID,GO_STATE_ACTIVE,false); - 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/bindings/scripts/scripts/zone/stratholme/stratholme.cpp b/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp deleted file mode 100644 index ea8fe41fef0..00000000000 --- a/src/bindings/scripts/scripts/zone/stratholme/stratholme.cpp +++ /dev/null @@ -1,290 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL mob_freed_soulAI : public ScriptedAI -{ - mob_freed_soulAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - switch (rand()%4) - { - case 0: DoScriptText(SAY_ZAPPED0, m_creature); break; - case 1: DoScriptText(SAY_ZAPPED1, m_creature); break; - case 2: DoScriptText(SAY_ZAPPED2, m_creature); break; - case 3: DoScriptText(SAY_ZAPPED3, m_creature); break; - } - } - - 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 TRINITY_DLL_DECL 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) - m_creature->SummonCreature(ENTRY_FREED, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000); - } - - void UpdateAI(const uint32 diff) - { - if (Tagged) - { - if (Die_Timer < diff) - { - if (Unit* temp = Unit::GetUnit(*m_creature,Tagger)) - temp->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - }else Die_Timer -= diff; - } - } -}; - -CreatureAI* GetAI_mob_restless_soul(Creature* pCreature) -{ - return new mob_restless_soulAI (pCreature); -} - -/*###### -## mobs_spectral_ghostly_citizen -######*/ - -enum -{ - SPELL_HAUNTING_PHANTOM = 16336, - SPELL_SLAP = 6754 -}; - -struct TRINITY_DLL_DECL 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) - { - float x,y,z; - m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),20.0f,x,y,z); - - //100%, 50%, 33%, 25% chance to spawn - uint32 j = urand(1,i); - if (j==1) - m_creature->SummonCreature(ENTRY_RESTLESS,x,y,z,0,TEMPSUMMON_CORPSE_DESPAWN,600000); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (Tagged) - { - if (Die_Timer < diff) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - }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 (m_creature->IsWithinDistInMap(pPlayer, 5)) - m_creature->CastSpell(pPlayer,SPELL_SLAP,false); - else - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_RUDE); - break; - case TEXTEMOTE_WAVE: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); - break; - case TEXTEMOTE_BOW: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_BOW); - break; - case TEXTEMOTE_KISS: - m_creature->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/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp deleted file mode 100644 index 980fe656b4a..00000000000 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_brutallus.cpp +++ /dev/null @@ -1,326 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL boss_brutallusAI : public ScriptedAI -{ - boss_brutallusAI(Creature *c) : ScriptedAI(c){ - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - Unit* Madrigosa; - - 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; - Intro = true; //for debug - - m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Madrigosa = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_MADRIGOSA)); - //Creature* boss = Unit::GetCreature((*m_creature),AzgalorGUID); - if (!Madrigosa) error_log("Madrigosa ist nicht zu finden"); - - if (Intro && Madrigosa){ - if (!Madrigosa->isAlive()) - EndIntro(); - else error_log("Madrigosa is Tod"); - } - else - EndIntro(); - - if (pInstance) - pInstance->SetData(DATA_BRUTALLUS_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - DoScriptText(YELL_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_BRUTALLUS_EVENT, IN_PROGRESS); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%3) - { - case 0: DoScriptText(YELL_KILL1, m_creature); break; - case 1: DoScriptText(YELL_KILL2, m_creature); break; - case 2: DoScriptText(YELL_KILL3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(YELL_DEATH, m_creature); - - if (pInstance){ - pInstance->SetData(DATA_BRUTALLUS_EVENT, DONE); - float x,y,z; - m_creature->GetPosition(x,y,z); - m_creature->SummonCreature(FELMYST, x,y, z+30, m_creature->GetOrientation(), TEMPSUMMON_MANUAL_DESPAWN, 0); - } - } - - void StartIntro() - { - if (!Intro) - return; - if (Madrigosa){ - Madrigosa->setDeathState(ALIVE); - Madrigosa->setActive(true); - IsIntro = true; - } - error_log("Starte das Intro"); - } - - void EndIntro() - { - error_log("Beende das Intro"); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Intro = false; - IsIntro = false; - } - - void DoIntro() - { - if (!Madrigosa) - return; - - switch(IntroPhase) - { - case 0: - DoScriptText(YELL_MADR_ICE_BARRIER, Madrigosa); - IntroPhaseTimer = 5000; - ++IntroPhase; - break; - case 1: - m_creature->SetInFront(Madrigosa); - Madrigosa->SetInFront(m_creature); - DoScriptText(YELL_MADR_INTRO, Madrigosa, m_creature); - IntroPhaseTimer = 9000; - ++IntroPhase; - break; - case 2: - DoScriptText(YELL_INTRO, m_creature, Madrigosa); - IntroPhaseTimer = 13000; - ++IntroPhase; - break; - case 3: - DoCast(m_creature, SPELL_INTRO_FROST_BLAST); - Madrigosa->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - IntroFrostBoltTimer = 3000; - IntroPhaseTimer = 28000; - ++IntroPhase; - break; - case 4: - DoScriptText(YELL_INTRO_BREAK_ICE, m_creature); - IntroPhaseTimer = 6000; - ++IntroPhase; - break; - case 5: - Madrigosa->CastSpell(m_creature, SPELL_INTRO_ENCAPSULATE_CHANELLING, false); - DoScriptText(YELL_MADR_TRAP, Madrigosa); - DoCast(m_creature, SPELL_INTRO_ENCAPSULATE); - IntroPhaseTimer = 11000; - ++IntroPhase; - break; - case 6: - m_creature->SetSpeed(MOVE_RUN, 4.0f, true); - DoScriptText(YELL_INTRO_CHARGE, m_creature); - IntroPhaseTimer = 3000; - ++IntroPhase; - break; - case 7: - m_creature->DealDamage(Madrigosa, Madrigosa->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, true); - DoScriptText(YELL_MADR_DEATH, Madrigosa); - m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->AttackStop(); - m_creature->SetSpeed(MOVE_RUN, 1.0f, true); - IntroPhaseTimer = 3000; - ++IntroPhase; - break; - case 8: - DoScriptText(YELL_INTRO_KILL_MADRIGOSA, m_creature); - m_creature->SetOrientation(0.14); - Madrigosa->setDeathState(CORPSE); - IntroPhaseTimer = 5000; - ++IntroPhase; - break; - case 9: - DoScriptText(YELL_INTRO_TAUNT, m_creature); - IntroPhaseTimer = 5000; - ++IntroPhase; - break; - case 10: - EndIntro(); - break; - } - } - - void MoveInLineOfSight(Unit *who){ - if (pInstance && Intro) - pInstance->SetData(DATA_BRUTALLUS_EVENT, SPECIAL); - } - - void UpdateAI(const uint32 diff) - { - if (Intro && !IsIntro) - StartIntro(); - - if (IsIntro) - { - if (IntroPhaseTimer < diff){ - DoIntro(); - }else IntroPhaseTimer -= diff; - - if (IntroPhase == 3 + 1){ - if (IntroFrostBoltTimer < diff){ - if (Madrigosa){ - Madrigosa->CastSpell(m_creature, SPELL_INTRO_FROSTBOLT, false); - IntroFrostBoltTimer = 2000; - } - }else IntroFrostBoltTimer -= diff; - } - } - - if (!UpdateVictim() || IsIntro) - return; - - if (SlashTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_METEOR_SLASH); - SlashTimer = 11000; - }else SlashTimer -= diff; - - if (StompTimer < diff) - { - switch(rand()%3) - { - case 0: DoScriptText(YELL_LOVE1, m_creature); break; - case 1: DoScriptText(YELL_LOVE2, m_creature); break; - case 2: DoScriptText(YELL_LOVE3, m_creature); break; - } - DoCast(m_creature->getVictim(), SPELL_STOMP); - StompTimer = 30000; - }else StompTimer -= diff; - - if (BurnTimer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - target->CastSpell(target, SPELL_BURN, true); - BurnTimer = 60000; - }else BurnTimer -= diff; - - if (BerserkTimer < diff && !Enraged) - { - DoScriptText(YELL_BERSERK, m_creature); - DoCast(m_creature, 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/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp deleted file mode 100644 index 86ed15ad653..00000000000 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_eredar_twins.cpp +++ /dev/null @@ -1,761 +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 "precompiled.h" -#include "def_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 -}; - -enum Creatures -{ - GRAND_WARLOCK_ALYTHESS = 25166, - MOB_SHADOW_IMAGE = 25214, - LADY_SACROLASH = 25165 -}; - -struct TRINITY_DLL_DECL 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((*m_creature),pInstance->GetData64(DATA_ALYTHESS)); - if (Temp) - if (Temp->isDead()) - { - CAST_CRE(Temp)->Respawn(); - }else - { - if (Temp->getVictim()) - { - m_creature->getThreatManager().addThreat(Temp->getVictim(),0.0f); - } - } - } - - if (!m_creature->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((*m_creature),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) - { - switch (rand()%2) - { - case 0: DoScriptText(YELL_SAC_KILL_1, m_creature); break; - case 1: DoScriptText(YELL_SAC_KILL_2, m_creature); break; - } - } - } - - void JustDied(Unit* Killer) - { - // only if ALY death - if (SisterDeath) - { - DoScriptText(SAY_SAC_DEAD, m_creature); - - if (pInstance) - pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE); - } - else - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } - - void SpellHitTarget(Unit* target,const SpellEntry* spell) - { - switch(spell->Id) - { - case SPELL_SHADOW_BLADES: - case SPELL_SHADOW_NOVA: - case SPELL_CONFOUNDING_BLOW: - case SPELL_SHADOW_FURY: - HandleTouchedSpells(target, SPELL_DARK_TOUCHED); - break; - case SPELL_CONFLAGRATION: - HandleTouchedSpells(target, SPELL_FLAME_TOUCHED); - break; - } - } - - void HandleTouchedSpells(Unit* target, uint32 TouchedType) - { - switch(TouchedType) - { - case SPELL_FLAME_TOUCHED: - if (!target->HasAura(SPELL_DARK_FLAME)) - { - if (target->HasAura(SPELL_DARK_TOUCHED)) - { - target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED); - target->CastSpell(target, SPELL_DARK_FLAME, true); - }else target->CastSpell(target, SPELL_FLAME_TOUCHED, true); - } - break; - case SPELL_DARK_TOUCHED: - if (!target->HasAura(SPELL_DARK_FLAME)) - { - if (target->HasAura(SPELL_FLAME_TOUCHED)) - { - target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); - target->CastSpell(target, SPELL_DARK_FLAME, true); - }else target->CastSpell(target, SPELL_DARK_TOUCHED, true); - } - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!SisterDeath) - { - if (pInstance) - { - Unit* Temp = NULL; - Temp = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_ALYTHESS)); - if (Temp && Temp->isDead()) - { - DoScriptText(YELL_SISTER_ALYTHESS_DEAD, m_creature); - DoCast(m_creature,SPELL_EMPOWER); - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - SisterDeath = true; - } - } - } - - if (!UpdateVictim()) - return; - - if (SisterDeath) - { - if (ConflagrationTimer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - DoCast(target, SPELL_CONFLAGRATION); - ConflagrationTimer = 30000+(rand()%5000); - } - }else ConflagrationTimer -= diff; - } - else - { - if (ShadownovaTimer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - DoCast(target, SPELL_SHADOW_NOVA); - - if (!SisterDeath) - { - if (target) - DoScriptText(EMOTE_SHADOW_NOVA, m_creature, target); - DoScriptText(YELL_SHADOW_NOVA, m_creature); - } - ShadownovaTimer = 30000+(rand()%5000); - } - }else ShadownovaTimer -=diff; - } - - if (ConfoundingblowTimer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - DoCast(target, SPELL_CONFOUNDING_BLOW); - ConfoundingblowTimer = 20000 + (rand()%5000); - } - }else ConfoundingblowTimer -=diff; - - if (ShadowimageTimer < diff) - { - Unit* target = NULL; - Creature* temp = NULL; - for(uint8 i = 0;i<3; ++i) - { - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - temp = DoSpawnCreature(MOB_SHADOW_IMAGE,0,0,0,0,TEMPSUMMON_CORPSE_DESPAWN,10000); - if (temp && target) - temp->AI()->AttackStart(target); - } - ShadowimageTimer = 20000; - }else ShadowimageTimer -=diff; - - if (ShadowbladesTimer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(m_creature, SPELL_SHADOW_BLADES); - ShadowbladesTimer = 10000; - } - }else ShadowbladesTimer -=diff; - - if (EnrageTimer < diff && !Enraged) - { - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - DoScriptText(YELL_ENRAGE, m_creature); - DoCast(m_creature,SPELL_ENRAGE); - Enraged = true; - }else EnrageTimer -= diff; - - if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) - { - //If we are within range melee the target - if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - HandleTouchedSpells(m_creature->getVictim(), SPELL_DARK_TOUCHED); - m_creature->AttackerStateUpdate(m_creature->getVictim()); - m_creature->resetAttackTimer(); - } - } - } -}; - -CreatureAI* GetAI_boss_sacrolash(Creature* pCreature) -{ - return new boss_sacrolashAI (pCreature); -}; - -struct TRINITY_DLL_DECL 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((*m_creature),pInstance->GetData64(DATA_SACROLASH)); - if (Temp) - if (Temp->isDead()) - { - CAST_CRE(Temp)->Respawn(); - }else - { - if (Temp->getVictim()) - { - m_creature->getThreatManager().addThreat(Temp->getVictim(),0.0f); - } - } - } - - if (!m_creature->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((*m_creature),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 (!m_creature->isInCombat()) - { - Scripted_NoMovementAI::AttackStart(who); - } - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || m_creature->getVictim()) - return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) - { - if (!m_creature->isInCombat()) - { - DoStartNoMovement(who); - } - } - } - else if (IntroStepCounter == 10 && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 30)) - { - IntroStepCounter = 0; - } - } - - void KilledUnit(Unit *victim) - { - if (rand()%4 == 0) - { - switch (rand()%2) - { - case 0: DoScriptText(YELL_ALY_KILL_1, m_creature); break; - case 1: DoScriptText(YELL_ALY_KILL_2, m_creature); break; - } - } - } - - void JustDied(Unit* Killer) - { - if (SisterDeath) - { - DoScriptText(YELL_ALY_DEAD, m_creature); - - if (pInstance) - pInstance->SetData(DATA_EREDAR_TWINS_EVENT, DONE); - } - else - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } - - void SpellHitTarget(Unit* target,const SpellEntry* spell) - { - switch(spell->Id) - { - - case SPELL_BLAZE: - target->CastSpell(target, SPELL_BLAZE_SUMMON, true); - case SPELL_CONFLAGRATION: - case SPELL_FLAME_SEAR: - HandleTouchedSpells(target, SPELL_FLAME_TOUCHED); - break; - case SPELL_SHADOW_NOVA: - HandleTouchedSpells(target, SPELL_DARK_TOUCHED); - break; - } - } - - void HandleTouchedSpells(Unit* target, uint32 TouchedType) - { - switch(TouchedType) - { - case SPELL_FLAME_TOUCHED: - if (!target->HasAura(SPELL_DARK_FLAME)) - { - if (target->HasAura(SPELL_DARK_TOUCHED)) - { - target->RemoveAurasDueToSpell(SPELL_DARK_TOUCHED); - target->CastSpell(target, SPELL_DARK_FLAME, true); - }else - { - target->CastSpell(target, SPELL_FLAME_TOUCHED, true); - } - } - break; - case SPELL_DARK_TOUCHED: - if (!target->HasAura(SPELL_DARK_FLAME)) - { - if (target->HasAura(SPELL_FLAME_TOUCHED)) - { - target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); - target->CastSpell(target, SPELL_DARK_FLAME, true); - }else target->CastSpell(target, SPELL_DARK_TOUCHED, true); - } - break; - } - } - - uint32 IntroStep(uint32 step) - { - Creature* Sacrolash = Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_SACROLASH)); - 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, m_creature); return 1000; - case 3: - if (Sacrolash) - DoScriptText(YELL_INTRO_SAC_3, Sacrolash); - return 2000; - case 4: DoScriptText(YELL_INTRO_ALY_4, m_creature); return 1000; - case 5: - if (Sacrolash) - DoScriptText(YELL_INTRO_SAC_5, Sacrolash); - return 2000; - case 6: DoScriptText(YELL_INTRO_ALY_6, m_creature); return 1000; - case 7: - if (Sacrolash) - DoScriptText(YELL_INTRO_SAC_7, Sacrolash); - return 3000; - case 8: DoScriptText(YELL_INTRO_ALY_8, m_creature); 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((*m_creature),pInstance->GetData64(DATA_SACROLASH)); - if (Temp && Temp->isDead()) - { - DoScriptText(YELL_SISTER_SACROLASH_DEAD, m_creature); - DoCast(m_creature, SPELL_EMPOWER); - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - SisterDeath = true; - } - } - } - - if (!UpdateVictim()) - return; - - if (SisterDeath) - { - if (ShadownovaTimer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - DoCast(target, SPELL_SHADOW_NOVA); - ShadownovaTimer= 30000+(rand()%5000); - } - }else ShadownovaTimer -=diff; - } - else - { - if (ConflagrationTimer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - DoCast(target, SPELL_CONFLAGRATION); - ConflagrationTimer = 30000+(rand()%5000); - - if (!SisterDeath) - { - if (target) - DoScriptText(EMOTE_CONFLAGRATION, m_creature, target); - DoScriptText(YELL_CANFLAGRATION, m_creature); - } - - BlazeTimer = 4000; - } - }else ConflagrationTimer -= diff; - } - - if (FlamesearTimer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(m_creature, SPELL_FLAME_SEAR); - FlamesearTimer = 15000; - } - }else FlamesearTimer -=diff; - - if (PyrogenicsTimer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(m_creature, SPELL_PYROGENICS,true); - PyrogenicsTimer = 15000; - } - }else PyrogenicsTimer -= diff; - - if (BlazeTimer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(m_creature->getVictim(), SPELL_BLAZE); - BlazeTimer = 3800; - } - }else BlazeTimer -= diff; - - if (EnrageTimer < diff && !Enraged) - { - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - DoScriptText(YELL_BERSERK, m_creature); - DoCast(m_creature, SPELL_ENRAGE); - Enraged = true; - }else EnrageTimer -= diff; - } -}; - -CreatureAI* GetAI_boss_alythess(Creature* pCreature) -{ - return new boss_alythessAI (pCreature); -}; - -struct TRINITY_DLL_DECL mob_shadow_imageAI : public ScriptedAI -{ - mob_shadow_imageAI(Creature *c) : ScriptedAI(c) {} - - uint32 ShadowfuryTimer; - uint32 KillTimer; - uint32 DarkstrikeTimer; - - void Reset() - { - ShadowfuryTimer = 5000 + (rand()%15000); - DarkstrikeTimer = 3000; - KillTimer = 15000; - } - - void EnterCombat(Unit *who){} - - void SpellHitTarget(Unit* target,const SpellEntry* spell) - { - switch(spell->Id) - { - - case SPELL_SHADOW_FURY: - case SPELL_DARK_STRIKE: - if (!target->HasAura(SPELL_DARK_FLAME)) - { - if (target->HasAura(SPELL_FLAME_TOUCHED)) - { - target->RemoveAurasDueToSpell(SPELL_FLAME_TOUCHED); - target->CastSpell(target, SPELL_DARK_FLAME, true); - }else target->CastSpell(target,SPELL_DARK_TOUCHED,true); - } - break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->HasAura(SPELL_IMAGE_VISUAL)) - DoCast(m_creature, SPELL_IMAGE_VISUAL); - - if (KillTimer < diff) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - KillTimer = 9999999; - }else KillTimer -=diff; - - if (!UpdateVictim()) - return; - - if (ShadowfuryTimer < diff) - { - DoCast(m_creature, SPELL_SHADOW_FURY); - ShadowfuryTimer = 10000; - }else ShadowfuryTimer -=diff; - - if (DarkstrikeTimer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - //If we are within range melee the target - if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) - DoCast(m_creature->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/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp deleted file mode 100644 index 8402f077fdd..00000000000 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_felmyst.cpp +++ /dev/null @@ -1,623 +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 "precompiled.h" -#include "def_sunwell_plateau.h" - -enum Quotes -{ - 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 Creatures -{ - MOB_FELMYST = 25038, - //MOB_BRUTALLUS = - //MOB_KALECGOS = - MOB_DEAD = 25268, - MOB_MADRIGOSA = 25160, - MOB_FELMYST_VISUAL = 25041, - MOB_FLIGHT_LEFT = 25357, - MOB_FLIGHT_RIGHT = 25358, - MOB_DEATH_CLOUD = 25703, - MOB_VAPOR = 25265, - MOB_VAPOR_TRAIL = 25267 -}; - -enum PhaseFelmyst -{ - PHASE_NULL = 0, - PHASE_GROUND = 1, - PHASE_FLIGHT = 2, -}; - -enum EventFelmyst -{ - EVENT_NULL = 0, - EVENT_BERSERK = 1, - - EVENT_CLEAVE = 2, - EVENT_CORROSION = 3, - EVENT_GAS_NOVA = 4, - EVENT_ENCAPSULATE = 5, - EVENT_FLIGHT = 6, - - EVENT_FLIGHT_SEQUENCE = 2, - EVENT_SUMMON_DEAD = 3, - EVENT_SUMMON_FOG = 4 -}; - -static EventFelmyst MaxTimer[]= -{ - EVENT_NULL, - EVENT_FLIGHT, - EVENT_SUMMON_FOG, -}; - -struct TRINITY_DLL_DECL 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; - EventFelmyst Event; - uint32 Timer[EVENT_FLIGHT + 1]; - - uint32 FlightCount; - uint32 BreathCount; - - float BreathX, BreathY; - - void Reset() - { - Phase = PHASE_NULL; - Event = EVENT_NULL; - Timer[EVENT_BERSERK] = 600000; - FlightCount = 0; - - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); - m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); - - DespawnSummons(MOB_VAPOR_TRAIL); - m_creature->setActive(false); - - if (pInstance) - pInstance->SetData(DATA_FELMYST_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - m_creature->setActive(true); - DoZoneInCombat(); - m_creature->CastSpell(m_creature, AURA_SUNWELL_RADIANCE, true); - m_creature->CastSpell(m_creature, 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) - { - switch(rand()%2) - { - case 0: DoScriptText(YELL_KILL1, m_creature); break; - case 1: DoScriptText(YELL_KILL2, m_creature); break; - } - } - - void JustRespawned() - { - DoScriptText(YELL_BIRTH, m_creature); - } - - void JustDied(Unit* Killer) - { - DoScriptText(YELL_DEATH, m_creature); - - 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); - Unit* summon = m_creature->SummonCreature(MOB_DEAD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (summon) - { - summon->SetMaxHealth(caster->GetMaxHealth()); - summon->SetHealth(caster->GetMaxHealth()); - summon->CastSpell(summon, SPELL_FOG_CHARM, true); - summon->CastSpell(summon, SPELL_FOG_CHARM2, true); - } - m_creature->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(SelectUnit(SELECT_TARGET_RANDOM, 0)); - DoZoneInCombat(summon); - summon->CastSpell(summon, SPELL_DEAD_PASSIVE, true); - } - } - - void MovementInform(uint32, uint32) - { - Timer[EVENT_FLIGHT_SEQUENCE] = 1; - } - - void DamageTaken(Unit*, uint32 &damage) - { - if (Phase != PHASE_GROUND && damage >= m_creature->GetHealth()) - damage = 0; - } - - void EnterPhase(PhaseFelmyst NextPhase) - { - switch(NextPhase) - { - case PHASE_GROUND: - Timer[EVENT_CLEAVE] = 5000 + rand()%5 * 1000; - Timer[EVENT_CORROSION] = 10000 + rand()%10 * 1000; - Timer[EVENT_GAS_NOVA] = 15000 + rand()%5 * 1000; - Timer[EVENT_ENCAPSULATE] = 20000 + rand()%5 * 1000; - Timer[EVENT_FLIGHT] = 60000; - break; - case PHASE_FLIGHT: - Timer[EVENT_FLIGHT_SEQUENCE] = 1000; - Timer[EVENT_SUMMON_DEAD] = 0; - Timer[EVENT_SUMMON_FOG] = 0; - FlightCount = 0; - BreathCount = 0; - break; - default: - break; - } - Phase = NextPhase; - } - - void HandleFlightSequence() - { - switch(FlightCount) - { - case 0: - //m_creature->AttackStop(); - error_log("prevent fly phase"); - m_creature->GetMotionMaster()->Clear(false); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - m_creature->StopMoving(); - DoScriptText(YELL_TAKEOFF, m_creature); - Timer[EVENT_FLIGHT_SEQUENCE] = 2000; - break; - case 1: - error_log("Move to Fly point"); - m_creature->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX()+1, m_creature->GetPositionY(), m_creature->GetPositionZ()+10); - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 2:{ - error_log("Summon Vapor case 2"); - Unit* target; - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); - if (!target) target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)); - if (target) - { - Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); - if (Vapor) - { - Vapor->AI()->AttackStart(target); - m_creature->InterruptNonMeleeSpells(false); - m_creature->CastSpell(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug - Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true); - } - } - else - { - EnterEvadeMode(); - return; - } - Timer[EVENT_FLIGHT_SEQUENCE] = 10000; - break;} - case 3: { - DespawnSummons(MOB_VAPOR_TRAIL); - error_log("Summon Vapor case3"); - //m_creature->CastSpell(m_creature, SPELL_VAPOR_SELECT); need core support - Unit* target; - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); - if (!target) target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)); - if (target) - { - //target->CastSpell(target, SPELL_VAPOR_SUMMON, true); need core support - Creature* Vapor = m_creature->SummonCreature(MOB_VAPOR, target->GetPositionX()-5+rand()%10, target->GetPositionY()-5+rand()%10, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 9000); - if (Vapor) - { - Vapor->AI()->AttackStart(target); - m_creature->InterruptNonMeleeSpells(false); - m_creature->CastSpell(Vapor, SPELL_VAPOR_CHANNEL, false); // core bug - Vapor->CastSpell(Vapor, SPELL_VAPOR_TRIGGER, true); - } - } - else - { - EnterEvadeMode(); - return; - } - Timer[EVENT_FLIGHT_SEQUENCE] = 10000; - break;} - case 4: - DespawnSummons(MOB_VAPOR_TRAIL); - Timer[EVENT_FLIGHT_SEQUENCE] = 1; - break; - case 5:{ - Unit* target; - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true); - if (!target) target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)); - if (target) - { - BreathX = target->GetPositionX(); - BreathY = target->GetPositionY(); - float x, y, z; - target->GetContactPoint(m_creature, x, y, z, 70); - m_creature->GetMotionMaster()->MovePoint(0, x, y, z+10); - }else - { - EnterEvadeMode(); - return; - } - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break;} - case 6: - m_creature->SetOrientation(m_creature->GetAngle(BreathX, BreathY)); - m_creature->StopMoving(); - //DoTextEmote("takes a deep breath.", NULL); - Timer[EVENT_FLIGHT_SEQUENCE] = 10000; - break; - case 7: - m_creature->CastSpell(m_creature, SPELL_FOG_BREATH, true); - { - float x, y, z; - m_creature->GetPosition(x, y, z); - x = 2 * BreathX - x; - y = 2 * BreathY - y; - m_creature->GetMotionMaster()->MovePoint(0, x, y, z); - } - Timer[EVENT_SUMMON_FOG] = 1; - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 8: - m_creature->RemoveAurasDueToSpell(SPELL_FOG_BREATH); - BreathCount++; - Timer[EVENT_SUMMON_FOG] = 0; - Timer[EVENT_FLIGHT_SEQUENCE] = 1; - if (BreathCount < 3) FlightCount = 4; - break; - case 9: - if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0)) - { - float x, y, z; - target->GetContactPoint(m_creature, x, y, z); - m_creature->GetMotionMaster()->MovePoint(0, x, y, z); - } - else - { - EnterEvadeMode(); - return; - } - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 10: - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->StopMoving(); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - EnterPhase(PHASE_GROUND); - m_creature->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0)); - break; - default: - break; - } - FlightCount++; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (Phase == PHASE_FLIGHT && !m_creature->IsInEvadeMode()) - EnterEvadeMode(); - return; - } - - Event = EVENT_NULL; - for(uint32 i = 1; i <= MaxTimer[Phase]; ++i) - { - if (Timer[i]) - if (Timer[i] <= diff) - { - if (!Event) - Event = (EventFelmyst)i; - }else Timer[i] -= diff; - } - - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - if (Phase == PHASE_GROUND) - { - switch(Event) - { - case EVENT_BERSERK: - DoScriptText(YELL_BERSERK, m_creature); - m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - Timer[EVENT_BERSERK] = 10000; - break; - case EVENT_CLEAVE: - m_creature->CastSpell(m_creature->getVictim(), SPELL_CLEAVE, false); - Timer[EVENT_CLEAVE] = 5000 + rand()%5 * 1000; - break; - case EVENT_CORROSION: - m_creature->CastSpell(m_creature->getVictim(), SPELL_CORROSION, false); - Timer[EVENT_CORROSION] = 20000 + rand()%10 * 1000; - break; - case EVENT_GAS_NOVA: - m_creature->CastSpell(m_creature, SPELL_GAS_NOVA, false); - Timer[EVENT_GAS_NOVA] = 20000 + rand()%5 * 1000; - break; - case EVENT_ENCAPSULATE: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 150, true)) - { - m_creature->CastSpell(target, SPELL_ENCAPSULATE_CHANNEL, false); - Timer[EVENT_ENCAPSULATE] = 25000 + rand()%5 * 1000; - }break; - case EVENT_FLIGHT: - EnterPhase(PHASE_FLIGHT); - break; - default: - DoMeleeAttackIfReady(); - break; - } - } - - if (Phase == PHASE_FLIGHT) - { - switch(Event) - { - case EVENT_BERSERK: - DoScriptText(YELL_BERSERK, m_creature); - m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - Timer[EVENT_BERSERK] = 0; - break; - case EVENT_FLIGHT_SEQUENCE: - HandleFlightSequence(); - break; - case EVENT_SUMMON_FOG: - { - float x, y, z; - m_creature->GetPosition(x, y, z); - m_creature->UpdateGroundPositionZ(x, y, z); - if (Creature *Fog = m_creature->SummonCreature(MOB_VAPOR_TRAIL, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 10000)) - { - Fog->RemoveAurasDueToSpell(SPELL_TRAIL_TRIGGER); - Fog->CastSpell(Fog, SPELL_FOG_TRIGGER, true); - } - } - Timer[EVENT_SUMMON_FOG] = 1000; - break; - default: - break; - } - } - } - - void DespawnSummons(uint32 entry) - { - std::list templist; - float x, y, z; - m_creature->GetPosition(x, y, z); - - { - CellPair pair(Trinity::ComputeCellPair(x, y)); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - Trinity::AllCreaturesOfEntryInRange check(m_creature, entry, 100); - Trinity::CreatureListSearcher searcher(m_creature, templist, check); - - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); - - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap())); - } - - for(std::list::iterator i = templist.begin(); i != templist.end(); ++i) - { - if (entry == MOB_VAPOR_TRAIL && Phase == PHASE_FLIGHT) - { - (*i)->GetPosition(x, y, z); - m_creature->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 TRINITY_DLL_DECL mob_felmyst_vaporAI : public ScriptedAI -{ - mob_felmyst_vaporAI(Creature *c) : ScriptedAI(c) - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetSpeed(MOVE_RUN, 0.8); - } - void Reset() {} - void EnterCombat(Unit* who) - { - DoZoneInCombat(); - //m_creature->CastSpell(m_creature, SPELL_VAPOR_FORCE, true); core bug - } - void UpdateAI(const uint32 diff) - { - if (!m_creature->getVictim()) - AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } -}; - -struct TRINITY_DLL_DECL mob_felmyst_trailAI : public ScriptedAI -{ - mob_felmyst_trailAI(Creature *c) : ScriptedAI(c) - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->CastSpell(m_creature, SPELL_TRAIL_TRIGGER, true); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); - m_creature->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/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp deleted file mode 100644 index 874330c0212..00000000000 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kalecgos.cpp +++ /dev/null @@ -1,693 +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 "precompiled.h" -#include "def_sunwell_plateau.h" - -enum Quotes -{ - //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, - - //Shattrowar - 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 SpellIds -{ - 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 Creatures -{ - MOB_KALECGOS = 24850, - MOB_KALEC = 24891, - MOB_SATHROVARR = 24892 -}; - -#define GO_FAILED "You are unable to use this currently." - -#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 - -uint32 WildMagic[]= { 44978, 45001, 45002, 45004, 45006, 45010 }; - -struct TRINITY_DLL_DECL boss_kalecgosAI : public ScriptedAI -{ - boss_kalecgosAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - SathGUID = 0; - DoorGUID = 0; - } - - ScriptedInstance *pInstance; - - uint32 ArcaneBuffetTimer; - uint32 FrostBreathTimer; - uint32 WildMagicTimer; - uint32 SpectralBlastTimer; - uint32 TailLashTimer; - uint32 CheckTimer; - uint32 TalkTimer; - uint32 TalkSequence; - - bool isFriendly; - bool isEnraged; - bool isBanished; - - uint64 SathGUID; - uint64 DoorGUID; - - void Reset() - { - if (pInstance) - { - SathGUID = pInstance->GetData64(DATA_SATHROVARR); - DoorGUID = pInstance->GetData64(DATA_GO_FORCEFIELD); - - if (GameObject *Door = pInstance->instance->GetGameObject(pInstance->GetData64(DoorGUID))) - Door->SetLootState(GO_JUST_DEACTIVATED); - } - - Unit *Sath = Unit::GetUnit(*m_creature,SathGUID); - if (Sath) CAST_CRE(Sath)->AI()->EnterEvadeMode(); - - m_creature->setFaction(14); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); - - ArcaneBuffetTimer = 8000; - FrostBreathTimer = 15000; - WildMagicTimer = 10000; - TailLashTimer = 25000; - SpectralBlastTimer = 20000+(rand()%5000); - CheckTimer = SpectralBlastTimer+20000; //after spectral blast - - TalkTimer = 0; - TalkSequence = 0; - isFriendly = false; - isEnraged = false; - isBanished = false; - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= m_creature->GetHealth() && done_by != m_creature) - damage = 0; - } - - void EnterCombat(Unit* who) - { - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_EVIL_AGGRO, m_creature); - if (GameObject *Door = pInstance->instance->GetGameObject(pInstance->GetData64(DoorGUID))) - Door->SetLootState(GO_ACTIVATED); - DoZoneInCombat(); - - if (pInstance) - pInstance->SetData(DATA_KALECGOS_EVENT, IN_PROGRESS); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_EVIL_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_EVIL_SLAY2, m_creature); break; - } - } - - void MovementInform(uint32 type,uint32 id) - { - m_creature->SetVisibility(VISIBILITY_OFF); - if (isFriendly) - m_creature->setDeathState(JUST_DIED); - else - { - m_creature->GetMotionMaster()->MoveTargetedHome(); - TalkTimer = 30000; - } - } - - void GoodEnding() - { - switch(TalkSequence) - { - case 1: - m_creature->setFaction(35); - TalkTimer = 1000; - break; - case 2: - DoScriptText(SAY_GOOD_PLRWIN, m_creature); - TalkTimer = 10000; - break; - case 3: - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MovePoint(0,FLY_X,FLY_Y,FLY_Z); - TalkTimer = 600000; - break; - default: - break; - } - } - - void BadEnding() - { - switch(TalkSequence) - { - case 1: - DoScriptText(SAY_EVIL_ENRAGE, m_creature); - TalkTimer = 3000; - break; - case 2: - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MovePoint(0,FLY_X,FLY_Y,FLY_Z); - TalkTimer = 600000; - break; - case 3: - EnterEvadeMode(); - break; - default: - break; - } - } - - void UpdateAI(const uint32 diff); -}; - -struct TRINITY_DLL_DECL 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() - { - if (pInstance) - KalecgosGUID = pInstance->GetData64(DATA_KALECGOS_DRAGON); - - if (KalecGUID) - { - if (Unit* Kalec = Unit::GetUnit(*m_creature, KalecGUID)) - Kalec->setDeathState(JUST_DIED); - KalecGUID = 0; - } - - ShadowBoltTimer = 7000 + rand()%3 * 1000; - AgonyCurseTimer = 20000; - CorruptionStrikeTimer = 13000; - CheckTimer = 1000; - ResetThreat = 1000; - isEnraged = false; - isBanished = false; - - if (pInstance) - pInstance->SetData(DATA_KALECGOS_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit* who) - { - Creature *Kalec = m_creature->SummonCreature(MOB_KALEC, m_creature->GetPositionX() + 10, m_creature->GetPositionY() + 5, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0); - if (Kalec) - { - KalecGUID = Kalec->GetGUID(); - m_creature->CombatStart(Kalec); - m_creature->AddThreat(Kalec, 100.0f); - } - DoScriptText(SAY_SATH_AGGRO, m_creature); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= m_creature->GetHealth() && done_by != m_creature) - damage = 0; - } - - void KilledUnit(Unit *target) - { - if (target->GetGUID() == KalecGUID) - { - TeleportAllPlayersBack(); - if (Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID)) - { - CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->TalkTimer = 1; - CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->isFriendly = false; - } - EnterEvadeMode(); - return; - } - switch(rand()%2) - { - case 0: DoScriptText(SAY_SATH_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SATH_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *killer) - { - DoScriptText(SAY_SATH_DEATH, m_creature); - m_creature->GetMap()->CreatureRelocation(m_creature, m_creature->GetPositionX(), m_creature->GetPositionY(), DRAGON_REALM_Z, m_creature->GetOrientation()); - TeleportAllPlayersBack(); - if (Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID)) - { - CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->TalkTimer = 1; - CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->isFriendly = true; - } - - if (pInstance) - pInstance->SetData(DATA_KALECGOS_EVENT, DONE); - } - - void TeleportAllPlayersBack() - { - Map* pMap = m_creature->GetMap(); - if (!pMap->IsDungeon()) return; - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - Map::PlayerList::const_iterator i; - for(i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->HasAura(AURA_SPECTRAL_REALM)) - i_pl->RemoveAurasDueToSpell(AURA_SPECTRAL_REALM); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (CheckTimer < diff) - { - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !isEnraged) - { - Unit* Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID); - if (Kalecgos) - { - Kalecgos->CastSpell(Kalecgos, SPELL_ENRAGE, true); - CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->isEnraged = true; - } - DoCast(m_creature, SPELL_ENRAGE, true); - isEnraged = true; - } - - if (!isBanished && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1) - { - if (Unit *Kalecgos = Unit::GetUnit(*m_creature, KalecgosGUID)) - { - if (CAST_AI(boss_kalecgosAI, CAST_CRE(Kalecgos)->AI())->isBanished) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - else - { - DoCast(m_creature, SPELL_BANISH); - isBanished = true; - } - } - else - { - m_creature->MonsterTextEmote("is unable to find Kalecgos", NULL); - EnterEvadeMode(); - return; - } - } - CheckTimer = 1000; - }else CheckTimer -= diff; - - if (ResetThreat < diff) - { - if ((m_creature->getVictim()->HasAura(AURA_SPECTRAL_EXHAUSTION)) && (m_creature->getVictim()->GetTypeId() == TYPEID_PLAYER)) - { - for(std::list::iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr) - { - if (((*itr)->getUnitGuid()) == (m_creature->getVictim()->GetGUID())) - { - (*itr)->removeReference(); - break; - } - } - } - ResetThreat = 1000; - }else ResetThreat -= diff; - - if (ShadowBoltTimer < diff) - { - DoScriptText(SAY_SATH_SPELL1, m_creature); - DoCast(m_creature, SPELL_SHADOW_BOLT); - ShadowBoltTimer = 7000+(rand()%3000); - }else ShadowBoltTimer -= diff; - - if (AgonyCurseTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (!target) target = m_creature->getVictim(); - DoCast(target, SPELL_AGONY_CURSE); - AgonyCurseTimer = 20000; - }else AgonyCurseTimer -= diff; - - if (CorruptionStrikeTimer < diff) - { - DoScriptText(SAY_SATH_SPELL2, m_creature); - DoCast(m_creature->getVictim(), SPELL_CORRUPTION_STRIKE); - CorruptionStrikeTimer = 13000; - }else CorruptionStrikeTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL 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 EnterCombat(Unit* who) {} - - 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 (!UpdateVictim()) - return; - - if (YellTimer < diff) - { - switch(YellSequence) - { - case 0: - DoScriptText(SAY_GOOD_AGGRO, m_creature); - YellSequence++; - break; - case 1: - if ((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 50) - { - DoScriptText(SAY_GOOD_NEAR_DEATH, m_creature); - YellSequence++; - } - break; - case 2: - if ((m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 10) - { - DoScriptText(SAY_GOOD_NEAR_DEATH2, m_creature); - YellSequence++; - } - break; - default: - break; - } - YellTimer = 5000; - } - - if (RevitalizeTimer < diff) - { - DoCast(m_creature, SPELL_REVITALIZE); - RevitalizeTimer = 5000; - }else RevitalizeTimer -= diff; - - if (HeroicStrikeTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_HEROIC_STRIKE); - HeroicStrikeTimer = 2000; - }else HeroicStrikeTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -void boss_kalecgosAI::UpdateAI(const uint32 diff) -{ - if (TalkTimer) - { - if (!TalkSequence) - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(); - if (GameObject *Door = pInstance->instance->GetGameObject(pInstance->GetData64(DoorGUID))) - Door->SetLootState(GO_JUST_DEACTIVATED); - TalkSequence++; - } - if (TalkTimer <= diff) - { - if (isFriendly) - GoodEnding(); - else - BadEnding(); - TalkSequence++; - }else TalkTimer -= diff; - } - else - { - if (!UpdateVictim()) - return; - - if (CheckTimer < diff) - { - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !isEnraged) - { - Unit* Sath = Unit::GetUnit(*m_creature, SathGUID); - if (Sath) - { - Sath->CastSpell(Sath, SPELL_ENRAGE, true); - CAST_AI(boss_sathrovarrAI, CAST_CRE(Sath)->AI())->isEnraged = true; - } - DoCast(m_creature, SPELL_ENRAGE, true); - isEnraged = true; - } - - if (!isBanished && (m_creature->GetHealth()*100)/m_creature->GetMaxHealth() < 1) - { - if (Unit *Sath = Unit::GetUnit(*m_creature, SathGUID)) - { - if (CAST_AI(boss_sathrovarrAI, CAST_CRE(Sath)->AI())->isBanished) - { - Sath->DealDamage(Sath, Sath->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - else - { - DoCast(m_creature, SPELL_BANISH); - isBanished = true; - } - } - 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) - { - //this is a hack. we need to find a victim without aura in core - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target && target != m_creature->getVictim() && target->isAlive() && !target->HasAura(AURA_SPECTRAL_EXHAUSTION)) - { - DoCast(target, SPELL_SPECTRAL_BLAST); - SpectralBlastTimer = 20000+(rand()%5000); - } - else - { - SpectralBlastTimer = 1000; - } - }else SpectralBlastTimer -= diff; - - DoMeleeAttackIfReady(); - } -} - -bool GOkalecgos_teleporter(Player* pPlayer, GameObject* pGo) -{ - if (pPlayer->HasAura(AURA_SPECTRAL_EXHAUSTION)) - 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/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp deleted file mode 100644 index ec5f1d71988..00000000000 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_kiljaeden.cpp +++ /dev/null @@ -1,1311 +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: 70 -SDComment: Phase4, Phase5, Shadow Spike, Armageddon -SDCategory: Sunwell_Plateau -EndScriptData */ - -//TODO rewrite Amagedon -//TODO Remove blue visual from Orbs on reset and if it is used - -#include "precompiled.h" -#include "def_sunwell_plateau.h" -#include - -/*** Speech and sounds***/ -enum Speeches -{ - // 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 SpellIds -{ - /* 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_SINISTER_REFLECTION = 45785, // Summon shadow copies of 5 raid members that fight against KJ's enemies - 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 -}; - -enum CreatureIds -{ - 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 -}; - -/*** GameObjects ***/ -#define GAMEOBJECT_ORB_OF_THE_BLUE_DRAGONFLIGHT 188415 - -/*** 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_KALEC_JOIN = 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 -float DeceiverLocations[3][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 (?) -}; - -float OrbLocations[4][5] = { - (1694.48, 674.29, 28.0502, 4.86985), - (1745.68, 621.823, 28.0505, 2.93777), - (1704.14, 583.591, 28.1696, 1.59003), - (1653.12, 635.41, 28.0932, 0.0977725), -}; - -struct Speech -{ - int32 textid; - uint32 pCreature, timer; -}; -// TODO: Timers -static Speech Sacrifice[]= -{ - {SAY_KALECGOS_AWAKEN, CREATURE_KALECGOS, 5000}, - {SAY_ANVEENA_IMPRISONED, CREATURE_ANVEENA, 5000}, - {SAY_KALECGOS_LETGO, CREATURE_KALECGOS, 8000}, - {SAY_ANVEENA_LOST, CREATURE_ANVEENA, 5000}, - {SAY_KALECGOS_FOCUS, CREATURE_KALECGOS, 7000}, - {SAY_ANVEENA_KALEC, CREATURE_ANVEENA, 2000}, - {SAY_KALECGOS_FATE, CREATURE_KALECGOS, 3000}, - {SAY_ANVEENA_GOODBYE, CREATURE_ANVEENA, 6000}, - {SAY_KALECGOS_GOODBYE, CREATURE_KALECGOS, 12000}, - {SAY_KJ_PHASE5, CREATURE_KILJAEDEN, 8000}, - {SAY_KALECGOS_ENCOURAGE, CREATURE_KALECGOS, 5000} -}; - -class AllOrbsInGrid -{ -public: - AllOrbsInGrid() {} - bool operator() (GameObject* pGo) - { - if (pGo->GetEntry() == GAMEOBJECT_ORB_OF_THE_BLUE_DRAGONFLIGHT) - return true; - return false; - } -}; - -bool GOHello_go_orb_of_the_blue_flight(Player* pPlayer, GameObject* pGo) -{ - if (pGo->GetUInt32Value(GAMEOBJECT_FACTION) == 35){ - ScriptedInstance* pInstance = pGo->GetInstanceData(); - float x,y,z; - //float dx,dy,dz; - pGo->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, true); - pGo->SetUInt32Value(GAMEOBJECT_FACTION, 0); - Creature* Kalec = Unit::GetCreature(*pPlayer, pInstance->GetData64(DATA_KALECGOS_KJ)); - //Kalec->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); - pGo->GetPosition(x,y,z); - // this won't work. need rewritten - /* - for(uint8 i = 0; i < 4; ++i) - { - if (DynamicObject* Dyn = Kalec->GetDynObject(SPELL_RING_OF_BLUE_FLAMES)) - { - Dyn->GetPosition(dx,dy,dz); - if (x == dx && dy == y && dz == z) - { - Dyn->Delete(); - break; - } - } - } - */ - pGo->Refresh(); - } - return true; -} - -//AI for Kalecgos -struct TRINITY_DLL_DECL boss_kalecgos_kjAI : public ScriptedAI -{ - boss_kalecgos_kjAI(Creature* c) : ScriptedAI(c){ - pInstance = c->GetInstanceData(); - } - - GameObject* Orb[4]; - ScriptedInstance* pInstance; - uint8 OrbsEmpowered; - uint8 EmpowerCount; - - bool Searched; - - void InitializeAI(){ - for(uint8 i = 0; i < 4; ++i) - Orb[i] = NULL; - FindOrbs(); - OrbsEmpowered = 0; - EmpowerCount = 0; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_ONTRANSPORT + MOVEMENTFLAG_LEVITATING); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->setActive(true); - Searched = false; - FindOrbs(); - } - - void Reset(){} - - void FindOrbs() - { - CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - std::list orbList; - AllOrbsInGrid check; - Trinity::GameObjectListSearcher searcher(me, orbList, check); - TypeContainerVisitor, GridTypeMapContainer> visitor(searcher); - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, visitor, *(m_creature->GetMap())); - if (orbList.empty()) - return; - uint8 i = 0; - for(std::list::iterator itr = orbList.begin(); itr != orbList.end(); ++itr, ++i){ - Orb[i] = pInstance->instance->GetGameObject(pInstance->GetData64((*itr)->GetGUID())); - } - } - - void ResetOrbs(){ - m_creature->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); - for(uint8 i = 0; i < 4; ++i) - if (Orb[i]) Orb[i]->SetUInt32Value(GAMEOBJECT_FACTION, 0); - } - - void EmpowerOrb(bool all) - { - if (!Orb[OrbsEmpowered]) - return; - uint8 random = rand()%3; - if (all){ - m_creature->RemoveDynObject(SPELL_RING_OF_BLUE_FLAMES); - for(uint8 i = 0; i < 4; ++i){ - if (!Orb[i]) return; - Orb[i]->CastSpell(m_creature, SPELL_RING_OF_BLUE_FLAMES); - Orb[i]->SetUInt32Value(GAMEOBJECT_FACTION, 35); - Orb[i]->setActive(true); - Orb[i]->Refresh(); - } - } - else - { - // this won't work - /* - float x,y,z, dx,dy,dz; - Orb[random]->GetPosition(x,y,z); - for(uint8 i = 0; i < 4; ++i){ - DynamicObject* Dyn = m_creature->GetDynObject(SPELL_RING_OF_BLUE_FLAMES); - if (Dyn){ - Dyn->GetPosition(dx,dy,dz); - if (x == dx && dy == y && dz == z){ - Dyn->Delete(); - break; - } - } - }*/ - Orb[random]->CastSpell(m_creature, SPELL_RING_OF_BLUE_FLAMES); - Orb[random]->SetUInt32Value(GAMEOBJECT_FACTION, 35); - Orb[random]->setActive(true); - Orb[random]->Refresh(); - ++OrbsEmpowered; - } - ++EmpowerCount; - - switch(EmpowerCount){ - case 1: DoScriptText(SAY_KALEC_ORB_READY1, m_creature); break; - case 2: DoScriptText(SAY_KALEC_ORB_READY2, m_creature); break; - case 3: DoScriptText(SAY_KALEC_ORB_READY3, m_creature); break; - case 4: DoScriptText(SAY_KALEC_ORB_READY4, m_creature); break; - } - } - - void UpdateAI(const uint32 diff){ - if (!Searched){ - FindOrbs(); - Searched = true; - } - - if (OrbsEmpowered == 4) OrbsEmpowered = 0; - } -}; - -CreatureAI* GetAI_boss_kalecgos_kj(Creature* pCreature) -{ - return new boss_kalecgos_kjAI (pCreature); -} - -//AI for Kil'jaeden -struct TRINITY_DLL_DECL boss_kiljaedenAI : public Scripted_NoMovementAI -{ - boss_kiljaedenAI(Creature* c) : Scripted_NoMovementAI(c), Summons(m_creature){ - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - SummonList Summons; - Creature* Kalec; - Unit* randomPlayer; - - uint8 Phase; - uint8 ActiveTimers; - - uint32 Timer[10]; - uint32 WaitTimer; - - /* Boolean */ - bool IsKalecJoined; - bool IsInDarkness; - bool TimerIsDeactiveted[10]; - bool IsWaiting; - bool OrbActivated; - - void Reset() - { - // TODO: Fix timers - Timer[TIMER_KALEC_JOIN] = 26000; - - //Phase 2 Timer - Timer[TIMER_SOUL_FLAY] = 20000; - Timer[TIMER_LEGION_LIGHTNING] = 40000; - Timer[TIMER_FIRE_BLOOM] = 30000; - Timer[TIMER_SUMMON_SHILEDORB] = 45000; - - //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; - - Phase = PHASE_DECEIVERS; - - IsKalecJoined = false; - IsInDarkness = false; - IsWaiting = false; - OrbActivated = false; - - Kalec = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KALECGOS_KJ))); - ChangeTimers(false, 0); - } - - void ChangeTimers(bool status, uint32 WTimer){ - for(uint8 i = 0; i < 10; ++i) - TimerIsDeactiveted[i] = status; - TimerIsDeactiveted[TIMER_KALEC_JOIN] = IsKalecJoined; - - if (WTimer > 0){ - IsWaiting = true; - WaitTimer = WTimer; - } - - if (OrbActivated) TimerIsDeactiveted[TIMER_ORBS_EMPOWER] = true; - if (Timer[TIMER_SHADOW_SPIKE] == 0) TimerIsDeactiveted[TIMER_SHADOW_SPIKE] = true; - if (Phase == PHASE_SACRIFICE) TimerIsDeactiveted[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); - }else{ - summoned->SetLevel(m_creature->getLevel()); - } - summoned->setFaction(m_creature->getFaction()); - Summons.Summon(summoned); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_KJ_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_KILJAEDEN_EVENT, DONE); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KJ_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_KJ_SLAY2, m_creature); break; - } - } - - void EnterEvadeMode() - { - Scripted_NoMovementAI::EnterEvadeMode(); - Summons.DespawnAll(); - - // Reset the controller - if (pInstance){ - Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))); - if (Control) - CAST_AI(Scripted_NoMovementAI, Control->AI())->Reset(); - } - } - - void EnterCombat(Unit* who){ - DoZoneInCombat(); - DoScriptText(SAY_KJ_EMERGE, m_creature); - } - - void CastSinisterReflection() - { - switch(rand()%2){ - case 0: DoScriptText(SAY_KJ_REFLECTION1, m_creature); break; - case 1: DoScriptText(SAY_KJ_REFLECTION2, m_creature); break; - } - DoCast(m_creature, SPELL_SINISTER_REFLECTION, true); - for(uint8 i = 0; i < 4; ++i){ - float x,y,z; - Unit* target; - for(uint8 z = 0; z < 6; ++z){ - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (!target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break; - } - target->GetPosition(x,y,z); - Creature* SinisterReflection = m_creature->SummonCreature(CREATURE_SINISTER_REFLECTION, x,y,z,0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (SinisterReflection) - SinisterReflection->AI()->AttackStart(target); - } - } - - 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 && !TimerIsDeactiveted[t]){ - switch(t){ - case TIMER_KALEC_JOIN: - if (Kalec){ - DoScriptText(SAY_KALECGOS_JOIN, Kalec); - IsKalecJoined = true; - TimerIsDeactiveted[TIMER_KALEC_JOIN] = true; - } - break; - case TIMER_SOUL_FLAY: - if (!m_creature->IsNonMeleeSpellCasted(false)){ - m_creature->CastSpell(m_creature->getVictim(), SPELL_SOUL_FLAY, false); - m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_SOUL_FLAY_SLOW, true); - Timer[TIMER_SOUL_FLAY] = 3500; - } - break; - case TIMER_LEGION_LIGHTNING: - if (!m_creature->IsNonMeleeSpellCasted(false)){ - m_creature->RemoveAurasDueToSpell(SPELL_SOUL_FLAY); - for(uint8 z = 0; z < 6; ++z){ - randomPlayer = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (!randomPlayer->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break; - } - if (randomPlayer)DoCast(randomPlayer, 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 (!m_creature->IsNonMeleeSpellCasted(false)){ - m_creature->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]); - m_creature->SummonCreature(CREATURE_SHIELD_ORB, sx, sy, SHIELD_ORB_Z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); - } - Timer[TIMER_SUMMON_SHILEDORB] = 30000+rand()%30*1000; // 30-60seconds cooldown - Timer[TIMER_SOUL_FLAY] = 2000; - break; - case TIMER_SHADOW_SPIKE: //Phase 3 - if (!m_creature->IsNonMeleeSpellCasted(false)){ - DoCastAOE(SPELL_SHADOW_SPIKE, false); - Timer[TIMER_SHADOW_SPIKE] = 0; - TimerIsDeactiveted[TIMER_SHADOW_SPIKE] = true; - ChangeTimers(true, 30000); - } - 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 (!m_creature->IsNonMeleeSpellCasted(false)){ - // Begins to channel for 8 seconds, then deals 50'000 damage to all raid members. - if (!IsInDarkness){ - DoScriptText(EMOTE_KJ_DARKNESS, m_creature); - DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS, false); - ChangeTimers(true, 9000); - Timer[TIMER_DARKNESS] = 8750; - TimerIsDeactiveted[TIMER_DARKNESS] = false; - if (Phase == PHASE_SACRIFICE) TimerIsDeactiveted[TIMER_ARMAGEDDON] = false; - IsInDarkness = true; - }else{ - Timer[TIMER_DARKNESS] = (Phase == PHASE_SACRIFICE) ? 20000 + rand()%15000 : 40000 + rand()%30000; - IsInDarkness = false; - DoCastAOE(SPELL_DARKNESS_OF_A_THOUSAND_SOULS_DAMAGE); - switch(rand()%3){ - case 0: DoScriptText(SAY_KJ_DARKNESS1, m_creature); break; - case 1: DoScriptText(SAY_KJ_DARKNESS2, m_creature); break; - case 2: DoScriptText(SAY_KJ_DARKNESS3, m_creature); break; - } - } - Timer[TIMER_SOUL_FLAY] = 9000; - } - break; - case TIMER_ORBS_EMPOWER: //Phase 3 - if (Phase == PHASE_SACRIFICE){ - if (Kalec)CAST_AI(boss_kalecgos_kjAI, Kalec->AI())->EmpowerOrb(true); - }else if (Kalec)CAST_AI(boss_kalecgos_kjAI, Kalec->AI())->EmpowerOrb(false); - Timer[TIMER_ORBS_EMPOWER]= (Phase == PHASE_SACRIFICE) ? 45000 : 35000; - OrbActivated = true; - TimerIsDeactiveted[TIMER_ORBS_EMPOWER] = true; - break; - case TIMER_ARMAGEDDON: //Phase 4 - Unit* target; - for(uint8 z = 0; z < 6; ++z){ - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (!target->HasAura(SPELL_VENGEANCE_OF_THE_BLUE_FLIGHT,0)) break; - } - if (target){ - float x, y, z; - target->GetPosition(x, y, z); - m_creature->SummonCreature(CREATURE_ARMAGEDDON_TARGET, x,y,z,0, TEMPSUMMON_TIMED_DESPAWN,15000); - } - Timer[TIMER_ARMAGEDDON] = 2000; // No, I'm not kidding - break; - } - break; - } - } - //Time runs over! - for(uint8 i = 0; i < ActiveTimers; ++i) - if (!TimerIsDeactiveted[i]){ - Timer[i] -= diff; - if (((int32)Timer[i]) < 0) Timer[i] = 0; - } - - //Phase 3 - if (Phase <= PHASE_NORMAL){ - if (Phase == PHASE_NORMAL && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 85)){ - CastSinisterReflection(); - DoScriptText(SAY_KJ_PHASE3, m_creature); - Phase = PHASE_DARKNESS; - OrbActivated = false; - ActiveTimers = 9; - } - else return; - } - - //Phase 4 - if (Phase <= PHASE_DARKNESS){ - if (Phase == PHASE_DARKNESS && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 55)){ - DoScriptText(SAY_KJ_PHASE4, m_creature); - Phase = PHASE_ARMAGEDDON; - OrbActivated = false; - ActiveTimers = 10; - } - else return; - } - - //Phase 5 specific spells all we can - if (Phase <= PHASE_ARMAGEDDON){ - if (Phase == PHASE_ARMAGEDDON && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25)){ - Phase = PHASE_SACRIFICE; - Creature* Anveena = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_ANVEENA))); - if (Anveena)Anveena->CastSpell(m_creature, SPELL_SACRIFICE_OF_ANVEENA, false); - OrbActivated = false; - ChangeTimers(true, 10000);// He shouldn't cast spells for ~10 seconds after Anveena's sacrifice. This will be done within Anveena's script - } - else return; - } - -} -}; - -CreatureAI* GetAI_boss_kiljaeden(Creature* pCreature) -{ - return new boss_kiljaedenAI (pCreature); -} - -//AI for Kil'jaeden Event Controller -struct TRINITY_DLL_DECL mob_kiljaeden_controllerAI : public Scripted_NoMovementAI -{ - mob_kiljaeden_controllerAI(Creature* c) : Scripted_NoMovementAI(c), Summons(m_creature){ - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - Creature* KalecKJ; - SummonList Summons; - - bool SummonedDeceivers; - bool KiljaedenDeath; - - uint32 RandomSayTimer; - uint32 Phase; - uint8 DeceiverDeathCount; - - void InitializeAI(){ - KalecKJ = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KALECGOS_KJ)); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->addUnitState(UNIT_STAT_STUNNED); - } - - void Reset(){ - Phase = PHASE_DECEIVERS; - if (KalecKJ)CAST_AI(boss_kalecgos_kjAI, KalecKJ->AI())->ResetOrbs(); - DeceiverDeathCount = 0; - SummonedDeceivers = false; - KiljaedenDeath = false; - RandomSayTimer = 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); - CAST_AI(boss_kiljaedenAI, summoned->AI())->Phase=PHASE_NORMAL; - summoned->AddThreat(m_creature->getVictim(), 1.0f); - break; - } - Summons.Summon(summoned); - } - - void UpdateAI(const uint32 diff) - { - if (RandomSayTimer < diff && pInstance->GetData(DATA_MURU_EVENT) != DONE && pInstance->GetData(DATA_KILJAEDEN_EVENT) == NOT_STARTED){ - switch(rand()%5){ - case 0: DoScriptText(SAY_KJ_OFFCOMBAT1, m_creature); break; - case 1: DoScriptText(SAY_KJ_OFFCOMBAT2, m_creature); break; - case 2: DoScriptText(SAY_KJ_OFFCOMBAT3, m_creature); break; - case 3: DoScriptText(SAY_KJ_OFFCOMBAT4, m_creature); break; - case 4: DoScriptText(SAY_KJ_OFFCOMBAT5, m_creature); break; - } - RandomSayTimer = 30000; - }else RandomSayTimer -= diff; - - if (!SummonedDeceivers){ - for(uint8 i = 0; i < 3; ++i) - m_creature->SummonCreature(CREATURE_HAND_OF_THE_DECEIVER, DeceiverLocations[i][0], DeceiverLocations[i][1], FLOOR_Z, DeceiverLocations[i][2], TEMPSUMMON_DEAD_DESPAWN, 0); - - DoSpawnCreature(CREATURE_ANVEENA, 0, 0, 40, 0, TEMPSUMMON_DEAD_DESPAWN, 0); - DoCast(m_creature, SPELL_ANVEENA_ENERGY_DRAIN); - SummonedDeceivers = true; - } - - if (DeceiverDeathCount > 2 && Phase == PHASE_DECEIVERS){ - m_creature->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 Hand of the Deceiver -struct TRINITY_DLL_DECL 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 = 8000 + rand()%6000; // 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(m_creature->getFaction()); - summoned->SetLevel(m_creature->getLevel()); - } - - void EnterCombat(Unit* who){ - if (pInstance){ - pInstance->SetData(DATA_KILJAEDEN_EVENT, IN_PROGRESS); - Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))); - if (Control) - Control->AddThreat(who, 1.0f); - } - m_creature->InterruptNonMeleeSpells(true); - } - - void JustDied(Unit* killer){ - if (!pInstance) - return; - - Creature* Control = CAST_CRE(Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_KILJAEDEN_CONTROLLER))); - if (Control) - CAST_AI(mob_kiljaeden_controllerAI, Control->AI())->DeceiverDeathCount++; - } - - void UpdateAI(const uint32 diff){ - if (!me->isInCombat()) - DoCast(m_creature, SPELL_SHADOW_CHANNELING); - - if (!UpdateVictim()) - return; - - // Gain Shadow Infusion at 20% health - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) && !m_creature->HasAura(SPELL_SHADOW_INFUSION, 0)) - DoCast(m_creature, SPELL_SHADOW_INFUSION, true); - - // Shadow Bolt Volley - Shoots Shadow Bolts at all enemies within 30 yards, for ~2k Shadow damage. - if (ShadowBoltVolleyTimer < diff){ - DoCast(m_creature->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){ - Creature* Portal = DoSpawnCreature(CREATURE_FELFIRE_PORTAL, 0, 0,0, 0, TEMPSUMMON_TIMED_DESPAWN, 20000); - if (Portal) - { - std::list::iterator itr; - for(itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr) - { - Unit* pUnit = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (pUnit) - Portal->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 TRINITY_DLL_DECL mob_felfire_portalAI : public Scripted_NoMovementAI -{ - mob_felfire_portalAI(Creature* c) : Scripted_NoMovementAI(c) {} - - uint32 SpawnFiendTimer; - - void InitializeAI(){ - SpawnFiendTimer = 5000; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - // TODO: Timers - void Reset() { - - } - - void JustSummoned(Creature* summoned) - { - summoned->setFaction(m_creature->getFaction()); - summoned->SetLevel(m_creature->getLevel()); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (SpawnFiendTimer < diff) - { - Creature* Fiend = DoSpawnCreature(CREATURE_VOLATILE_FELFIRE_FIEND, 0, 0, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000); - if (Fiend) - Fiend->AddThreat(SelectUnit(SELECT_TARGET_RANDOM,0), 100000.0f); - SpawnFiendTimer = 4000 + rand()%4000; - }else SpawnFiendTimer -= diff; - } -}; - -CreatureAI* GetAI_mob_felfire_portal(Creature* pCreature) -{ - return new mob_felfire_portalAI (pCreature); -} - -//AI for Felfire Fiend -struct TRINITY_DLL_DECL mob_volatile_felfire_fiendAI : public ScriptedAI -{ - mob_volatile_felfire_fiendAI(Creature* c) : ScriptedAI(c) {} - - uint32 ExplodeTimer; - - bool LockedTarget; - - void Reset() - { - ExplodeTimer = 2000; - LockedTarget = false; - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage > m_creature->GetHealth()) - DoCast(m_creature, SPELL_FELFIRE_FISSION, true); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!LockedTarget){ - m_creature->AddThreat(m_creature->getVictim(), 10000000.0f); - LockedTarget = true; - } - - if (ExplodeTimer){ - if (ExplodeTimer < diff) - ExplodeTimer = 0; - else ExplodeTimer -= diff; - } - else if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 3)) // Explode if it's close enough to it's target - { - DoCast(m_creature->getVictim(), SPELL_FELFIRE_FISSION); - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } -}; - -CreatureAI* GetAI_mob_volatile_felfire_fiend(Creature* pCreature) -{ - return new mob_volatile_felfire_fiendAI (pCreature); -} - -//AI for Armageddon target -struct TRINITY_DLL_DECL mob_armageddonAI : public Scripted_NoMovementAI -{ - mob_armageddonAI(Creature* c) : Scripted_NoMovementAI(c) {} - - uint8 Spell; - uint32 Timer; - - void Reset(){ - Spell = 0; - Timer = 0; - } - - void UpdateAI(const uint32 diff) - { - if (Timer < diff){ - switch(Spell){ - case 0: - DoCast(m_creature, SPELL_ARMAGEDDON_VISUAL, true); - ++Spell; - break; - case 1: - DoCast(m_creature, SPELL_ARMAGEDDON_VISUAL2, true); - Timer = 9000; - ++Spell; - break; - case 2: - DoCast(m_creature, SPELL_ARMAGEDDON_TRIGGER, true); - ++Spell; - Timer = 5000; - break; - case 3: - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - break; - } - }else Timer -=diff; - } -}; - -CreatureAI* GetAI_mob_armageddon(Creature* pCreature) -{ - return new mob_armageddonAI (pCreature); -} - -//AI for Shield Orbs -struct TRINITY_DLL_DECL mob_shield_orbAI : public ScriptedAI -{ - mob_shield_orbAI(Creature* c) : ScriptedAI(c) { - pInstance = c->GetInstanceData(); - } - - bool PointReached; - bool Clockwise; - uint32 Timer; - uint32 CheckTimer; - ScriptedInstance* pInstance; - float x, y, r, c, mx, my; - - void InitializeAI(){ - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - PointReached = true; - Timer = 500+ rand()%500; - CheckTimer = 1000; - r = 17; - c = 0; - mx = ShieldOrbLocations[0][0]; - my = ShieldOrbLocations[0][1]; - if (rand()%2 == 0)Clockwise = true; - else Clockwise = false; - } - - void Reset(){} - - void UpdateAI(const uint32 diff){ - if (PointReached){ - if (Clockwise){ - y = my - r * sin(c); - x = mx - r * cos(c); - }else{ - y = my + r * sin(c); - x = mx + r * cos(c); - } - PointReached = false; - CheckTimer = 1000; - m_creature->GetMotionMaster()->MovePoint(1,x, y, SHIELD_ORB_Z); - c += 3.1415926535/32; - if (c > 2*3.1415926535) c = 0; - }else{ - if (CheckTimer < diff){ - DoTeleportTo(x,y,SHIELD_ORB_Z); - PointReached = true; - }else CheckTimer -= diff; - - } - - if (Timer < diff){ - Unit* random = (Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID))); - if (random)DoCast(random, SPELL_SHADOW_BOLT, false); - Timer = 500+ rand()%500; - }else Timer -= diff; - } - - void MovementInform(uint32 type, uint32 id){ - if (type != POINT_MOTION_TYPE) - return; - - PointReached = true; - } -}; - -CreatureAI* GetAI_mob_shield_orb(Creature* pCreature) -{ - return new mob_shield_orbAI (pCreature); -} - -//AI for Sinister Reflection -struct TRINITY_DLL_DECL mob_sinster_reflectionAI : public ScriptedAI -{ - mob_sinster_reflectionAI(Creature* c) : ScriptedAI(c) {} - - uint8 Class; - uint32 Timer[3]; - - void Reset(){ - Timer[0] = 0; - Timer[1] = 0; - Timer[2] = 0; - Class = 0; - } - - void UpdateAI(const uint32 diff){ - - if (Class == 0){ - Class = m_creature->getVictim()->getClass(); - switch(Class){ - case CLASS_DRUID: - break; - case CLASS_HUNTER: - break; - case CLASS_MAGE: - break; - case CLASS_WARLOCK: - break; - case CLASS_WARRIOR: - m_creature->SetCanDualWield(true); - break; - case CLASS_PALADIN: - break; - case CLASS_PRIEST: - break; - case CLASS_SHAMAN: - m_creature->SetCanDualWield(true); - break; - case CLASS_ROGUE: - m_creature->SetCanDualWield(true); - break; - } - } - - switch(Class){ - case CLASS_DRUID: - if (Timer[1] < diff){ - DoCast(m_creature->getVictim(), SPELL_SR_MOONFIRE, false); - Timer[1] = 3000; - } - DoMeleeAttackIfReady(); - break; - case CLASS_HUNTER: - if (Timer[1] < diff){ - DoCast(m_creature->getVictim(), SPELL_SR_MULTI_SHOT, false); - Timer[1] = 9000; - } - if (Timer[2] < diff){ - DoCast(m_creature->getVictim(), SPELL_SR_SHOOT, false); - Timer[2] = 5000; - } - if (m_creature->IsWithinMeleeRange(m_creature->getVictim(), 6)){ - if (Timer[3] < diff){ - DoCast(m_creature->getVictim(), SPELL_SR_MULTI_SHOT, false); - Timer[3] = 7000; - } - DoMeleeAttackIfReady(); - } - break; - case CLASS_MAGE: - if (Timer[1] < diff){ - DoCast(m_creature->getVictim(), SPELL_SR_FIREBALL, false); - Timer[1] = 3000; - } - DoMeleeAttackIfReady(); - break; - case CLASS_WARLOCK: - if (Timer[1] < diff){ - DoCast(m_creature->getVictim(), SPELL_SR_SHADOW_BOLT, false); - Timer[1] = 4000; - } - if (Timer[2] < diff){ - DoCast(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true), SPELL_SR_CURSE_OF_AGONY, true); - Timer[2] = 3000; - } - DoMeleeAttackIfReady(); - break; - case CLASS_WARRIOR: - if (Timer[1] < diff){ - DoCast(m_creature->getVictim(), SPELL_SR_WHIRLWIND, false); - Timer[1] = 10000; - } - DoMeleeAttackIfReady(); - break; - case CLASS_PALADIN: - if (Timer[1] < diff){ - DoCast(m_creature->getVictim(), SPELL_SR_HAMMER_OF_JUSTICE, false); - Timer[1] = 7000; - } - if (Timer[2] < diff){ - DoCast(m_creature->getVictim(), SPELL_SR_HOLY_SHOCK, false); - Timer[2] = 3000; - } - DoMeleeAttackIfReady(); - break; - case CLASS_PRIEST: - if (Timer[1] < diff){ - DoCast(m_creature->getVictim(), SPELL_SR_HOLY_SMITE, false); - Timer[1] = 5000; - } - if (Timer[2] < diff){ - DoCast(m_creature, SPELL_SR_RENEW, false); - Timer[2] = 7000; - } - DoMeleeAttackIfReady(); - break; - case CLASS_SHAMAN: - if (Timer[1] < diff){ - DoCast(m_creature->getVictim(), SPELL_SR_EARTH_SHOCK, false); - Timer[1] = 5000; - } - DoMeleeAttackIfReady(); - break; - case CLASS_ROGUE: - if (Timer[1] < diff){ - DoCast(m_creature->getVictim(), SPELL_SR_HEMORRHAGE, true); - Timer[1] = 5000; - } - DoMeleeAttackIfReady(); - break; - } - debug_log("Sinister-Timer"); - for(uint8 i = 0; i < 3; ++i) - Timer[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/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp deleted file mode 100644 index 003080002d1..00000000000 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/boss_muru.cpp +++ /dev/null @@ -1,668 +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 "precompiled.h" -#include "def_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 Creatures -{ - 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, - BOSS_MURU = 25741, - BOSS_ENTROPIUS = 25840 -}; - -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 TRINITY_DLL_DECL boss_entropiusAI : public ScriptedAI -{ - boss_entropiusAI(Creature *c) : ScriptedAI(c), Summons(m_creature) - { - 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(m_creature, 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); - m_creature->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 && !m_creature->HasAura(SPELL_ENRAGE, 0)) - { - DoCast(m_creature,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 TRINITY_DLL_DECL boss_muruAI : public Scripted_NoMovementAI -{ - boss_muruAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature) - { - 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; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->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 > m_creature->GetHealth() && Phase == 1) - { - damage = 0; - Phase = 2; - m_creature->RemoveAllAuras(); - DoCast(m_creature, SPELL_OPEN_ALL_PORTALS, false); - m_creature->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: - m_creature->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] GetData(DATA_MURU_EVENT)) - { - case NOT_STARTED: - Reset(); - break; - case DONE: - Phase = 4; - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - break; - } - Timer[TIMER_PHASE] = 3000; - }else Timer[TIMER_PHASE] -= diff; - return; - } - - if (EnrageTimer < diff && !m_creature->HasAura(SPELL_ENRAGE, 0)) - { - DoCast(m_creature, 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) - m_creature->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) - m_creature->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: - m_creature->RemoveAllAuras(); - DoCast(m_creature, 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 TRINITY_DLL_DECL npc_muru_portalAI : public Scripted_NoMovementAI -{ - npc_muru_portalAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - SummonList Summons; - Creature* Muru; - - bool SummonSentinel; - bool InAction; - - uint32 SummonTimer; - - void Reset() - { - SummonTimer = 5000; - - InAction = false; - SummonSentinel = false; - - m_creature->addUnitState(UNIT_STAT_STUNNED); - - Summons.DespawnAll(); - } - - void JustSummoned(Creature* summoned) - { - Player* Target = Unit::GetPlayer(pInstance->GetData64(DATA_PLAYER_GUID)); - if (Target) - summoned->AI()->AttackStart(Target); - - Summons.Summon(summoned); - } - - void SpellHit(Unit* caster, const SpellEntry* Spell) - { - float x,y,z,o; - m_creature->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->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 TRINITY_DLL_DECL npc_dark_fiendAI : public ScriptedAI -{ - npc_dark_fiendAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 WaitTimer; - bool InAction; - - void Reset() - { - WaitTimer = 2000; - InAction = false; - - m_creature->addUnitState(UNIT_STAT_STUNNED); - } - - void SpellHit(Unit* caster, const SpellEntry* Spell) - { - for(uint8 i = 0; i < 3; ++i) - if (Spell->Effect[i] == 38) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (WaitTimer < diff) - { - if (!InAction) - { - m_creature->clearUnitState(UNIT_STAT_STUNNED); - DoCastAOE(SPELL_DARKFIEND_SKIN, false); - AttackStart(SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true)); - InAction = true; - WaitTimer = 500; - } - else - { - - if (m_creature->IsWithinDist(m_creature->getVictim(), 5)) - { - DoCastAOE(SPELL_DARKFIEND_AOE, false); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - } - WaitTimer = 500; - } - }else WaitTimer -= diff; - } -}; - -CreatureAI* GetAI_npc_dark_fiend(Creature* pCreature) -{ - return new npc_dark_fiendAI (pCreature); -} - -struct TRINITY_DLL_DECL npc_void_sentinelAI : public ScriptedAI -{ - npc_void_sentinelAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 PulseTimer; - uint32 VoidBlastTimer; - - void Reset() - { - PulseTimer = 3000; - VoidBlastTimer = 45000; //is this a correct timer? - - float x,y,z,o; - m_creature->GetHomePosition(x,y,z,o); - DoTeleportTo(x,y,71); - } - - void JustDied(Unit* killer) - { - for (uint8 i = 0; i < 8; ++i){ - m_creature->SummonCreature(CREATURE_VOID_SPAWN, m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->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(m_creature->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 TRINITY_DLL_DECL 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; - - m_creature->addUnitState(UNIT_STAT_STUNNED); - DoCastAOE(SPELL_BLACKHOLE_SPAWN, true); - } - - void UpdateAI(const uint32 diff) - { - if (SpellTimer < diff) - { - Unit* Victim = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_PLAYER_GUID)); - switch(NeedForAHack) - { - case 0: - m_creature->clearUnitState(UNIT_STAT_STUNNED); - DoCastAOE(SPELL_BLACKHOLE_GROW, false); - if (Victim) - AttackStart(Victim); - SpellTimer = 700; - NeedForAHack = 2; - break; - case 1: - m_creature->AddAura(SPELL_BLACKHOLE_GROW, m_creature); - NeedForAHack = 2; - SpellTimer = 600; - break; - case 2: - SpellTimer = 400; - NeedForAHack = 3; - m_creature->RemoveAura(SPELL_BLACKHOLE_GROW, 1); - break; - case 3: - SpellTimer = 400+rand()%500; - NeedForAHack = 1; - Unit* Temp = m_creature->getVictim(); - if (!Temp) - return; - if (Temp->GetPositionZ() > 73 && Victim) - AttackStart(Victim); - } - }else SpellTimer -= diff; - - if (DespawnTimer < diff) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - }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/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h b/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h deleted file mode 100644 index ca8c014d9df..00000000000 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/def_sunwell_plateau.h +++ /dev/null @@ -1,37 +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 ***/ -#define DATA_KALECGOS_EVENT 1 -#define DATA_BRUTALLUS_EVENT 2 -#define DATA_FELMYST_EVENT 3 -#define DATA_EREDAR_TWINS_EVENT 4 -#define DATA_MURU_EVENT 5 -#define DATA_KILJAEDEN_EVENT 6 - -/*** Creatures ***/ -#define DATA_KALECGOS_DRAGON 7 -#define DATA_KALECGOS_HUMAN 8 -#define DATA_SATHROVARR 9 -#define DATA_BRUTALLUS 10 -#define DATA_MADRIGOSA 11 -#define DATA_FELMYST 12 -#define DATA_ALYTHESS 13 -#define DATA_SACROLASH 14 -#define DATA_MURU 15 -#define DATA_KILJAEDEN 16 -#define DATA_KILJAEDEN_CONTROLLER 17 -#define DATA_ANVEENA 18 -#define DATA_KALECGOS_KJ 19 - -/*** GameObjects ***/ -#define DATA_GO_FORCEFIELD 20 - -/*** Misc ***/ -#define DATA_PLAYER_GUID 27 -#endif - diff --git a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp deleted file mode 100644 index 8b763e9d7b7..00000000000 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/instance_sunwell_plateau.cpp +++ /dev/null @@ -1,274 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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; - - /** GameObjects **/ - uint64 ForceField; // Kalecgos Encounter - 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; - - /*** GameObjects ***/ - ForceField = 0; - FireBarrier = 0; - MurusGate[0] = 0; - MurusGate[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 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: 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/bindings/scripts/scripts/zone/sunwell_plateau/sunwell_plateau.cpp b/src/bindings/scripts/scripts/zone/sunwell_plateau/sunwell_plateau.cpp deleted file mode 100644 index e68717857cb..00000000000 --- a/src/bindings/scripts/scripts/zone/sunwell_plateau/sunwell_plateau.cpp +++ /dev/null @@ -1,66 +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 "precompiled.h" -#include "def_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/bindings/scripts/scripts/zone/uldaman/boss_archaedas.cpp b/src/bindings/scripts/scripts/zone/uldaman/boss_archaedas.cpp deleted file mode 100644 index 43628a6565e..00000000000 --- a/src/bindings/scripts/scripts/zone/uldaman/boss_archaedas.cpp +++ /dev/null @@ -1,493 +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 3 prople click 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 "precompiled.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 TRINITY_DLL_DECL boss_archaedasAI : public ScriptedAI -{ - boss_archaedasAI(Creature *c) : ScriptedAI(c) - { - pInstance = (m_creature->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 - m_creature->setFaction(35); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); - - } - - void ActivateMinion (uint64 guid, bool flag) - { - Unit *minion = Unit::GetUnit(*m_creature, guid); - - if (minion && minion->isAlive()) - { - DoCast (minion, SPELL_AWAKEN_VAULT_WALKER, flag); - minion->CastSpell(minion, SPELL_ARCHAEDAS_AWAKEN,true); - } - } - - - void EnterCombat(Unit *who) - { - m_creature->setFaction (14); - m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->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)) { - m_creature->MonsterYell(SAY_AGGRO,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO); - Awaken_Timer = 4000; - wakingUp = true; - } - } - - void KilledUnit(Unit *victim) - { - m_creature->MonsterYell(SAY_KILL,LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, 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(*m_creature, 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 && m_creature->GetHealth()*100 / m_creature->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 - m_creature->MonsterYell(SAY_SUMMON,LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_SUMMON); - guardiansAwake = true; - } - - //If we are <33 summon the vault walkers - if (!vaultWalkersAwake && m_creature->GetHealth()*100 / m_creature->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 - m_creature->MonsterYell(SAY_SUMMON2, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_SUMMON2); - vaultWalkersAwake = true; - } - - - if (Tremor_Timer < diff) - { - //Cast - DoCast(m_creature->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 TRINITY_DLL_DECL mob_archaedas_minionsAI : public ScriptedAI -{ - mob_archaedas_minionsAI(Creature *c) : ScriptedAI(c) - { - pInstance = (m_creature->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; - - m_creature->setFaction(35); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); - m_creature->RemoveAllAuras(); - } - - void EnterCombat(Unit *who) - { - m_creature->setFaction (14); - m_creature->RemoveAllAuras(); - m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->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(*m_creature, 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 3 people to activate the Archaedas script -SDCategory: Uldaman -EndScriptData */ - - -#define OBJECT_ALTAR_OF_ARCHAEDAS 133234 - -#define NUMBER_NEEDED_TO_ACTIVATE 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 - uint32 count=0; - Unit *pTarget; - for (uint32 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 "precompiled.h" - -#define SPELL_SELF_DESTRUCT 9874 - -struct TRINITY_DLL_DECL mob_stonekeepersAI : public ScriptedAI -{ - mob_stonekeepersAI(Creature *c) : ScriptedAI(c) - { - pInstance = (m_creature->GetInstanceData()); - } - - ScriptedInstance* pInstance; - - void Reset() - { - m_creature->setFaction(35); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_DISABLE_MOVE); - m_creature->RemoveAllAuras(); - } - - void EnterCombat(Unit *who) - { - m_creature->setFaction (14); - m_creature->RemoveFlag (UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->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 (m_creature, 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 3 people 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 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 - uint32 count=0; - Unit *pTarget; - for (uint32 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/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp b/src/bindings/scripts/scripts/zone/uldaman/boss_ironaya.cpp deleted file mode 100644 index 17e32e7178a..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define SAY_AGGRO -1070000 - -#define SPELL_ARCINGSMASH 8374 -#define SPELL_KNOCKAWAY 10101 -#define SPELL_WSTOMP 11876 - -struct TRINITY_DLL_DECL 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, m_creature); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //If we are <50% hp do knockaway ONCE - if (!hasCastedKnockaway && m_creature->GetHealth()*2 < m_creature->GetMaxHealth()) - { - m_creature->CastSpell(m_creature->getVictim(),SPELL_KNOCKAWAY, true); - - // current aggro target is knocked away pick new target - Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); - - if (!Target || Target == m_creature->getVictim()) - Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); - - if (Target) - m_creature->TauntApply(Target); - - //Shouldn't cast this agian - hasCastedKnockaway = true; - } - - //Arcing_Timer - if (Arcing_Timer < diff) - { - DoCast(m_creature,SPELL_ARCINGSMASH); - Arcing_Timer = 13000; - }else Arcing_Timer -= diff; - - if (!hasCastedWstomp && m_creature->GetHealth()*4 < m_creature->GetMaxHealth()) - { - DoCast(m_creature,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/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp b/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp deleted file mode 100644 index 21b639e2449..00000000000 --- a/src/bindings/scripts/scripts/zone/uldaman/instance_uldaman.cpp +++ /dev/null @@ -1,306 +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 "precompiled.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 TRINITY_DLL_DECL 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::iterator i = stoneKeeper.begin(); i != stoneKeeper.end(); ++i) - { - Creature *target = instance->GetCreature(*i); - if (!target || !target->isAlive() || target->getFaction()==14) - continue; - target->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_DISABLE_MOVE); - target->setFaction(14); - target->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::iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) - { - Creature *target = instance->GetCreature(*i); - if (!target || !target->isAlive() || target->getFaction()==14) - continue; - archaedas->CastSpell(target, SPELL_AWAKEN_VAULT_WALKER, true); - target->CastSpell(target, 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::iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) - { - Creature *target = instance->GetCreature(*i); - if (!target || target->isDead() || target->getFaction()!=14) - continue; - target->setDeathState(JUST_DIED); - target->RemoveCorpse(); - } - - // Vault Walkers - for(std::vector::iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i) - { - Creature *target = instance->GetCreature(*i); - if (!target || target->isDead() || target->getFaction()!=14) - continue; - target->setDeathState(JUST_DIED); - target->RemoveCorpse(); - } - - // Earthen Guardians - for(std::vector::iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i) - { - Creature *target = instance->GetCreature(*i); - if (!target || target->isDead() || target->getFaction()!=14) - continue; - target->setDeathState(JUST_DIED); - target->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::iterator i = archaedasWallMinions.begin(); i != archaedasWallMinions.end(); ++i) - { - Creature *target = instance->GetCreature(*i); - if (target && target->isDead()) - { - target->Respawn(); - target->GetMotionMaster()->MoveTargetedHome(); - SetFrozenState(target); - } - } - - // Vault Walkers - for(std::vector::iterator i = vaultWalker.begin(); i != vaultWalker.end(); ++i) - { - Creature *target = instance->GetCreature(*i); - if (target && target->isDead()) - { - target->Respawn(); - target->GetMotionMaster()->MoveTargetedHome(); - SetFrozenState(target); - } - } - - // Earthen Guardians - for(std::vector::iterator i = earthenGuardian.begin(); i != earthenGuardian.end(); ++i) - { - Creature *target = instance->GetCreature(*i); - if (target && target->isDead()) - { - target->Respawn(); - target->GetMotionMaster()->MoveTargetedHome(); - SetFrozenState(target); - } - } - } - - 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/bindings/scripts/scripts/zone/uldaman/uldaman.cpp b/src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp deleted file mode 100644 index 730dcac211a..00000000000 --- a/src/bindings/scripts/scripts/zone/uldaman/uldaman.cpp +++ /dev/null @@ -1,188 +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 "precompiled.h" - -/*###### -## mob_jadespine_basilisk -######*/ - -#define SPELL_CSLUMBER 3636 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_CSLUMBER); - m_creature->CastSpell(m_creature->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 == m_creature->getVictim()) - Target = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (Target) - m_creature->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 -######*/ - -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, "Who are the Earthen?", 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, "What is a \"subterranean being matrix\"?", 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, "What are the anomalies you speak of?", 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, "What is a resilient foundation of construction?", 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, "So... the Earthen were made out of stone?", 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, "Anything else I should know about the Earthen?", 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, "I think I understand the Creators' design intent for the Earthen now. What are the Earthen's anomalies that you spoke of earlier?", 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, "What high-stress environments would cause the Earthen to destabilize?", 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, "What happens when the Earthen destabilize?", 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, "Troggs?! Are the troggs you mention the same as the ones in the world today?", 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, "You mentioned two results when the Earthen destabilize. What is the second?", 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, "Dwarves!!! Now you're telling me that dwarves originally came from the Earthen?!", 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, "These dwarves are the same ones today, yes? Do the dwarves maintain any other links to the Earthen?", 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, "Who are the Creators?", 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, "This is a lot to think about.", 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, "I will access the discs now.", 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/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp deleted file mode 100644 index fb369aee5e4..00000000000 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_akilzon.cpp +++ /dev/null @@ -1,456 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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 = (10+rand()%10)*1000; //10 to 20 seconds (bosskillers) - GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers) - CallLighting_Timer = (10+rand()%10)*1000; //totaly random timer. can't find any info on this - ElectricalStorm_Timer = 60*1000; //60 seconds(bosskillers) - Enrage_Timer = 10*60*1000; //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) - { - m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); - //DoZoneInCombat(); - if (pInstance) - pInstance->SetData(DATA_AKILZONEVENT, IN_PROGRESS); - } - - void JustDied(Unit* Killer) - { - m_creature->MonsterYell(SAY_ONDEATH,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature, SOUND_ONDEATH); - if (pInstance) - pInstance->SetData(DATA_AKILZONEVENT, DONE); - DespawnSummons(); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: - m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); - break; - case 1: - m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); - break; - } - } - - void DespawnSummons() - { - for (uint8 i = 0; i < 8; ++i) - { - Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]); - if (bird && bird->isAlive()) - { - bird->SetVisibility(VISIBILITY_OFF); - bird->setDeathState(JUST_DIED); - } - } - } - - void SetWeather(uint32 weather, float grade) - { - Map* pMap = m_creature->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(m_creature->GetPositionX(), m_creature->GetPositionY())); - Cell cell(p); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - std::list tempUnitMap; - - { - Trinity::AnyAoETargetUnitInObjectRangeCheck u_check(m_creature, m_creature, 999); - Trinity::UnitListSearcher searcher(m_creature, tempUnitMap, u_check); - - TypeContainerVisitor, WorldTypeMapContainer > world_unit_searcher(searcher); - TypeContainerVisitor, GridTypeMapContainer > grid_unit_searcher(searcher); - - CellLock cell_lock(cell, p); - cell_lock->Visit(cell_lock, world_unit_searcher, *(m_creature->GetMap())); - cell_lock->Visit(cell_lock, grid_unit_searcher, *(m_creature->GetMap())); - } - //dealdamege - for(std::list::iterator i = tempUnitMap.begin(); i != tempUnitMap.end(); ++i) - { - if (!Cloud->IsWithinDist(*i, 6, false)) - { - Cloud->CastCustomSpell(*i, 43137, &bp0, NULL, NULL, true, 0, 0, m_creature->GetGUID()); - } - } - // visual - float x,y,z; - z = m_creature->GetPositionZ(); - for(uint8 i = 0; i < 5+rand()%5; ++i) - { - x = 343+rand()%60; - y = 1380+rand()%60; - if (Unit *trigger = m_creature->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; - m_creature->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* target = Unit::GetUnit(*m_creature, CloudGUID); - if (!target || !target->isAlive()) - { - EnterEvadeMode(); - return; - } - else if (Unit* Cyclone = Unit::GetUnit(*m_creature, CycloneGUID)) - Cyclone->CastSpell(target, 25160, true); // keep casting or... - - if (StormSequenceTimer < diff) { - HandleStormSequence(target); - }else StormSequenceTimer -= diff; - return; - } - - if (Enrage_Timer < diff) { - m_creature->MonsterYell(SAY_ONENRAGE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_ONENRAGE); - m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - Enrage_Timer = 600000; - }else Enrage_Timer -= diff; - - if (StaticDisruption_Timer < diff) { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!target) target = m_creature->getVictim(); - TargetGUID = target->GetGUID(); - m_creature->CastSpell(target, SPELL_STATIC_DISRUPTION, false); - m_creature->SetInFront(m_creature->getVictim()); - StaticDisruption_Timer = (10+rand()%8)*1000; // < 20s - - /*if (float dist = m_creature->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f) dist = 5.0f; - SDisruptAOEVisual_Timer = 1000 + floor(dist / 30 * 1000.0f);*/ - }else StaticDisruption_Timer -= diff; - - if (GustOfWind_Timer < diff) { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!target) target = m_creature->getVictim(); - DoCast(target, SPELL_GUST_OF_WIND); - GustOfWind_Timer = (20+rand()%10)*1000; //20 to 30 seconds(bosskillers) - } else GustOfWind_Timer -= diff; - - if (CallLighting_Timer < diff) { - DoCast(m_creature->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* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 50, true); - if (!target) - { - EnterEvadeMode(); - return; - } - target->CastSpell(target, 44007, true);//cloud visual - m_creature->CastSpell(target, SPELL_ELECTRICAL_STORM, false);//storm cyclon + visual - float x,y,z; - target->GetPosition(x,y,z); - if (target) - { - target->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - target->SendMonsterMove(x,y,m_creature->GetPositionZ()+15,0); - } - Unit *Cloud = m_creature->SummonTrigger(x, y, m_creature->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) - { - m_creature->MonsterYell(SAY_ONSUMMON, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_ONSUMMON); - - float x, y, z; - m_creature->GetPosition(x, y, z); - - for (uint8 i = 0; i < 8; ++i) - { - Unit* bird = Unit::GetUnit(*m_creature,BirdGUIDs[i]); - if (!bird)//they despawned on die - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - x = target->GetPositionX() + 10 - rand()%20; - y = target->GetPositionY() + 10 - rand()%20; - z = target->GetPositionZ() + 6 + rand()%5 + 10; - if (z > 95) z = 95 - rand()%5; - } - Creature *pCreature = m_creature->SummonCreature(MOB_SOARING_EAGLE, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (pCreature) - { - pCreature->AddThreat(m_creature->getVictim(), 1.0f); - pCreature->AI()->AttackStart(m_creature->getVictim()); - BirdGUIDs[i] = pCreature->GetGUID(); - } - } - } - SummonEagles_Timer = 999999; - } else SummonEagles_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL 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; - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - } - - void EnterCombat(Unit *who) {DoZoneInCombat();} - - void MoveInLineOfSight(Unit* who) {} - - void MovementInform(uint32, uint32) - { - arrived = true; - if (TargetGUID) - { - if (Unit* target = Unit::GetUnit(*m_creature, TargetGUID)) - m_creature->CastSpell(target, SPELL_EAGLE_SWOOP, true); - TargetGUID = 0; - m_creature->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* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - float x, y, z; - if (EagleSwoop_Timer) - { - x = target->GetPositionX() + 10 - rand()%20; - y = target->GetPositionY() + 10 - rand()%20; - z = target->GetPositionZ() + 10 + rand()%5; - if (z > 95) z = 95 - rand()%5; - } - else - { - target->GetContactPoint(m_creature, x, y, z); - z += 2; - m_creature->SetSpeed(MOVE_RUN, 5.0f); - TargetGUID = target->GetGUID(); - } - m_creature->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/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp deleted file mode 100644 index d8c83039b2f..00000000000 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_halazzi.cpp +++ /dev/null @@ -1,403 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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(m_creature, SPELL_DUAL_WIELD, true); - - Phase = PHASE_NONE; - EnterPhase(PHASE_LYNX); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_HALAZZIEVENT, IN_PROGRESS); - - m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_AGGRO); - - EnterPhase(PHASE_LYNX); - } - - void JustSummoned(Creature* summon) - { - summon->AI()->AttackStart(m_creature->getVictim()); - if (summon->GetEntry() == MOB_SPIRIT_LYNX) - LynxGUID = summon->GetGUID(); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= m_creature->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) - { - m_creature->CastSpell(m_creature, SPELL_TRANSFORM_MERGE, true); - m_creature->Attack(m_creature->getVictim(), true); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - if (Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID)) - { - Lynx->SetVisibility(VISIBILITY_OFF); - Lynx->setDeathState(JUST_DIED); - } - m_creature->SetMaxHealth(600000); - m_creature->SetHealth(600000 - 150000 * TransformCount); - FrenzyTimer = 16000; - SaberlashTimer = 20000; - ShockTimer = 10000; - TotemTimer = 12000; - break; - case PHASE_SPLIT: - m_creature->MonsterYell(YELL_SPLIT, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_SPLIT); - m_creature->CastSpell(m_creature, SPELL_TRANSFORM_SPLIT, true); - break; - case PHASE_HUMAN: - //DoCast(m_creature, SPELL_SUMMON_LYNX, true); - DoSpawnCreature(MOB_SPIRIT_LYNX, 5,5,0,0, TEMPSUMMON_CORPSE_DESPAWN, 0); - m_creature->SetMaxHealth(400000); - m_creature->SetHealth(400000); - ShockTimer = 10000; - TotemTimer = 12000; - break; - case PHASE_MERGE: - if (Unit *Lynx = Unit::GetUnit(*m_creature, LynxGUID)) - { - m_creature->MonsterYell(YELL_MERGE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_MERGE); - Lynx->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Lynx->GetMotionMaster()->Clear(); - Lynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveFollow(Lynx, 0, 0); - TransformCount++; - }break; - default: - break; - } - Phase = NextPhase; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (BerserkTimer < diff) - { - m_creature->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_BERSERK); - DoCast(m_creature, 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 - //m_creature->CastSpell(m_creature, 41296, true); - m_creature->CastSpell(m_creature->getVictim(), SPELL_SABER_LASH, true); - //m_creature->RemoveAurasDueToSpell(41296); - SaberlashTimer = 30000; - }else SaberlashTimer -= diff; - - if (FrenzyTimer < diff) - { - DoCast(m_creature, SPELL_FRENZY); - FrenzyTimer = (10+rand()%5)*1000; - }else FrenzyTimer -= diff; - - if (Phase == PHASE_LYNX) - if (CheckTimer < diff) - { - if (m_creature->GetHealth() * 4 < m_creature->GetMaxHealth() * (3 - TransformCount)) - EnterPhase(PHASE_SPLIT); - CheckTimer = 1000; - }else CheckTimer -= diff; - } - - if (Phase == PHASE_HUMAN || Phase == PHASE_ENRAGE) - { - if (TotemTimer < diff) - { - DoCast(m_creature, SPELL_SUMMON_TOTEM); - TotemTimer = 20000; - }else TotemTimer -= diff; - - if (ShockTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (target->IsNonMeleeSpellCasted(false)) - DoCast(target,SPELL_EARTHSHOCK); - else - DoCast(target,SPELL_FLAMESHOCK); - ShockTimer = 10000 + rand()%5000; - } - }else ShockTimer -= diff; - - if (Phase == PHASE_HUMAN) - if (CheckTimer < diff) - { - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20)/*m_creature->GetHealth() * 10 < m_creature->GetMaxHealth()*/) - EnterPhase(PHASE_MERGE); - else - { - Unit *Lynx = Unit::GetUnit(*m_creature, 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(*m_creature, LynxGUID); - if (Lynx) - { - Lynx->GetMotionMaster()->MoveFollow(m_creature, 0, 0); - m_creature->GetMotionMaster()->MoveFollow(Lynx, 0, 0); - if (m_creature->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(rand()%2) - { - case 0: - m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_KILL_ONE); - break; - - case 1: - m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_KILL_TWO); - break; - } - } - - void JustDied(Unit* Killer) - { - if (pInstance) - pInstance->SetData(DATA_HALAZZIEVENT, DONE); - - m_creature->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_DEATH); - } -}; - -// Spirits Lynx AI - -struct TRINITY_DLL_DECL boss_spiritlynxAI : public ScriptedAI -{ - boss_spiritlynxAI(Creature *c) : ScriptedAI(c) {} - - uint32 FrenzyTimer; - uint32 shredder_timer; - - void Reset() - { - FrenzyTimer = (30+rand()%20)*1000; //frenzy every 30-50 seconds - shredder_timer = 4000; - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= m_creature->GetHealth()) - damage = 0; - } - - void AttackStart(Unit *who) - { - if (!m_creature->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(m_creature, SPELL_LYNX_FRENZY); - FrenzyTimer = (30+rand()%20)*1000; - }else FrenzyTimer -= diff; - - if (shredder_timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp deleted file mode 100644 index 3ccd0ec129f..00000000000 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_hexlord.cpp +++ /dev/null @@ -1,912 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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 TRINITY_DLL_DECL 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; - - Unit* SoulDrainTarget; - - 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(); - - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 46916); - m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - } - - void EnterCombat(Unit* who) - { - if (pInstance) - pInstance->SetData(DATA_HEXLORDEVENT, IN_PROGRESS); - - DoZoneInCombat(); - m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_AGGRO); - - for(uint8 i = 0; i < 4; ++i) - { - Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]); - if (Temp && Temp->isAlive()) - CAST_CRE(Temp)->AI()->AttackStart(m_creature->getVictim()); - else - { - EnterEvadeMode(); - break; - } - } - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: - m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_ONE); - break; - case 1: - m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_TWO); - break; - } - } - - void JustDied(Unit* victim) - { - if (pInstance) - pInstance->SetData(DATA_HEXLORDEVENT, DONE); - - m_creature->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_DEATH); - - for(uint8 i = 0; i < 4 ; ++i) - { - Unit* Temp = Unit::GetUnit((*m_creature),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::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((*m_creature), AddGUID[i])); - if (!pCreature || !pCreature->isAlive()) - { - if (pCreature) pCreature->setDeathState(DEAD); - pCreature = m_creature->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(m_creature, Pos_X[i], POS_Y, POS_Z, ORIENT); - pCreature->StopMoving(); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ResetTimer < diff) - { - if (m_creature->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) - { - Unit* Temp = Unit::GetUnit((*m_creature),AddGUID[i]); - if (Temp && Temp->isAlive() && !Temp->getVictim()) - CAST_CRE(Temp)->AI()->AttackStart(m_creature->getVictim()); - } - CheckAddState_Timer = 5000; - }else CheckAddState_Timer -= diff; - - if (DrainPower_Timer < diff) - { - m_creature->CastSpell(m_creature, SPELL_DRAIN_POWER, true); - m_creature->MonsterYell(YELL_DRAIN_POWER, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_DRAIN_POWER); - DrainPower_Timer = 40000 + rand()%15000; // 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 - { - m_creature->CastSpell(m_creature, SPELL_SPIRIT_BOLTS, false); - m_creature->MonsterYell(YELL_SPIRIT_BOLTS, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, 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* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 70, true); - Unit *trigger = DoSpawnCreature(MOB_TEMP_TRIGGER, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN, 30000); - if (!target || !trigger) - { - EnterEvadeMode(); - return; - } - else - { - trigger->SetDisplayId(11686); - trigger->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - trigger->CastSpell(target, SPELL_SIPHON_SOUL, true); - trigger->GetMotionMaster()->MoveChase(m_creature); - - //m_creature->CastSpell(target, SPELL_SIPHON_SOUL, true); - //m_creature->SetUInt64Value(UNIT_FIELD_CHANNEL_OBJECT, target->GetGUID()); - //m_creature->SetUInt32Value(UNIT_CHANNEL_SPELL, SPELL_SIPHON_SOUL); - - PlayerGUID = target->GetGUID(); - PlayerAbility_Timer = 8000 + rand()%2000; - PlayerClass = target->getClass() - 1; - if (PlayerClass == 10) PlayerClass = 9; // druid - if (PlayerClass == 4 && target->HasSpell(15473)) PlayerClass = 5; // shadow priest - SiphonSoul_Timer = 99999; // buff lasts 30 sec - } - }else SiphonSoul_Timer -= diff; - - if (PlayerAbility_Timer < diff) - { - //Unit* target = Unit::GetUnit(*m_creature, PlayerGUID); - //if (target && target->isAlive()) - { - UseAbility(); - PlayerAbility_Timer = 8000 + rand()%2000; - } - }else PlayerAbility_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - void UseAbility() - { - uint32 random = rand()%3; - Unit *target = NULL; - switch(PlayerAbility[PlayerClass][random].target) - { - case ABILITY_TARGET_SELF: - target = m_creature; - break; - case ABILITY_TARGET_VICTIM: - target = m_creature->getVictim(); - break; - case ABILITY_TARGET_ENEMY: - default: - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - break; - case ABILITY_TARGET_HEAL: - target = DoSelectLowestHpFriendly(50, 0); - break; - case ABILITY_TARGET_BUFF: - { - std::list templist = DoFindFriendlyMissingBuff(50, PlayerAbility[PlayerClass][random].spell); - if (!templist.empty()) target = *(templist.begin()); - } - break; - } - if (target) - m_creature->CastSpell(target, PlayerAbility[PlayerClass][random].spell, false); - } -}; - -#define SPELL_BLOODLUST 43578 -#define SPELL_CLEAVE 15496 - -struct TRINITY_DLL_DECL 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* target = *(templist.begin())) - m_creature->CastSpell(target, SPELL_BLOODLUST, false); - } - bloodlust_timer = 12000; - }else bloodlust_timer -= diff; - - if (cleave_timer < diff) - { - m_creature->CastSpell(m_creature->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 TRINITY_DLL_DECL 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 (m_creature->Attack(who, false)) - { - m_creature->GetMotionMaster()->MoveChase(who, 20); - m_creature->AddThreat(who, 0.0f); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (flashheal_timer < diff) - { - Unit* target = DoSelectLowestHpFriendly(99, 30000); - if (target) - { - if (target->IsWithinDistInMap(m_creature, 50)) - m_creature->CastSpell(target,SPELL_FLASH_HEAL, false); - else - { - // bugged - //m_creature->GetMotionMaster()->Clear(); - //m_creature->GetMotionMaster()->MoveChase(target, 20); - } - } - else - { - if (rand()%2) - { - if (target = DoSelectLowestHpFriendly(50, 0)) - m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false); - } - else if (target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false); - } - flashheal_timer = 2500; - }else flashheal_timer -= diff; - - /*if (dispelmagic_timer < diff) - { - if (rand()%2) - { - Unit* target = SelectTarget(); - - m_creature->CastSpell(target, SPELL_DISPEL_MAGIC, false); - } - else - m_creature->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 TRINITY_DLL_DECL 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 (m_creature->Attack(who, false)) - { - m_creature->GetMotionMaster()->MoveChase(who, 20); - m_creature->AddThreat(who, 0.0f); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (firebolt_timer < diff) - { - m_creature->CastSpell(m_creature->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 TRINITY_DLL_DECL 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) - { - m_creature->CastSpell(m_creature->getVictim(),SPELL_THUNDERCLAP, false); - thunderclap_timer = 12000; - }else thunderclap_timer -= diff; - - if (flamebreath_timer < diff) - { - m_creature->CastSpell(m_creature->getVictim(),SPELL_FLAME_BREATH, false); - flamebreath_timer = 12000; - }else flamebreath_timer -= diff; - - boss_hexlord_addAI::UpdateAI(diff); - } -}; - -#define SPELL_PSYCHIC_WAIL 43590 - -struct TRINITY_DLL_DECL 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) - { - m_creature->CastSpell(m_creature->getVictim(),SPELL_PSYCHIC_WAIL, false); - psychicwail_timer = 12000; - }else psychicwail_timer -= diff; - - boss_hexlord_addAI::UpdateAI(diff); - } -}; - -#define SPELL_VENOM_SPIT 43579 - -struct TRINITY_DLL_DECL 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 (m_creature->Attack(who, false)) - { - m_creature->GetMotionMaster()->MoveChase(who, 20); - m_creature->AddThreat(who, 0.0f); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (venomspit_timer < diff) - { - if (Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0)) - m_creature->CastSpell(victim,SPELL_VENOM_SPIT, false); - venomspit_timer = 2500; - }else venomspit_timer -= diff; - - boss_hexlord_addAI::UpdateAI(diff); - } -}; - -//Fenstalker -#define SPELL_VOLATILE_INFECTION 43586 - -struct TRINITY_DLL_DECL 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 - m_creature->getVictim()->CastSpell(m_creature->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 TRINITY_DLL_DECL 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) - { - m_creature->CastSpell(m_creature->getVictim(),SPELL_MIGHTY_BLOW, false); - mightyblow_timer = 12000; - } - if (coldstare_timer < diff) - { - if (Unit* victim = SelectUnit(SELECT_TARGET_RANDOM, 0)) - m_creature->CastSpell(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/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp deleted file mode 100644 index 46a6c0dac59..00000000000 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_janalai.cpp +++ /dev/null @@ -1,704 +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 "precompiled.h" -#include "def_zulaman.h" -#include "GridNotifiers.h" - -enum -{ - 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 TRINITY_DLL_DECL 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, m_creature); - - if (pInstance) - pInstance->SetData(DATA_JANALAIEVENT, DONE); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_JANALAIEVENT, IN_PROGRESS); - - DoScriptText(SAY_AGGRO, m_creature); -// DoZoneInCombat(); - } - - void DamageDeal(Unit* target, uint32 &damage) - { - if (isFlameBreathing) - { - if (!m_creature->HasInArc(M_PI/6, target)) - 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 = m_creature->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 = m_creature->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 =(rand()%(area_dx))-(area_dx/2); - dy =(rand()%(area_dy))-(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; - m_creature->GetPosition(x, y, z); - - { - CellPair pair(Trinity::ComputeCellPair(x, y)); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_EGG, 100); - Trinity::CreatureListSearcher searcher(m_creature, templist, check); - - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); - - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap())); - } - - //error_log("Eggs %d at middle", templist.size()); - if (!templist.size()) - return false; - - for(std::list::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; - m_creature->GetPosition(x, y, z); - - { - CellPair pair(Trinity::ComputeCellPair(x, y)); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - Trinity::AllCreaturesOfEntryInRange check(m_creature, MOB_FIRE_BOMB, 100); - Trinity::CreatureListSearcher searcher(m_creature, templist, check); - - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); - - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap())); - } - for(std::list::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((*m_creature), 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 = 20000+rand()%20000; - m_creature->RemoveAurasDueToSpell(SPELL_FIRE_BOMB_CHANNEL); - if (EnrageTimer <= 10000) - EnrageTimer = 0; - else - EnrageTimer -= 10000; - } - } - - void UpdateAI(const uint32 diff) - { - if (isFlameBreathing) - { - if (!m_creature->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 && m_creature->GetHealth() * 4 < m_creature->GetMaxHealth()) - EnrageTimer = 0; - - if (EnrageTimer < diff) - { - if (!enraged) - { - m_creature->CastSpell(m_creature, SPELL_ENRAGE, true); - enraged = true; - EnrageTimer = 300000; - } - else - { - DoScriptText(SAY_BERSERK, m_creature); - m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - EnrageTimer = 300000; - } - }else EnrageTimer -= diff; - - if (BombTimer < diff) - { - DoScriptText(SAY_FIRE_BOMBS, m_creature); - - m_creature->AttackStop(); - m_creature->GetMotionMaster()->Clear(); - DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]); - m_creature->StopMoving(); - m_creature->CastSpell(m_creature, SPELL_FIRE_BOMB_CHANNEL, false); - //DoTeleportPlayer(m_creature, JanalainPos[0][0], JanalainPos[0][1],JanalainPos[0][2], 0); - //m_creature->CastSpell(m_creature, SPELL_TELE_TO_CENTER, true); - - FireWall(); - SpawnBombs(); - isBombing = true; - BombSequenceTimer = 100; - - //Teleport every Player into the middle - Map* pMap = m_creature->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); - } - //m_creature->CastSpell(Temp, SPELL_SUMMON_PLAYERS, true); // core bug, spell does not work if too far - return; - }else BombTimer -= diff; - - if (!noeggs) - { - if (100 * m_creature->GetHealth() < 35 * m_creature->GetMaxHealth()) - { - DoScriptText(SAY_ALL_EGGS, m_creature); - - m_creature->AttackStop(); - m_creature->GetMotionMaster()->Clear(); - DoTeleportTo(JanalainPos[0][0],JanalainPos[0][1],JanalainPos[0][2]); - m_creature->StopMoving(); - m_creature->CastSpell(m_creature, SPELL_HATCH_ALL, false); - HatchAllEggs(2); - noeggs = true; - } - else if (HatcherTimer < diff) - { - if (HatchAllEggs(0)) - { - DoScriptText(SAY_SUMMON_HATCHER, m_creature); - m_creature->SummonCreature(MOB_AMANI_HATCHER,hatcherway[0][0][0],hatcherway[0][0][1],hatcherway[0][0][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,10000); - m_creature->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* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - m_creature->AttackStop(); - m_creature->GetMotionMaster()->Clear(); - m_creature->CastSpell(target, SPELL_FLAME_BREATH, false); - m_creature->StopMoving(); - isFlameBreathing = true; - } - FireBreathTimer = 8000; - }else FireBreathTimer -= diff; - } -}; - -CreatureAI* GetAI_boss_janalaiAI(Creature* pCreature) -{ - return new boss_janalaiAI(pCreature); -} - -struct TRINITY_DLL_DECL 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) - m_creature->CastSpell(m_creature, 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 TRINITY_DLL_DECL 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() - { - side =(m_creature->GetPositionY() < 1150); - waypoint = 0; - isHatching = false; - hasChangedSide = false; - WaitTimer = 1; - HatchNum = 0; - } - - bool HatchEggs(uint32 num) - { - std::list templist; - float x, y, z; - m_creature->GetPosition(x, y, z); - - { - CellPair pair(Trinity::ComputeCellPair(x, y)); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - Trinity::AllCreaturesOfEntryInRange check(m_creature, 23817, 50); - Trinity::CreatureListSearcher searcher(m_creature, templist, check); - - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); - - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap())); - } - - //error_log("Eggs %d at %d", templist.size(), side); - - for(std::list::iterator i = templist.begin(); i != templist.end() && num > 0; ++i) - { - if ((*i)->GetDisplayId() != 11686) - { - (*i)->CastSpell(*i, SPELL_HATCH_EGG, false); - num--; - } - } - - if (num) - return false; // no more templist - else - return true; - } - - 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)) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->setDeathState(JUST_DIED); - return; - } - - if (!isHatching) - { - if (WaitTimer) - { - m_creature->GetMotionMaster()->Clear(); - m_creature->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 - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->setDeathState(JUST_DIED); - } - }else WaitTimer -= diff; - } - } -}; - -CreatureAI* GetAI_mob_amanishi_hatcherAI(Creature* pCreature) -{ - return new mob_amanishi_hatcherAI(pCreature); -} - -struct TRINITY_DLL_DECL mob_hatchlingAI : public ScriptedAI -{ - mob_hatchlingAI(Creature *c) : ScriptedAI(c) - { - pInstance =c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - uint32 BuffetTimer; - - void Reset() - { - BuffetTimer = 7000; - if (m_creature->GetPositionY() > 1150) - m_creature->GetMotionMaster()->MovePoint(0, hatcherway[0][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[0][3][2]); - else - m_creature->GetMotionMaster()->MovePoint(0,hatcherway[1][3][0]+rand()%4-2,1150+rand()%4-2,hatcherway[1][3][2]); - - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - } - - void EnterCombat(Unit *who) {/*DoZoneInCombat();*/} - - void UpdateAI(const uint32 diff) - { - if (!pInstance || !(pInstance->GetData(DATA_JANALAIEVENT) == IN_PROGRESS)) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->setDeathState(JUST_DIED); - return; - } - - if (!UpdateVictim()) - return; - - if (BuffetTimer < diff) - { - m_creature->CastSpell(m_creature->getVictim(), SPELL_FLAMEBUFFET, false); - BuffetTimer = 10000; - }else BuffetTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_hatchlingAI(Creature* pCreature) -{ - return new mob_hatchlingAI(pCreature); -} - -struct TRINITY_DLL_DECL 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); - m_creature->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/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp deleted file mode 100644 index 817e652706e..00000000000 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_nalorakk.cpp +++ /dev/null @@ -1,453 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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) - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - inMove = false; - waitTimer = 0; - m_creature->SetSpeed(MOVE_RUN,2); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - }else - { - (*m_creature).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; - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); - } - - void SendAttacker(Unit* target) - { - std::list templist; - float x, y, z; - m_creature->GetPosition(x, y, z); - - { - CellPair pair(Trinity::ComputeCellPair(x, y)); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - Trinity::AllFriendlyCreaturesInGrid check(m_creature); - Trinity::CreatureListSearcher searcher(m_creature, templist, check); - - TypeContainerVisitor, GridTypeMapContainer> cSearcher(searcher); - - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, cSearcher, *(m_creature->GetMap())); - } - - if (!templist.size()) - return; - - for(std::list::iterator i = templist.begin(); i != templist.end(); ++i) - { - if ((*i) && m_creature->IsWithinDistInMap((*i),25)) - { - (*i)->SetNoCallAssistance(true); - (*i)->AI()->AttackStart(target); - } - } - } - - void AttackStart(Unit* who) - { - if (!MoveEvent) - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit *who) - { - if (!MoveEvent) - { - ScriptedAI::MoveInLineOfSight(who); - } - else - { - if (m_creature->IsHostileTo(who)) - { - if (!inMove) - { - switch(MovePhase) - { - case 0: - if (m_creature->IsWithinDistInMap(who, 50)) - { - m_creature->MonsterYell(YELL_NALORAKK_WAVE1, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE1); - - (*m_creature).GetMotionMaster()->MovePoint(1,NalorakkWay[1][0],NalorakkWay[1][1],NalorakkWay[1][2]); - MovePhase ++; - inMove = true; - - SendAttacker(who); - } - break; - case 2: - if (m_creature->IsWithinDistInMap(who, 40)) - { - m_creature->MonsterYell(YELL_NALORAKK_WAVE2, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE2); - - (*m_creature).GetMotionMaster()->MovePoint(3,NalorakkWay[3][0],NalorakkWay[3][1],NalorakkWay[3][2]); - MovePhase ++; - inMove = true; - - SendAttacker(who); - } - break; - case 5: - if (m_creature->IsWithinDistInMap(who, 40)) - { - m_creature->MonsterYell(YELL_NALORAKK_WAVE3, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE3); - - (*m_creature).GetMotionMaster()->MovePoint(6,NalorakkWay[6][0],NalorakkWay[6][1],NalorakkWay[6][2]); - MovePhase ++; - inMove = true; - - SendAttacker(who); - } - break; - case 7: - if (m_creature->IsWithinDistInMap(who, 50)) - { - SendAttacker(who); - - m_creature->MonsterYell(YELL_NALORAKK_WAVE4, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_NALORAKK_WAVE4); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - MoveEvent = false; - } - break; - } - } - } - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_NALORAKKEVENT, IN_PROGRESS); - - m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_AGGRO); - DoZoneInCombat(); - } - - void JustDied(Unit* Killer) - { - if (pInstance) - pInstance->SetData(DATA_NALORAKKEVENT, DONE); - - m_creature->MonsterYell(YELL_DEATH,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_DEATH); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: - m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_KILL_ONE); - break; - case 1: - m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, 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: - m_creature->SetOrientation(3.1415*2); - inMove = false; - return; - case 1: - case 3: - case 4: - case 6: - MovePhase ++; - waitTimer = 1; - inMove = true; - return; - case 5: - m_creature->SetOrientation(3.1415*0.5); - inMove = false; - return; - case 7: - m_creature->SetOrientation(3.1415*0.5); - inMove = false; - return; - } - - } - } - - void UpdateAI(const uint32 diff) - { - if (waitTimer) - { - if (inMove) - if (waitTimer < diff) - { - (*m_creature).GetMotionMaster()->MovementExpired(); - (*m_creature).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(m_creature, SPELL_BERSERK, true); - m_creature->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_BERSERK); - Berserk_Timer = 600000; - }else Berserk_Timer -= diff; - - if (ShapeShift_Timer < diff) - { - if (inBearForm) - { - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 5122); - m_creature->MonsterYell(YELL_SHIFTEDTOTROLL, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_TOTROLL); - m_creature->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 - { - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 1, 0); - m_creature->MonsterYell(YELL_SHIFTEDTOBEAR, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_TOBEAR); - DoCast(m_creature, 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(m_creature->getVictim(), SPELL_BRUTALSWIPE); - BrutalSwipe_Timer = 7000 + rand()%5000; - }else BrutalSwipe_Timer -= diff; - - if (Mangle_Timer < diff) - { - if (m_creature->getVictim() && !m_creature->getVictim()->HasAura(SPELL_MANGLEEFFECT)) - { - DoCast(m_creature->getVictim(), SPELL_MANGLE); - Mangle_Timer = 1000; - } - else Mangle_Timer = 10000 + rand()%5000; - }else Mangle_Timer -= diff; - - if (Surge_Timer < diff) - { - m_creature->MonsterYell(YELL_SURGE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_YELL_SURGE); - Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 1, 45, true); - if (target) - DoCast(target, SPELL_SURGE); - Surge_Timer = 15000 + rand()%5000; - }else Surge_Timer -= diff; - } - else - { - if (LaceratingSlash_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_LACERATINGSLASH); - LaceratingSlash_Timer = 18000 + rand()%5000; - }else LaceratingSlash_Timer -= diff; - - if (RendFlesh_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_RENDFLESH); - RendFlesh_Timer = 5000 + rand()%5000; - }else RendFlesh_Timer -= diff; - - if (DeafeningRoar_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp b/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp deleted file mode 100644 index a0c2bec4428..00000000000 --- a/src/bindings/scripts/scripts/zone/zulaman/boss_zuljin.cpp +++ /dev/null @@ -1,624 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL boss_zuljinAI : public ScriptedAI -{ - boss_zuljinAI(Creature *c) : ScriptedAI(c), Summons(m_creature) - { - 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 = m_creature->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(); - - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 47174); - //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, 218172674); - //m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_ZULJINEVENT, IN_PROGRESS); - - DoZoneInCombat(); - - m_creature->MonsterYell(YELL_INTRO,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature, SOUND_INTRO); - SpawnAdds(); - EnterPhase(0); - } - - void KilledUnit(Unit* victim) - { - if (Intro_Timer) - return; - - switch(rand()%2) - { - case 0: - m_creature->MonsterYell(YELL_KILL_ONE, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_KILL_ONE); - break; - case 1: - m_creature->MonsterYell(YELL_KILL_TWO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_KILL_TWO); - break; - } - } - - void JustDied(Unit* Killer) - { - if (pInstance) - pInstance->SetData(DATA_ZULJINEVENT, DONE); - - m_creature->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_DEATH); - Summons.DespawnEntry(CREATURE_COLUMN_OF_FIRE); - - if (Unit *Temp = Unit::GetUnit(*m_creature, 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 (!m_creature->IsNonMeleeSpellCasted(false)) - { - if (m_creature->isAttackReady() && m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - if (Phase == 1 && !Overpower_Timer) - { - uint32 health = m_creature->getVictim()->GetHealth(); - m_creature->AttackerStateUpdate(m_creature->getVictim()); - if (m_creature->getVictim() && health == m_creature->getVictim()->GetHealth()) - { - m_creature->CastSpell(m_creature->getVictim(), SPELL_OVERPOWER, false); - Overpower_Timer = 5000; - } - }else m_creature->AttackerStateUpdate(m_creature->getVictim()); - m_creature->resetAttackTimer(); - } - } - } - - void SpawnAdds() - { - Creature *pCreature = NULL; - for(uint8 i = 0; i < 4; ++i) - { - pCreature = m_creature->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(*m_creature, 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(); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); - m_creature->RemoveAurasDueToSpell(Transform[Phase].unaura); - DoCast(m_creature, Transform[Phase].spell); - m_creature->MonsterYell(Transform[Phase].text, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, Transform[Phase].sound); - if (Phase > 0) - { - if (Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[Phase - 1])) - Temp->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); - } - if (Unit *Temp = Unit::GetUnit(*m_creature, SpiritGUID[NextPhase - 1])) - Temp->CastSpell(m_creature, SPELL_SIPHON_SOUL, false); // should m cast on temp - if (NextPhase == 2) - { - m_creature->GetMotionMaster()->Clear(); - m_creature->CastSpell(m_creature, 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 - m_creature->AI()->AttackStart(m_creature->getVictim()); - if (NextPhase == 3) - { - m_creature->RemoveAurasDueToSpell(SPELL_ENERGY_STORM); - Summons.DespawnEntry(CREATURE_FEATHER_VORTEX); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - break; - default: - break; - } - Phase = NextPhase; - } - - void UpdateAI(const uint32 diff) - { - if (!TankGUID) - { - if (!UpdateVictim()) - return; - - if (m_creature->GetHealth() < health_20 * (4 - Phase)) - EnterPhase(Phase + 1); - } - - if (Berserk_Timer < diff) - { - m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - m_creature->MonsterYell(YELL_BERSERK, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_BERSERK); - Berserk_Timer = 60000; - }else Berserk_Timer -= diff; - - switch (Phase) - { - case 0: - if (Intro_Timer) - { - if (Intro_Timer <= diff) - { - m_creature->MonsterYell(YELL_AGGRO, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_AGGRO); - Intro_Timer = 0; - }else Intro_Timer -= diff; - } - - if (Whirlwind_Timer < diff) - { - DoCast(m_creature, SPELL_WHIRLWIND); - Whirlwind_Timer = 15000 + rand()%5000; - }else Whirlwind_Timer -= diff; - - if (Grievous_Throw_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - m_creature->CastSpell(target, SPELL_GRIEVOUS_THROW, false); - Grievous_Throw_Timer = 10000; - }else Grievous_Throw_Timer -= diff; - break; - - case 1: - if (Creeping_Paralysis_Timer < diff) - { - DoCast(m_creature, 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* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - TankGUID = m_creature->getVictim()->GetGUID(); - m_creature->SetSpeed(MOVE_RUN, 5.0f); - AttackStart(target); // 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* target = m_creature->getVictim(); - if (!target || !target->isTargetableForAttack()) target = Unit::GetUnit(*m_creature, TankGUID); - if (!target || !target->isTargetableForAttack()) target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - { - AttackStart(target); - if (m_creature->IsWithinMeleeRange(target)) - { - m_creature->CastSpell(target, SPELL_CLAW_RAGE_DAMAGE, true); - Claw_Counter++; - if (Claw_Counter == 12) - { - Claw_Rage_Timer = 15000 + rand()%5000; - m_creature->SetSpeed(MOVE_RUN, 1.2f); - AttackStart(Unit::GetUnit(*m_creature, TankGUID)); - TankGUID = 0; - return; - } - else - Claw_Loop_Timer = 500; - } - } - else - { - EnterEvadeMode(); // if (target) - return; - } - }else Claw_Loop_Timer -= diff; - } //if (TankGUID) - }else Claw_Rage_Timer -= diff; - - if (Lynx_Rush_Timer <= diff) - { - if (!TankGUID) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - TankGUID = m_creature->getVictim()->GetGUID(); - m_creature->SetSpeed(MOVE_RUN, 5.0f); - AttackStart(target); // change victim - Lynx_Rush_Timer = 0; - Claw_Counter = 0; - } - } - else if (!Lynx_Rush_Timer) - { - Unit* target = m_creature->getVictim(); - if (!target || !target->isTargetableForAttack()) - { - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - AttackStart(target); - } - if (target) - { - if (m_creature->IsWithinMeleeRange(target)) - { - m_creature->CastSpell(target, SPELL_LYNX_RUSH_DAMAGE, true); - Claw_Counter++; - if (Claw_Counter == 9) - { - Lynx_Rush_Timer = 15000 + rand()%5000; - m_creature->SetSpeed(MOVE_RUN, 1.2f); - AttackStart(Unit::GetUnit(*m_creature, TankGUID)); - TankGUID = 0; - } - else - AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - else - { - EnterEvadeMode(); // if (target) - return; - } - } //if (TankGUID) - }else Lynx_Rush_Timer -= diff; - - break; - case 4: - if (Flame_Whirl_Timer < diff) - { - DoCast(m_creature, SPELL_FLAME_WHIRL); - Flame_Whirl_Timer = 12000; - }Flame_Whirl_Timer -= diff; - - if (Pillar_Of_Fire_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_SUMMON_PILLAR); - Pillar_Of_Fire_Timer = 10000; - }else Pillar_Of_Fire_Timer -= diff; - - if (Flame_Breath_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - m_creature->SetInFront(target); - DoCast(m_creature, 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 TRINITY_DLL_DECL feather_vortexAI : public ScriptedAI -{ - feather_vortexAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - - void EnterCombat(Unit* target) {} - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_ZAP_INFORM) - m_creature->CastSpell(caster, SPELL_ZAP_DAMAGE, true); - } - - void UpdateAI(const uint32 diff) - { - //if the vortex reach the target, it change his target to another player - if (m_creature->IsWithinMeleeRange(m_creature->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/bindings/scripts/scripts/zone/zulaman/def_zulaman.h b/src/bindings/scripts/scripts/zone/zulaman/def_zulaman.h deleted file mode 100644 index 6fb0ef173bd..00000000000 --- a/src/bindings/scripts/scripts/zone/zulaman/def_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/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp b/src/bindings/scripts/scripts/zone/zulaman/instance_zulaman.cpp deleted file mode 100644 index 74186442d9e..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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; - - uint64 HexLordGateGUID = 0; - uint64 ZulJinGateGUID = 0; - uint64 AkilzonDoorGUID = 0; - uint64 HalazziDoorGUID = 0; - uint64 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/bindings/scripts/scripts/zone/zulaman/zulaman.cpp b/src/bindings/scripts/scripts/zone/zulaman/zulaman.cpp deleted file mode 100644 index 86cb3196ab7..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_zulaman.h" - -/*###### -## npc_forest_frog -######*/ - -#define SPELL_REMOVE_AMANI_CURSE 43732 -#define SPELL_PUSH_MOJO 43923 -#define ENTRY_FOREST_FROG 24396 - -struct TRINITY_DLL_DECL 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()%11) - { - case 0: cEntry = 24024; break; //Kraz - case 1: cEntry = 24397; break; //Mannuth - case 2: cEntry = 24403; break; //Deez - case 3: cEntry = 24404; break; //Galathryn - case 4: cEntry = 24405; break; //Adarrah - case 5: cEntry = 24406; break; //Fudgerick - case 6: cEntry = 24407; break; //Darwen - case 7: cEntry = 24445; break; //Mitzi - case 8: cEntry = 24448; break; //Christian - case 9: cEntry = 24453; break; //Brennan - case 10: 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) m_creature->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 && m_creature->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 TRINITY_DLL_DECL 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(m_creature->GetGUID(), LOOT_CORPSE); - } - void UpdateAI(const uint32 diff) - { - if (IsLoot) m_creature->CastSpell(m_creature, 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(pCreature->GetNpcTextId(), 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/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp deleted file mode 100644 index 3358255e0bc..00000000000 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_arlokk.cpp +++ /dev/null @@ -1,274 +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 "precompiled.h" -#include "def_zulgurub.h" - -bool GOHello_go_gong_of_bethekk(Player* pPlayer, GameObject* pGo) -{ - if (ScriptedInstance* m_pInstance = (ScriptedInstance*)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 false; -} - -enum -{ - 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 TRINITY_DLL_DECL 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; - - 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; - - m_pMarkedTarget = NULL; - - m_creature->SetDisplayId(MODEL_ID_NORMAL); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit* pWho) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_ARLOKK, NOT_STARTED); - - //we should be summoned, so despawn - m_creature->ForcedDespawn(); - } - - void JustDied(Unit* pKiller) - { - DoScriptText(SAY_DEATH, m_creature); - - m_creature->SetDisplayId(MODEL_ID_NORMAL); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - if (m_pInstance) - m_pInstance->SetData(TYPE_ARLOKK, DONE); - } - - void DoSummonPhanters() - { - if (m_pMarkedTarget) - DoScriptText(SAY_FEAST_PANTHER, m_creature, m_pMarkedTarget); - - m_creature->SummonCreature(NPC_ZULIAN_PROWLER, -11532.7998, -1649.6734, 41.4800, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - m_creature->SummonCreature(NPC_ZULIAN_PROWLER, -11532.9970, -1606.4840, 41.2979, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - } - - void JustSummoned(Creature* pSummoned) - { - if (m_pMarkedTarget) - pSummoned->AI()->AttackStart(m_pMarkedTarget); - - ++m_uiSummonCount; - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - if (!m_bIsPhaseTwo) - { - if (m_uiShadowWordPain_Timer < uiDiff) - { - DoCast(m_creature->getVictim(),SPELL_SHADOWWORDPAIN); - m_uiShadowWordPain_Timer = 15000; - } - else - m_uiShadowWordPain_Timer -= uiDiff; - - if (m_uiMark_Timer < uiDiff) - { - m_pMarkedTarget = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (m_pMarkedTarget) - DoCast(m_pMarkedTarget, SPELL_MARK); - else - error_log("TSCR: boss_arlokk could not accuire m_pMarkedTarget."); - - m_uiMark_Timer = 15000; - } - else - m_uiMark_Timer -= uiDiff; - } - else - { - //Cleave_Timer - if (m_uiCleave_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_CLEAVE); - m_uiCleave_Timer = 16000; - } - else - m_uiCleave_Timer -= uiDiff; - - //Gouge_Timer - if (m_uiGouge_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_GOUGE); - - if (m_creature->getThreatManager().getThreat(m_creature->getVictim())) - m_creature->getThreatManager().modifyThreatPercent(m_creature->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 - m_creature->SetDisplayId(MODEL_ID_BLANK); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - m_creature->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 - m_creature->SetDisplayId(MODEL_ID_PANTHER); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); - m_creature->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/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_gahzranka.cpp deleted file mode 100644 index ab2b4c81704..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" - -#define SPELL_FROSTBREATH 16099 -#define SPELL_MASSIVEGEYSER 22421 //Not working. Cause its a summon... -#define SPELL_SLAM 24326 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_FROSTBREATH); - Frostbreath_Timer = 7000 + rand()%4000; - }else Frostbreath_Timer -= diff; - - //MassiveGeyser_Timer - if (MassiveGeyser_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MASSIVEGEYSER); - DoResetThreat(); - - MassiveGeyser_Timer = 22000 + rand()%10000; - }else MassiveGeyser_Timer -= diff; - - //Slam_Timer - if (Slam_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_grilek.cpp deleted file mode 100644 index 696bcded32d..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_zulgurub.h" - -#define SPELL_AVARTAR 24646 //The Enrage Spell -#define SPELL_GROUNDTREMOR 6524 - -struct TRINITY_DLL_DECL 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(m_creature, SPELL_AVARTAR); - Unit* target = NULL; - - target = SelectUnit(SELECT_TARGET_RANDOM,1); - - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-50); - if (target) - AttackStart(target); - - Avartar_Timer = 25000 + rand()%10000; - }else Avartar_Timer -= diff; - - //GroundTremor_Timer - if (GroundTremor_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_hakkar.cpp deleted file mode 100644 index 2fb48ae3a5d..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //BloodSiphon_Timer - if (BloodSiphon_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_BLOODSIPHON); - BloodSiphon_Timer = 90000; - }else BloodSiphon_Timer -= diff; - - //CorruptedBlood_Timer - if (CorruptedBlood_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CORRUPTEDBLOOD); - CorruptedBlood_Timer = 30000 + rand()%15000; - }else CorruptedBlood_Timer -= diff; - - //CauseInsanity_Timer - /*if (CauseInsanity_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_CAUSEINSANITY); - - CauseInsanity_Timer = 35000 + rand()%8000; - }else CauseInsanity_Timer -= diff;*/ - - //WillOfHakkar_Timer - if (WillOfHakkar_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_WILLOFHAKKAR); - - WillOfHakkar_Timer = 25000 + rand()%10000; - }else WillOfHakkar_Timer -= diff; - - if (!Enraged && Enrage_Timer < diff) - { - DoCast(m_creature, 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(m_creature->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(m_creature->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(m_creature->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(m_creature,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(m_creature,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/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.cpp deleted file mode 100644 index 05ab262c21c..00000000000 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_hazzarah.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_Hazzarah -SD%Complete: 100 -SDComment: -SDCategory: Zul'Gurub -EndScriptData */ - -#include "precompiled.h" -#include "def_zulgurub.h" - -#define SPELL_MANABURN 26046 -#define SPELL_SLEEP 24664 - -struct TRINITY_DLL_DECL boss_hazzarahAI : public ScriptedAI -{ - boss_hazzarahAI(Creature *c) : ScriptedAI(c) {} - - uint32 ManaBurn_Timer; - uint32 Sleep_Timer; - uint32 Illusions_Timer; - Creature* Illusion; - - 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(m_creature->getVictim(),SPELL_MANABURN); - ManaBurn_Timer = 8000 + rand()%8000; - }else ManaBurn_Timer -= diff; - - //Sleep_Timer - if (Sleep_Timer < diff) - { - DoCast(m_creature->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* target = NULL; - for(uint8 i = 0; i < 3; ++i) - { - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (!target) - return; - - Illusion = m_creature->SummonCreature(15163,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,30000); - if (Illusion) - (Illusion->AI())->AttackStart(target); - } - - 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/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_jeklik.cpp deleted file mode 100644 index 5b295f35623..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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, m_creature); - DoCast(m_creature,SPELL_BAT_FORM); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_JEKLIK, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (m_creature->getVictim() && m_creature->isAlive()) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 50)) - { - if (Charge_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoCast(target,SPELL_CHARGE); - AttackStart(target); - } - - Charge_Timer = 15000 + rand()%15000; - }else Charge_Timer -= diff; - - if (SonicBurst_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SONICBURST); - SonicBurst_Timer = 8000 + rand()%5000; - }else SonicBurst_Timer -= diff; - - if (Screech_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SCREECH); - Screech_Timer = 18000 + rand()%8000; - }else Screech_Timer -= diff; - - if (SpawnBats_Timer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - - Creature* Bat = NULL; - Bat = m_creature->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - Bat = m_creature->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - Bat = m_creature->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - Bat = m_creature->SummonCreature(11368,-12291.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - Bat = m_creature->SummonCreature(11368,-12289.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - Bat = m_creature->SummonCreature(11368,-12293.6220,-1380.2640,144.8304,5.483, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (target && Bat) Bat ->AI()->AttackStart(target); - - SpawnBats_Timer = 60000; - }else SpawnBats_Timer -= diff; - } - else - { - if (PhaseTwo) - { - if (PhaseTwo && ShadowWordPain_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoCast(target, SPELL_SHADOW_WORD_PAIN); - ShadowWordPain_Timer = 12000 + rand()%6000; - } - }ShadowWordPain_Timer -=diff; - - if (MindFlay_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_MIND_FLAY); - MindFlay_Timer = 16000; - }MindFlay_Timer -=diff; - - if (ChainMindFlay_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature->getVictim(), SPELL_CHAIN_MIND_FLAY); - ChainMindFlay_Timer = 15000 + rand()%15000; - }ChainMindFlay_Timer -=diff; - - if (GreaterHeal_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_GREATERHEAL); - GreaterHeal_Timer = 25000 + rand()%10000; - }GreaterHeal_Timer -=diff; - - if (SpawnFlyingBats_Timer < diff) - { - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (!target) - return; - - Creature* FlyingBat = m_creature->SummonCreature(14965, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()+15, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (FlyingBat) - FlyingBat->AI()->AttackStart(target); - - SpawnFlyingBats_Timer = 10000 + rand()%5000; - }else SpawnFlyingBats_Timer -=diff; - } - else - { - m_creature->SetDisplayId(15219); - DoResetThreat(); - PhaseTwo = true; - } - } - - DoMeleeAttackIfReady(); - } - } -}; - -//Flying Bat -struct TRINITY_DLL_DECL 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; - - m_creature->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 *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, 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) - { - m_creature->setDeathState(JUST_DIED); - m_creature->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/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp deleted file mode 100644 index e1c5e0ea7c5..00000000000 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_jindo.cpp +++ /dev/null @@ -1,275 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL boss_jindoAI : public ScriptedAI -{ - boss_jindoAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - 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, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //BrainWashTotem_Timer - if (BrainWashTotem_Timer < diff) - { - DoCast(m_creature, SPELL_BRAINWASHTOTEM); - BrainWashTotem_Timer = 18000 + rand()%8000; - }else BrainWashTotem_Timer -= diff; - - //HealingWard_Timer - if (HealingWard_Timer < diff) - { - //DoCast(m_creature, SPELL_POWERFULLHEALINGWARD); - m_creature->SummonCreature(14987, m_creature->GetPositionX()+3, m_creature->GetPositionY()-2, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,30000); - HealingWard_Timer = 14000 + rand()%6000; - }else HealingWard_Timer -= diff; - - //Hex_Timer - if (Hex_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_HEX); - - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->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* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoCast(target, SPELL_DELUSIONSOFJINDO); - - Creature *Shade = m_creature->SummonCreature(14986, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Shade) - Shade->AI()->AttackStart(target); - } - - 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* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target && target->GetTypeId() == TYPEID_PLAYER) - { - DoTeleportPlayer(target, -11583.7783,-1249.4278,77.5471,4.745); - - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(target,-100); - - Creature *Skeletons; - Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-2, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()-4, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-2, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()+4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = m_creature->SummonCreature(14826, target->GetPositionX(), target->GetPositionY()-4, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - Skeletons = m_creature->SummonCreature(14826, target->GetPositionX()+3, target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Skeletons) - Skeletons->AI()->AttackStart(target); - } - - Teleport_Timer = 15000 + rand()%8000; - }else Teleport_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Healing Ward -struct TRINITY_DLL_DECL 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((*m_creature), pInstance->GetData64(DATA_JINDO)); - if (pJindo) - DoCast(pJindo, SPELL_HEAL); - } - Heal_Timer = 3000; - }else Heal_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Shade of Jindo -struct TRINITY_DLL_DECL mob_shade_of_jindoAI : public ScriptedAI -{ - mob_shade_of_jindoAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 ShadowShock_Timer; - - ScriptedInstance *pInstance; - - void Reset() - { - ShadowShock_Timer = 1000; - m_creature->CastSpell(m_creature, SPELL_INVISIBLE,true); - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI (const uint32 diff) - { - - //ShadowShock_Timer - if (ShadowShock_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_mandokir.cpp deleted file mode 100644 index 892e1cdf8b4..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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(m_creature, 23243); - } - - void KilledUnit(Unit* victim) - { - if (victim->GetTypeId() == TYPEID_PLAYER) - { - ++KillCount; - - if (KillCount == 3) - { - DoScriptText(SAY_DING_KILL, m_creature); - - if (m_pInstance) - { - uint64 JindoGUID = m_pInstance->GetData64(DATA_JINDO); - if (JindoGUID) - { - if (Unit* jTemp = Unit::GetUnit(*m_creature,JindoGUID)) - { - if (jTemp->isAlive()) - DoScriptText(SAY_GRATS_JINDO, jTemp); - } - } - } - DoCast(m_creature, SPELL_LEVEL_UP, true); - KillCount = 0; - } - } - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (m_creature->getVictim() && m_creature->isAlive()) - { - if (!CombatStart) - { - //At combat Start Mandokir is mounted so we must unmount it first - m_creature->Unmount(); - - //And summon his raptor - m_creature->SummonCreature(14988, m_creature->getVictim()->GetPositionX(), m_creature->getVictim()->GetPositionY(), m_creature->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(*m_creature, WatchTarget); - - if (pUnit && ( - targetX != pUnit->GetPositionX() || - targetY != pUnit->GetPositionY() || - targetZ != pUnit->GetPositionZ() || - pUnit->isInCombat())) - { - if (m_creature->IsWithinMeleeRange(pUnit)) - { - DoCast(pUnit,24316); - } - else - { - DoCast(pUnit,SPELL_CHARGE); - //m_creature->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, m_creature, 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(*m_creature, WatchTarget); - if (pUnit) - { - targetX = pUnit->GetPositionX(); - targetY = pUnit->GetPositionY(); - targetZ = pUnit->GetPositionZ(); - } - endWatch = false; - } - - if (!someWatched) - { - //Cleave - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 7000; - }else Cleave_Timer -= diff; - - //Whirlwind - if (Whirlwind_Timer < diff) - { - DoCast(m_creature,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::iterator i = m_creature->getThreatManager().getThreatList().begin(); - for(; i != m_creature->getThreatManager().getThreatList().end(); ++i) - { - Unit* pUnit = Unit::GetUnit(*m_creature, (*i)->getUnitGuid()); - if (pUnit && m_creature->IsWithinMeleeRange(pUnit)) - TargetInRange++; - } - - if (TargetInRange > 3) - DoCast(m_creature->getVictim(),SPELL_FEAR); - - Fear_Timer = 4000; - }else Fear_Timer -=diff; - - //Mortal Strike if target below 50% hp - if (m_creature->getVictim() && m_creature->getVictim()->GetHealth() < m_creature->getVictim()->GetMaxHealth()*0.5) - { - if (MortalStrike_Timer < diff) - { - DoCast(m_creature->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(m_creature, SPELL_ENRAGE); - RaptorDead = true; - } - } - } - - Check_Timer = 1000; - }else Check_Timer -= diff; - - DoMeleeAttackIfReady(); - } - } -}; - -//Ohgan -struct TRINITY_DLL_DECL 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(m_creature->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/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_marli.cpp deleted file mode 100644 index 595716f1487..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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; - - Creature *Spider; - 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, m_creature); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - if (m_pInstance) - m_pInstance->SetData(TYPE_MARLI, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (m_creature->getVictim() && m_creature->isAlive()) - { - if (PoisonVolley_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_POISONVOLLEY); - PoisonVolley_Timer = 10000 + rand()%10000; - }else PoisonVolley_Timer -= diff; - - if (!PhaseTwo && Aspect_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ASPECT_OF_MARLI); - Aspect_Timer = 13000 + rand()%5000; - }else Aspect_Timer -= diff; - - if (!Spawned && SpawnStartSpiders_Timer < diff) - { - DoScriptText(SAY_SPIDER_SPAWN, m_creature); - - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (!target) - return; - - Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - - Spawned = true; - }else SpawnStartSpiders_Timer -= diff; - - if (SpawnSpider_Timer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (!target) - return; - - Spider = m_creature->SummonCreature(15041,target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Spider) - Spider->AI()->AttackStart(target); - SpawnSpider_Timer = 12000 + rand()%5000; - }else SpawnSpider_Timer -= diff; - - if (!PhaseTwo && Transform_Timer < diff) - { - DoScriptText(SAY_TRANSFORM, m_creature); - DoCast(m_creature,SPELL_SPIDER_FORM); - const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 35))); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 35))); - m_creature->UpdateDamagePhysical(BASE_ATTACK); - DoCast(m_creature->getVictim(),SPELL_ENVOLWINGWEB); - - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-100); - - PhaseTwo = true; - Transform_Timer = 35000 + rand()%25000; - }else Transform_Timer -= diff; - - if (PhaseTwo) - { - if (Charge_Timer < diff) - { - Unit* target = NULL; - int i = 0 ; - while (i < 3) // max 3 tries to get a random target with power_mana - { - ++i; //not aggro leader - target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target) - if (target->getPowerType() == POWER_MANA) - i=3; - } - if (target) - { - DoCast(target, SPELL_CHARGE); - //m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); - //m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); - AttackStart(target); - } - - Charge_Timer = 8000; - }else Charge_Timer -= diff; - - if (TransformBack_Timer < diff) - { - m_creature->SetDisplayId(15220); - const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 1))); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 1))); - m_creature->UpdateDamagePhysical(BASE_ATTACK); - - PhaseTwo = false; - TransformBack_Timer = 25000 + rand()%15000; - }else TransformBack_Timer -= diff; - - } - - DoMeleeAttackIfReady(); - } - } -}; - -//Spawn of Marli -struct TRINITY_DLL_DECL 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(m_creature,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/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_renataki.cpp deleted file mode 100644 index 608897ad18d..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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) - { - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); - m_creature->SetDisplayId(11686); - - m_creature->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* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - { - DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); - DoCast(target,SPELL_AMBUSH); - } - - Ambushed = true; - Ambush_Timer = 3000; - }else Ambush_Timer -= diff; - } - - if (Ambushed) - { - if (Visible_Timer < diff) - { - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL); - - m_creature->SetDisplayId(15268); - SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_NO_CHANGE, EQUIP_NO_CHANGE); - - m_creature->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* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,1); - - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-50); - - if (target) - AttackStart(target); - - Aggro_Timer = 7000 + rand()%13000; - }else Aggro_Timer -= diff; - - if (!Invisible) - if (ThousandBlades_Timer < diff) - { - DoCast(m_creature->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/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_thekal.cpp deleted file mode 100644 index 4c40702b691..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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, m_creature); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - 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((*m_creature), 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((*m_creature), 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(m_creature->getVictim(),SPELL_MORTALCLEAVE); - MortalCleave_Timer = 15000 + rand()%5000; - }else MortalCleave_Timer -= diff; - - if (!PhaseTwo && Silence_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SILENCE); - Silence_Timer = 20000 + rand()%5000; - }else Silence_Timer -= diff; - - if (!PhaseTwo && !WasDead && m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05) - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); - m_creature->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(m_creature,SPELL_TIGER_FORM); - m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetHealth(int(m_creature->GetMaxHealth()*1.0)); - const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 40))); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 40))); - m_creature->UpdateDamagePhysical(BASE_ATTACK); - DoResetThreat(); - PhaseTwo = true; - }else Resurrect_Timer -= diff; - } - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() == 100) && WasDead) - { - WasDead = false; - } - - if (PhaseTwo) - { - if (Charge_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoCast(target,SPELL_CHARGE); - DoResetThreat(); - AttackStart(target); - } - - Charge_Timer = 15000 + rand()%7000; - }else Charge_Timer -= diff; - - if (Frenzy_Timer < diff) - { - DoCast(m_creature,SPELL_FRENZY); - Frenzy_Timer = 30000; - }else Frenzy_Timer -= diff; - - if (ForcePunch_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SILENCE); - ForcePunch_Timer = 16000 + rand()%5000; - }else ForcePunch_Timer -= diff; - - if (SummonTigers_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SUMMONTIGERS); - SummonTigers_Timer = 10000 + rand()%4000; - }else SummonTigers_Timer -= diff; - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11) && !Enraged) - { - DoCast(m_creature, SPELL_ENRAGE); - Enraged = true; - } - } - - DoMeleeAttackIfReady(); - - } -}; - -//Zealot Lor'Khan -struct TRINITY_DLL_DECL 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); - - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - m_creature->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(m_creature,SPELL_SHIELD); - Shield_Timer = 61000; - }else Shield_Timer -= diff; - - //BloodLust_Timer - if (BloodLust_Timer < diff) - { - DoCast(m_creature,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((*m_creature), m_pInstance->GetData64(DATA_THEKAL)); - Unit *pZath = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_ZATH)); - - if (!pThekal || !pZath) - return; - - switch(rand()%2) - { - case 0: - if (m_creature->IsWithinMeleeRange(pThekal)) - DoCast(pThekal, SPELL_GREATERHEAL); - break; - case 1: - if (m_creature->IsWithinMeleeRange(pZath)) - DoCast(pZath, SPELL_GREATERHEAL); - break; - } - } - - GreaterHeal_Timer = 15000+rand()%5000; - }else GreaterHeal_Timer -= diff; - - //Disarm_Timer - if (Disarm_Timer < diff) - { - DoCast(m_creature->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((*m_creature), 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((*m_creature), 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 (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05) - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); - m_creature->setFaction(35); - m_creature->AttackStop(); - - if (m_pInstance) - m_pInstance->SetData(TYPE_LORKHAN, SPECIAL); - - FakeDeath = true; - } - - DoMeleeAttackIfReady(); - } -}; - -//Zealot Zath -struct TRINITY_DLL_DECL 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); - - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->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(m_creature->getVictim(),SPELL_SWEEPINGSTRIKES); - SweepingStrikes_Timer = 22000+rand()%4000; - }else SweepingStrikes_Timer -= diff; - - //SinisterStrike_Timer - if (SinisterStrike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SINISTERSTRIKE); - SinisterStrike_Timer = 8000+rand()%8000; - }else SinisterStrike_Timer -= diff; - - //Gouge_Timer - if (Gouge_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_GOUGE); - - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-100); - - Gouge_Timer = 17000+rand()%10000; - }else Gouge_Timer -= diff; - - //Kick_Timer - if (Kick_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KICK); - Kick_Timer = 15000+rand()%10000; - }else Kick_Timer -= diff; - - //Blind_Timer - if (Blind_Timer < diff) - { - DoCast(m_creature->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((*m_creature), 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((*m_creature), 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 (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05) - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetStandState(UNIT_STAND_STATE_SLEEP); - m_creature->setFaction(35); - m_creature->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/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp deleted file mode 100644 index 1376db2d259..00000000000 --- a/src/bindings/scripts/scripts/zone/zulgurub/boss_venoxis.cpp +++ /dev/null @@ -1,200 +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 "precompiled.h" -#include "def_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 TRINITY_DLL_DECL 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, m_creature); - if (m_pInstance) - m_pInstance->SetData(TYPE_VENOXIS, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 50)) - { - if (Dispell_Timer < diff) - { - DoCast(m_creature, SPELL_DISPELL); - Dispell_Timer = 15000 + rand()%15000; - }else Dispell_Timer -= diff; - - if (Renew_Timer < diff) - { - DoCast(m_creature, SPELL_RENEW); - Renew_Timer = 20000 + rand()%10000; - }else Renew_Timer -= diff; - - if (HolyWrath_Timer < diff) - { - DoCast(m_creature->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* target = SelectUnit(SELECT_TARGET_TOPAGGRO,i)) - if (m_creature->IsWithinMeleeRange(target)) - TargetInRange++; - } - - if (TargetInRange > 1) - { - DoCast(m_creature->getVictim(),SPELL_HOLY_NOVA); - HolyNova_Timer = 1000; - } - else - { - HolyNova_Timer = 2000; - } - - }else HolyNova_Timer -= diff; - - if (HolyFire_Timer < diff && TargetInRange < 3) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_HOLY_FIRE); - - HolyFire_Timer = 8000; - }else HolyFire_Timer -= diff; - } - else - { - if (!PhaseTwo) - { - DoScriptText(SAY_TRANSFORM, m_creature); - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_SNAKE_FORM); - m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, 2.00f); - const CreatureInfo *cinfo = m_creature->GetCreatureInfo(); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, (cinfo->mindmg +((cinfo->mindmg/100) * 25))); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, (cinfo->maxdmg +((cinfo->maxdmg/100) * 25))); - m_creature->UpdateDamagePhysical(BASE_ATTACK); - DoResetThreat(); - PhaseTwo = true; - } - - if (PhaseTwo && PoisonCloud_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_POISON_CLOUD); - PoisonCloud_Timer = 15000; - }PoisonCloud_Timer -=diff; - - if (PhaseTwo && VenomSpit_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_VENOMSPIT); - - VenomSpit_Timer = 15000 + rand()%5000; - }else VenomSpit_Timer -= diff; - - if (PhaseTwo && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 11)) - { - if (!InBerserk) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, 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/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp b/src/bindings/scripts/scripts/zone/zulgurub/boss_wushoolay.cpp deleted file mode 100644 index f0dbbda947a..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_zulgurub.h" - -#define SPELL_LIGHTNINGCLOUD 25033 -#define SPELL_LIGHTNINGWAVE 24819 - -struct TRINITY_DLL_DECL 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(m_creature->getVictim(),SPELL_LIGHTNINGCLOUD); - LightningCloud_Timer = 15000 + rand()%5000; - }else LightningCloud_Timer -= diff; - - //LightningWave_Timer - if (LightningWave_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) DoCast(target,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/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h b/src/bindings/scripts/scripts/zone/zulgurub/def_zulgurub.h deleted file mode 100644 index 3aab5b24b56..00000000000 --- a/src/bindings/scripts/scripts/zone/zulgurub/def_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 -{ - 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/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp b/src/bindings/scripts/scripts/zone/zulgurub/instance_zulgurub.cpp deleted file mode 100644 index 03b3e64c5e6..00000000000 --- a/src/bindings/scripts/scripts/zone/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 "precompiled.h" -#include "def_zulgurub.h" - -struct TRINITY_DLL_DECL 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/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 8d2e4466a41..49d2aa8bb7e 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -26,7 +26,144 @@ extern void AddSC_npcs_special(); extern void AddSC_npc_taxi(); //eastern kingdoms -extern void AddSC_the_scarlet_enclave(); +extern void AddSC_blackrock_depths(); //Blackrock Depths +extern void AddSC_boss_ambassador_flamelash(); +extern void AddSC_boss_anubshiah(); +extern void AddSC_boss_draganthaurissan(); +extern void AddSC_boss_general_angerforge(); +extern void AddSC_boss_gorosh_the_dervish(); +extern void AddSC_boss_grizzle(); +extern void AddSC_boss_high_interrogator_gerstahn(); +extern void AddSC_boss_magmus(); +extern void AddSC_boss_moira_bronzebeard(); +extern void AddSC_boss_tomb_of_seven(); +extern void AddSC_instance_blackrock_depths(); +extern void AddSC_boss_drakkisath(); //Blackrock Spire +extern void AddSC_boss_halycon(); +extern void AddSC_boss_highlordomokk(); +extern void AddSC_boss_mothersmolderweb(); +extern void AddSC_boss_overlordwyrmthalak(); +extern void AddSC_boss_shadowvosh(); +extern void AddSC_boss_thebeast(); +extern void AddSC_boss_warmastervoone(); +extern void AddSC_boss_quatermasterzigris(); +extern void AddSC_boss_pyroguard_emberseer(); +extern void AddSC_boss_gyth(); +extern void AddSC_boss_rend_blackhand(); +extern void AddSC_boss_razorgore(); //Blackwing lair +extern void AddSC_boss_vael(); +extern void AddSC_boss_broodlord(); +extern void AddSC_boss_firemaw(); +extern void AddSC_boss_ebonroc(); +extern void AddSC_boss_flamegor(); +extern void AddSC_boss_chromaggus(); +extern void AddSC_boss_nefarian(); +extern void AddSC_boss_victor_nefarius(); +extern void AddSC_instance_deadmines(); //Deadmines +extern void AddSC_boss_attumen(); //Karazhan +extern void AddSC_boss_curator(); +extern void AddSC_boss_maiden_of_virtue(); +extern void AddSC_boss_shade_of_aran(); +extern void AddSC_boss_malchezaar(); +extern void AddSC_boss_terestian_illhoof(); +extern void AddSC_boss_moroes(); +extern void AddSC_bosses_opera(); +extern void AddSC_boss_netherspite(); +extern void AddSC_instance_karazhan(); +extern void AddSC_karazhan(); +extern void AddSC_boss_nightbane(); +extern void AddSC_boss_felblood_kaelthas(); // Magister's Terrace +extern void AddSC_boss_selin_fireheart(); +extern void AddSC_boss_vexallus(); +extern void AddSC_boss_priestess_delrissa(); +extern void AddSC_instance_magisters_terrace(); +extern void AddSC_magisters_terrace(); +extern void AddSC_boss_lucifron(); //Molten core +extern void AddSC_boss_magmadar(); +extern void AddSC_boss_gehennas(); +extern void AddSC_boss_garr(); +extern void AddSC_boss_baron_geddon(); +extern void AddSC_boss_shazzrah(); +extern void AddSC_boss_golemagg(); +extern void AddSC_boss_sulfuron(); +extern void AddSC_boss_majordomo(); +extern void AddSC_boss_ragnaros(); +extern void AddSC_instance_molten_core(); +extern void AddSC_molten_core(); +extern void AddSC_the_scarlet_enclave(); //Scarlet Enclave +extern void AddSC_boss_arcanist_doan(); //Scarlet Monastery +extern void AddSC_boss_azshir_the_sleepless(); +extern void AddSC_boss_bloodmage_thalnos(); +extern void AddSC_boss_headless_horseman(); +extern void AddSC_boss_herod(); +extern void AddSC_boss_high_inquisitor_fairbanks(); +extern void AddSC_boss_houndmaster_loksey(); +extern void AddSC_boss_interrogator_vishas(); +extern void AddSC_boss_scorn(); +extern void AddSC_instance_scarlet_monastery(); +extern void AddSC_boss_mograine_and_whitemane(); +extern void AddSC_boss_darkmaster_gandling(); //Scholomance +extern void AddSC_boss_death_knight_darkreaver(); +extern void AddSC_boss_theolenkrastinov(); +extern void AddSC_boss_illuciabarov(); +extern void AddSC_boss_instructormalicia(); +extern void AddSC_boss_jandicebarov(); +extern void AddSC_boss_kormok(); +extern void AddSC_boss_lordalexeibarov(); +extern void AddSC_boss_lorekeeperpolkelt(); +extern void AddSC_boss_rasfrost(); +extern void AddSC_boss_theravenian(); +extern void AddSC_boss_vectus(); +extern void AddSC_instance_scholomance(); +extern void AddSC_shadowfang_keep(); //Shadowfang keep +extern void AddSC_instance_shadowfang_keep(); +extern void AddSC_boss_magistrate_barthilas(); //Stratholme +extern void AddSC_boss_maleki_the_pallid(); +extern void AddSC_boss_nerubenkan(); +extern void AddSC_boss_cannon_master_willey(); +extern void AddSC_boss_baroness_anastari(); +extern void AddSC_boss_ramstein_the_gorger(); +extern void AddSC_boss_timmy_the_cruel(); +extern void AddSC_boss_postmaster_malown(); +extern void AddSC_boss_baron_rivendare(); +extern void AddSC_boss_dathrohan_balnazzar(); +extern void AddSC_boss_order_of_silver_hand(); +extern void AddSC_instance_stratholme(); +extern void AddSC_stratholme(); +extern void AddSC_instance_sunwell_plateau(); //Sunwell Plateau +extern void AddSC_boss_kalecgos(); +extern void AddSC_boss_brutallus(); +extern void AddSC_boss_felmyst(); +extern void AddSC_boss_eredar_twins(); +extern void AddSC_boss_muru(); +extern void AddSC_boss_kiljaeden(); +extern void AddSC_sunwell_plateau(); +extern void AddSC_boss_archaedas(); //Uldaman +extern void AddSC_boss_ironaya(); +extern void AddSC_uldaman(); +extern void AddSC_instance_uldaman(); +extern void AddSC_boss_akilzon(); //Zul'Aman +extern void AddSC_boss_halazzi(); +extern void AddSC_boss_hex_lord_malacrass(); +extern void AddSC_boss_janalai(); +extern void AddSC_boss_nalorakk(); +extern void AddSC_boss_zuljin(); +extern void AddSC_instance_zulaman(); +extern void AddSC_zulaman(); +extern void AddSC_boss_jeklik(); //Zul'Gurub +extern void AddSC_boss_venoxis(); +extern void AddSC_boss_marli(); +extern void AddSC_boss_mandokir(); +extern void AddSC_boss_gahzranka(); +extern void AddSC_boss_thekal(); +extern void AddSC_boss_arlokk(); +extern void AddSC_boss_jindo(); +extern void AddSC_boss_hakkar(); +extern void AddSC_boss_grilek(); +extern void AddSC_boss_hazzarah(); +extern void AddSC_boss_renataki(); +extern void AddSC_boss_wushoolay(); +extern void AddSC_instance_zulgurub(); //extern void AddSC_alterac_mountains(); extern void AddSC_arathi_highlands(); extern void AddSC_blasted_lands(); @@ -138,45 +275,6 @@ extern void AddSC_instance_black_temple(); //Blackfathom Depths extern void AddSC_instance_blackfathom_deeps(); -//Blackrock Depths -extern void AddSC_blackrock_depths(); -extern void AddSC_boss_ambassador_flamelash(); -extern void AddSC_boss_anubshiah(); -extern void AddSC_boss_draganthaurissan(); -extern void AddSC_boss_general_angerforge(); -extern void AddSC_boss_gorosh_the_dervish(); -extern void AddSC_boss_grizzle(); -extern void AddSC_boss_high_interrogator_gerstahn(); -extern void AddSC_boss_magmus(); -extern void AddSC_boss_moira_bronzebeard(); -extern void AddSC_boss_tomb_of_seven(); -extern void AddSC_instance_blackrock_depths(); - -//Blackrock Spire -extern void AddSC_boss_drakkisath(); -extern void AddSC_boss_halycon(); -extern void AddSC_boss_highlordomokk(); -extern void AddSC_boss_mothersmolderweb(); -extern void AddSC_boss_overlordwyrmthalak(); -extern void AddSC_boss_shadowvosh(); -extern void AddSC_boss_thebeast(); -extern void AddSC_boss_warmastervoone(); -extern void AddSC_boss_quatermasterzigris(); -extern void AddSC_boss_pyroguard_emberseer(); -extern void AddSC_boss_gyth(); -extern void AddSC_boss_rend_blackhand(); - -//Blackwing lair -extern void AddSC_boss_razorgore(); -extern void AddSC_boss_vael(); -extern void AddSC_boss_broodlord(); -extern void AddSC_boss_firemaw(); -extern void AddSC_boss_ebonroc(); -extern void AddSC_boss_flamegor(); -extern void AddSC_boss_chromaggus(); -extern void AddSC_boss_nefarian(); -extern void AddSC_boss_victor_nefarius(); - //Caverns of Time //--Battle for Mt. Hyjal extern void AddSC_hyjal(); @@ -224,9 +322,6 @@ extern void AddSC_instance_steam_vault(); extern void AddSC_boss_hungarfen(); extern void AddSC_boss_the_black_stalker(); -//Deadmines -extern void AddSC_instance_deadmines(); - //Gruul's Lair extern void AddSC_boss_gruul(); extern void AddSC_boss_high_king_maulgar(); @@ -255,50 +350,12 @@ extern void AddSC_boss_omor_the_unscarred(); extern void AddSC_boss_vazruden_the_herald(); extern void AddSC_instance_ramparts(); -//Karazhan -extern void AddSC_boss_attumen(); -extern void AddSC_boss_curator(); -extern void AddSC_boss_maiden_of_virtue(); -extern void AddSC_boss_shade_of_aran(); -extern void AddSC_boss_malchezaar(); -extern void AddSC_boss_terestian_illhoof(); -extern void AddSC_boss_moroes(); -extern void AddSC_bosses_opera(); -extern void AddSC_boss_netherspite(); -extern void AddSC_instance_karazhan(); -extern void AddSC_karazhan(); -extern void AddSC_boss_nightbane(); - -//Lower Blackrock Spire - -// Magister's Terrace -extern void AddSC_boss_felblood_kaelthas(); -extern void AddSC_boss_selin_fireheart(); -extern void AddSC_boss_vexallus(); -extern void AddSC_boss_priestess_delrissa(); -extern void AddSC_instance_magisters_terrace(); -extern void AddSC_magisters_terrace(); - //Maraudon extern void AddSC_boss_celebras_the_cursed(); extern void AddSC_boss_landslide(); extern void AddSC_boss_noxxion(); extern void AddSC_boss_ptheradras(); -//Molten core -extern void AddSC_boss_lucifron(); -extern void AddSC_boss_magmadar(); -extern void AddSC_boss_gehennas(); -extern void AddSC_boss_garr(); -extern void AddSC_boss_baron_geddon(); -extern void AddSC_boss_shazzrah(); -extern void AddSC_boss_golemagg(); -extern void AddSC_boss_sulfuron(); -extern void AddSC_boss_majordomo(); -extern void AddSC_boss_ragnaros(); -extern void AddSC_instance_molten_core(); -extern void AddSC_molten_core(); - //Naxxramas extern void AddSC_boss_anubrekhan(); extern void AddSC_boss_maexxna(); @@ -344,67 +401,6 @@ extern void AddSC_razorfen_downs(); //Razorfen Kraul extern void AddSC_razorfen_kraul(); -//Ruins of Ahn'Qiraj -//Scarlet Monastery -extern void AddSC_boss_arcanist_doan(); -extern void AddSC_boss_azshir_the_sleepless(); -extern void AddSC_boss_bloodmage_thalnos(); -extern void AddSC_boss_headless_horseman(); -extern void AddSC_boss_herod(); -extern void AddSC_boss_high_inquisitor_fairbanks(); -extern void AddSC_boss_houndmaster_loksey(); -extern void AddSC_boss_interrogator_vishas(); -extern void AddSC_boss_scorn(); -extern void AddSC_instance_scarlet_monastery(); -extern void AddSC_boss_mograine_and_whitemane(); - -//Scholomance -extern void AddSC_boss_darkmaster_gandling(); -extern void AddSC_boss_death_knight_darkreaver(); -extern void AddSC_boss_theolenkrastinov(); -extern void AddSC_boss_illuciabarov(); -extern void AddSC_boss_instructormalicia(); -extern void AddSC_boss_jandicebarov(); -extern void AddSC_boss_kormok(); -extern void AddSC_boss_lordalexeibarov(); -extern void AddSC_boss_lorekeeperpolkelt(); -extern void AddSC_boss_rasfrost(); -extern void AddSC_boss_theravenian(); -extern void AddSC_boss_vectus(); -extern void AddSC_instance_scholomance(); - -//Shadowfang keep -extern void AddSC_shadowfang_keep(); -extern void AddSC_instance_shadowfang_keep(); - -//Stratholme -extern void AddSC_boss_magistrate_barthilas(); -extern void AddSC_boss_maleki_the_pallid(); -extern void AddSC_boss_nerubenkan(); -extern void AddSC_boss_cannon_master_willey(); -extern void AddSC_boss_baroness_anastari(); -extern void AddSC_boss_ramstein_the_gorger(); -extern void AddSC_boss_timmy_the_cruel(); -extern void AddSC_boss_postmaster_malown(); -extern void AddSC_boss_baron_rivendare(); -extern void AddSC_boss_dathrohan_balnazzar(); -extern void AddSC_boss_order_of_silver_hand(); -extern void AddSC_instance_stratholme(); -extern void AddSC_stratholme(); - -//Sunken Temple -//Sunwell Plateau -extern void AddSC_instance_sunwell_plateau(); -extern void AddSC_boss_kalecgos(); -extern void AddSC_boss_brutallus(); -extern void AddSC_boss_felmyst(); -extern void AddSC_boss_eredar_twins(); -extern void AddSC_boss_muru(); -extern void AddSC_boss_kiljaeden(); -extern void AddSC_sunwell_plateau(); - -//Tanaris - //Tempest Keep //--Arcatraz extern void AddSC_arcatraz(); @@ -441,12 +437,6 @@ extern void AddSC_boss_twinemperors(); extern void AddSC_mob_anubisath_sentinel(); extern void AddSC_instance_temple_of_ahnqiraj(); -//Uldaman -extern void AddSC_boss_archaedas(); -extern void AddSC_boss_ironaya(); -extern void AddSC_uldaman(); -extern void AddSC_instance_uldaman(); - //Ulduar extern void AddSC_boss_auriaya(); extern void AddSC_boss_flame_leviathan(); @@ -474,36 +464,10 @@ extern void AddSC_instance_wailing_caverns(); //Zul'Farrak extern void AddSC_zulfarrak(); -//Zul'Gurub -extern void AddSC_boss_jeklik(); -extern void AddSC_boss_venoxis(); -extern void AddSC_boss_marli(); -extern void AddSC_boss_mandokir(); -extern void AddSC_boss_gahzranka(); -extern void AddSC_boss_thekal(); -extern void AddSC_boss_arlokk(); -extern void AddSC_boss_jindo(); -extern void AddSC_boss_hakkar(); -extern void AddSC_boss_grilek(); -extern void AddSC_boss_hazzarah(); -extern void AddSC_boss_renataki(); -extern void AddSC_boss_wushoolay(); -extern void AddSC_instance_zulgurub(); - -//Zul'Aman -extern void AddSC_boss_akilzon(); -extern void AddSC_boss_halazzi(); -extern void AddSC_boss_hex_lord_malacrass(); -extern void AddSC_boss_janalai(); -extern void AddSC_boss_nalorakk(); -extern void AddSC_boss_zuljin(); -extern void AddSC_instance_zulaman(); -extern void AddSC_zulaman(); - -//Vault of Archavon -extern void AddSC_boss_archavon(); -extern void AddSC_boss_emalon(); -extern void AddSC_instance_archavon(); +//Vault of Archavon +extern void AddSC_boss_archavon(); +extern void AddSC_boss_emalon(); +extern void AddSC_instance_archavon(); //Halls of Lightning extern void AddSC_boss_bjarngrim(); @@ -537,7 +501,144 @@ void AddScripts() AddSC_npc_taxi(); //eastern kingdoms - AddSC_the_scarlet_enclave(); + AddSC_blackrock_depths(); //Blackrock Depths + AddSC_boss_ambassador_flamelash(); + AddSC_boss_anubshiah(); + AddSC_boss_draganthaurissan(); + AddSC_boss_general_angerforge(); + AddSC_boss_gorosh_the_dervish(); + AddSC_boss_grizzle(); + AddSC_boss_high_interrogator_gerstahn(); + AddSC_boss_magmus(); + AddSC_boss_moira_bronzebeard(); + AddSC_boss_tomb_of_seven(); + AddSC_instance_blackrock_depths(); + AddSC_boss_drakkisath(); //Blackrock Spire + AddSC_boss_halycon(); + AddSC_boss_highlordomokk(); + AddSC_boss_mothersmolderweb(); + AddSC_boss_overlordwyrmthalak(); + AddSC_boss_shadowvosh(); + AddSC_boss_thebeast(); + AddSC_boss_warmastervoone(); + AddSC_boss_quatermasterzigris(); + AddSC_boss_pyroguard_emberseer(); + AddSC_boss_gyth(); + AddSC_boss_rend_blackhand(); + AddSC_boss_razorgore(); //Blackwing lair + AddSC_boss_vael(); + AddSC_boss_broodlord(); + AddSC_boss_firemaw(); + AddSC_boss_ebonroc(); + AddSC_boss_flamegor(); + AddSC_boss_chromaggus(); + AddSC_boss_nefarian(); + AddSC_boss_victor_nefarius(); + AddSC_instance_deadmines(); //Deadmines + AddSC_boss_attumen(); //Karazhan + AddSC_boss_curator(); + AddSC_boss_maiden_of_virtue(); + AddSC_boss_shade_of_aran(); + AddSC_boss_malchezaar(); + AddSC_boss_terestian_illhoof(); + AddSC_boss_moroes(); + AddSC_bosses_opera(); + AddSC_boss_netherspite(); + AddSC_instance_karazhan(); + AddSC_karazhan(); + AddSC_boss_nightbane(); + AddSC_boss_felblood_kaelthas(); // Magister's Terrace + AddSC_boss_selin_fireheart(); + AddSC_boss_vexallus(); + AddSC_boss_priestess_delrissa(); + AddSC_instance_magisters_terrace(); + AddSC_magisters_terrace(); + AddSC_boss_lucifron(); //Molten core + AddSC_boss_magmadar(); + AddSC_boss_gehennas(); + AddSC_boss_garr(); + AddSC_boss_baron_geddon(); + AddSC_boss_shazzrah(); + AddSC_boss_golemagg(); + AddSC_boss_sulfuron(); + AddSC_boss_majordomo(); + AddSC_boss_ragnaros(); + AddSC_instance_molten_core(); + AddSC_molten_core(); + AddSC_the_scarlet_enclave(); //Scarlet Enclave + AddSC_boss_arcanist_doan(); //Scarlet Monastery + AddSC_boss_azshir_the_sleepless(); + AddSC_boss_bloodmage_thalnos(); + AddSC_boss_headless_horseman(); + AddSC_boss_herod(); + AddSC_boss_high_inquisitor_fairbanks(); + AddSC_boss_houndmaster_loksey(); + AddSC_boss_interrogator_vishas(); + AddSC_boss_scorn(); + AddSC_instance_scarlet_monastery(); + AddSC_boss_mograine_and_whitemane(); + AddSC_boss_darkmaster_gandling(); //Scholomance + AddSC_boss_death_knight_darkreaver(); + AddSC_boss_theolenkrastinov(); + AddSC_boss_illuciabarov(); + AddSC_boss_instructormalicia(); + AddSC_boss_jandicebarov(); + AddSC_boss_kormok(); + AddSC_boss_lordalexeibarov(); + AddSC_boss_lorekeeperpolkelt(); + AddSC_boss_rasfrost(); + AddSC_boss_theravenian(); + AddSC_boss_vectus(); + AddSC_instance_scholomance(); + AddSC_shadowfang_keep(); //Shadowfang keep + AddSC_instance_shadowfang_keep(); + AddSC_boss_magistrate_barthilas(); //Stratholme + AddSC_boss_maleki_the_pallid(); + AddSC_boss_nerubenkan(); + AddSC_boss_cannon_master_willey(); + AddSC_boss_baroness_anastari(); + AddSC_boss_ramstein_the_gorger(); + AddSC_boss_timmy_the_cruel(); + AddSC_boss_postmaster_malown(); + AddSC_boss_baron_rivendare(); + AddSC_boss_dathrohan_balnazzar(); + AddSC_boss_order_of_silver_hand(); + AddSC_instance_stratholme(); + AddSC_stratholme(); + AddSC_instance_sunwell_plateau(); //Sunwell Plateau + AddSC_boss_kalecgos(); + AddSC_boss_brutallus(); + AddSC_boss_felmyst(); + AddSC_boss_eredar_twins(); + AddSC_boss_muru(); + AddSC_boss_kiljaeden(); + AddSC_sunwell_plateau(); + AddSC_boss_archaedas(); //Uldaman + AddSC_boss_ironaya(); + AddSC_uldaman(); + AddSC_instance_uldaman(); + AddSC_boss_akilzon(); //Zul'Aman + AddSC_boss_halazzi(); + AddSC_boss_hex_lord_malacrass(); + AddSC_boss_janalai(); + AddSC_boss_nalorakk(); + AddSC_boss_zuljin(); + AddSC_instance_zulaman(); + AddSC_zulaman(); + AddSC_boss_jeklik(); //Zul'Gurub + AddSC_boss_venoxis(); + AddSC_boss_marli(); + AddSC_boss_mandokir(); + AddSC_boss_gahzranka(); + AddSC_boss_thekal(); + AddSC_boss_arlokk(); + AddSC_boss_jindo(); + AddSC_boss_hakkar(); + AddSC_boss_grilek(); + AddSC_boss_hazzarah(); + AddSC_boss_renataki(); + AddSC_boss_wushoolay(); + AddSC_instance_zulgurub(); //AddSC_alterac_mountains(); AddSC_arathi_highlands(); AddSC_blasted_lands(); @@ -649,45 +750,6 @@ void AddScripts() //Blackfathom Depths AddSC_instance_blackfathom_deeps(); - //Blackrock Depths - AddSC_blackrock_depths(); - AddSC_boss_ambassador_flamelash(); - AddSC_boss_anubshiah(); - AddSC_boss_draganthaurissan(); - AddSC_boss_general_angerforge(); - AddSC_boss_gorosh_the_dervish(); - AddSC_boss_grizzle(); - AddSC_boss_high_interrogator_gerstahn(); - AddSC_boss_magmus(); - AddSC_boss_moira_bronzebeard(); - AddSC_boss_tomb_of_seven(); - AddSC_instance_blackrock_depths(); - - //Blackrock Spire - AddSC_boss_drakkisath(); - AddSC_boss_halycon(); - AddSC_boss_highlordomokk(); - AddSC_boss_mothersmolderweb(); - AddSC_boss_overlordwyrmthalak(); - AddSC_boss_shadowvosh(); - AddSC_boss_thebeast(); - AddSC_boss_warmastervoone(); - AddSC_boss_quatermasterzigris(); - AddSC_boss_pyroguard_emberseer(); - AddSC_boss_gyth(); - AddSC_boss_rend_blackhand(); - - //Blackwing lair - AddSC_boss_razorgore(); - AddSC_boss_vael(); - AddSC_boss_broodlord(); - AddSC_boss_firemaw(); - AddSC_boss_ebonroc(); - AddSC_boss_flamegor(); - AddSC_boss_chromaggus(); - AddSC_boss_nefarian(); - AddSC_boss_victor_nefarius(); - //Caverns of Time //--Battle for Mt. Hyjal AddSC_hyjal(); @@ -735,9 +797,6 @@ void AddScripts() AddSC_boss_hungarfen(); AddSC_boss_the_black_stalker(); - //Deadmines - AddSC_instance_deadmines(); - //Gruul's Lair AddSC_boss_gruul(); AddSC_boss_high_king_maulgar(); @@ -766,50 +825,12 @@ void AddScripts() AddSC_boss_vazruden_the_herald(); AddSC_instance_ramparts(); - //Karazhan - AddSC_boss_attumen(); - AddSC_boss_curator(); - AddSC_boss_maiden_of_virtue(); - AddSC_boss_shade_of_aran(); - AddSC_boss_malchezaar(); - AddSC_boss_terestian_illhoof(); - AddSC_boss_moroes(); - AddSC_bosses_opera(); - AddSC_boss_netherspite(); - AddSC_instance_karazhan(); - AddSC_karazhan(); - AddSC_boss_nightbane(); - - //Lower Blackrock Spire - - // Magister's Terrace - AddSC_boss_felblood_kaelthas(); - AddSC_boss_selin_fireheart(); - AddSC_boss_vexallus(); - AddSC_boss_priestess_delrissa(); - AddSC_instance_magisters_terrace(); - AddSC_magisters_terrace(); - //Maraudon AddSC_boss_celebras_the_cursed(); AddSC_boss_landslide(); AddSC_boss_noxxion(); AddSC_boss_ptheradras(); - //Molten core - AddSC_boss_lucifron(); - AddSC_boss_magmadar(); - AddSC_boss_gehennas(); - AddSC_boss_garr(); - AddSC_boss_baron_geddon(); - AddSC_boss_shazzrah(); - AddSC_boss_golemagg(); - AddSC_boss_sulfuron(); - AddSC_boss_majordomo(); - AddSC_boss_ragnaros(); - AddSC_instance_molten_core(); - AddSC_molten_core(); - //Naxxramas AddSC_boss_anubrekhan(); AddSC_boss_maexxna(); @@ -855,67 +876,6 @@ void AddScripts() //Razorfen Kraul AddSC_razorfen_kraul(); - //Ruins of Ahn'Qiraj - //Scarlet Monastery - AddSC_boss_arcanist_doan(); - AddSC_boss_azshir_the_sleepless(); - AddSC_boss_bloodmage_thalnos(); - AddSC_boss_headless_horseman(); - AddSC_boss_herod(); - AddSC_boss_high_inquisitor_fairbanks(); - AddSC_boss_houndmaster_loksey(); - AddSC_boss_interrogator_vishas(); - AddSC_boss_scorn(); - AddSC_instance_scarlet_monastery(); - AddSC_boss_mograine_and_whitemane(); - - //Scholomance - AddSC_boss_darkmaster_gandling(); - AddSC_boss_death_knight_darkreaver(); - AddSC_boss_theolenkrastinov(); - AddSC_boss_illuciabarov(); - AddSC_boss_instructormalicia(); - AddSC_boss_jandicebarov(); - AddSC_boss_kormok(); - AddSC_boss_lordalexeibarov(); - AddSC_boss_lorekeeperpolkelt(); - AddSC_boss_rasfrost(); - AddSC_boss_theravenian(); - AddSC_boss_vectus(); - AddSC_instance_scholomance(); - - //Shadowfang keep - AddSC_shadowfang_keep(); - AddSC_instance_shadowfang_keep(); - - //Stratholme - AddSC_boss_magistrate_barthilas(); - AddSC_boss_maleki_the_pallid(); - AddSC_boss_nerubenkan(); - AddSC_boss_cannon_master_willey(); - AddSC_boss_baroness_anastari(); - AddSC_boss_ramstein_the_gorger(); - AddSC_boss_timmy_the_cruel(); - AddSC_boss_postmaster_malown(); - AddSC_boss_baron_rivendare(); - AddSC_boss_dathrohan_balnazzar(); - AddSC_boss_order_of_silver_hand(); - AddSC_instance_stratholme(); - AddSC_stratholme(); - - //Sunken Temple - //Sunwell Plateau - AddSC_instance_sunwell_plateau(); - AddSC_boss_kalecgos(); - AddSC_boss_brutallus(); - AddSC_boss_felmyst(); - AddSC_boss_eredar_twins(); - AddSC_boss_muru(); - AddSC_boss_kiljaeden(); - AddSC_sunwell_plateau(); - - //Tanaris - //Tempest Keep //--Arcatraz AddSC_arcatraz(); @@ -952,19 +912,13 @@ void AddScripts() AddSC_mob_anubisath_sentinel(); AddSC_instance_temple_of_ahnqiraj(); - //Uldaman - AddSC_boss_archaedas(); - AddSC_boss_ironaya(); - AddSC_uldaman(); - AddSC_instance_uldaman(); - //Ulduar AddSC_boss_auriaya(); AddSC_boss_flame_leviathan(); AddSC_boss_ignis(); AddSC_boss_razorscale(); AddSC_boss_xt002(); - // AddSC_instance_ulduar(); + //AddSC_instance_ulduar(); //Un'Goro Crater AddSC_ungoro_crater(); @@ -985,32 +939,6 @@ void AddScripts() //Zul'Farrak AddSC_zulfarrak(); - //Zul'Gurub - AddSC_boss_jeklik(); - AddSC_boss_venoxis(); - AddSC_boss_marli(); - AddSC_boss_mandokir(); - AddSC_boss_gahzranka(); - AddSC_boss_thekal(); - AddSC_boss_arlokk(); - AddSC_boss_jindo(); - AddSC_boss_hakkar(); - AddSC_boss_grilek(); - AddSC_boss_hazzarah(); - AddSC_boss_renataki(); - AddSC_boss_wushoolay(); - AddSC_instance_zulgurub(); - - //Zul'Aman - AddSC_boss_akilzon(); - AddSC_boss_halazzi(); - AddSC_boss_hex_lord_malacrass(); - AddSC_boss_janalai(); - AddSC_boss_nalorakk(); - AddSC_boss_zuljin(); - AddSC_instance_zulaman(); - AddSC_zulaman(); - //Vault of Archavon AddSC_boss_archavon(); AddSC_boss_emalon(); -- cgit v1.2.3 From 6e9ee95bb7f6ef79b9e7a3d8e869c2e5217b3fa3 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 16:29:41 +0200 Subject: Merge [SD2] r1304 Move source files to continent folder, part 2 --HG-- branch : trunk --- src/bindings/scripts/CMakeLists.txt | 132 +- src/bindings/scripts/VC80/80ScriptDev2.vcproj | 653 +++++---- src/bindings/scripts/VC90/90ScriptDev2.vcproj | 1358 +++++++++++++++++- .../blackfathom_depths/def_blackfathom_deeps.h | 23 + .../instance_blackfathom_deeps.cpp | 145 ++ .../culling_of_stratholme/boss_epoch.cpp | 86 ++ .../culling_of_stratholme/boss_mal_ganis.cpp | 123 ++ .../culling_of_stratholme/boss_meathook.cpp | 138 ++ .../culling_of_stratholme/boss_salramm.cpp | 155 +++ .../def_culling_of_stratholme.h | 4 + .../instance_culling_of_stratholme.cpp | 21 + .../caverns_of_time/dark_portal/boss_aeonus.cpp | 151 ++ .../dark_portal/boss_chrono_lord_deja.cpp | 160 +++ .../caverns_of_time/dark_portal/boss_temporus.cpp | 158 +++ .../caverns_of_time/dark_portal/dark_portal.cpp | 409 ++++++ .../caverns_of_time/dark_portal/def_dark_portal.h | 35 + .../dark_portal/instance_dark_portal.cpp | 351 +++++ .../caverns_of_time/hyjal/boss_anetheron.cpp | 312 +++++ .../caverns_of_time/hyjal/boss_archimonde.cpp | 640 +++++++++ .../caverns_of_time/hyjal/boss_azgalor.cpp | 288 ++++ .../caverns_of_time/hyjal/boss_kazrogal.cpp | 197 +++ .../hyjal/boss_rage_winterchill.cpp | 192 +++ .../kalimdor/caverns_of_time/hyjal/def_hyjal.h | 38 + .../kalimdor/caverns_of_time/hyjal/hyjal.cpp | 246 ++++ .../kalimdor/caverns_of_time/hyjal/hyjalAI.cpp | 1159 ++++++++++++++++ .../kalimdor/caverns_of_time/hyjal/hyjalAI.h | 248 ++++ .../kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp | 1453 ++++++++++++++++++++ .../kalimdor/caverns_of_time/hyjal/hyjal_trash.h | 35 + .../caverns_of_time/hyjal/instance_hyjal.cpp | 322 +++++ .../old_hillsbrad/boss_captain_skarloc.cpp | 156 +++ .../old_hillsbrad/boss_epoch_hunter.cpp | 150 ++ .../old_hillsbrad/boss_leutenant_drake.cpp | 194 +++ .../old_hillsbrad/def_old_hillsbrad.h | 19 + .../old_hillsbrad/instance_old_hillsbrad.cpp | 238 ++++ .../old_hillsbrad/old_hillsbrad.cpp | 682 +++++++++ .../kalimdor/maraudon/boss_celebras_the_cursed.cpp | 98 ++ .../scripts/kalimdor/maraudon/boss_landslide.cpp | 95 ++ .../scripts/kalimdor/maraudon/boss_noxxion.cpp | 150 ++ .../kalimdor/maraudon/boss_princess_theradras.cpp | 109 ++ .../scripts/kalimdor/onyxias_lair/boss_onyxia.cpp | 307 +++++ .../boss_amnennar_the_coldbringer.cpp | 130 ++ .../kalimdor/razorfen_downs/razorfen_downs.cpp | 85 ++ .../kalimdor/razorfen_kraul/def_razorfen_kraul.h | 21 + .../razorfen_kraul/instance_razorfen_kraul.cpp | 105 ++ .../kalimdor/razorfen_kraul/razorfen_kraul.cpp | 252 ++++ .../kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp | 108 ++ .../kalimdor/ruins_of_ahnqiraj/boss_buru.cpp | 27 + .../kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp | 94 ++ .../kalimdor/ruins_of_ahnqiraj/boss_moam.cpp | 120 ++ .../kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp | 38 + .../kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp | 45 + .../instance_ruins_of_ahnqiraj.cpp | 25 + .../kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp | 346 +++++ .../kalimdor/temple_of_ahnqiraj/boss_cthun.cpp | 1335 ++++++++++++++++++ .../kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp | 206 +++ .../kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp | 148 ++ .../kalimdor/temple_of_ahnqiraj/boss_ouro.cpp | 140 ++ .../kalimdor/temple_of_ahnqiraj/boss_sartura.cpp | 298 ++++ .../kalimdor/temple_of_ahnqiraj/boss_skeram.cpp | 316 +++++ .../temple_of_ahnqiraj/boss_twinemperors.cpp | 618 +++++++++ .../kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp | 30 + .../temple_of_ahnqiraj/def_temple_of_ahnqiraj.h | 23 + .../instance_temple_of_ahnqiraj.cpp | 166 +++ .../temple_of_ahnqiraj/mob_anubisath_sentinel.cpp | 318 +++++ .../scripts/scripts/kalimdor/ungoro_crater.cpp | 210 +++ .../kalimdor/wailing_caverns/def_wailing_caverns.h | 24 + .../wailing_caverns/instance_wailing_caverns.cpp | 142 ++ .../kalimdor/wailing_caverns/wailing_caverns.cpp | 411 ++++++ .../scripts/kalimdor/zulfarrak/zulfarrak.cpp | 223 +++ .../blackfathom_depths/def_blackfathom_deeps.h | 23 - .../instance_blackfathom_deeps.cpp | 145 -- .../culling_of_stratholme/boss_epoch.cpp | 86 -- .../culling_of_stratholme/boss_mal_ganis.cpp | 123 -- .../culling_of_stratholme/boss_meathook.cpp | 138 -- .../culling_of_stratholme/boss_salramm.cpp | 155 --- .../def_culling_of_stratholme.h | 4 - .../instance_culling_of_stratholme.cpp | 21 - .../caverns_of_time/dark_portal/boss_aeonus.cpp | 151 -- .../dark_portal/boss_chrono_lord_deja.cpp | 160 --- .../caverns_of_time/dark_portal/boss_temporus.cpp | 158 --- .../caverns_of_time/dark_portal/dark_portal.cpp | 409 ------ .../caverns_of_time/dark_portal/def_dark_portal.h | 35 - .../dark_portal/instance_dark_portal.cpp | 351 ----- .../zone/caverns_of_time/hyjal/boss_anetheron.cpp | 312 ----- .../zone/caverns_of_time/hyjal/boss_archimonde.cpp | 640 --------- .../zone/caverns_of_time/hyjal/boss_azgalor.cpp | 288 ---- .../zone/caverns_of_time/hyjal/boss_kazrogal.cpp | 197 --- .../hyjal/boss_rage_winterchill.cpp | 192 --- .../scripts/zone/caverns_of_time/hyjal/def_hyjal.h | 38 - .../scripts/zone/caverns_of_time/hyjal/hyjal.cpp | 246 ---- .../scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp | 1159 ---------------- .../scripts/zone/caverns_of_time/hyjal/hyjalAI.h | 248 ---- .../zone/caverns_of_time/hyjal/hyjal_trash.cpp | 1453 -------------------- .../zone/caverns_of_time/hyjal/hyjal_trash.h | 35 - .../zone/caverns_of_time/hyjal/instance_hyjal.cpp | 322 ----- .../old_hillsbrad/boss_captain_skarloc.cpp | 156 --- .../old_hillsbrad/boss_epoch_hunter.cpp | 150 -- .../old_hillsbrad/boss_leutenant_drake.cpp | 194 --- .../old_hillsbrad/def_old_hillsbrad.h | 19 - .../old_hillsbrad/instance_old_hillsbrad.cpp | 238 ---- .../old_hillsbrad/old_hillsbrad.cpp | 682 --------- .../zone/maraudon/boss_celebras_the_cursed.cpp | 98 -- .../scripts/zone/maraudon/boss_landslide.cpp | 95 -- .../scripts/scripts/zone/maraudon/boss_noxxion.cpp | 150 -- .../zone/maraudon/boss_princess_theradras.cpp | 109 -- .../scripts/zone/onyxias_lair/boss_onyxia.cpp | 307 ----- .../boss_amnennar_the_coldbringer.cpp | 130 -- .../scripts/zone/razorfen_downs/razorfen_downs.cpp | 85 -- .../zone/razorfen_kraul/def_razorfen_kraul.h | 21 - .../razorfen_kraul/instance_razorfen_kraul.cpp | 105 -- .../scripts/zone/razorfen_kraul/razorfen_kraul.cpp | 252 ---- .../zone/ruins_of_ahnqiraj/boss_ayamiss.cpp | 108 -- .../scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp | 27 - .../zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp | 94 -- .../scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp | 120 -- .../zone/ruins_of_ahnqiraj/boss_ossirian.cpp | 38 - .../scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp | 45 - .../instance_ruins_of_ahnqiraj.cpp | 25 - .../zone/temple_of_ahnqiraj/boss_bug_trio.cpp | 346 ----- .../scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp | 1335 ------------------ .../zone/temple_of_ahnqiraj/boss_fankriss.cpp | 206 --- .../zone/temple_of_ahnqiraj/boss_huhuran.cpp | 148 -- .../scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp | 140 -- .../zone/temple_of_ahnqiraj/boss_sartura.cpp | 298 ---- .../zone/temple_of_ahnqiraj/boss_skeram.cpp | 316 ----- .../zone/temple_of_ahnqiraj/boss_twinemperors.cpp | 618 --------- .../zone/temple_of_ahnqiraj/boss_viscidus.cpp | 30 - .../temple_of_ahnqiraj/def_temple_of_ahnqiraj.h | 23 - .../instance_temple_of_ahnqiraj.cpp | 166 --- .../temple_of_ahnqiraj/mob_anubisath_sentinel.cpp | 318 ----- .../scripts/zone/ungoro_crater/ungoro_crater.cpp | 210 --- .../zone/wailing_caverns/def_wailing_caverns.h | 24 - .../wailing_caverns/instance_wailing_caverns.cpp | 142 -- .../zone/wailing_caverns/wailing_caverns.cpp | 411 ------ .../scripts/scripts/zone/zulfarrak/zulfarrak.cpp | 223 --- src/bindings/scripts/system/ScriptLoader.cpp | 206 ++- 136 files changed, 17060 insertions(+), 15871 deletions(-) create mode 100644 src/bindings/scripts/scripts/kalimdor/blackfathom_depths/def_blackfathom_deeps.h create mode 100644 src/bindings/scripts/scripts/kalimdor/blackfathom_depths/instance_blackfathom_deeps.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/def_dark_portal.h create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/def_hyjal.h create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.h create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/maraudon/boss_landslide.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/maraudon/boss_noxxion.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/maraudon/boss_princess_theradras.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/razorfen_kraul/def_razorfen_kraul.h create mode 100644 src/bindings/scripts/scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/wailing_caverns/def_wailing_caverns.h create mode 100644 src/bindings/scripts/scripts/kalimdor/wailing_caverns/instance_wailing_caverns.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp create mode 100644 src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp delete mode 100644 src/bindings/scripts/scripts/zone/blackfathom_depths/def_blackfathom_deeps.h delete mode 100644 src/bindings/scripts/scripts/zone/blackfathom_depths/instance_blackfathom_deeps.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp delete mode 100644 src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp delete mode 100644 src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp delete mode 100644 src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp delete mode 100644 src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp delete mode 100644 src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp delete mode 100644 src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp delete mode 100644 src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp delete mode 100644 src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.cpp delete mode 100644 src/bindings/scripts/scripts/zone/razorfen_kraul/def_razorfen_kraul.h delete mode 100644 src/bindings/scripts/scripts/zone/razorfen_kraul/instance_razorfen_kraul.cpp delete mode 100644 src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp delete mode 100644 src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp delete mode 100644 src/bindings/scripts/scripts/zone/wailing_caverns/def_wailing_caverns.h delete mode 100644 src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp delete mode 100644 src/bindings/scripts/scripts/zone/wailing_caverns/wailing_caverns.cpp delete mode 100644 src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 0d63ed10020..b83b2f09f58 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -194,6 +194,71 @@ SET(trinityscript_LIB_SRCS scripts/examples/example_escort.cpp scripts/examples/example_gossip_codebox.cpp scripts/examples/example_misc.cpp + scripts/kalimdor/blackfathom_depths/instance_blackfathom_deeps.cpp + scripts/kalimdor/blackfathom_depths/def_blackfathom_deeps.h + scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp + scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp + scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp + scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp + scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp + scripts/kalimdor/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h + scripts/kalimdor/caverns_of_time/dark_portal/def_dark_portal.h + scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp + scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp + scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp + scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp + scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp + scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp + scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp + scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp + scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp + scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp + scripts/kalimdor/caverns_of_time/hyjal/def_hyjal.h + scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp + scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp + scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.h + scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp + scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h + scripts/kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp + scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp + scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp + scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp + scripts/kalimdor/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h + scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp + scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp + scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp + scripts/kalimdor/maraudon/boss_landslide.cpp + scripts/kalimdor/maraudon/boss_noxxion.cpp + scripts/kalimdor/maraudon/boss_princess_theradras.cpp + scripts/kalimdor/onyxias_lair/boss_onyxia.cpp + scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp + scripts/kalimdor/razorfen_downs/razorfen_downs.cpp + scripts/kalimdor/razorfen_kraul/def_razorfen_kraul.h + scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp + scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp + scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp + scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp + scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp + scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp + scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp + scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp + scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp + scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp + scripts/kalimdor/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h + scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp + scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp + scripts/kalimdor/wailing_caverns/def_wailing_caverns.h + scripts/kalimdor/wailing_caverns/instance_wailing_caverns.cpp + scripts/kalimdor/wailing_caverns/wailing_caverns.cpp + scripts/kalimdor/zulfarrak/zulfarrak.cpp scripts/kalimdor/ashenvale.cpp scripts/kalimdor/azshara.cpp scripts/kalimdor/azuremyst_isle.cpp @@ -214,6 +279,7 @@ SET(trinityscript_LIB_SRCS scripts/kalimdor/the_barrens.cpp scripts/kalimdor/thousand_needles.cpp scripts/kalimdor/thunder_bluff.cpp + scripts/kalimdor/ungoro_crater.cpp scripts/kalimdor/winterspring.cpp scripts/northrend/borean_tundra.cpp scripts/northrend/dragonblight.cpp @@ -257,32 +323,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/black_temple/def_black_temple.h scripts/zone/black_temple/illidari_council.cpp scripts/zone/black_temple/instance_black_temple.cpp - scripts/zone/blackfathom_depths/instance_blackfathom_deeps.cpp - scripts/zone/blackfathom_depths/def_blackfathom_deeps.h - scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h - scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp - scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp - scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp - scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp - scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp - scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp - scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp - scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp - scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp - scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp - scripts/zone/caverns_of_time/hyjal/def_hyjal.h - scripts/zone/caverns_of_time/hyjal/hyjal.cpp - scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp - scripts/zone/caverns_of_time/hyjal/hyjal_trash.h - scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp - scripts/zone/caverns_of_time/hyjal/hyjalAI.h - scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp - scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp - scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp - scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp - scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h - scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp - scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp @@ -320,10 +360,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp - scripts/zone/maraudon/boss_celebras_the_cursed.cpp - scripts/zone/maraudon/boss_landslide.cpp - scripts/zone/maraudon/boss_noxxion.cpp - scripts/zone/maraudon/boss_princess_theradras.cpp scripts/zone/naxxramas/boss_anubrekhan.cpp scripts/zone/naxxramas/boss_faerlina.cpp scripts/zone/naxxramas/boss_gluth.cpp @@ -341,19 +377,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/naxxramas/boss_thaddius.cpp scripts/zone/naxxramas/def_naxxramas.h scripts/zone/naxxramas/instance_naxxramas.cpp - scripts/zone/onyxias_lair/boss_onyxia.cpp - scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp - scripts/zone/razorfen_downs/razorfen_downs.cpp - scripts/zone/razorfen_kraul/def_razorfen_kraul.h - scripts/zone/razorfen_kraul/instance_razorfen_kraul.cpp - scripts/zone/razorfen_kraul/razorfen_kraul.cpp - scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp - scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp - scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp - scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp - scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp - scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp - scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp scripts/zone/tempest_keep/arcatraz/arcatraz.cpp scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp scripts/zone/tempest_keep/arcatraz/def_arcatraz.h @@ -374,23 +397,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp scripts/zone/tempest_keep/the_mechanar/def_mechanar.h scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp - scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp - scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp - scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp - scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp - scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp - scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp - scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp - scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp - scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp - scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h - scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp - scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp - scripts/zone/ungoro_crater/ungoro_crater.cpp - scripts/zone/wailing_caverns/def_wailing_caverns.h - scripts/zone/wailing_caverns/instance_wailing_caverns.cpp - scripts/zone/wailing_caverns/wailing_caverns.cpp - scripts/zone/zulfarrak/zulfarrak.cpp scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp @@ -462,12 +468,6 @@ SET(trinityscript_LIB_SRCS scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h - scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp - scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp - scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp - scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp - scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp - scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index ece3e669445..00b918bd22e 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -1178,6 +1178,322 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1257,6 +1573,10 @@ RelativePath="..\scripts\kalimdor\thunder_bluff.cpp" > + + @@ -1337,339 +1657,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index 87b5cb00ce4..d25138a9e0f 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -1254,6 +1254,10 @@ RelativePath="..\scripts\kalimdor\thunder_bluff.cpp" > + + @@ -1605,68 +1609,1308 @@ > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + R + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/def_blackfathom_deeps.h b/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/def_blackfathom_deeps.h new file mode 100644 index 00000000000..6a1b1974886 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/def_blackfathom_deeps.h @@ -0,0 +1,23 @@ +/* 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_BFD_H +#define DEF_BFD_H + +enum +{ + DATA_SHRINE1 = 1, + DATA_SHRINE2 = 2, + DATA_SHRINE3 = 3, + DATA_SHRINE4 = 4, + DATA_TWILIGHT_LORD_KELRIS = 5, + DATA_SHRINE_OF_GELIHAST = 6, + DATA_ALTAR_OF_THE_DEEPS = 7, + DATA_MAINDOOR = 8, + + TYPE_KELRIS = 10, + TYPE_SHRINE = 11 +}; + +#endif diff --git a/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/instance_blackfathom_deeps.cpp b/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/instance_blackfathom_deeps.cpp new file mode 100644 index 00000000000..19203ce2d73 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/blackfathom_depths/instance_blackfathom_deeps.cpp @@ -0,0 +1,145 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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_Blackfathom_Deeps +SD%Complete: 50 +SDComment: +SDCategory: Blackfathom Deeps +EndScriptData */ + +#include "precompiled.h" +#include "def_blackfathom_deeps.h" + +#define MAX_ENCOUNTER 2 + +/* Encounter 0 = Twilight Lord Kelris + Encounter 1 = Shrine event + Must kill twilight lord for shrine event to be possible + */ + +struct TRINITY_DLL_DECL instance_blackfathom_deeps : public ScriptedInstance +{ + instance_blackfathom_deeps(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 m_uiTwilightLordKelrisGUID; + uint64 m_uiShrine1GUID; + uint64 m_uiShrine2GUID; + uint64 m_uiShrine3GUID; + uint64 m_uiShrine4GUID; + uint64 m_uiShrineOfGelihastGUID; + uint64 m_uiAltarOfTheDeepsGUID; + uint64 m_uiMainDoorGUID; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiTwilightLordKelrisGUID = 0; + m_uiShrine1GUID = 0; + m_uiShrine2GUID = 0; + m_uiShrine3GUID = 0; + m_uiShrine4GUID = 0; + m_uiShrineOfGelihastGUID = 0; + m_uiAltarOfTheDeepsGUID = 0; + m_uiMainDoorGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == 4832) + m_uiTwilightLordKelrisGUID = pCreature->GetGUID(); + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 21118: m_uiShrine1GUID = pGo->GetGUID(); break; + case 21119: m_uiShrine2GUID = pGo->GetGUID(); break; + case 21120: m_uiShrine3GUID = pGo->GetGUID(); break; + case 21121: m_uiShrine4GUID = pGo->GetGUID(); break; + case 103015: m_uiShrineOfGelihastGUID = pGo->GetGUID(); break; + case 103016: m_uiAltarOfTheDeepsGUID = pGo->GetGUID(); break; + case 21117: m_uiMainDoorGUID = pGo->GetGUID(); break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_KELRIS: + m_auiEncounter[0] = uiData; + break; + case TYPE_SHRINE: + m_auiEncounter[1] = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_KELRIS: + return m_auiEncounter[0]; + case TYPE_SHRINE: + return m_auiEncounter[1]; + } + + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_TWILIGHT_LORD_KELRIS: + return m_uiTwilightLordKelrisGUID; + case DATA_SHRINE1: + return m_uiShrine1GUID; + case DATA_SHRINE2: + return m_uiShrine2GUID; + case DATA_SHRINE3: + return m_uiShrine3GUID; + case DATA_SHRINE4: + return m_uiShrine4GUID; + case DATA_SHRINE_OF_GELIHAST: + return m_uiShrineOfGelihastGUID; + case DATA_MAINDOOR: + return m_uiMainDoorGUID; + } + + return 0; + } +}; + +InstanceData* GetInstanceData_instance_blackfathom_deeps(Map* pMap) +{ + return new instance_blackfathom_deeps(pMap); +} + +void AddSC_instance_blackfathom_deeps() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_blackfathom_deeps"; + newscript->GetInstanceData = &GetInstanceData_instance_blackfathom_deeps; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp new file mode 100644 index 00000000000..2e9877e97e2 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_epoch.cpp @@ -0,0 +1,86 @@ +/* Script Data Start +SDName: Boss epoch +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CURSE_OF_EXERTION 52772 +#define SPELL_TIME_WARP 52766 //Time slows down, reducing attack, casting and movement speed by 70% for 6 sec. +#define SPELL_TIME_STOP 58848 //Stops time in a 50 yard sphere for 2 sec. +#define SPELL_WOUNDING_STRIKE_N 52771 //Used only on the tank +#define SPELL_WOUNDING_STRIKE_H 58830 + +//Say +#define SAY_INTRO -1595000 //"Prince Arthas Menethil, on this day, a powerful darkness has taken hold of your soul. The death you are destined to visit upon others will this day be your own." +#define SAY_AGGRO -1595001 //"We'll see about that, young prince." +#define SAY_TIME_WARP_1 -1595002 //"Tick tock, tick tock..." +#define SAY_TIME_WARP_2 -1595003 //"Not quick enough!" +#define SAY_TIME_WARP_3 -1595004 //"Let's get this over with. " +#define SAY_SLAY_1 -1595005 //"There is no future for you." +#define SAY_SLAY_2 -1595006 //"This is the hour of our greatest triumph!" +#define SAY_SLAY_3 -1595007 //"You were destined to fail. " +#define SAY_DEATH -1595008 //"*gurgles*" + +struct TRINITY_DLL_DECL boss_epochAI : public ScriptedAI +{ + boss_epochAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0:DoScriptText(SAY_SLAY_1, m_creature);break; + case 1:DoScriptText(SAY_SLAY_2, m_creature);break; + case 2:DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_epoch(Creature* pCreature) +{ + return new boss_epochAI (pCreature); +} + +void AddSC_boss_epoch() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_epoch"; + newscript->GetAI = &GetAI_boss_epoch; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp new file mode 100644 index 00000000000..bd68d94d994 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp @@ -0,0 +1,123 @@ +/* Script Data Start +SDName: Boss mal_ganis +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_mal_ganis' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CARRION_SWARM_N 52720 //A cresting wave of chaotic magic splashes over enemies in front of the caster, dealing 3230 to 3570 Shadow damage and 380 to 420 Shadow damage every 3 sec. for 15 sec. +#define SPELL_CARRION_SWARM_H 58852 +#define SPELL_MIND_BLAST_N 52722 //Inflicts 4163 to 4837 Shadow damage to an enemy. +#define SPELL_MIND_BLAST_H 58850 +#define SPELL_SLEEP 52721 //Puts an enemy to sleep for up to 10 sec. Any damage caused will awaken the target. +#define SPELL_VAMPIRIC_TOUCH 52723 //Heals the caster for half the damage dealt by a melee attack. + +//Yell Mal'ganis +#define SAY_INTRO_1 -1595009 +#define SAY_INTRO_2 -1595010 +#define SAY_OUTRO -1595011 +#define SAY_AGGRO -1595012 +#define SAY_KILL_1 -1595013 +#define SAY_KILL_2 -1595014 +#define SAY_KILL_3 -1595015 +#define SAY_SLAY_1 -1595016 +#define SAY_SLAY_2 -1595017 +#define SAY_SLAY_3 -1595018 +#define SAY_SLAY_4 -1595019 +#define SAY_SLEEP_1 -1595020 +#define SAY_SLEEP_2 -1595021 +#define SAY_30HEALTH -1595022 +#define SAY_15HEALTH -1595023 +#define SAY_ESCAPE_SPEECH_1 -1595024 +#define SAY_ESCAPE_SPEECH_2 -1595025 + +struct TRINITY_DLL_DECL boss_mal_ganisAI : public ScriptedAI +{ + boss_mal_ganisAI(Creature *c) : ScriptedAI(c) {} + + bool yelled, + yelled2, + yelled3; + + void Reset() + { + yelled = false; + yelled2 = false; + yelled3 = false; + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (!yelled) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) + { + DoScriptText(SAY_30HEALTH, m_creature); + yelled = true; + } + } + + if (!yelled2) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15) + { + DoScriptText(SAY_15HEALTH, m_creature); + yelled2 = true; + } + } + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 1) + { + //Handle Escape Event + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%4) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + case 3: DoScriptText(SAY_SLAY_4, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_mal_ganis(Creature* pCreature) +{ + return new boss_mal_ganisAI (pCreature); +} + +void AddSC_boss_mal_ganis() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_mal_ganis"; + newscript->GetAI = &GetAI_boss_mal_ganis; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp new file mode 100644 index 00000000000..117a17585c6 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_meathook.cpp @@ -0,0 +1,138 @@ +/* Script Data Start +SDName: Boss meathook +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_meathook' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spell +#define SPELL_CONSTRICTING_CHAINS_N 52696 //Encases the targets in chains, dealing 1800 Physical damage every 1 sec. and stunning the target for 5 sec. +#define SPELL_CONSTRICTING_CHAINS_H 58823 +#define SPELL_DISEASE_EXPULSION_N 52666 //Meathook belches out a cloud of disease, dealing 1710 to 1890 Nature damage and interrupting the spell casting of nearby enemy targets for 4 sec. +#define SPELL_DISEASE_EXPULSION_H 58824 +#define SPELL_FRENZY 58841 //Increases the caster's Physical damage by 10% for 30 sec. + +//Yell +#define SAY_AGGRO -1595026 +#define SAY_SLAY_1 -1595027 +#define SAY_SLAY_2 -1595028 +#define SAY_SLAY_3 -1595029 +#define SAY_SPAWN -1595030 +#define SAY_DEATH -1595031 + +struct TRINITY_DLL_DECL boss_meathookAI : public ScriptedAI +{ + boss_meathookAI(Creature *c) : ScriptedAI(c) {} + + uint32 Chain_Timer, + Disease_Timer, + Frenzy_Timer; + + void Reset() + { + Chain_Timer = 12000 + rand()%5000; //seen on video 13, 17, 15, 12, 16 + Disease_Timer = 2000 + rand()%1000; //approx 3s + Frenzy_Timer = 20000 + rand()%10000; //made it up + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void AttackStart(Unit* who) {} + + std::list pList; + void MoveInLineOfSight(Unit* who, const uint32 diff) + { + /*if (m_creature->isHostileTo(who)) + { + pList.append(who); + }*/ + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Disease_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_DISEASE_EXPULSION_N); + Disease_Timer = 1500 + rand()%2500; + }else Disease_Timer -= diff; + + if (Frenzy_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FRENZY); + Frenzy_Timer = 20000 + rand()%10000; + }else Frenzy_Timer -= diff; + + if (Chain_Timer < diff) + { + + /* + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + std::list::iterator itr; + + int st=0; + for(itr = m_threatlist.begin(); itr != m_threatlist.end(); ++itr) + { + //st++; + m_creature->getThreatManager(). + } + Unit* targets[st]; + int st2=0; + for(int i=1; i<=st; ++i){ + if (!IsWithinLOSInMap(targets[i]) + st2++; + } + Unit* targets_out_of_LOS[st2];*/ + + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_CONSTRICTING_CHAINS_N); //anyone but the tank + Chain_Timer = 2000 + rand()%1000; + }else Chain_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_meathook(Creature* pCreature) +{ + return new boss_meathookAI (pCreature); +} + +void AddSC_boss_meathook() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_meathook"; + newscript->GetAI = &GetAI_boss_meathook; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp new file mode 100644 index 00000000000..418adb82ff4 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/boss_salramm.cpp @@ -0,0 +1,155 @@ +/* Script Data Start +SDName: Boss salramm +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_salramm' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CURSE_OF_TWISTED_FLESH 58845 +#define SPELL_EXPLODE_GHOUL_N 52480 +#define SPELL_EXPLODE_GHOUL_H 58825 +#define SPELL_SHADOW_BOLT_N 57725 +#define SPELL_SHADOW_BOLT_H 58828 +#define SPELL_STEAL_FLESH 52708 +#define SPELL_SUMMON_GHOULS 52451 + +//Yell +#define SAY_AGGRO -1595032 +#define SAY_SPAWN -1595033 +#define SAY_SLAY_1 -1595034 +#define SAY_SLAY_2 -1595035 +#define SAY_SLAY_3 -1595036 +#define SAY_DEATH -1595037 +#define SAY_EXPLODE_GHOUL_1 -1595038 +#define SAY_EXPLODE_GHOUL_2 -1595039 +#define SAY_STEAL_FLESH_1 -1595040 +#define SAY_STEAL_FLESH_2 -1595041 +#define SAY_STEAL_FLESH_3 -1595042 +#define SAY_SUMMON_GHOULS_1 -1595043 +#define SAY_SUMMON_GHOULS_2 -1595044 + +struct TRINITY_DLL_DECL boss_salrammAI : public ScriptedAI +{ + boss_salrammAI(Creature *c) : ScriptedAI(c) {} + + uint32 Curse_flesh_Timer, + Explode_ghoul_Timer, + Shadow_bolt_Timer, + Steal_flesh_Timer, + Summon_ghouls_Timer; + + void Reset() + { + Curse_flesh_Timer = 30000; //30s DBM + Explode_ghoul_Timer = 25000 + rand()%3000; //approx 6 sec after summon ghouls + Shadow_bolt_Timer = 8000 + rand()%4000; // approx 10s + Steal_flesh_Timer = 12345; + Summon_ghouls_Timer = 19000 + rand()%5000; //on a video approx 24s after aggro + } + + void EnterCombat(Unit* who) + {DoScriptText(SAY_AGGRO, m_creature);} + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + Unit* random_target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + //Curse of twisted flesh timer + if (Curse_flesh_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CURSE_OF_TWISTED_FLESH); + Curse_flesh_Timer = 37000; + }else Curse_flesh_Timer -= diff; + + //Shadow bolt timer + if (Shadow_bolt_Timer < diff) + { + if (random_target) + DoCast(random_target,SPELL_SHADOW_BOLT_N); + Shadow_bolt_Timer = 8000 + rand()%4000; + }else Shadow_bolt_Timer -= diff; + + //Steal Flesh timer + if (Steal_flesh_Timer < diff) + { + switch(rand()%3) + { + case 0: + DoScriptText(SAY_STEAL_FLESH_1, m_creature); + break; + case 1: + DoScriptText(SAY_STEAL_FLESH_2, m_creature); + break; + case 2: + DoScriptText(SAY_STEAL_FLESH_3, m_creature); + break; + } + if (random_target) + DoCast(random_target,SPELL_STEAL_FLESH); + Steal_flesh_Timer = 10000; + }else Steal_flesh_Timer -= diff; + + //Summon ghouls timer + if (Summon_ghouls_Timer < diff) + { + switch(rand()%2) + { + case 0: + DoScriptText(SAY_SUMMON_GHOULS_1, m_creature); + break; + case 1: + DoScriptText(SAY_SUMMON_GHOULS_2, m_creature); + break; + } + if (random_target) + DoCast(random_target,SPELL_SUMMON_GHOULS); + Summon_ghouls_Timer = 10000; + }else Summon_ghouls_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) + {DoScriptText(SAY_DEATH, m_creature);} + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_salramm(Creature* pCreature) +{ + return new boss_salrammAI (pCreature); +} + +void AddSC_boss_salramm() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_salramm"; + newscript->GetAI = &GetAI_boss_salramm; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h new file mode 100644 index 00000000000..849549e8f99 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h @@ -0,0 +1,4 @@ +#ifndef DEF_CULLING_OF_STRATHOLME_H +#define DEF_CULLING_OF_STRATHOLME_H + +#endif diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp new file mode 100644 index 00000000000..35ee68ea991 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_culling_of_stratholme.h" + +struct TRINITY_DLL_DECL instance_culling_of_stratholme : public ScriptedInstance +{ + instance_culling_of_stratholme(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_culling_of_stratholme(Map* pMap) +{ + return new instance_culling_of_stratholme(pMap); +} + +void AddSC_instance_culling_of_stratholme() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_culling_of_stratholme"; + newscript->GetInstanceData = &GetInstanceData_instance_culling_of_stratholme; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp new file mode 100644 index 00000000000..5667f5ae0b1 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_aeonus.cpp @@ -0,0 +1,151 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Aeonus +SD%Complete: 80 +SDComment: Some spells not implemented +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +#include "precompiled.h" +#include "def_dark_portal.h" + +enum +{ + SAY_ENTER = -1269012, + SAY_AGGRO = -1269013, + SAY_BANISH = -1269014, + SAY_SLAY1 = -1269015, + SAY_SLAY2 = -1269016, + SAY_DEATH = -1269017, + EMOTE_FRENZY = -1269018, + + SPELL_CLEAVE = 40504, + SPELL_TIME_STOP = 31422, + SPELL_ENRAGE = 37605, + SPELL_SAND_BREATH = 31473, + H_SPELL_SAND_BREATH = 39049 +}; + +struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI +{ + boss_aeonusAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + bool HeroicMode; + + uint32 SandBreath_Timer; + uint32 TimeStop_Timer; + uint32 Frenzy_Timer; + + void Reset() + { + SandBreath_Timer = 15000+rand()%15000; + TimeStop_Timer = 10000+rand()%5000; + Frenzy_Timer = 30000+rand()%15000; + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void MoveInLineOfSight(Unit *who) + { + //Despawn Time Keeper + if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) + { + if (m_creature->IsWithinDistInMap(who,20.0f)) + { + DoScriptText(SAY_BANISH, m_creature); + m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + { + pInstance->SetData(TYPE_RIFT,DONE); + pInstance->SetData(TYPE_MEDIVH,DONE);//FIXME: later should be removed + } + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Sand Breath + if (SandBreath_Timer < diff) + { + DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_SAND_BREATH : SPELL_SAND_BREATH); + SandBreath_Timer = 15000+rand()%10000; + }else SandBreath_Timer -= diff; + + //Time Stop + if (TimeStop_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_TIME_STOP); + TimeStop_Timer = 20000+rand()%15000; + }else TimeStop_Timer -= diff; + + //Frenzy + if (Frenzy_Timer < diff) + { + DoScriptText(EMOTE_FRENZY, m_creature); + DoCast(m_creature, SPELL_ENRAGE); + Frenzy_Timer = 20000+rand()%15000; + }else Frenzy_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_aeonus(Creature* pCreature) +{ + return new boss_aeonusAI (pCreature); +} + +void AddSC_boss_aeonus() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_aeonus"; + newscript->GetAI = &GetAI_boss_aeonus; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp new file mode 100644 index 00000000000..2a1d3c4fe03 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp @@ -0,0 +1,160 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Chrono_Lord_Deja +SD%Complete: 65 +SDComment: All abilities not implemented +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +#include "precompiled.h" +#include "def_dark_portal.h" + +enum +{ + SAY_ENTER = -1269006, + SAY_AGGRO = -1269007, + SAY_BANISH = -1269008, + SAY_SLAY1 = -1269009, + SAY_SLAY2 = -1269010, + SAY_DEATH = -1269011, + + SPELL_ARCANE_BLAST = 31457, + H_SPELL_ARCANE_BLAST = 38538, + SPELL_ARCANE_DISCHARGE = 31472, + H_SPELL_ARCANE_DISCHARGE = 38539, + SPELL_TIME_LAPSE = 31467, + SPELL_ATTRACTION = 38540 //Not Implemented (Heroic mode) +}; + +struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI +{ + boss_chrono_lord_dejaAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + bool HeroicMode; + + uint32 ArcaneBlast_Timer; + uint32 TimeLapse_Timer; + uint32 Attraction_Timer; + uint32 ArcaneDischarge_Timer; + + void Reset() + { + ArcaneBlast_Timer = 18000+rand()%5000; + TimeLapse_Timer = 10000+rand()%5000; + ArcaneDischarge_Timer = 20000+rand()%10000; + Attraction_Timer = 25000+rand()%10000; + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void MoveInLineOfSight(Unit *who) + { + //Despawn Time Keeper + if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) + { + if (m_creature->IsWithinDistInMap(who,20.0f)) + { + DoScriptText(SAY_BANISH, m_creature); + m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(TYPE_RIFT,SPECIAL); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Arcane Blast + if (ArcaneBlast_Timer < diff) + { + DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_ARCANE_BLAST : SPELL_ARCANE_BLAST); + ArcaneBlast_Timer = 15000+rand()%10000; + }else ArcaneBlast_Timer -= diff; + + //Arcane Discharge + if (ArcaneDischarge_Timer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + DoCast(target,HeroicMode ? H_SPELL_ARCANE_DISCHARGE : SPELL_ARCANE_DISCHARGE); + ArcaneDischarge_Timer = 20000+rand()%10000; + }else ArcaneDischarge_Timer -= diff; + + //Time Lapse + if (TimeLapse_Timer < diff) + { + DoScriptText(SAY_BANISH, m_creature); + DoCast(m_creature, SPELL_TIME_LAPSE); + TimeLapse_Timer = 15000+rand()%10000; + }else TimeLapse_Timer -= diff; + + if (HeroicMode) + { + if (Attraction_Timer < diff) + { + DoCast(m_creature,SPELL_ATTRACTION); + Attraction_Timer = 25000+rand()%10000; + }else Attraction_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_chrono_lord_deja(Creature* pCreature) +{ + return new boss_chrono_lord_dejaAI (pCreature); +} + +void AddSC_boss_chrono_lord_deja() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_chrono_lord_deja"; + newscript->GetAI = &GetAI_boss_chrono_lord_deja; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.cpp new file mode 100644 index 00000000000..0d1a6eec214 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/boss_temporus.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_Temporus +SD%Complete: 75 +SDComment: More abilities need to be implemented +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +#include "precompiled.h" +#include "def_dark_portal.h" + +enum +{ + SAY_ENTER = -1269000, + SAY_AGGRO = -1269001, + SAY_BANISH = -1269002, + SAY_SLAY1 = -1269003, + SAY_SLAY2 = -1269004, + SAY_DEATH = -1269005, + + SPELL_HASTE = 31458, + SPELL_MORTAL_WOUND = 31464, + SPELL_WING_BUFFET = 31475, + H_SPELL_WING_BUFFET = 38593, + SPELL_REFLECT = 38592 //Not Implemented (Heroic mod) +}; + +struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI +{ + boss_temporusAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + bool HeroicMode; + + uint32 Haste_Timer; + uint32 SpellReflection_Timer; + uint32 MortalWound_Timer; + uint32 WingBuffet_Timer; + + void Reset() + { + Haste_Timer = 15000+rand()%8000; + SpellReflection_Timer = 30000; + MortalWound_Timer = 8000; + WingBuffet_Timer = 25000+rand()%10000; + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(TYPE_RIFT,SPECIAL); + } + + void MoveInLineOfSight(Unit *who) + { + //Despawn Time Keeper + if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) + { + if (m_creature->IsWithinDistInMap(who,20.0f)) + { + DoScriptText(SAY_BANISH, m_creature); + + m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + ScriptedAI::MoveInLineOfSight(who); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Attack Haste + if (Haste_Timer < diff) + { + DoCast(m_creature, SPELL_HASTE); + Haste_Timer = 20000+rand()%5000; + }else Haste_Timer -= diff; + + //MortalWound_Timer + if (MortalWound_Timer < diff) + { + DoCast(m_creature, SPELL_MORTAL_WOUND); + MortalWound_Timer = 10000+rand()%10000; + }else MortalWound_Timer -= diff; + + //Wing ruffet + if (WingBuffet_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_WING_BUFFET : SPELL_WING_BUFFET); + WingBuffet_Timer = 20000+rand()%10000; + }else WingBuffet_Timer -= diff; + + if (HeroicMode) + { + if (SpellReflection_Timer < diff) + { + DoCast(m_creature,SPELL_REFLECT); + SpellReflection_Timer = 25000+rand()%10000; + }else SpellReflection_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_temporus(Creature* pCreature) +{ + return new boss_temporusAI (pCreature); +} + +void AddSC_boss_temporus() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_temporus"; + newscript->GetAI = &GetAI_boss_temporus; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp new file mode 100644 index 00000000000..b57abc8c5d6 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/dark_portal.cpp @@ -0,0 +1,409 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Dark_Portal +SD%Complete: 30 +SDComment: Misc NPC's and mobs for instance. Most here far from complete. +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +/* ContentData +npc_medivh_bm +npc_time_rift +npc_saat +EndContentData */ + +#include "precompiled.h" +#include "def_dark_portal.h" + +#define SAY_ENTER -1269020 //where does this belong? +#define SAY_INTRO -1269021 +#define SAY_WEAK75 -1269022 +#define SAY_WEAK50 -1269023 +#define SAY_WEAK25 -1269024 +#define SAY_DEATH -1269025 +#define SAY_WIN -1269026 +#define SAY_ORCS_ENTER -1269027 +#define SAY_ORCS_ANSWER -1269028 + +#define SPELL_CHANNEL 31556 +#define SPELL_PORTAL_RUNE 32570 //aura(portal on ground effect) + +#define SPELL_BLACK_CRYSTAL 32563 //aura +#define SPELL_PORTAL_CRYSTAL 32564 //summon + +#define SPELL_BANISH_PURPLE 32566 //aura +#define SPELL_BANISH_GREEN 32567 //aura + +#define SPELL_CORRUPT 31326 +#define SPELL_CORRUPT_AEONUS 37853 + +#define C_COUNCIL_ENFORCER 17023 + +struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI +{ + npc_medivh_bmAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 SpellCorrupt_Timer; + uint32 Check_Timer; + + bool Life75; + bool Life50; + bool Life25; + + void Reset() + { + SpellCorrupt_Timer = 0; + + if (!pInstance) + return; + + if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) + m_creature->CastSpell(m_creature,SPELL_CHANNEL,true); + else if (m_creature->HasAura(SPELL_CHANNEL)) + m_creature->RemoveAura(SPELL_CHANNEL); + + m_creature->CastSpell(m_creature,SPELL_PORTAL_RUNE,true); + } + + void MoveInLineOfSight(Unit *who) + { + if (!pInstance) + return; + + if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f)) + { + if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS || pInstance->GetData(TYPE_MEDIVH) == DONE) + return; + + DoScriptText(SAY_INTRO, m_creature); + pInstance->SetData(TYPE_MEDIVH,IN_PROGRESS); + m_creature->CastSpell(m_creature,SPELL_CHANNEL,false); + Check_Timer = 5000; + } + else if (who->GetTypeId() == TYPEID_UNIT && m_creature->IsWithinDistInMap(who, 15.0f)) + { + if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) + return; + + uint32 entry = who->GetEntry(); + if (entry == C_ASSAS || entry == C_WHELP || entry == C_CHRON || entry == C_EXECU || entry == C_VANQU) + { + who->StopMoving(); + who->CastSpell(m_creature,SPELL_CORRUPT,false); + } + else if (entry == C_AEONUS) + { + who->StopMoving(); + who->CastSpell(m_creature,SPELL_CORRUPT_AEONUS,false); + } + } + } + + void AttackStart(Unit *who) + { + //if (pInstance && pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) + //return; + + //ScriptedAI::AttackStart(who); + } + + void EnterCombat(Unit *who) {} + + void SpellHit(Unit* caster, const SpellEntry* spell) + { + if (SpellCorrupt_Timer) + return; + + if (spell->Id == SPELL_CORRUPT_AEONUS) + SpellCorrupt_Timer = 1000; + + if (spell->Id == SPELL_CORRUPT) + SpellCorrupt_Timer = 3000; + } + + void JustDied(Unit* Killer) + { + if (Killer->GetEntry() == m_creature->GetEntry()) + return; + + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (SpellCorrupt_Timer) + { + if (SpellCorrupt_Timer <= diff) + { + pInstance->SetData(TYPE_MEDIVH,SPECIAL); + + if (m_creature->HasAura(SPELL_CORRUPT_AEONUS)) + SpellCorrupt_Timer = 1000; + else if (m_creature->HasAura(SPELL_CORRUPT)) + SpellCorrupt_Timer = 3000; + else + SpellCorrupt_Timer = 0; + }else SpellCorrupt_Timer -= diff; + } + + if (Check_Timer) + { + if (Check_Timer <= diff) + { + uint32 pct = pInstance->GetData(DATA_SHIELD); + + Check_Timer = 5000; + + if (Life25 && pct <= 25) + { + DoScriptText(SAY_WEAK25, m_creature); + Life25 = false; + } + else if (Life50 && pct <= 50) + { + DoScriptText(SAY_WEAK50, m_creature); + Life50 = false; + } + else if (Life75 && pct <= 75) + { + DoScriptText(SAY_WEAK75, m_creature); + Life75 = false; + } + + //if we reach this it means event was running but at some point reset. + if (pInstance->GetData(TYPE_MEDIVH) == NOT_STARTED) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + m_creature->Respawn(); + return; + } + + if (pInstance->GetData(TYPE_RIFT) == DONE) + { + DoScriptText(SAY_WIN, m_creature); + Check_Timer = 0; + + if (m_creature->HasAura(SPELL_CHANNEL)) + m_creature->RemoveAura(SPELL_CHANNEL); + + //TODO: start the post-event here + pInstance->SetData(TYPE_MEDIVH,DONE); + } + }else Check_Timer -= diff; + } + + //if (!UpdateVictim()) + //return; + + //DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_medivh_bm(Creature* pCreature) +{ + return new npc_medivh_bmAI (pCreature); +} + +struct Wave +{ + uint32 PortalMob[4]; //spawns for portal waves (in order) +}; + +static Wave PortalWaves[]= +{ + {C_ASSAS, C_WHELP, C_CHRON, 0}, + {C_EXECU, C_CHRON, C_WHELP, C_ASSAS}, + {C_EXECU, C_VANQU, C_CHRON, C_ASSAS} +}; + +struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI +{ + npc_time_riftAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 TimeRiftWave_Timer; + uint8 mRiftWaveCount; + uint8 mPortalCount; + uint8 mWaveId; + + void Reset() + { + + TimeRiftWave_Timer = 15000; + mRiftWaveCount = 0; + + if (!pInstance) + return; + + mPortalCount = pInstance->GetData(DATA_PORTAL_COUNT); + + if (mPortalCount < 6) + mWaveId = 0; + else if (mPortalCount > 12) + mWaveId = 2; + else mWaveId = 1; + + } + void EnterCombat(Unit *who) {} + + void DoSummonAtRift(uint32 creature_entry) + { + if (!creature_entry) + return; + + if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) + { + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + return; + } + + float x,y,z; + m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),10.0f,x,y,z); + + //normalize Z-level if we can, if rift is not at ground level. + z = std::max(m_creature->GetMap()->GetHeight(x, y, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(x, y)); + + Unit *Summon = m_creature->SummonCreature(creature_entry,x,y,z,m_creature->GetOrientation(), + TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + + if (Summon) + { + if (Unit *temp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MEDIVH))) + Summon->AddThreat(temp,0.0f); + } + } + + void DoSelectSummon() + { + uint32 entry = 0; + + if ((mRiftWaveCount > 2 && mWaveId < 1) || mRiftWaveCount > 3) + mRiftWaveCount = 0; + + entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount]; + debug_log("TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).",mRiftWaveCount,entry); + + ++mRiftWaveCount; + + if (entry == C_WHELP) + { + for(uint8 i = 0; i < 3; ++i) + DoSummonAtRift(entry); + }else DoSummonAtRift(entry); + } + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (TimeRiftWave_Timer < diff) + { + DoSelectSummon(); + TimeRiftWave_Timer = 15000; + }else TimeRiftWave_Timer -= diff; + + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + debug_log("TSCR: npc_time_rift: not casting anylonger, i need to die."); + m_creature->setDeathState(JUST_DIED); + + if (pInstance->GetData(TYPE_RIFT) == IN_PROGRESS) + pInstance->SetData(TYPE_RIFT,SPECIAL); + } +}; + +CreatureAI* GetAI_npc_time_rift(Creature* pCreature) +{ + return new npc_time_riftAI (pCreature); +} + +#define SAY_SAAT_WELCOME -1269019 + +#define GOSSIP_ITEM_OBTAIN "[PH] Obtain Chrono-Beacon" +#define SPELL_CHRONO_BEACON 34975 +#define ITEM_CHRONO_BEACON 24289 + +bool GossipHello_npc_saat(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(ITEM_CHRONO_BEACON,1)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(10000, pCreature->GetGUID()); + return true; + } + else if (pPlayer->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !pPlayer->HasItemCount(ITEM_CHRONO_BEACON,1)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(10001, pCreature->GetGUID()); + return true; + } + + pPlayer->SEND_GOSSIP_MENU(10002, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_saat(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->CastSpell(pPlayer,SPELL_CHRONO_BEACON,false); + } + return true; +} + +void AddSC_dark_portal() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_medivh_bm"; + newscript->GetAI = &GetAI_npc_medivh_bm; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_time_rift"; + newscript->GetAI = &GetAI_npc_time_rift; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_saat"; + newscript->pGossipHello = &GossipHello_npc_saat; + newscript->pGossipSelect = &GossipSelect_npc_saat; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/def_dark_portal.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/def_dark_portal.h new file mode 100644 index 00000000000..7bfd8c917d7 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/def_dark_portal.h @@ -0,0 +1,35 @@ +/* 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_DARKPORTAL_H +#define DEF_DARKPORTAL_H + +#define TYPE_MEDIVH 1 +#define TYPE_RIFT 2 + +#define DATA_MEDIVH 10 +#define DATA_PORTAL_COUNT 11 +#define DATA_SHIELD 12 + +#define WORLD_STATE_BM 2541 +#define WORLD_STATE_BM_SHIELD 2540 +#define WORLD_STATE_BM_RIFT 2784 + +#define QUEST_OPENING_PORTAL 10297 +#define QUEST_MASTER_TOUCH 9836 + +#define C_TIME_KEEPER 17918 +#define C_RKEEP 21104 +#define C_RLORD 17839 +#define C_DEJA 17879 +#define C_TEMPO 17880 +#define C_AEONUS 17881 +#define C_ASSAS 17835 +#define C_WHELP 21818 +#define C_CHRON 17892 +#define C_EXECU 18994 +#define C_VANQU 18995 + +#endif + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp new file mode 100644 index 00000000000..f406bca7113 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/dark_portal/instance_dark_portal.cpp @@ -0,0 +1,351 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along 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_Dark_Portal +SD%Complete: 50 +SDComment: Quest support: 9836, 10297. Currently in progress. +SDCategory: Caverns of Time, The Dark Portal +EndScriptData */ + +#include "precompiled.h" +#include "def_dark_portal.h" + +#define MAX_ENCOUNTER 2 + +#define C_MEDIVH 15608 +#define C_TIME_RIFT 17838 + +#define SPELL_RIFT_CHANNEL 31387 + +#define RIFT_BOSS 1 + +inline uint32 RandRiftBoss() { return ((rand()%2) ? C_RKEEP : C_RLORD); } + +float PortalLocation[4][4]= +{ + {-2041.06, 7042.08, 29.99, 1.30}, + {-1968.18, 7042.11, 21.93, 2.12}, + {-1885.82, 7107.36, 22.32, 3.07}, + {-1928.11, 7175.95, 22.11, 3.44} +}; + +struct Wave +{ + uint32 PortalBoss; //protector of current portal + uint32 NextPortalTime; //time to next portal, or 0 if portal boss need to be killed +}; + +static Wave RiftWaves[]= +{ + {RIFT_BOSS, 0}, + {C_DEJA, 0}, + {RIFT_BOSS, 120000}, + {C_TEMPO, 140000}, + {RIFT_BOSS, 120000}, + {C_AEONUS, 0} +}; + +struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance +{ + instance_dark_portal(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint32 mRiftPortalCount; + uint32 mShieldPercent; + uint8 mRiftWaveCount; + uint8 mRiftWaveId; + + uint32 NextPortal_Timer; + + uint64 MedivhGUID; + uint8 CurrentRiftId; + + void Initialize() + { + MedivhGUID = 0; + Clear(); + } + + void Clear() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + mRiftPortalCount = 0; + mShieldPercent = 100; + mRiftWaveCount = 0; + mRiftWaveId = 0; + + CurrentRiftId = 0; + + NextPortal_Timer = 0; + } + + void InitWorldState(bool Enable = true) + { + DoUpdateWorldState(WORLD_STATE_BM,Enable ? 1 : 0); + DoUpdateWorldState(WORLD_STATE_BM_SHIELD, 100); + DoUpdateWorldState(WORLD_STATE_BM_RIFT, 0); + } + + bool IsEncounterInProgress() + { + if (GetData(TYPE_MEDIVH) == IN_PROGRESS) + return true; + + return false; + } + + void OnPlayerEnter(Player* pPlayer) + { + if (GetData(TYPE_MEDIVH) == IN_PROGRESS) + return; + + pPlayer->SendUpdateWorldState(WORLD_STATE_BM,0); + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == C_MEDIVH) + MedivhGUID = pCreature->GetGUID(); + } + + //what other conditions to check? + bool CanProgressEvent() + { + if (instance->GetPlayers().isEmpty()) + return false; + + return true; + } + + uint8 GetRiftWaveId() + { + switch(mRiftPortalCount) + { + case 6: + mRiftWaveId = 2; + return 1; + case 12: + mRiftWaveId = 4; + return 3; + case 18: + return 5; + default: + return mRiftWaveId; + } + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_MEDIVH: + if (data == SPECIAL && m_auiEncounter[0] == IN_PROGRESS) + { + --mShieldPercent; + + DoUpdateWorldState(WORLD_STATE_BM_SHIELD, mShieldPercent); + + if (!mShieldPercent) + { + if (Creature* pMedivh = instance->GetCreature(MedivhGUID)) + { + if (pMedivh->isAlive()) + { + pMedivh->DealDamage(pMedivh, pMedivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_auiEncounter[0] = FAIL; + m_auiEncounter[1] = NOT_STARTED; + } + } + } + } + else + { + if (data == IN_PROGRESS) + { + debug_log("TSCR: Instance Dark Portal: Starting event."); + InitWorldState(); + m_auiEncounter[1] = IN_PROGRESS; + NextPortal_Timer = 15000; + } + + if (data == DONE) + { + //this may be completed further out in the post-event + debug_log("TSCR: Instance Dark Portal: Event completed."); + 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->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(QUEST_OPENING_PORTAL); + + if (pPlayer->GetQuestStatus(QUEST_MASTER_TOUCH) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(QUEST_MASTER_TOUCH); + } + } + } + } + + m_auiEncounter[0] = data; + } + break; + case TYPE_RIFT: + if (data == SPECIAL) + { + if (mRiftPortalCount < 7) + NextPortal_Timer = 5000; + } + else + m_auiEncounter[1] = data; + break; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_MEDIVH: + return m_auiEncounter[0]; + case TYPE_RIFT: + return m_auiEncounter[1]; + case DATA_PORTAL_COUNT: + return mRiftPortalCount; + case DATA_SHIELD: + return mShieldPercent; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + if (data == DATA_MEDIVH) + return MedivhGUID; + + return 0; + } + + Creature* SummonedPortalBoss(Creature* pSource) + { + uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss; + + if (entry == RIFT_BOSS) + entry = RandRiftBoss(); + + float x,y,z; + pSource->GetRandomPoint(pSource->GetPositionX(),pSource->GetPositionY(),pSource->GetPositionZ(),10.0f,x,y,z); + //normalize Z-level if we can, if rift is not at ground level. + z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y)); + + debug_log("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry); + + Creature* pSummoned = pSource->SummonCreature(entry,x,y,z,pSource->GetOrientation(), + TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + + if (pSummoned) + return pSummoned; + + debug_log("TSCR: Instance Dark Portal: what just happened there? No boss, no loot, no fun..."); + return NULL; + } + + void DoSpawnPortal() + { + if (Creature* pMedivh = instance->GetCreature(MedivhGUID)) + { + int tmp = rand()%(4-1); + + if (tmp >= CurrentRiftId) + tmp++; + debug_log("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); + + CurrentRiftId = tmp; + + Creature* pTemp = pMedivh->SummonCreature(C_TIME_RIFT, + PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3], + TEMPSUMMON_CORPSE_DESPAWN,0); + if (pTemp) + { + + pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + + if (Creature* pBoss = SummonedPortalBoss(pTemp)) + { + if (pBoss->GetEntry() == C_AEONUS) + { + pBoss->AddThreat(pMedivh,0.0f); + } + else + { + pBoss->AddThreat(pTemp,0.0f); + pTemp->CastSpell(pBoss,SPELL_RIFT_CHANNEL,false); + } + } + } + } + } + + void Update(uint32 diff) + { + if (m_auiEncounter[1] != IN_PROGRESS) + return; + + //add delay timer? + if (!CanProgressEvent()) + { + Clear(); + return; + } + + if (NextPortal_Timer) + { + if (NextPortal_Timer <= diff) + { + ++mRiftPortalCount; + + DoUpdateWorldState(WORLD_STATE_BM_RIFT, mRiftPortalCount); + + DoSpawnPortal(); + NextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime; + }else NextPortal_Timer -= diff; + } + } +}; + +InstanceData* GetInstanceData_instance_dark_portal(Map* pMap) +{ + return new instance_dark_portal(pMap); +} + +void AddSC_instance_dark_portal() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "instance_dark_portal"; + newscript->GetInstanceData = &GetInstanceData_instance_dark_portal; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp new file mode 100644 index 00000000000..9f2971083e4 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_anetheron.cpp @@ -0,0 +1,312 @@ + +#include "precompiled.h" +#include "def_hyjal.h" +#include "hyjal_trash.h" + +#define SPELL_CARRION_SWARM 31306 +#define SPELL_SLEEP 31298 +#define SPELL_VAMPIRIC_AURA 38196 +#define SPELL_INFERNO 31299 + +#define SAY_ONDEATH "The clock... is still... ticking." +#define SOUND_ONDEATH 10982 + +#define SAY_ONSLAY1 "Your hopes are lost!" +#define SAY_ONSLAY2 "Scream for me!" +#define SAY_ONSLAY3 "Pity, no time for a slow death!" +#define SOUND_ONSLAY1 10981 +#define SOUND_ONSLAY2 11038 +#define SOUND_ONSLAY3 11039 + +#define SAY_SWARM1 "The swarm is eager to feed!" +#define SAY_SWARM2 "Pestilence upon you!" +#define SOUND_SWARM1 10979 +#define SOUND_SWARM2 11037 + +#define SAY_SLEEP1 "You look tired..." +#define SAY_SLEEP2 "Sweet dreams..." +#define SOUND_SLEEP1 10978 +#define SOUND_SLEEP2 11545 + +#define SAY_INFERNO1 "Let fire rain from above!" +#define SAY_INFERNO2 "Earth and sky shall burn!" +#define SOUND_INFERNO1 10980 +#define SOUND_INFERNO2 11036 + +#define SAY_ONAGGRO "You are defenders of a doomed world! Flee here, and perhaps you will prolong your pathetic lives!" +#define SOUND_ONAGGRO 10977 + +struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI +{ + boss_anetheronAI(Creature *c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + SpellEntry *TempSpell = GET_SPELL(SPELL_SLEEP); + if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) + { + TempSpell->EffectImplicitTargetA[0] = 1; + TempSpell->EffectImplicitTargetB[0] = 0; + } + } + + uint32 SwarmTimer; + uint32 SleepTimer; + uint32 AuraTimer; + uint32 InfernoTimer; + bool pGo; + uint32 pos; + + void Reset() + { + damageTaken = 0; + SwarmTimer = 45000; + SleepTimer = 60000; + AuraTimer = 5000; + InfernoTimer = 45000; + + if (pInstance && IsEvent) + pInstance->SetData(DATA_ANETHERONEVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance && IsEvent) + pInstance->SetData(DATA_ANETHERONEVENT, IN_PROGRESS); + DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); + m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); + m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); + m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0); + break; + case 2: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); + m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0); + break; + } + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + + void JustDied(Unit *victim) + { + hyjal_trashAI::JustDied(victim); + if (pInstance && IsEvent) + pInstance->SetData(DATA_ANETHERONEVENT, DONE); + DoPlaySoundToSet(m_creature, SOUND_ONDEATH); + m_creature->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0); + } + + void UpdateAI(const uint32 diff) + { + if (IsEvent) + { + //Must update npc_escortAI + npc_escortAI::UpdateAI(diff); + if (!pGo) + { + pGo = true; + if (pInstance) + { + AddWaypoint(0, 4896.08, -1576.35, 1333.65); + AddWaypoint(1, 4898.68, -1615.02, 1329.48); + AddWaypoint(2, 4907.12, -1667.08, 1321.00); + AddWaypoint(3, 4963.18, -1699.35, 1340.51); + AddWaypoint(4, 4989.16, -1716.67, 1335.74); + AddWaypoint(5, 5026.27, -1736.89, 1323.02); + AddWaypoint(6, 5037.77, -1770.56, 1324.36); + AddWaypoint(7, 5067.23, -1789.95, 1321.17); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (SwarmTimer < diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,100,true)) + DoCast(target,SPELL_CARRION_SWARM); + + SwarmTimer = 45000+rand()%15000; + switch(rand()%2) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_SWARM1); + m_creature->MonsterYell(SAY_SWARM1, LANG_UNIVERSAL, 0); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_SWARM2); + m_creature->MonsterYell(SAY_SWARM2, LANG_UNIVERSAL, 0); + break; + } + }else SwarmTimer -= diff; + + if (SleepTimer < diff) + { + for(uint8 i=0;i<3; ++i) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,100,true)) + target->CastSpell(target,SPELL_SLEEP,true); + } + SleepTimer = 60000; + switch(rand()%2) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_SLEEP1); + m_creature->MonsterYell(SAY_SLEEP1, LANG_UNIVERSAL, 0); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_SLEEP2); + m_creature->MonsterYell(SAY_SLEEP2, LANG_UNIVERSAL, 0); + break; + } + }else SleepTimer -= diff; + if (AuraTimer < diff) + { + DoCast(m_creature, SPELL_VAMPIRIC_AURA,true); + AuraTimer = 10000+rand()%10000; + }else AuraTimer -= diff; + if (InfernoTimer < diff) + { + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,100,true), SPELL_INFERNO); + InfernoTimer = 45000; + switch(rand()%2) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_INFERNO1); + m_creature->MonsterYell(SAY_INFERNO1, LANG_UNIVERSAL, 0); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_INFERNO2); + m_creature->MonsterYell(SAY_INFERNO2, LANG_UNIVERSAL, 0); + break; + } + }else InfernoTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_anetheron(Creature* pCreature) +{ + return new boss_anetheronAI (pCreature); +} + +#define SPELL_IMMOLATION 31303 +#define SPELL_INFERNO_EFFECT 31302 + +struct TRINITY_DLL_DECL mob_towering_infernalAI : public ScriptedAI +{ + mob_towering_infernalAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + if (pInstance) + AnetheronGUID = pInstance->GetData64(DATA_ANETHERON); + } + + uint32 ImmolationTimer; + uint32 CheckTimer; + uint64 AnetheronGUID; + ScriptedInstance* pInstance; + + void Reset() + { + DoCast(m_creature, SPELL_INFERNO_EFFECT); + ImmolationTimer = 5000; + CheckTimer = 5000; + } + + void EnterCombat(Unit *who) + { + + } + + void KilledUnit(Unit *victim) + { + + } + + void JustDied(Unit *victim) + { + + } + + void MoveInLineOfSight(Unit *who) + { + if (m_creature->IsWithinDist(who, 50) && !m_creature->isInCombat() && m_creature->IsHostileTo(who)) + AttackStart(who); + } + + void UpdateAI(const uint32 diff) + { + if (CheckTimer < diff) + { + if (AnetheronGUID) + { + Creature* boss = Unit::GetCreature((*m_creature),AnetheronGUID); + if (!boss || (boss && boss->isDead())) + { + m_creature->setDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + return; + } + } + CheckTimer = 5000; + }else CheckTimer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (ImmolationTimer < diff) + { + DoCast(m_creature, SPELL_IMMOLATION); + ImmolationTimer = 5000; + }else ImmolationTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_towering_infernal(Creature* pCreature) +{ + return new mob_towering_infernalAI (pCreature); +} + +void AddSC_boss_anetheron() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_anetheron"; + newscript->GetAI = &GetAI_boss_anetheron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_towering_infernal"; + newscript->GetAI = &GetAI_mob_towering_infernal; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp new file mode 100644 index 00000000000..4819a74fc0c --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_archimonde.cpp @@ -0,0 +1,640 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Archimonde +SD%Complete: 85 +SDComment: Doomfires not completely offlike due to core limitations for random moving. Tyrande and second phase not fully implemented. +SDCategory: Caverns of Time, Mount Hyjal +EndScriptData */ + +#include "precompiled.h" +#include "def_hyjal.h" +#include "SpellAuras.h" +#include "hyjal_trash.h" + +//text id -1534018 are the text used when previous events complete. Not part of this script. +#define SAY_AGGRO -1534019 +#define SAY_DOOMFIRE1 -1534020 +#define SAY_DOOMFIRE2 -1534021 +#define SAY_AIR_BURST1 -1534022 +#define SAY_AIR_BURST2 -1534023 +#define SAY_SLAY1 -1534024 +#define SAY_SLAY2 -1534025 +#define SAY_SLAY3 -1534026 +#define SAY_ENRAGE -1534027 +#define SAY_DEATH -1534028 +#define SAY_SOUL_CHARGE1 -1534029 +#define SAY_SOUL_CHARGE2 -1534030 + +#define SPELL_DENOUEMENT_WISP 32124 +#define SPELL_ANCIENT_SPARK 39349 +#define SPELL_PROTECTION_OF_ELUNE 38528 + +#define SPELL_DRAIN_WORLD_TREE 39140 +#define SPELL_DRAIN_WORLD_TREE_2 39141 + +#define SPELL_FINGER_OF_DEATH 31984 +#define SPELL_HAND_OF_DEATH 35354 +#define SPELL_AIR_BURST 32014 +#define SPELL_GRIP_OF_THE_LEGION 31972 +#define SPELL_DOOMFIRE_STRIKE 31903 //summons two creatures +#define SPELL_DOOMFIRE_SPAWN 32074 +#define SPELL_DOOMFIRE 31945 +#define SPELL_SOUL_CHARGE_YELLOW 32045 +#define SPELL_SOUL_CHARGE_GREEN 32051 +#define SPELL_SOUL_CHARGE_RED 32052 +#define SPELL_UNLEASH_SOUL_YELLOW 32054 +#define SPELL_UNLEASH_SOUL_GREEN 32057 +#define SPELL_UNLEASH_SOUL_RED 32053 +#define SPELL_FEAR 31970 + +#define CREATURE_ARCHIMONDE 17968 +#define CREATURE_DOOMFIRE 18095 +#define CREATURE_DOOMFIRE_SPIRIT 18104 +#define CREATURE_ANCIENT_WISP 17946 +#define CREATURE_CHANNEL_TARGET 22418 + +#define NORDRASSIL_X 5503.713 +#define NORDRASSIL_Y -3523.436 +#define NORDRASSIL_Z 1608.781 + +struct mob_ancient_wispAI : public ScriptedAI +{ + mob_ancient_wispAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + ArchimondeGUID = 0; + } + + ScriptedInstance* pInstance; + uint64 ArchimondeGUID; + uint32 CheckTimer; + + void Reset() + { + CheckTimer = 1000; + + if (pInstance) + ArchimondeGUID = pInstance->GetData64(DATA_ARCHIMONDE); + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void EnterCombat(Unit* who) {} + + void DamageTaken(Unit* done_by, uint32 &damage) { damage = 0; } + + void UpdateAI(const uint32 diff) + { + if (CheckTimer < diff) + { + if (Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID)) + { + if ((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive()) + DoCast(m_creature, SPELL_DENOUEMENT_WISP); + else + DoCast(Archimonde, SPELL_ANCIENT_SPARK); + } + CheckTimer = 1000; + }else CheckTimer -= diff; + } +}; + +/* This script is merely a placeholder for the Doomfire that triggers Doomfire spell. It will + MoveChase the Doomfire Spirit always, until despawn (AttackStart is called upon it's spawn) */ +struct TRINITY_DLL_DECL mob_doomfireAI : public ScriptedAI +{ + mob_doomfireAI(Creature* c) : ScriptedAI(c) {} + + void Reset() { } + + void MoveInLineOfSight(Unit* who) { } + void EnterCombat(Unit* who) { } + void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; } +}; + +/* This is the script for the Doomfire Spirit Mob. This mob simply follow players or + travels in random directions if target cannot be found. */ +struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI +{ + mob_doomfire_targettingAI(Creature* c) : ScriptedAI(c) {} + + uint64 TargetGUID; + uint32 ChangeTargetTimer; + + void Reset() + { + TargetGUID = 0; + ChangeTargetTimer = 5000; + } + + void MoveInLineOfSight(Unit* who) + { + //will update once TargetGUID is 0. In case noone actually moves(not likely) and this is 0 + //when UpdateAI needs it, it will be forced to select randomPoint + if (!TargetGUID && who->GetTypeId() == TYPEID_PLAYER) + TargetGUID = who->GetGUID(); + } + + void EnterCombat(Unit* who) {} + + void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; } + + void UpdateAI(const uint32 diff) + { + if (ChangeTargetTimer < diff) + { + if (Unit *temp = Unit::GetUnit(*m_creature,TargetGUID)) + { + m_creature->GetMotionMaster()->MoveFollow(temp,0.0f,0.0f); + TargetGUID = 0; + } + else + { + float x,y,z = 0.0; + m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 40, x, y, z); + m_creature->GetMotionMaster()->MovePoint(0, x, y, z); + } + + ChangeTargetTimer = 5000; + }else ChangeTargetTimer -= diff; + } +}; + +/* Finally, Archimonde's script. His script isn't extremely complex, most are simply spells on timers. + The only complicated aspect of the battle is Finger of Death and Doomfire, with Doomfire being the + hardest bit to code. Finger of Death is simply a distance check - if no one is in melee range, then + select a random target and cast the spell on them. However, if someone IS in melee range, and this + is NOT the main tank (creature's victim), then we aggro that player and they become the new victim. + For Doomfire, we summon a mob (Doomfire Spirit) for the Doomfire mob to follow. It's spirit will + randomly select it's target to follow and then we create the random movement making it unpredictable. */ + +struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI +{ + boss_archimondeAI(Creature *c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint64 DoomfireSpiritGUID; + uint64 WorldTreeGUID; + + uint32 DrainNordrassilTimer; + uint32 FearTimer; + uint32 AirBurstTimer; + uint32 GripOfTheLegionTimer; + uint32 DoomfireTimer; + uint32 SoulChargeTimer; + uint32 SoulChargeCount; + uint32 MeleeRangeCheckTimer; + uint32 HandOfDeathTimer; + uint32 SummonWispTimer; + uint32 WispCount; + uint32 EnrageTimer; + uint32 CheckDistanceTimer; + + bool Enraged; + bool BelowTenPercent; + bool HasProtected; + bool IsChanneling; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED); + + DoomfireSpiritGUID = 0; + damageTaken = 0; + WorldTreeGUID = 0; + + DrainNordrassilTimer = 0; + FearTimer = 42000; + AirBurstTimer = 30000; + GripOfTheLegionTimer = 5000 + rand()%20000; + DoomfireTimer = 20000; + SoulChargeTimer = 2000 + rand()%27000; + SoulChargeCount = 0; + MeleeRangeCheckTimer = 15000; + HandOfDeathTimer = 2000; + WispCount = 0; // When ~30 wisps are summoned, Archimonde dies + EnrageTimer = 600000; // 10 minutes + CheckDistanceTimer = 30000; // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage + SummonWispTimer = 0; + + Enraged = false; + BelowTenPercent = false; + HasProtected = false; + IsChanneling = false; + } + + void EnterCombat(Unit *who) + { + m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL); + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + + if (pInstance) + pInstance->SetData(DATA_ARCHIMONDEEVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + + if (victim && (victim->GetTypeId() == TYPEID_PLAYER)) + GainSoulCharge(CAST_PLR(victim)); + } + + void GainSoulCharge(Player* victim) + { + switch(victim->getClass()) + { + case CLASS_PRIEST: + case CLASS_PALADIN: + case CLASS_WARLOCK: + victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_RED, true); + break; + case CLASS_MAGE: + case CLASS_ROGUE: + case CLASS_WARRIOR: + victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_YELLOW, true); + break; + case CLASS_DRUID: + case CLASS_SHAMAN: + case CLASS_HUNTER: + victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_GREEN, true); + break; + } + + SoulChargeTimer = 2000 + rand()%28000; + ++SoulChargeCount; + } + + void JustDied(Unit *victim) + { + hyjal_trashAI::JustDied(victim); + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_ARCHIMONDEEVENT, DONE); + } + + bool CanUseFingerOfDeath() + { + // First we check if our current victim is in melee range or not. + Unit* victim = m_creature->getVictim(); + if (victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim))) + return false; + + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + if (m_threatlist.empty()) + return false; + + std::list targets; + std::list::iterator itr = m_threatlist.begin(); + for(; itr != m_threatlist.end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); + if (pUnit && pUnit->isAlive()) + targets.push_back(pUnit); + } + + if (targets.empty()) + return false; + + targets.sort(ObjectDistanceOrder(m_creature)); + Unit* target = targets.front(); + if (target) + { + if (!m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target))) + return true; // Cast Finger of Death + else // This target is closest, he is our new tank + m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim())); + } + + return false; + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == CREATURE_ANCIENT_WISP) + summoned->AI()->AttackStart(m_creature); + else + { + summoned->setFaction(m_creature->getFaction()); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + if (summoned->GetEntry() == CREATURE_DOOMFIRE_SPIRIT) + { + DoomfireSpiritGUID = summoned->GetGUID(); + } + + if (summoned->GetEntry() == CREATURE_DOOMFIRE) + { + summoned->CastSpell(summoned,SPELL_DOOMFIRE_SPAWN,false); + summoned->CastSpell(summoned,SPELL_DOOMFIRE,true,0,0,m_creature->GetGUID()); + + if (Unit *DoomfireSpirit = Unit::GetUnit(*m_creature, DoomfireSpiritGUID)) + { + summoned->GetMotionMaster()->MoveFollow(DoomfireSpirit,0.0f,0.0f); + DoomfireSpiritGUID = 0; + } + } + } + + //this is code doing close to what the summoning spell would do (spell 31903) + void SummonDoomfire(Unit* target) + { + m_creature->SummonCreature(CREATURE_DOOMFIRE_SPIRIT, + target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, + TEMPSUMMON_TIMED_DESPAWN, 27000); + + m_creature->SummonCreature(CREATURE_DOOMFIRE, + target->GetPositionX()-15.0,target->GetPositionY()-15.0,target->GetPositionZ(),0, + TEMPSUMMON_TIMED_DESPAWN, 27000); + } + + void UnleashSoulCharge() + { + m_creature->InterruptNonMeleeSpells(false); + + bool HasCast = false; + uint32 chargeSpell = 0; + uint32 unleashSpell = 0; + + switch(rand()%3) + { + case 0: + chargeSpell = SPELL_SOUL_CHARGE_RED; + unleashSpell = SPELL_UNLEASH_SOUL_RED; + break; + case 1: + chargeSpell = SPELL_SOUL_CHARGE_YELLOW; + unleashSpell = SPELL_UNLEASH_SOUL_YELLOW; + break; + case 2: + chargeSpell = SPELL_SOUL_CHARGE_GREEN; + unleashSpell = SPELL_UNLEASH_SOUL_GREEN; + break; + } + + if (m_creature->HasAura(chargeSpell)) + { + m_creature->RemoveAuraFromStack(chargeSpell); + DoCast(m_creature->getVictim(), unleashSpell); + HasCast = true; + SoulChargeCount--; + } + + if (HasCast) + SoulChargeTimer = 2000 + rand()%28000; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->isInCombat()) + { + if (pInstance) + { + // Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished. + if ((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35))) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->setFaction(35); + } + else if ((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((m_creature->GetVisibility() != VISIBILITY_ON) || (m_creature->getFaction() == 35))) + { + m_creature->setFaction(1720); + m_creature->SetVisibility(VISIBILITY_ON); + } + } + + if (DrainNordrassilTimer < diff) + { + if (!IsChanneling) + { + Creature *temp = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000); + + if (temp) + WorldTreeGUID = temp->GetGUID(); + + if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID)) + { + Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Nordrassil->SetDisplayId(11686); + DoCast(Nordrassil, SPELL_DRAIN_WORLD_TREE); + IsChanneling = true; + } + } + + if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID)) + { + Nordrassil->CastSpell(m_creature, SPELL_DRAIN_WORLD_TREE_2, true); + DrainNordrassilTimer = 1000; + } + }else DrainNordrassilTimer -= diff; + } + + if (!UpdateVictim()) + return; + + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged) + BelowTenPercent = true; + + if (!Enraged) + { + if (EnrageTimer < diff) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 10) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + Enraged = true; + DoScriptText(SAY_ENRAGE, m_creature); + } + }else EnrageTimer -= diff; + + if (CheckDistanceTimer < diff) + { + // To simplify the check, we simply summon a Creature in the location and then check how far we are from the creature + Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000); + if (Check) + { + Check->SetVisibility(VISIBILITY_OFF); + + if (m_creature->IsWithinDistInMap(Check, 75)) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + Enraged = true; + DoScriptText(SAY_ENRAGE, m_creature); + } + } + CheckDistanceTimer = 5000; + }else CheckDistanceTimer -= diff; + } + + if (BelowTenPercent) + { + if (!HasProtected) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + + //all members of raid must get this buff + DoCast(m_creature->getVictim(), SPELL_PROTECTION_OF_ELUNE); + HasProtected = true; + Enraged = true; + } + + if (SummonWispTimer < diff) + { + DoSpawnCreature(CREATURE_ANCIENT_WISP, rand()%40, rand()%40, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + SummonWispTimer = 1500; + ++WispCount; + }else SummonWispTimer -= diff; + + if (WispCount >= 30) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + + if (Enraged) + { + if (HandOfDeathTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_HAND_OF_DEATH); + HandOfDeathTimer = 2000; + }else HandOfDeathTimer -= diff; + return; // Don't do anything after this point. + } + + if (SoulChargeCount) + { + if (SoulChargeTimer < diff) + UnleashSoulCharge(); + else SoulChargeTimer -= diff; + } + + if (GripOfTheLegionTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_GRIP_OF_THE_LEGION); + GripOfTheLegionTimer = 5000 + rand()%20000; + }else GripOfTheLegionTimer -= diff; + + if (AirBurstTimer < diff) + { + if (rand()%2 == 0) + DoScriptText(SAY_AIR_BURST1, m_creature); + else + DoScriptText(SAY_AIR_BURST2, m_creature); + + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_AIR_BURST);//not on tank + AirBurstTimer = 25000 + rand()%15000; + }else AirBurstTimer -= diff; + + if (FearTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FEAR); + FearTimer = 42000; + }else FearTimer -= diff; + + if (DoomfireTimer < diff) + { + if (rand()%2 == 0) + DoScriptText(SAY_DOOMFIRE1, m_creature); + else + DoScriptText(SAY_DOOMFIRE2, m_creature); + + Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!temp) + temp = m_creature->getVictim(); + + //replace with spell cast 31903 once implicitTarget 73 implemented + SummonDoomfire(temp); + + //supposedly three doomfire can be up at the same time + DoomfireTimer = 20000; + }else DoomfireTimer -= diff; + + if (MeleeRangeCheckTimer < diff) + { + if (CanUseFingerOfDeath()) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FINGER_OF_DEATH); + MeleeRangeCheckTimer = 1000; + } + + MeleeRangeCheckTimer = 5000; + }else MeleeRangeCheckTimer -= diff; + + DoMeleeAttackIfReady(); + } + void WaypointReached(uint32 i){} +}; + +CreatureAI* GetAI_boss_archimonde(Creature* pCreature) +{ + return new boss_archimondeAI (pCreature); +} + +CreatureAI* GetAI_mob_doomfire(Creature* pCreature) +{ + return new mob_doomfireAI(pCreature); +} + +CreatureAI* GetAI_mob_doomfire_targetting(Creature* pCreature) +{ + return new mob_doomfire_targettingAI(pCreature); +} + +CreatureAI* GetAI_mob_ancient_wisp(Creature* pCreature) +{ + return new mob_ancient_wispAI(pCreature); +} + +void AddSC_boss_archimonde() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_archimonde"; + newscript->GetAI = &GetAI_boss_archimonde; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_doomfire"; + newscript->GetAI = &GetAI_mob_doomfire; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_doomfire_targetting"; + newscript->GetAI = &GetAI_mob_doomfire_targetting; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ancient_wisp"; + newscript->GetAI = &GetAI_mob_ancient_wisp; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp new file mode 100644 index 00000000000..c4c928359c1 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_azgalor.cpp @@ -0,0 +1,288 @@ + +#include "precompiled.h" +#include "def_hyjal.h" +#include "hyjal_trash.h" + +#define SPELL_RAIN_OF_FIRE 31340 +#define SPELL_DOOM 31347 +#define SPELL_HOWL_OF_AZGALOR 31344 +#define SPELL_CLEAVE 31345 +#define SPELL_BERSERK 26662 + +#define SAY_ONDEATH "Your time is almost... up" +#define SOUND_ONDEATH 11002 + +#define SAY_ONSLAY1 "Reesh, hokta!" +#define SAY_ONSLAY2 "Don't fight it" +#define SAY_ONSLAY3 "No one is going to save you" +#define SOUND_ONSLAY1 11001 +#define SOUND_ONSLAY2 11048 +#define SOUND_ONSLAY3 11047 + +#define SAY_DOOM1 "Just a taste... of what awaits you" +#define SAY_DOOM2 "Suffer you despicable insect!" +#define SOUND_DOOM1 11046 +#define SOUND_DOOM2 11000 + +#define SAY_ONAGGRO "Abandon all hope! The legion has returned to finish what was begun so many years ago. This time there will be no escape!" +#define SOUND_ONAGGRO 10999 + +struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI +{ + boss_azgalorAI(Creature *c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + SpellEntry *TempSpell = GET_SPELL(SPELL_HOWL_OF_AZGALOR); + if (TempSpell) + TempSpell->EffectRadiusIndex[0] = 12;//100yards instead of 50000?! + } + + uint32 RainTimer; + uint32 DoomTimer; + uint32 HowlTimer; + uint32 CleaveTimer; + uint32 EnrageTimer; + bool enraged; + + bool pGo; + uint32 pos; + + void Reset() + { + damageTaken = 0; + RainTimer = 20000; + DoomTimer = 50000; + HowlTimer = 30000; + CleaveTimer = 10000; + EnrageTimer = 600000; + enraged = false; + + if (pInstance && IsEvent) + pInstance->SetData(DATA_AZGALOREVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance && IsEvent) + pInstance->SetData(DATA_AZGALOREVENT, IN_PROGRESS); + DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); + m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); + m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); + m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); + break; + case 2: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); + m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL); + break; + } + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + + void JustDied(Unit *victim) + { + hyjal_trashAI::JustDied(victim); + if (pInstance && IsEvent) + pInstance->SetData(DATA_AZGALOREVENT, DONE); + DoPlaySoundToSet(m_creature, SOUND_ONDEATH); + } + + void UpdateAI(const uint32 diff) + { + if (IsEvent) + { + //Must update npc_escortAI + npc_escortAI::UpdateAI(diff); + if (!pGo) + { + pGo = true; + if (pInstance) + { + AddWaypoint(0, 5492.91, -2404.61, 1462.63); + AddWaypoint(1, 5531.76, -2460.87, 1469.55); + AddWaypoint(2, 5554.58, -2514.66, 1476.12); + AddWaypoint(3, 5554.16, -2567.23, 1479.90); + AddWaypoint(4, 5540.67, -2625.99, 1480.89); + AddWaypoint(5, 5508.16, -2659.2, 1480.15); + AddWaypoint(6, 5489.62, -2704.05, 1482.18); + AddWaypoint(7, 5457.04, -2726.26, 1485.10); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (RainTimer < diff) + { + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,30,true), SPELL_RAIN_OF_FIRE); + RainTimer = 20000+rand()%15000; + }else RainTimer -= diff; + + if (DoomTimer < diff) + { + DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,100,true), SPELL_DOOM);//never on tank + DoomTimer = 45000+rand()%5000; + }else DoomTimer -= diff; + + if (HowlTimer < diff) + { + DoCast(m_creature, SPELL_HOWL_OF_AZGALOR); + HowlTimer = 30000; + }else HowlTimer -= diff; + + if (CleaveTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + CleaveTimer = 10000+rand()%5000; + }else CleaveTimer -= diff; + + if (EnrageTimer < diff && !enraged) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, SPELL_BERSERK, true); + enraged = true; + EnrageTimer = 600000; + }else EnrageTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_azgalor(Creature* pCreature) +{ + return new boss_azgalorAI (pCreature); +} + +#define SPELL_THRASH 12787 +#define SPELL_CRIPPLE 31406 +#define SPELL_WARSTOMP 31408 + +struct TRINITY_DLL_DECL mob_lesser_doomguardAI : public hyjal_trashAI +{ + mob_lesser_doomguardAI(Creature *c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + if (pInstance) + AzgalorGUID = pInstance->GetData64(DATA_AZGALOR); + } + + uint32 CrippleTimer; + uint32 WarstompTimer; + uint32 CheckTimer; + uint64 AzgalorGUID; + ScriptedInstance* pInstance; + + void Reset() + { + CrippleTimer = 50000; + WarstompTimer = 10000; + DoCast(m_creature, SPELL_THRASH); + CheckTimer = 5000; + } + + void EnterCombat(Unit *who) + { + } + + void KilledUnit(Unit *victim) + { + + } + + void WaypointReached(uint32 i) + { + + } + + void MoveInLineOfSight(Unit *who) + { + if (m_creature->IsWithinDist(who, 50) && !m_creature->isInCombat() && m_creature->IsHostileTo(who)) + AttackStart(who); + } + + void JustDied(Unit *victim) + { + + } + + void UpdateAI(const uint32 diff) + { + if (CheckTimer < diff) + { + if (AzgalorGUID) + { + Creature* boss = Unit::GetCreature((*m_creature),AzgalorGUID); + if (!boss || (boss && boss->isDead())) + { + m_creature->setDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + return; + } + } + CheckTimer = 5000; + }else CheckTimer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (WarstompTimer < diff) + { + DoCast(m_creature, SPELL_WARSTOMP); + WarstompTimer = 10000+rand()%5000; + }else WarstompTimer -= diff; + + if (CrippleTimer < diff) + { + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,100,true), SPELL_CRIPPLE); + CrippleTimer = 25000+rand()%5000; + }else CrippleTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_lesser_doomguard(Creature* pCreature) +{ + return new mob_lesser_doomguardAI (pCreature); +} + +void AddSC_boss_azgalor() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_azgalor"; + newscript->GetAI = &GetAI_boss_azgalor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_lesser_doomguard"; + newscript->GetAI = &GetAI_mob_lesser_doomguard; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp new file mode 100644 index 00000000000..59700ddac0a --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_kazrogal.cpp @@ -0,0 +1,197 @@ + +#include "precompiled.h" +#include "def_hyjal.h" +#include "hyjal_trash.h" + +#define SPELL_CLEAVE 31436 +#define SPELL_WARSTOMP 31480 +#define SPELL_MARK 31447 + +#define SOUND_ONDEATH 11018 + +#define SAY_ONSLAY1 "Shaza-Kiel!" +#define SAY_ONSLAY2 "You... are nothing!" +#define SAY_ONSLAY3 "Miserable nuisance!" +#define SOUND_ONSLAY1 11017 +#define SOUND_ONSLAY2 11053 +#define SOUND_ONSLAY3 11054 + +#define SAY_MARK1 "Your death will be a painful one." +#define SAY_MARK2 "You... are marked." +#define SOUND_MARK1 11016 +#define SOUND_MARK2 11052 + +#define SAY_ONAGGRO "Cry for mercy! Your meaningless lives will soon be forfeit." +#define SOUND_ONAGGRO 11015 + +struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI +{ + boss_kazrogalAI(Creature *c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + SpellEntry *TempSpell = GET_SPELL(SPELL_MARK); + if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) + { + TempSpell->EffectImplicitTargetA[0] = 1; + TempSpell->EffectImplicitTargetB[0] = 0; + } + } + + uint32 CleaveTimer; + uint32 WarStompTimer; + uint32 MarkTimer; + uint32 MarkTimerBase; + bool pGo; + uint32 pos; + + void Reset() + { + damageTaken = 0; + CleaveTimer = 5000; + WarStompTimer = 15000; + MarkTimer = 45000; + MarkTimerBase = 45000; + + if (pInstance && IsEvent) + pInstance->SetData(DATA_KAZROGALEVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance && IsEvent) + pInstance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS); + DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); + m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); + m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); + m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); + break; + case 2: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); + m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL); + break; + } + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + + void JustDied(Unit *victim) + { + hyjal_trashAI::JustDied(victim); + if (pInstance && IsEvent) + pInstance->SetData(DATA_KAZROGALEVENT, DONE); + DoPlaySoundToSet(m_creature, SOUND_ONDEATH); + } + + void UpdateAI(const uint32 diff) + { + if (IsEvent) + { + //Must update npc_escortAI + npc_escortAI::UpdateAI(diff); + if (!pGo) + { + pGo = true; + if (pInstance) + { + AddWaypoint(0, 5492.91, -2404.61, 1462.63); + AddWaypoint(1, 5531.76, -2460.87, 1469.55); + AddWaypoint(2, 5554.58, -2514.66, 1476.12); + AddWaypoint(3, 5554.16, -2567.23, 1479.90); + AddWaypoint(4, 5540.67, -2625.99, 1480.89); + AddWaypoint(5, 5508.16, -2659.2, 1480.15); + AddWaypoint(6, 5489.62, -2704.05, 1482.18); + AddWaypoint(7, 5457.04, -2726.26, 1485.10); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (CleaveTimer < diff) + { + DoCast(m_creature, SPELL_CLEAVE); + CleaveTimer = 6000+rand()%15000; + }else CleaveTimer -= diff; + + if (WarStompTimer < diff) + { + DoCast(m_creature, SPELL_WARSTOMP); + WarStompTimer = 60000; + }else WarStompTimer -= diff; + + if (m_creature->HasAura(SPELL_MARK)) + m_creature->RemoveAurasDueToSpell(SPELL_MARK); + if (MarkTimer < diff) + { + //cast dummy, useful for bos addons + m_creature->CastCustomSpell(m_creature, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); + + std::list t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (target && target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA) + { + target->CastSpell(target, SPELL_MARK,true);//only cast on mana users + } + } + MarkTimerBase -= 5000; + if (MarkTimerBase < 5500) + MarkTimerBase = 5500; + MarkTimer = MarkTimerBase; + switch(rand()%3) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_MARK1); + m_creature->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, NULL); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_MARK2); + m_creature->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, NULL); + break; + } + }else MarkTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_kazrogal(Creature* pCreature) +{ + return new boss_kazrogalAI (pCreature); +} + +void AddSC_boss_kazrogal() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_kazrogal"; + newscript->GetAI = &GetAI_boss_kazrogal; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp new file mode 100644 index 00000000000..a7a9adf1676 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/boss_rage_winterchill.cpp @@ -0,0 +1,192 @@ + +#include "precompiled.h" +#include "def_hyjal.h" +#include "hyjal_trash.h" + +#define SPELL_FROST_ARMOR 31256 +#define SPELL_DEATH_AND_DECAY 31258 + +#define SPELL_FROST_NOVA 31250 +#define SPELL_ICEBOLT 31249 + +#define SAY_ONDEATH "You have won this battle, but not... the... war" +#define SOUND_ONDEATH 11026 + +#define SAY_ONSLAY1 "All life must perish!" +#define SAY_ONSLAY2 "Victory to the Legion!" +#define SOUND_ONSLAY1 11025 +#define SOUND_ONSLAY2 11057 + +#define SAY_DECAY1 "Crumble and rot!" +#define SAY_DECAY2 "Ashes to ashes, dust to dust" +#define SOUND_DECAY1 11023 +#define SOUND_DECAY2 11055 + +#define SAY_NOVA1 "Succumb to the icy chill... of death!" +#define SAY_NOVA2 "It will be much colder in your grave" +#define SOUND_NOVA1 11024 +#define SOUND_NOVA2 11058 + +#define SAY_ONAGGRO "The Legion's final conquest has begun! Once again the subjugation of this world is within our grasp. Let none survive!" +#define SOUND_ONAGGRO 11022 + +struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI +{ + boss_rage_winterchillAI(Creature *c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + } + + uint32 FrostArmorTimer; + uint32 DecayTimer; + uint32 NovaTimer; + uint32 IceboltTimer; + bool pGo; + uint32 pos; + + void Reset() + { + damageTaken = 0; + FrostArmorTimer = 37000; + DecayTimer = 45000; + NovaTimer = 15000; + IceboltTimer = 10000; + + if (pInstance && IsEvent) + pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance && IsEvent) + pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS); + DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); + m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); + m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); + m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); + break; + } + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + + void JustDied(Unit *victim) + { + hyjal_trashAI::JustDied(victim); + if (pInstance && IsEvent) + pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE); + DoPlaySoundToSet(m_creature, SOUND_ONDEATH); + m_creature->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, NULL); + } + + void UpdateAI(const uint32 diff) + { + if (IsEvent) + { + //Must update npc_escortAI + npc_escortAI::UpdateAI(diff); + if (!pGo) + { + pGo = true; + if (pInstance) + { + AddWaypoint(0, 4896.08, -1576.35, 1333.65); + AddWaypoint(1, 4898.68, -1615.02, 1329.48); + AddWaypoint(2, 4907.12, -1667.08, 1321.00); + AddWaypoint(3, 4963.18, -1699.35, 1340.51); + AddWaypoint(4, 4989.16, -1716.67, 1335.74); + AddWaypoint(5, 5026.27, -1736.89, 1323.02); + AddWaypoint(6, 5037.77, -1770.56, 1324.36); + AddWaypoint(7, 5067.23, -1789.95, 1321.17); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (FrostArmorTimer < diff) + { + DoCast(m_creature, SPELL_FROST_ARMOR); + FrostArmorTimer = 40000+rand()%20000; + }else FrostArmorTimer -= diff; + if (DecayTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_DEATH_AND_DECAY); + DecayTimer = 60000+rand()%20000; + switch(rand()%2) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_DECAY1); + m_creature->MonsterYell(SAY_DECAY1, LANG_UNIVERSAL, NULL); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_DECAY2); + m_creature->MonsterYell(SAY_DECAY2, LANG_UNIVERSAL, NULL); + break; + } + }else DecayTimer -= diff; + if (NovaTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FROST_NOVA); + NovaTimer = 30000+rand()%15000; + switch(rand()%2) + { + case 0: + DoPlaySoundToSet(m_creature, SOUND_NOVA1); + m_creature->MonsterYell(SAY_NOVA1, LANG_UNIVERSAL, NULL); + break; + case 1: + DoPlaySoundToSet(m_creature, SOUND_NOVA2); + m_creature->MonsterYell(SAY_NOVA2, LANG_UNIVERSAL, NULL); + break; + } + }else NovaTimer -= diff; + if (IceboltTimer < diff) + { + DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,40,true), SPELL_ICEBOLT); + IceboltTimer = 11000+rand()%20000; + }else IceboltTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_rage_winterchill(Creature* pCreature) +{ + return new boss_rage_winterchillAI (pCreature); +} + +void AddSC_boss_rage_winterchill() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_rage_winterchill"; + newscript->GetAI = &GetAI_boss_rage_winterchill; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/def_hyjal.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/def_hyjal.h new file mode 100644 index 00000000000..c08f28a4f3d --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/def_hyjal.h @@ -0,0 +1,38 @@ +/* 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_HYJAL_H +#define DEF_HYJAL_H + +#define ERROR_INST_DATA "TSCR: Instance data not set properly for Mount Hyjal. Encounters will be buggy" + +enum +{ + WORLD_STATE_WAVES = 2842, + WORLD_STATE_ENEMY = 2453, + WORLD_STATE_ENEMYCOUNT = 2454, + + DATA_ANETHERON = 1, + DATA_ANETHERONEVENT = 2, + DATA_ARCHIMONDE = 3, + DATA_ARCHIMONDEEVENT = 4, + DATA_AZGALOR = 5, + DATA_AZGALOREVENT = 6, + DATA_JAINAPROUDMOORE = 7, + DATA_KAZROGAL = 8, + DATA_KAZROGALEVENT = 9, + DATA_RAGEWINTERCHILL = 10, + DATA_RAGEWINTERCHILLEVENT = 11, + DATA_THRALL = 12, + DATA_TYRANDEWHISPERWIND = 13, + DATA_TRASH = 14, + DATA_RESET_TRASH_COUNT = 15, + DATA_ALLIANCE_RETREAT = 16, + DATA_HORDE_RETREAT = 17, + DATA_RAIDDAMAGE = 18, + DATA_RESET_RAIDDAMAGE = 19, + TYPE_RETREAT = 20 +}; +#endif + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp new file mode 100644 index 00000000000..a7861e11ccc --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal.cpp @@ -0,0 +1,246 @@ + /* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Hyjal +SD%Complete: 80 +SDComment: gossip text id's unknown +SDCategory: Caverns of Time, Mount Hyjal +EndScriptData */ + +/* ContentData +npc_jaina_proudmoore +npc_thrall +npc_tyrande_whisperwind +EndContentData */ + +#include "precompiled.h" +#include "hyjalAI.h" + +#define GOSSIP_ITEM_BEGIN_ALLY "My companions and I are with you, Lady Proudmoore." +#define GOSSIP_ITEM_ANETHERON "We are ready for whatever Archimonde might send our way, Lady Proudmoore." + +#define GOSSIP_ITEM_BEGIN_HORDE "I am with you, Thrall." +#define GOSSIP_ITEM_AZGALOR "We have nothing to fear." + +#define GOSSIP_ITEM_RETREAT "We can't keep this up. Let's retreat!" + +#define GOSSIP_ITEM_TYRANDE "Aid us in defending Nordrassil" +#define ITEM_TEAR_OF_GODDESS 24494 + + +CreatureAI* GetAI_npc_jaina_proudmoore(Creature* pCreature) +{ + hyjalAI* ai = new hyjalAI(pCreature); + + ai->Reset(); + ai->EnterEvadeMode(); + + ai->Spell[0].SpellId = SPELL_BLIZZARD; + ai->Spell[0].Cooldown = 15000 + rand()%20000; + ai->Spell[0].TargetType = TARGETTYPE_RANDOM; + + ai->Spell[1].SpellId = SPELL_PYROBLAST; + ai->Spell[1].Cooldown = 5500 + rand()%4000; + ai->Spell[1].TargetType = TARGETTYPE_RANDOM; + + ai->Spell[2].SpellId = SPELL_SUMMON_ELEMENTALS; + ai->Spell[2].Cooldown = 15000 + rand()%30000; + ai->Spell[2].TargetType = TARGETTYPE_SELF; + + return ai; +} + +bool GossipHello_npc_jaina_proudmoore(Player* pPlayer, Creature* pCreature) +{ + hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); + if (ai->EventBegun) + return false; + + uint32 RageEncounter = ai->GetInstanceData(DATA_RAGEWINTERCHILLEVENT); + uint32 AnetheronEncounter = ai->GetInstanceData(DATA_ANETHERONEVENT); + if (RageEncounter == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_ALLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + else if (RageEncounter == DONE && AnetheronEncounter == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ANETHERON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + else if (RageEncounter == DONE && AnetheronEncounter == DONE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + + if (pPlayer->isGameMaster()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_jaina_proudmoore(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + ai->StartEvent(pPlayer); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + ai->FirstBossDead = true; + ai->WaveCount = 9; + ai->StartEvent(pPlayer); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + ai->Retreat(); + break; + case GOSSIP_ACTION_INFO_DEF: + ai->Debug = !ai->Debug; + debug_log("TSCR: HyjalAI - Debug mode has been toggled"); + break; + } + return true; +} + +CreatureAI* GetAI_npc_thrall(Creature* pCreature) +{ + hyjalAI* ai = new hyjalAI(pCreature); + + ai->Reset(); + ai->EnterEvadeMode(); + + ai->Spell[0].SpellId = SPELL_CHAIN_LIGHTNING; + ai->Spell[0].Cooldown = 3000 + rand()%5000; + ai->Spell[0].TargetType = TARGETTYPE_VICTIM; + + ai->Spell[1].SpellId = SPELL_SUMMON_DIRE_WOLF; + ai->Spell[1].Cooldown = 6000 + rand()%35000; + ai->Spell[1].TargetType = TARGETTYPE_RANDOM; + + return ai; +} + +bool GossipHello_npc_thrall(Player* pPlayer, Creature* pCreature) +{ + hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); + if (ai->EventBegun) + return false; + + uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT); + // Only let them start the Horde phases if Anetheron is dead. + if (AnetheronEvent == DONE && ai->GetInstanceData(DATA_ALLIANCE_RETREAT)) + { + uint32 KazrogalEvent = ai->GetInstanceData(DATA_KAZROGALEVENT); + uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT); + if (KazrogalEvent == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_HORDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + else if (KazrogalEvent == DONE && AzgalorEvent == NOT_STARTED) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AZGALOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + else if (AzgalorEvent == DONE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); + } + + if (pPlayer->isGameMaster()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_thrall(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); + ai->DeSpawnVeins();//despawn the alliance veins + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF + 1: + ai->StartEvent(pPlayer); + break; + case GOSSIP_ACTION_INFO_DEF + 2: + ai->FirstBossDead = true; + ai->WaveCount = 9; + ai->StartEvent(pPlayer); + break; + case GOSSIP_ACTION_INFO_DEF + 3: + ai->Retreat(); + break; + case GOSSIP_ACTION_INFO_DEF: + ai->Debug = !ai->Debug; + debug_log("TSCR: HyjalAI - Debug mode has been toggled"); + break; + } + return true; +} + +CreatureAI* GetAI_npc_tyrande_whisperwind(Creature* pCreature) +{ + hyjalAI* ai = new hyjalAI(pCreature); + ai->Reset(); + ai->EnterEvadeMode(); + return ai; +} + +bool GossipHello_npc_tyrande_whisperwind(Player* pPlayer, Creature* pCreature) +{ + hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); + uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT); + + // Only let them get item if Azgalor is dead. + if (AzgalorEvent == DONE && !pPlayer->HasItemCount(ITEM_TEAR_OF_GODDESS,1)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TYRANDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_tyrande_whisperwind(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) + { + ItemPosCountVec dest; + uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1); + if (msg == EQUIP_ERR_OK) + { + Item* item = pPlayer->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true); + if (item && pPlayer) + pPlayer->SendNewItem(item,1,true,false,true); + } + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); + } + return true; +} + +void AddSC_hyjal() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_jaina_proudmoore"; + newscript->GetAI = &GetAI_npc_jaina_proudmoore; + newscript->pGossipHello = &GossipHello_npc_jaina_proudmoore; + newscript->pGossipSelect = &GossipSelect_npc_jaina_proudmoore; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_thrall"; + newscript->GetAI = &GetAI_npc_thrall; + newscript->pGossipHello = &GossipHello_npc_thrall; + newscript->pGossipSelect = &GossipSelect_npc_thrall; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_tyrande_whisperwind"; + newscript->pGossipHello = &GossipHello_npc_tyrande_whisperwind; + newscript->pGossipSelect = &GossipSelect_npc_tyrande_whisperwind; + newscript->GetAI = &GetAI_npc_tyrande_whisperwind; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp new file mode 100644 index 00000000000..726ce62b4c9 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.cpp @@ -0,0 +1,1159 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: HyjalAI +SD%Complete: 90 +SDComment: +SDCategory: Caverns of Time, Mount Hyjal +EndScriptData */ + +#include "precompiled.h" +#include "hyjalAI.h" +#include "hyjal_trash.h" +#include "MapManager.h" +#include "Language.h" +#include "Chat.h" +#include "Object.h" + +#define SPAWN_GARG_GATE 0 +#define SPAWN_WYRM_GATE 1 +#define SPAWN_NEAR_TOWER 2 +// Locations for summoning gargoyls and frost wyrms in special cases +float SpawnPointSpecial[3][3]= +{ + {5497.08, -2493.23, 1535.72}, //spawn point for the gargoyles near the horde gate + {5624.53, -2548.12, 1551.54}, //spawn point for the frost wyrm near the horde gate + {5604.41, -2811.98, 1547.77} //spawn point for the gargoyles and wyrms near the horde tower +}; + +// Locations for summoning waves in Alliance base +float AllianceBase[4][3]= +{ + {4928.48, -1526.38, 1326.83}, + {4923.54, -1514.29, 1327.98}, + {4928.41, -1510.35, 1327.99}, + {4938.35, -1521.00, 1326.69} +}; + +float JainaDummySpawn[2][4]= +{ + {5497.01, -2719.03, 1483.08, 2.90426}, + {5484.98, -2721.69, 1483.39, 6.00656} +}; + + +// Locations for summoning waves in Horde base +float HordeBase[4][3]= +{ + {5458.01, -2340.27, 1459.60}, + {5466.01, -2334.69, 1460.06}, + {5468.45, -2355.13, 1459.99}, + {5479.06, -2344.16, 1461.74} +}; + +// Lady Jaina's waypoints when retreathing +float JainaWPs[2][3]= +{ + {5078.56, -1789.79, 1320.73},//next to the small stairs + {5037.38, -1778.39, 1322.61},//center of alliance base +}; + +float InfernalPos[8][3]=//spawn points for the infernals in the horde base +{ + {5453.59, -2764.52, 1493.50}, + {5478.4, -2781.77, 1497.52}, + {5506.09, -2780.53, 1496.32}, + {5532.1, -2763.42, 1492.37}, + {5544.16, -2733.99, 1487.14}, + {5536.19, -2708.18, 1480.01}, + {5510.16, -2691.75, 1479.66}, + {5482.39, -2689.19, 1481.09} +}; + +float InfernalSPWP[26][4]=//spawn points for the infernals in the horde base used in the cleaning wave +{ + {5490.96, -2718.72, 1482.96, 0.49773}, + {5449.51, -2723.32, 1485.69, 2.69685}, + {5520.83, -2624.68, 1483.82, 1.20459}, + {5558.28, -2629.26, 1485.76, 0.37992}, + {5567.97, -2758.69, 1494.10, 5.04125}, + {5384.90, -2793.47, 1503.90, 5.55412}, + {5495.33, -2814.06, 1501.56, 1.12055}, + {5472.63, -2929.39, 1538.31, 1.95777}, + {5334.72, -2952.29, 1534.34, 0.50869}, + {5398.36, -2872.46, 1512.38, 0.76787}, + {5514.39, -2768.63, 1492.30, 1.55721}, + {5598.91, -2703.75, 1495.64, 2.56644}, + {5467.80, -2655.93, 1482.27, 0.85819}, + {5399.83, -2985.24, 1545.04, 5.92559}, + {5232.13, -2967.05, 1553.09, 5.41351}, + {5272.02, -3082.52, 1567.09, 3.40681}, + {5343.26, -3120.71, 1582.92, 3.16727}, + {5371.26, -3175.24, 1587.41, 6.10466}, + {5434.67, -3177.91, 1579.25, 2.77850}, + {5237.39, -3149.25, 1593.59, 0.83855}, + {5202.15, -3016.64, 1566.28, 3.31256}, + {5302.54, -2914.37, 1528.53, 3.37146}, + {5439.04, -2834.81, 1508.80, 2.14231}, + {5421.33, -2771.04, 1494.28, 6.06223}, + {5549.76, -2692.93, 1482.68, 2.19414}, + {5459.78, -2755.71, 1490.68, 1.05139} +}; + +float VeinPos[14][8]=//spawn points of the ancient gem veins +{ + {5184.84, -1982.59, 1382.66, 2.58079, 0, 0, 0.960944, 0.276742}, //alliance + {5107.66, -2071.16, 1368.37, 2.65148, 0, 0, 0.970124, 0.242611}, //alliance + {5040.53, -2227.65, 1403.17, 3.35049, 0, 0, 0.99455, -0.104257}, //alliance + {5187.59, -2453.12, 1455.51, 5.87943, 0, 0, 0.20051, -0.979692}, //alliance + {5429.43, -2340.65, 1465.38, 4.7681, 0, 0, 0.687138, -0.726527}, //alliance + {5463.99, -2315.95, 1470.29, 1.52045, 0, 0, 0.689084, 0.724682}, //alliance + {5624.65, -2495.09, 1510.11, 0.0124869, 0, 0, 0.00624342, 0.999981}, //alliance + {5285.41, -3348.32, 1663.01, 1.57152, 0, 0, 0.707362, 0.706852}, //horde + {5417.69, -3372.52, 1656.31, 0.361993, 0, 0, 0.18001, 0.983665}, //horde + {5315.34, -3238.32, 1622.88, 3.03627, 0, 0, 0.998614, 0.0526347}, //horde + {5303.4, -3096.44, 1596.41, 1.72073, 0, 0, 0.758081, 0.65216}, //horde + {5265.13, -3177.27, 1616.22, 0.813604, 0, 0, 0.395674, 0.918391}, //horde + {5374.3, -3420.59, 1653.43, 1.45762, 0, 0, 0.665981, 0.745969}, //horde + {5441.54, -3321.59, 1651.55, 0.258306, 0, 0, 0.128794, 0.991671} //horde +}; + +float AllianceOverrunGargPos[5][4]=//gargoyle spawn points in the alliance overrun +{ + {5279.94, -2049.68, 1311.38, 0},//garg1 + {5289.15, -2219.06, 1291.12, 0},//garg2 + {5202.07, -2136.10, 1305.07, 2.8},//garg3 + {5071.52, -2425.63, 1454.48, 5.54},//garg4 + {5120.65, -2467.92, 1463.93, 2.54}//garg5 +}; + +float AllianceFirePos[92][8]=//spawn points for the fire visuals (GO) in the alliance base +{ + {5039.9, -1796.84, 1323.88, 2.59222, 0, 0, 0.962511, 0.271243}, + {5087.2, -1795.2, 1320.68, 1.03946, 0, 0, 0.496644, 0.867954}, + {5112.68, -1806.66, 1359.93, 1.37799, 0, 0, 0.63576, 0.771887}, + {5095.61, -1793.27, 1359.78, 0.580806, 0, 0, 0.286338, 0.958129}, + {5090.43, -1784.45, 1360.44, 0.796784, 0, 0, 0.387937, 0.921686}, + {5139.25, -1783.11, 1359.39, 3.30849, 0, 0, 0.99652, -0.0833509}, + {5112.16, -1763.72, 1361.35, 5.10312, 0, 0, 0.556388, -0.830922}, + {4981.18, -1793.98, 1335.7, 3.23072, 0, 0, 0.999007, -0.0445498}, + {4996.57, -1766.75, 1341.62, 3.5331, 0, 0, 0.980902, -0.194505}, + {4983.74, -1769.25, 1345.75, 3.79228, 0, 0, 0.947541, -0.319635}, + {4996.01, -1774.43, 1330.71, 3.07364, 0, 0, 0.999423, 0.0339693}, + {5094.2, -1726.13, 1330.55, 1.56175, 0, 0, 0.703901, 0.710298}, + {5079.82, -1721.24, 1336.26, 1.18868, 0, 0, 0.559964, 0.828517}, + {5077.68, -1717.15, 1327.78, 0.0145145, 0, 0, 0.00725717, 0.999974}, + {5122.27, -1738.22, 1341.67, 0.835256, 0, 0, 0.405593, 0.914054}, + {5131.88, -1741.15, 1335.25, 2.15472, 0, 0, 0.880712, 0.473653}, + {5196.93, -1772.99, 1345.2, 0.128397, 0, 0, 0.0641544, 0.99794}, + {5225.33, -1756.06, 1344.17, 3.04223, 0, 0, 0.998766, 0.0496599}, + {5224.84, -1767.05, 1360.06, 3.19538, 0, 0, 0.999638, -0.0268922}, + {5202.05, -1763.47, 1361.68, 2.59455, 0, 0, 0.962826, 0.270122}, + {5194.74, -1766.66, 1356.94, 0.0734191, 0, 0, 0.0367013, 0.999326}, + {5159.67, -1832.97, 1344.5, 5.17457, 0, 0, 0.526356, -0.850264}, + {5096.17, -1858.73, 1332.46, 5.30021, 0, 0, 0.471939, -0.881631}, + {5110.7, -1856.59, 1342.84, 5.97564, 0, 0, 0.153167, -0.9882}, + {5109.76, -1855.3, 1332.38, 4.89572, 0, 0, 0.639411, -0.768865}, + {5068.95, -1837.37, 1328.81, 2.61569, 0, 0, 0.965628, 0.25993}, + {5064.4, -1824.77, 1329.02, 2.16409, 0, 0, 0.88292, 0.469524}, + {5059.89, -1848.79, 1329.59, 0.0709955, 0, 0, 0.0354903, 0.99937}, + {5014.37, -1851.39, 1322.56, 4.66949, 0, 0, 0.722111, -0.691777}, + {5025.1, -1848.27, 1323.39, 4.44565, 0, 0, 0.794854, -0.606801}, + {4942.63, -1890.13, 1326.59, 3.28719, 0, 0, 0.997351, -0.0727343}, + {4937.95, -1888.71, 1352.41, 3.41678, 0, 0, 0.990549, -0.13716}, + {4922.48, -1881.92, 1352.41, 5.03077, 0, 0, 0.586075, -0.810257}, + {4915.35, -1894.32, 1351.24, 6.22457, 0, 0, 0.0293048, -0.999571}, + {4922.71, -1904.84, 1352.56, 1.37866, 0, 0, 0.63602, 0.771672}, + {4932.89, -1905.49, 1352.56, 1.89702, 0, 0, 0.812549, 0.582893}, + {5011.83, -1861.05, 1345.86, 4.43777, 0, 0, 0.797239, -0.603664}, + {5011.83, -1861.05, 1363.26, 4.748, 0, 0, 0.694406, -0.719583}, + {5021.46, -1858.35, 1342.17, 4.86188, 0, 0, 0.652329, -0.757936}, + {4995.02, -1698.3, 1370.38, 6.15779, 0, 0, 0.0626579, -0.998035}, + {5119.85, -1728.9, 1336.04, 5.87112, 0, 0, 0.204579, -0.97885}, + {5214.75, -1751.02, 1342.5, 5.08965, 0, 0, 0.561972, -0.827156}, + {5075.04, -1822.43, 1328.87, 3.99951, 0, 0, 0.9094, -0.415924}, + {5057.09, -1823.32, 1350.35, 3.88169, 0, 0, 0.93231, -0.361659}, + {4984.6, -1816.99, 1329.21, 3.05308, 0, 0, 0.999021, 0.0442417}, + {4983.35, -1811.55, 1356.82, 3.33975, 0, 0, 0.995096, -0.098917}, + {4984.11, -1825.73, 1350.76, 2.26375, 0, 0, 0.905211, 0.424962}, + {4968.47, -1786.46, 1354.09, 3.07663, 0, 0, 0.999473, 0.0324733}, + {5061.82, -1751.16, 1339.07, 5.94727, 0, 0, 0.167171, -0.985928}, + {5063.75, -1763, 1351.91, 0.759707, 0, 0, 0.370784, 0.928719}, + {5078.65, -1708.26, 1353.9, 1.27022, 0, 0, 0.593264, 0.805008}, + {4983.19, -1755.96, 1331.13, 4.28221, 0, 0, 0.841733, -0.539894}, + {4972.76, -1755.3, 1332.5, 4.21938, 0, 0, 0.858276, -0.513188}, + {4961.65, -1760.82, 1351.69, 3.56515, 0, 0, 0.977659, -0.210198}, + {5086.45, -1779.83, 1321.62, 6.23157, 0, 0, 0.0258051, -0.999667}, + {5063.15, -1756.74, 1328.56, 0.886926, 0, 0, 0.42907, 0.903271}, + {5042.45, -1800.61, 1323.88, 2.50093, 0, 0, 0.949131, 0.31488}, + {5084.74, -1725.35, 1327.89, 1.65034, 0, 0, 0.734663, 0.678432}, + {4993.25, -1758.1, 1331.07, 3.49995, 0, 0, 0.98399, -0.178223}, + {5078.53, -1867.85, 1348.91, 5.85612, 0, 0, 0.211913, -0.977288}, + {5080.74, -1869.73, 1333.18, 6.18206, 0, 0, 0.0505424, -0.998722}, + {5089.55, -1894.13, 1356.08, 1.52072, 0, 0, 0.689181, 0.724589}, + {5113.24, -1899.49, 1363.77, 1.50108, 0, 0, 0.682034, 0.731321}, + {4984.18, -1907.69, 1325.62, 3.82193, 0, 0, 0.942698, -0.333646}, + {5094.14, -2432.08, 1429.38, 4.70083, 0, 0, 0.711182, -0.703007}, + {5329.89, -2113.30, 1281.06, 5.60560, 0, 0, 0.332347, -0.943157}, + {5170.87, -2148.13, 1278.32, 1.63540, 0, 0, 0.729573, 0.683903 }, + {5132.94, -1960.25, 1367.8, 3.69787, 0, 0, 0.961568, -0.274566}, + {5280.82, -2351.55, 1431.57, 4.46913, 0, 0, 0.787677, -0.616088}, + {5176.78, -2121.43, 1295.27, 3.24153, 0, 0, 0.998752, -0.04995}, + {5332.75, -2101.41, 1296.37, 5.50350, 0, 0, 0.380043, -0.924969}, + {5265.70, -2050.27, 1287.57, 0.50051, 0, 0, 0.247655, 0.968848 }, + {5194.21, -2129.89, 1274.04, 3.08053, 0, 0, 0.999534, 0.0305272}, + {5225.81, -1985.50, 1364.15, 0.37247, 0, 0, 0.185163, 0.982708 }, + {5339.46, -2204.47, 1280.45, 0.99921, 0, 0, 0.479081, 0.877771 }, + {5269.63, -2020.57, 1299.62, 3.00201, 0, 0, 0.997566, 0.0697332}, + {5111.54, -2445.70, 1435.31, 2.70983, 0, 0, 0.976788, 0.214207 }, + {5111.24, -1901.14, 1355.33, 1.61028, 0, 0, 0.720929, 0.693009 }, + {5310.42, -2207.82, 1277.46, 0.50441, 0, 0, 0.249544, 0.968363 }, + {5150.81, -2042.13, 1394.3, 2.21031, 0, 0, 0.893534, 0.448995 }, + {5224.84, -2376.61, 1366.33, 5.0621, 0, 0, 0.573311, -0.819338}, + {5105.41, -2454.86, 1446.16, 4.64584, 0, 0, 0.730239, -0.683191}, + {5309.65, -2188.28, 1266.84, 5.56631, 0, 0, 0.350811, -0.936446}, + {5281.46, -2047.82, 1287.67, 2.44909, 0, 0, 0.940652, 0.339373 }, + {5325.45, -2189.41, 1309.6, 6.23783, 0, 0, 0.0226771, -0.999743}, + {5190.96, -2142.54, 1293.03, 6.25668, 0, 0, 0.0132544, -0.999912}, + {5089.99, -2467.49, 1441.8, 0.77381, 0, 0, 0.377326, 0.92608 }, + {5195.08, -2129.01, 1285.36, 3.55727, 0, 0, 0.978480, -0.206344}, + {5353.76, -2116.28, 1299.27, 6.17894, 0, 0, 0.0521006, -0.998642}, + {5271.14, -2037.38, 1299.24, 4.07879, 0, 0, 0.892201, -0.451638}, + {5332.5 , -2181.28, 1279.95, 4.6906, 0, 0, 0.714768, -0.699362}, + {5108.2 , -2429.84, 1427.73, 4.5194, 0, 0, 0.771943, -0.635691} +}; + +float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde base +{ + {5524.11, -2612.73, 1483.38, 1.96198, 0, 0, 0.831047, 0.556202}, + {5514.42, -2617.19, 1505.77, 1.82453, 0, 0, 0.790892, 0.611956}, + {5510.21, -2624.77, 1485.34, 1.71065, 0, 0, 0.754783, 0.655974}, + {5570.72, -2619.04, 1487.62, 0.728898, 0, 0, 0.356435, 0.93432}, + {5570.29, -2639.37, 1487.31, 1.49308, 0, 0, 0.679104, 0.734042}, + {5583.56, -2637.2, 1503.78, 1.46559, 0, 0, 0.668951, 0.743307}, + {5571.53, -2626.81, 1510.99, 0.362107, 0, 0, 0.180066, 0.983654}, + {5545.97, -2659.62, 1489.64, 5.07055, 0, 0, 0.569845, -0.821752}, + {5557.44, -2675.91, 1482.58, 1.70118, 0, 0, 0.751671, 0.659539}, + {5594.98, -2742.31, 1495.51, 4.5993, 0, 0, 0.74594, -0.666013}, + {5599.65, -2755.6, 1505.05, 1.66896, 0, 0, 0.740947, 0.671564}, + {5565.95, -2774.75, 1499.48, 6.22425, 0, 0, 0.0294611, -0.999566}, + {5567.1, -2769.7, 1511.17, 5.99257, 0, 0, 0.144799, -0.989461}, + {5572.84, -2774.16, 1527.06, 0.836428, 0, 0, 0.406129, 0.913816}, + {5538.32, -2805.94, 1498.87, 4.30082, 0, 0, 0.836674, -0.547701}, + {5515.66, -2801.74, 1503.53, 5.57316, 0, 0, 0.347602, -0.937642}, + {5516.76, -2827.14, 1501.15, 0.35026, 0, 0, 0.174236, 0.984704}, + {5536.13, -2813.51, 1537.21, 4.51681, 0, 0, 0.772765, -0.634692}, + {5525.05, -2825.16, 1538.53, 0.489275, 0, 0, 0.242205, 0.970225}, + {5534.42, -2815.45, 1562.84, 4.62834, 0, 0, 0.736191, -0.676774}, + {5519.64, -2831.12, 1526.46, 0.611008, 0, 0, 0.300774, 0.953696}, + {5551.04, -2827.55, 1523.5, 3.35206, 0, 0, 0.994468, -0.10504}, + {5469.22, -2802.87, 1503.5, 4.99509, 0, 0, 0.600436, -0.799673}, + {5427.8, -2737.26, 1487.12, 1.78673, 0, 0, 0.779186, 0.626793}, + {5454.1, -2709.1, 1485.92, 3.03552, 0, 0, 0.998594, 0.0530137}, + {5436.3, -2718.2, 1506.02, 2.7567, 0, 0, 0.981539, 0.191261}, + {5412.6, -2740.55, 1510.79, 2.98446, 0, 0, 0.996915, 0.0784832}, + {5406.12, -2752.48, 1521.01, 2.05769, 0, 0, 0.856705, 0.515807}, + {5445.24, -2676.35, 1521.89, 2.91378, 0, 0, 0.99352, 0.113661}, + {5481.4, -2665.08, 1482.23, 4.30001, 0, 0, 0.836895, -0.547363}, + {5443.51, -2675.44, 1487.12, 2.90986, 0, 0, 0.993295, 0.115606}, + {5391.72, -2647.3, 1528.9, 3.76987, 0, 0, 0.951063, -0.308997}, + {5421.09, -2734.12, 1521.01, 2.70567, 0, 0, 0.97634, 0.216242}, + {5405.39, -2710.33, 1533.77, 2.51324, 0, 0, 0.951052, 0.309032}, + {5423.96, -2703.76, 1516.34, 2.79206, 0, 0, 0.984767, 0.173879}, + {5444.75, -2735.23, 1486.37, 2.22657, 0, 0, 0.897155, 0.441715}, + {5570.98, -2747.91, 1495.7, 5.14433, 0, 0, 0.53915, -0.84221}, + {5567.79, -2673.9, 1484.66, 2.72529, 0, 0, 0.978415, 0.20665}, + {5600.71, -2696.8, 1500.42, 0.443704, 0, 0, 0.220036, 0.975492}, + {5600.7, -2693.04, 1515.2, 5.16003, 0, 0, 0.532522, -0.846416}, + {5627.56, -2839.66, 1510.53, 5.41527, 0, 0, 0.420463, -0.907309}, + {5622.02, -2868.71, 1516.22, 2.25482, 0, 0, 0.903303, 0.429002}, + {5586.61, -2878.97, 1510.34, 4.55604, 0, 0, 0.76017, -0.649724}, + {5583.78, -2843.71, 1509.54, 5.35715, 0, 0, 0.44665, -0.894709}, + {5580.95, -2811.3, 1513.3, 3.57587, 0, 0, 0.976518, -0.215434}, + {5542.52, -2869.31, 1523.13, 5.23304, 0, 0, 0.501275, -0.865288}, + {5557.35, -2866.36, 1518.76, 4.48299, 0, 0, 0.783388, -0.621533}, + {5380.91, -2849.36, 1512.81, 3.90962, 0, 0, 0.927168, -0.374646}, + {5395.76, -2881.41, 1521.11, 4.28426, 0, 0, 0.84118, -0.540755}, + {5374.87, -2859.63, 1528.98, 3.30252, 0, 0, 0.996765, -0.0803745}, + {5356.07, -2854.66, 1520.34, 5.83933, 0, 0, 0.220108, -0.975475}, + {5363.01, -2975.72, 1539.02, 4.13738, 0, 0, 0.87859, -0.477576}, + {5336.85, -2980.74, 1561.24, 5.11126, 0, 0, 0.553001, -0.83318}, + {5335.23, -2974.62, 1540.05, 5.04451, 0, 0, 0.580496, -0.814263}, + {5422.37, -2998.87, 1549.98, 4.51831, 0, 0, 0.772288, -0.635272}, + {5405.54, -3014.6, 1562.16, 5.86761, 0, 0, 0.206298, -0.978489}, + {5427.96, -3019.4, 1561.58, 3.53498, 0, 0, 0.980718, -0.19543}, + {5348.12, -2977.84, 1582.47, 3.94025, 0, 0, 0.921323, -0.388799}, + {5331.12, -2993.71, 1576.14, 0.0642734, 0, 0, 0.0321311, 0.999484}, + {5321.63, -2986.55, 1552.2, 5.29503, 0, 0, 0.474219, -0.880407}, + {5292.1, -2914.36, 1529.52, 2.9742, 0, 0, 0.996499, 0.083601}, + {5281.77, -2926.5, 1530.62, 1.67829, 0, 0, 0.744071, 0.6681}, + {5287.19, -2909.94, 1543.49, 3.31192, 0, 0, 0.996376, -0.0850591}, + {5534.15, -2679.35, 1483.61, 0.428685, 0, 0, 0.212705, 0.977116}, + {5545.43, -2647.82, 1483.05, 5.38848, 0, 0, 0.432578, -0.901596} +}; + +hyjalAI::hyjalAI(Creature *c) : npc_escortAI(c), Summons(m_creature) +{ + pInstance = c->GetInstanceData(); + VeinsSpawned[0] = false; + VeinsSpawned[1] = false; + for(uint8 i=0;i<14; ++i) + VeinGUID[i] = 0; + InfernalCount = 0; + TeleportTimer = 1000; + Overrun = false; + Teleported = false; + WaitForTeleport = false; + OverrunCounter = 0; + OverrunCounter2 = 0; + InfernalPoint = 0; + RespawnTimer = 10000; + DoRespawn = false; + DoHide = false; + MassTeleportTimer = 0; + DoMassTeleport = false; +} + +void hyjalAI::JustSummoned(Creature *summoned) +{ + Summons.Summon(summoned); +} + +void hyjalAI::SummonedCreatureDespawn(Creature* summoned) +{ + Summons.Despawn(summoned); +} + +void hyjalAI::Reset() +{ + IsDummy = false; + m_creature->setActive(true); + // GUIDs + PlayerGUID = 0; + BossGUID[0] = 0; + BossGUID[1] = 0; + + // Timers + NextWaveTimer = 10000; + CheckTimer = 0; + RetreatTimer = 1000; + + // Misc + WaveCount = 0; + EnemyCount = 0; + + // Set faction properly based on Creature entry + switch(m_creature->GetEntry()) + { + case JAINA: + Faction = 0; + DoCast(m_creature, SPELL_BRILLIANCE_AURA, true); + break; + + case THRALL: + Faction = 1; + break; + + case TYRANDE: + Faction = 2; + break; + } + + //Bools + EventBegun = false; + FirstBossDead = false; + SecondBossDead = false; + Summon = false; + bRetreat = false; + Debug = false; + + + //Flags + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + //Initialize spells + memset(Spell, 0, sizeof(Spell)); + + + + //Reset Instance Data for trash count + if (pInstance) + { + if ((!pInstance->GetData(DATA_ALLIANCE_RETREAT) && m_creature->GetEntry() == JAINA) || (pInstance->GetData(DATA_ALLIANCE_RETREAT) && m_creature->GetEntry() == THRALL)) + { + //Reset World States + pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0); + pInstance->SetData(DATA_RESET_TRASH_COUNT, 0); + } + }else error_log(ERROR_INST_DATA); + + //Visibility + DoHide = true; +} + +void hyjalAI::EnterEvadeMode() +{ + if (m_creature->GetEntry() != JAINA) + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->LoadCreaturesAddon(); + + if (m_creature->isAlive()) + m_creature->GetMotionMaster()->MoveTargetedHome(); + + m_creature->SetLootRecipient(NULL); +} + +void hyjalAI::EnterCombat(Unit *who) +{ + if (IsDummy)return; + for(uint8 i = 0; i < 3; ++i) + if (Spell[i].Cooldown) + SpellTimer[i] = Spell[i].Cooldown; + + Talk(ATTACKED); +} + +void hyjalAI::MoveInLineOfSight(Unit *who) +{ + if (IsDummy) + return; + + npc_escortAI::MoveInLineOfSight(who); +} + +void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) +{ + uint32 random = rand()%4; + float SpawnLoc[3]; + + for(uint8 i = 0; i < 3; ++i) + { + SpawnLoc[i] = Base[random][i]; + } + Creature* pCreature = NULL; + switch(entry) + { + case 17906: //GARGOYLE + + if (!FirstBossDead && (WaveCount == 1 || WaveCount == 3)) + {//summon at tower + pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][1]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); + if (pCreature) + CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true; + }else{//summon at gate + pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_GARG_GATE][0]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][1]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); + } + break; + case 17907: //FROST_WYRM , + if (FirstBossDead && WaveCount == 1) + {//summon at gate + pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_WYRM_GATE][0],SpawnPointSpecial[SPAWN_WYRM_GATE][1],SpawnPointSpecial[SPAWN_WYRM_GATE][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); + }else{ + pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0], SpawnPointSpecial[SPAWN_NEAR_TOWER][1],SpawnPointSpecial[SPAWN_NEAR_TOWER][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); + if (pCreature) + CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true; + } + break; + case 17908: //GIANT_INFERNAL + InfernalCount++; + if (InfernalCount > 7)InfernalCount = 0; + pCreature = m_creature->SummonCreature(entry, InfernalPos[InfernalCount][0], InfernalPos[InfernalCount][1], InfernalPos[InfernalCount][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); + break; + default: + pCreature = m_creature->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); + break; + + } + + if (pCreature) + { + // Increment Enemy Count to be used in World States and instance script + ++EnemyCount; + + pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pCreature->setActive(true); + switch(entry) + { + case NECROMANCER: + case ABOMINATION: + case GHOUL: + case BANSHEE: + case CRYPT_FIEND: + case GARGOYLE: + case FROST_WYRM: + case GIANT_INFERNAL: + case FEL_STALKER: + case RAGE_WINTERCHILL: + case ANETHERON: + case KAZROGAL: + case AZGALOR: + CAST_AI(hyjal_trashAI, pCreature->AI())->IsEvent = true; + break; + } + if (pInstance) + { + if (pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE) + pCreature->SetDisableReputationGain(true);//no repu for solo farming + } + // Check if Creature is a boss. + if (pCreature->isWorldBoss()) + { + if (!FirstBossDead) BossGUID[0] = pCreature->GetGUID(); + else BossGUID[1] = pCreature->GetGUID(); + CheckTimer = 5000; + } + } +} + +void hyjalAI::SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3]) +{ + // 1 in 4 chance we give a rally yell. Not sure if the chance is offilike. + if (rand()%4 == 0) + Talk(RALLY); + + if (!pInstance) + { + error_log(ERROR_INST_DATA); + return; + } + InfernalCount = 0;//reset infernal count every new wave + + EnemyCount = pInstance->GetData(DATA_TRASH); + for(uint8 i = 0; i < 18; ++i) + { + if (wave[Count].Mob[i]) + SummonCreature(wave[Count].Mob[i], Base); + } + + if (!wave[Count].IsBoss) + { + uint32 stateValue = Count+1; + if (FirstBossDead) + stateValue -= 9; // Subtract 9 from it to give the proper wave number if we are greater than 8 + + // Set world state to our current wave number + pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, stateValue); // Set world state to our current wave number + // Enable world state + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 1); // Enable world state + + pInstance->SetData(DATA_TRASH, EnemyCount); // Send data for instance script to update count + + if (!Debug) + NextWaveTimer = wave[Count].WaveTimer; + else + { + NextWaveTimer = 15000; + debug_log("TSCR: HyjalAI: debug mode is enabled. Next Wave in 15 seconds"); + } + } + else + { + // Set world state for waves to 0 to disable it. + pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 1); + + // Set World State for enemies invading to 1. + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 1); + + Summon = false; + } + CheckTimer = 5000; +} + +void hyjalAI::StartEvent(Player* pPlayer) +{ + if (!pPlayer || IsDummy || !pInstance) + return; + + Talk(BEGIN); + + EventBegun = true; + Summon = true; + + NextWaveTimer = 15000; + CheckTimer = 5000; + PlayerGUID = pPlayer->GetGUID(); + + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + + pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0); + + DeSpawnVeins(); +} + +uint32 hyjalAI::GetInstanceData(uint32 Event) +{ + if (pInstance) + return pInstance->GetData(Event); + else error_log(ERROR_INST_DATA); + + return 0; +} + +void hyjalAI::Talk(uint32 id) +{ + std::list index; + for(uint8 i = 0; i < 9; ++i) + { + if (Faction == 0) // Alliance + { + if (JainaQuotes[i].id == id) + index.push_back(i); + } + else if (Faction == 1) // Horde + { + if (ThrallQuotes[i].id == id) + index.push_back(i); + } + } + + if (index.empty()) + return; // No quotes found, no use to continue + + uint8 ind = *(index.begin()) + rand()%index.size(); + + int32 YellId = 0; + if (Faction == 0) // Alliance + { + YellId = JainaQuotes[ind].textid; + } + else if (Faction == 1) // Horde + { + YellId = ThrallQuotes[ind].textid; + } + + if (YellId) + DoScriptText(YellId, m_creature); +} + +void hyjalAI::Retreat() +{ + if (pInstance) + { + pInstance->SetData(TYPE_RETREAT,SPECIAL); + + if (Faction == 0) + { + pInstance->SetData(DATA_ALLIANCE_RETREAT, 1); + AddWaypoint(0,JainaWPs[0][0],JainaWPs[0][1],JainaWPs[0][2]); + AddWaypoint(1,JainaWPs[1][0],JainaWPs[1][1],JainaWPs[1][2]); + Start(false, false); + SetDespawnAtEnd(false);//move to center of alliance base + } + if (Faction == 1) + { + pInstance->SetData(DATA_HORDE_RETREAT, 1); + Creature* JainaDummy = m_creature->SummonCreature(JAINA,JainaDummySpawn[0][0],JainaDummySpawn[0][1],JainaDummySpawn[0][2],JainaDummySpawn[0][3],TEMPSUMMON_TIMED_DESPAWN,60000); + if (JainaDummy) + { + JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + CAST_AI(hyjalAI, JainaDummy->AI())->IsDummy = true; + DummyGuid = JainaDummy->GetGUID(); + } + AddWaypoint(0,JainaDummySpawn[1][0],JainaDummySpawn[1][1],JainaDummySpawn[1][2]); + Start(false, false); + SetDespawnAtEnd(false);//move to center of alliance base + } + } + SpawnVeins(); + Overrun = true; + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//cant talk after overrun event started +} + +void hyjalAI::SpawnVeins() +{ + if (Faction == 0) + { + if (VeinsSpawned[0])//prevent any buggers + return; + for (uint8 i = 0; i<7; ++i) + { + GameObject* gem = m_creature->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0); + if (gem) + VeinGUID[i]=gem->GetGUID(); + } + VeinsSpawned[0] = true; + }else{ + if (VeinsSpawned[1]) + return; + for (uint8 i = 7; i<14; ++i) + { + GameObject* gem = m_creature->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0); + if (gem) + VeinGUID[i]=gem->GetGUID(); + } + VeinsSpawned[1] = true; + } +} + +void hyjalAI::DeSpawnVeins() +{ + if (!pInstance)return; + if (Faction == 1) + { + Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (!pUnit)return; + hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI()); + if (!ai)return; + for (uint8 i = 0; i<7; ++i) + { + if (GameObject* gem = pInstance->instance->GetGameObject(pInstance->GetData64(ai->VeinGUID[i]))) + gem->Delete(); + } + }else if (Faction) + { + Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_THRALL)); + if (!pUnit)return; + hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI()); + if (!ai)return; + for (uint8 i = 7; i<14; ++i) + { + if (GameObject* gem = pInstance->instance->GetGameObject(pInstance->GetData64(ai->VeinGUID[i]))) + gem->Delete(); + } + } +} + +void hyjalAI::UpdateAI(const uint32 diff) +{ + if (IsDummy) + { + if (MassTeleportTimer < diff && DoMassTeleport) + { + m_creature->CastSpell(m_creature,SPELL_MASS_TELEPORT,false); + DoMassTeleport = false; + }else MassTeleportTimer -= diff; + return; + } + if (DoHide) + { + DoHide = false; + switch(m_creature->GetEntry()) + { + case JAINA: + if (pInstance->GetData(DATA_ALLIANCE_RETREAT)) + { + m_creature->SetVisibility(VISIBILITY_OFF); + HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); + HideNearPos(5037.76, -1889.71); + for(uint8 i = 0; i < 92; ++i)//summon fires + m_creature->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0); + + } + else m_creature->SetVisibility(VISIBILITY_ON); + break; + case THRALL: //thrall + if (pInstance->GetData(DATA_HORDE_RETREAT)) + { + m_creature->SetVisibility(VISIBILITY_OFF); + HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); + HideNearPos(5563, -2763.19); + HideNearPos(5542.2, -2629.36); + for(uint8 i = 0; i < 65; ++i)//summon fires + m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0); + + } + else m_creature->SetVisibility(VISIBILITY_ON); + break; + } + } + if (DoRespawn) + { + if (RespawnTimer < diff) + { + DoRespawn = false; + RespawnNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); + if (Faction == 0) + { + RespawnNearPos(5037.76, -1889.71); + }else if (Faction == 1) + { + RespawnNearPos(5563, -2763.19); + RespawnNearPos(5542.2, -2629.36); + } + m_creature->SetVisibility(VISIBILITY_ON); + }else{ + RespawnTimer -= diff; + m_creature->SetVisibility(VISIBILITY_OFF); + } + return; + } + if (Overrun) + DoOverrun(Faction, diff); + if (bRetreat) + { + if (RetreatTimer < diff) + { + IsDummy = true; + bRetreat = false; + HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); + switch(m_creature->GetEntry()) + { + case JAINA://jaina + HideNearPos(5037.76, -1889.71); + break; + case THRALL://thrall + HideNearPos(5563, -2763.19); + HideNearPos(5542.2, -2629.36); + HideNearPos(5603.75, -2853.12); + break; + } + m_creature->SetVisibility(VISIBILITY_OFF); + }else RetreatTimer -= diff; + } + + if (!EventBegun) + return; + + if (Summon) + { + if (pInstance && EnemyCount) + { + EnemyCount = pInstance->GetData(DATA_TRASH); + if (!EnemyCount) + NextWaveTimer = 5000; + } + + if (NextWaveTimer < diff) + { + if (Faction == 0) + SummonNextWave(AllianceWaves, WaveCount, AllianceBase); + else if (Faction == 1) + SummonNextWave(HordeWaves, WaveCount, HordeBase); + ++WaveCount; + }else NextWaveTimer -= diff; + } + + if (CheckTimer < diff) + { + for(uint8 i = 0; i < 2; ++i) + { + if (BossGUID[i]) + { + Unit* pUnit = Unit::GetUnit((*m_creature), BossGUID[i]); + if (pUnit && (!pUnit->isAlive())) + { + if (BossGUID[i] == BossGUID[0]) + { + Talk(INCOMING); + FirstBossDead = true; + } + else if (BossGUID[i] == BossGUID[1]) + { + Talk(SUCCESS); + SecondBossDead = true; + } + EventBegun = false; + CheckTimer = 0; + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + BossGUID[i] = 0; + pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); // Reset world state for enemies to disable it + } + } + } + CheckTimer = 5000; + }else CheckTimer -= diff; + + if (!UpdateVictim()) + return; + + for(uint8 i = 0; i < 3; ++i) + { + if (Spell[i].SpellId) + { + if (SpellTimer[i] < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + Unit* target = NULL; + + switch(Spell[i].TargetType) + { + case TARGETTYPE_SELF: target = m_creature; break; + case TARGETTYPE_RANDOM: target = SelectUnit(SELECT_TARGET_RANDOM, 0); break; + case TARGETTYPE_VICTIM: target = m_creature->getVictim(); break; + } + + if (target && target->isAlive()) + { + DoCast(target, Spell[i].SpellId); + SpellTimer[i] = Spell[i].Cooldown; + } + }else SpellTimer[i] -= diff; + } + } + + DoMeleeAttackIfReady(); +} +void hyjalAI::JustDied(Unit* killer) +{ + if (IsDummy)return; + m_creature->Respawn(); + m_creature->SetVisibility(VISIBILITY_OFF); + DoRespawn = true; + RespawnTimer = 120000; + Talk(DEATH); + Summons.DespawnAll();//despawn all wave's summons + if (pInstance) + {//reset encounter if boss is despawned (ex: thrall is killed, boss despawns, event stucks at inprogress) + if (pInstance->GetData(DATA_RAGEWINTERCHILLEVENT) == IN_PROGRESS) + pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED); + if (pInstance->GetData(DATA_ANETHERONEVENT) == IN_PROGRESS) + pInstance->SetData(DATA_ANETHERONEVENT, NOT_STARTED); + if (pInstance->GetData(DATA_KAZROGALEVENT) == IN_PROGRESS) + pInstance->SetData(DATA_KAZROGALEVENT, NOT_STARTED); + if (pInstance->GetData(DATA_AZGALOREVENT) == IN_PROGRESS) + pInstance->SetData(DATA_AZGALOREVENT, NOT_STARTED); + pInstance->SetData(DATA_RESET_RAIDDAMAGE, NULL);//reset damage on die + } +} +void hyjalAI::HideNearPos(float x, float y) +{ + CellPair pair(Trinity::ComputeCellPair(x, y)); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + // First get all creatures. + std::list creatures; + Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); + Trinity::CreatureListSearcher creature_searcher(m_creature, creatures, creature_check); + TypeContainerVisitor + , + GridTypeMapContainer> creature_visitor(creature_searcher); + + CellLock cell_lock(cell, pair); + // Get Creatures + cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap())); + + if (!creatures.empty()) + { + for(std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) + { + (*itr)->SetVisibility(VISIBILITY_OFF); + (*itr)->setFaction(35);//make them friendly so mobs won't attack them + } + } +} +void hyjalAI::RespawnNearPos(float x, float y) +{ + CellPair p(Trinity::ComputeCellPair(x, y)); + Cell cell(p); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + Trinity::RespawnDo u_do; + Trinity::WorldObjectWorker worker(m_creature, u_do); + TypeContainerVisitor, GridTypeMapContainer > obj_worker(worker); + CellLock cell_lock(cell, p); + cell_lock->Visit(cell_lock, obj_worker, *m_creature->GetMap()); +} +void hyjalAI::WaypointReached(uint32 i) +{ + if (i == 1 || (i == 0 && m_creature->GetEntry() == THRALL)) + { + m_creature->MonsterYell("Hurry, we don't have much time",0,0); + WaitForTeleport = true; + TeleportTimer = 20000; + if (m_creature->GetEntry() == JAINA) + m_creature->CastSpell(m_creature,SPELL_MASS_TELEPORT,false); + if (m_creature->GetEntry() == THRALL && DummyGuid) + { + Unit* Dummy = Unit::GetUnit((*m_creature),DummyGuid); + if (Dummy) + { + CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->DoMassTeleport = true; + CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->MassTeleportTimer = 20000; + Dummy->CastSpell(m_creature,SPELL_MASS_TELEPORT,false); + } + } + //do some talking + //all alive guards walk near here + CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + // First get all creatures. + std::list creatures; + Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); + Trinity::CreatureListSearcher creature_searcher(m_creature, creatures, creature_check); + TypeContainerVisitor + , + GridTypeMapContainer> creature_visitor(creature_searcher); + + CellLock cell_lock(cell, pair); + cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap())); + + if (!creatures.empty()) + { + for(std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) + { + if ((*itr) && (*itr)->isAlive() && (*itr) != m_creature && (*itr)->GetEntry() != JAINA) + { + if (!(*itr)->IsWithinDist(m_creature, 60)) + (*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + float x, y, z; + (*itr)->SetDefaultMovementType(IDLE_MOTION_TYPE); + (*itr)->GetMotionMaster()->Initialize(); + float range = 10; + if (m_creature->GetEntry() == THRALL)range = 20; + m_creature->GetNearPoint(m_creature, x, y, z, range, 0, m_creature->GetAngle((*itr))); + (*itr)->GetMotionMaster()->MovePoint(0, x+irand(-5,5), y+irand(-5,5), m_creature->GetPositionZ()); + } + } + } + } +} +void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) +{ + npc_escortAI::UpdateAI(diff); + if (WaitForTeleport) + { + if (TeleportTimer < diff) + { + CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); + Cell cell(pair); + cell.data.Part.reserved = ALL_DISTRICT; + cell.SetNoCreate(); + + std::list creatures; + Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); + Trinity::CreatureListSearcher creature_searcher(m_creature, creatures, creature_check); + TypeContainerVisitor + , + GridTypeMapContainer> creature_visitor(creature_searcher); + + CellLock cell_lock(cell, pair); + cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap())); + + if (!creatures.empty()) + { + for(std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) + { + if ((*itr) && (*itr)->isAlive()) + { + (*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true); + (*itr)->setFaction(35);//make them friendly so mobs won't attack them + (*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + DoCast(m_creature, SPELL_TELEPORT_VISUAL); + bRetreat = true; + RetreatTimer = 1000; + } + + WaitForTeleport = false; + Teleported = true; + }TeleportTimer -= diff; + } + if (!Teleported) + return; + Overrun = false;//execute once + switch(faction) + { + case 0://alliance + for(uint8 i = 0; i < 92; ++i)//summon fires + m_creature->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0); + + for(uint8 i = 0; i < 25; ++i)//summon 25 ghouls + { + uint8 r = rand()%4; + Creature* pUnit = m_creature->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (pUnit) + { + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; + pUnit->setActive(true); + } + } + for(uint8 i = 0; i < 3; ++i)//summon 3 abominations + { + uint8 r = rand()%4; + Creature* pUnit = m_creature->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (pUnit) + { + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; + pUnit->setActive(true); + } + } + for(uint8 i = 0; i < 5; ++i)//summon 5 gargoyles + { + Creature* pUnit = m_creature->SummonCreature(GARGOYLE, AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (pUnit) + { + pUnit->SetHomePosition(AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3]); + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; + pUnit->setActive(true); + } + } + break; + case 1://horde + for(uint8 i = 0; i < 65; ++i)//summon fires + m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0); + + for(uint8 i = 0; i < 26; ++i)//summon infernals + { + Creature* pUnit = m_creature->SummonCreature(GIANT_INFERNAL, InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (pUnit) + { + pUnit->SetHomePosition(InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3]); + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; + pUnit->setActive(true); + } + } + for(uint8 i = 0; i < 25; ++i)//summon 25 ghouls + { + uint8 r = rand()%4; + Creature* pUnit = m_creature->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (pUnit) + { + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; + pUnit->setActive(true); + } + } + for(uint8 i = 0; i < 5; ++i)//summon 5 abominations + { + uint8 r = rand()%4; + Creature* pUnit = m_creature->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); + if (pUnit) + { + CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; + CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; + CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; + pUnit->setActive(true); + } + } + break; + } +} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h new file mode 100644 index 00000000000..3b0ff32a429 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h @@ -0,0 +1,248 @@ +/* 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 SC_HYJALAI_H +#define SC_HYJALAI_H + +#include "def_hyjal.h" +#include "escortAI.h" + +// Trash Mobs summoned in waves +#define NECROMANCER 17899//done +#define ABOMINATION 17898//done +#define GHOUL 17895//done +#define BANSHEE 17905//done +#define CRYPT_FIEND 17897//done +#define GARGOYLE 17906//done +#define FROST_WYRM 17907//done +#define GIANT_INFERNAL 17908//done +#define FEL_STALKER 17916//done + +#define JAINA 17772 +#define THRALL 17852 +#define TYRANDE 17948 + +#define ANCIENT_VEIN 185557 +#define FLAMEOBJECT 182592 + +// Bosses summoned after every 8 waves +#define RAGE_WINTERCHILL 17767 +#define ANETHERON 17808 +#define KAZROGAL 17888 +#define AZGALOR 17842 +#define ARCHIMONDE 17968 + +#define SPELL_TELEPORT_VISUAL 41232 +#define SPELL_MASS_TELEPORT 16807 + +//Spells for Jaina +#define SPELL_BRILLIANCE_AURA 31260 // The database must handle this spell via creature_addon(it should, but is removed in evade..) +#define SPELL_BLIZZARD 31266 +#define SPELL_PYROBLAST 31263 +#define SPELL_SUMMON_ELEMENTALS 31264 + +//Thrall spells +#define SPELL_CHAIN_LIGHTNING 31330 +#define SPELL_SUMMON_DIRE_WOLF 31331 + +struct Wave +{ + uint32 Mob[18]; // Stores Creature Entries to be summoned in Waves + uint32 WaveTimer; // The timer before the next wave is summoned + bool IsBoss; // Simply used to inform the wave summoner that the next wave contains a boss to halt all waves after that +}; + +static Wave AllianceWaves[]= // Waves that will be summoned in the Alliance Base +{ // Rage Winterchill Wave 1-8 + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, + // All 8 Waves are summoned, summon Rage Winterchill, next few waves are for Anetheron + {RAGE_WINTERCHILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}, + // Anetheron Wave 1-8 + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, + {NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, + {CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, BANSHEE, BANSHEE, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, GHOUL, GHOUL, 0, 0, 0, 0, 120000, false}, + {GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, + // All 8 Waves are summoned, summon Anatheron + {ANETHERON, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true} +}; + +static Wave HordeWaves[]= // Waves that are summoned in the Horde base +{ // Kaz'Rogal Wave 1-8 + {GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, + {CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, + {GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, FROST_WYRM, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, FROST_WYRM, 0, 0, 0, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 240000, false}, + // All 8 Waves are summoned, summon Kaz'Rogal, next few waves are for Azgalor + {KAZROGAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}, + // Azgalor Wave 1-8 + {ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, FROST_WYRM, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, 0, 0, 0, 0, 180000, false}, + {GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, 0, 0, 0, 0, 180000, false}, + {FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, + {NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 180000, false}, + {GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, FEL_STALKER, FEL_STALKER, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, 0, 0, 0, 0, 180000, false}, + {CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, FEL_STALKER, FEL_STALKER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 240000, false}, + // All 8 Waves are summoned, summon Azgalor + {AZGALOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true} +}; + +enum TargetType // Used in the spell cast system for the AI +{ + TARGETTYPE_SELF = 0, + TARGETTYPE_RANDOM = 1, + TARGETTYPE_VICTIM = 2, +}; + +struct Yells +{ + uint32 id; // Used to determine the type of yell (attack, rally, etc) + int32 textid; // The text id to be yelled +}; + +enum YellId +{ + ATTACKED = 0, // Used when attacked and set in combat + BEGIN = 1, // Used when the event is begun + INCOMING = 2, // Used to warn the raid that another wave phase is coming + RALLY = 3, // Used to rally the raid and warn that the next wave has been summoned + FAILURE = 4, // Used when raid has failed (unsure where to place) + SUCCESS = 5, // Used when the raid has sucessfully defeated a wave phase + DEATH = 6, // Used on death +}; + +static Yells JainaQuotes[]= +{ + {ATTACKED, -1534000}, + {ATTACKED, -1534001}, + {INCOMING, -1534002}, + {BEGIN, -1534003}, + {RALLY, -1534004}, + {RALLY, -1534005}, + {FAILURE, -1534006}, + {SUCCESS, -1534007}, + {DEATH, -1534008}, +}; + +static Yells ThrallQuotes[]= +{ + {ATTACKED, -1534009}, + {ATTACKED, -1534010}, + {INCOMING, -1534011}, + {BEGIN, -1534012}, + {RALLY, -1534013}, + {RALLY, -1534014}, + {FAILURE, -1534015}, + {SUCCESS, -1534016}, + {DEATH, -1534017}, +}; + +struct TRINITY_DLL_DECL hyjalAI : public npc_escortAI +{ + hyjalAI(Creature *c); + + void Reset(); // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat + + void EnterEvadeMode(); // Send creature back to spawn location and evade. + + void EnterCombat(Unit *who); // Used to reset cooldowns for our spells and to inform the raid that we're under attack + + void UpdateAI(const uint32 diff); // Called to summon waves, check for boss deaths and to cast our spells. + + void JustDied(Unit* killer); // Called on death, informs the raid that they have failed. + + void SetFaction(uint32 _faction) // Set the faction to either Alliance or Horde in Hyjal + { + Faction = _faction; + } + + void Retreat(); // "Teleport" (teleport visual + set invisible) all friendly creatures away from the base. + + void SpawnVeins(); + void DeSpawnVeins(); + void JustSummoned(Creature *summoned); + void SummonedCreatureDespawn(Creature* summoned); + void HideNearPos(float x, float y); + void RespawnNearPos(float x, float y); + void WaypointReached(uint32 i); + void DoOverrun(uint32 faction, const uint32 diff); + void MoveInLineOfSight(Unit *who); + + void SummonCreature(uint32 entry, float Base[4][3]); // Summons a creature for that wave in that base + + // Summons the next wave, calls SummonCreature + void SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3]); + + void StartEvent(Player* player); // Begins the event by gossip click + + uint32 GetInstanceData(uint32 Event); // Gets instance data for this instance, used to check if raid has gotten past a certain point and can access the next phase + + void Talk(uint32 id); // Searches for the appropriate yell and sound and uses it to inform the raid of various things + + public: + ScriptedInstance* pInstance; + + uint64 PlayerGUID; + uint64 BossGUID[2]; + uint64 VeinGUID[14]; + + uint32 NextWaveTimer; + uint32 WaveCount; + uint32 CheckTimer; + uint32 Faction; + uint32 EnemyCount; + uint32 RetreatTimer; + + bool EventBegun; + bool FirstBossDead; + bool SecondBossDead; + bool Summon; + bool bRetreat; + bool Debug; + bool VeinsSpawned[2]; + uint8 InfernalCount; + SummonList Summons; + bool Overrun; + bool Teleported; + bool WaitForTeleport; + uint32 TeleportTimer; + uint32 OverrunCounter; + uint32 OverrunCounter2; + uint32 InfernalPoint; + uint32 RespawnTimer; + bool DoRespawn; + bool DoHide; + bool IsDummy; + uint32 MassTeleportTimer; + bool DoMassTeleport; + uint64 DummyGuid; + + struct Spell + { + uint32 SpellId; + uint32 Cooldown; + uint32 TargetType; + }Spell[3]; + + private: + uint32 SpellTimer[3]; + //std::list CreatureList; +}; +#endif + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp new file mode 100644 index 00000000000..b0739530fdc --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.cpp @@ -0,0 +1,1453 @@ + +#include "precompiled.h" +#include "def_hyjal.h" +#include "hyjal_trash.h" +#include "hyjalAI.h" + +#define SPELL_METEOR 33814 //infernal visual +#define SPELL_IMMOLATION 37059 +#define SPELL_FLAME_BUFFET 31724 +#define NPC_TRIGGER 21987 //World Trigger (Tiny) +#define MODEL_INVIS 11686 //invisible model + +float HordeWPs[8][3]=//basic waypoints from spawn to leader +{ + {5492.91, -2404.61, 1462.63}, + {5531.76, -2460.87, 1469.55}, + {5554.58, -2514.66, 1476.12}, + {5554.16, -2567.23, 1479.90}, + {5540.67, -2625.99, 1480.89}, + {5508.16, -2659.20, 1480.15},//random rush starts from here + {5489.62, -2704.05, 1482.18}, + {5457.04, -2726.26, 1485.10} +}; +float AllianceWPs[8][3]=//basic waypoints from spawn to leader +{ + {4896.08, -1576.35, 1333.65}, + {4898.68, -1615.02, 1329.48}, + {4907.12, -1667.08, 1321.00}, + {4963.18, -1699.35, 1340.51}, + {4989.16, -1716.67, 1335.74},//first WP in the base, after the gate + {5026.27, -1736.89, 1323.02}, + {5037.77, -1770.56, 1324.36}, + {5067.23, -1789.95, 1321.17} +}; + +float FrostWyrmWPs[3][3]=//waypoints for the frost wyrms in horde base +{ + {5580.82, -2628.83, 1528.28}, + {5550.90, -2667.16, 1505.45}, + {5459.64, -2725.91, 1484.83} +}; + +float GargoyleWPs[3][3]=//waypoints for the gargoyles in horde base +{ + {5533.66, -2634.32, 1495.33}, + {5517.88, -2712.05, 1490.54}, + {5459.64, -2725.91, 1484.83} +}; + +float FlyPathWPs[3][3]=//waypoints for the gargoyls and frost wyrms in horde base in wave 1/3 +{ + {5531.96, -2772.83, 1516.68}, + {5498.32, -2734.84, 1497.01}, + {5456.67, -2725.48, 1493.08} +}; + +float AllianceOverrunWP[55][3]=//waypoints in the alliance base used in the end in the cleaning wave +{ + {4976.37,-1708.02,1339.43},//0spawn + {4994.83,-1725.52,1333.25},//1 start + {4982.92,-1753.7,1330.69},//2 end + {4996.75,-1721.47,1332.95},//3 start + {5015.74,-1755.05,1322.49},//4 + {4998.68,-1773.44,1329.59},//5 + {4994.83,-1725.52,1333.25},//6 start + {5022.8,-1735.46,1323.53},//7 + {5052.15,-1729.02,1320.88},//8 + {5082.43,-1726.29,1327.87},//9 + {4994.83,-1725.52,1333.25},//10 start + {5018.92,-1751.14,1322.19},//11 + {5040.09,-1792.09,1322.1},//12 + {4994.83,-1725.52,1333.25},//13 start + {5023.47,-1748.1,1322.51},//14 + {5013.43,-1842.39,1322.07},//15 + {4994.83,-1725.52,1333.25},//16 start + {5020.8,-1756.86,1322.2},//17 + {5019.53,-1824.6,1321.96},//18 + {5043.42,-1853.75,1324.52},//19 + {5053.02,-1864.13,1330.36},//20 + {5062.49,-1852.47,1330.49},//21 + {5015.27, -1738.77, 1324.83},//35//start 22 + {5027.97, -1775.25, 1321.87},//34 23 + {5015.94, -1821.24, 1321.86},//33 24 + {4983.25, -1857.4, 1320.48},//32 25 + {4981.51, -1883.7, 1322.34},//31 26 + {5002.33, -1893.98, 1325.88},//30 27 + {5049.32, -1886.54, 1331.69},//29 28 + {5089.68, -1846.88, 1328.99},//28 29 + {5127.90, -1825.14, 1335.58},//27 30 + {5163.27, -1789.08, 1337.04},//26 31 + {5138.97, -1755.88, 1334.57},//25 32 + {5096.63, -1742.22, 1329.61},//24 33 + {5065.81, -1729.43, 1325.66},//23 34 + {5049.32, -1726.31, 1320.64},//22 start + {5081.07, -1902.10, 1346.36},//36 abo start + {5107.65, -1912.03, 1356.49},//37 + {5132.83, -1927.07, 1362.42},//38 + {5147.78, -1954.41, 1365.98},//39 + {5164.96, -1966.48, 1367.04},//40 + {5189.04, -1961.06, 1367.90},//41 + {5212.27, -1975.30, 1365.58},//42 + {5221.82, -1994.18, 1364.97},//43 end1 + {5202.23, -1994.94, 1367.59},//44 end2 + {5279.94, -2049.68, 1311.38},//45 garg1 + {5289.15, -2219.06, 1291.12},//46 garg2 + {5202.07, -2136.10, 1305.07},//47 garg3 + {5071.52, -2425.63, 1454.48},//48 garg4 + {5120.65, -2467.92, 1463.93},//49 garg5 + {5283.04, -2043.26, 1300.11},//50 garg target1 + {5313.22, -2207.60, 1290.06},//51 garg target2 + {5180.41, -2121.87, 1292.62},//52 garg target3 + {5088.68, -2432.04, 1441.73},//53 garg target4 + {5111.26, -2454.73, 1449.63}//54 garg target5 + +}; + +float HordeOverrunWP[21][3]=//waypoints in the horde base used in the end in the cleaning wave +{ + {5490.72,-2702.94,1482.14},//0 start + {5469.77,-2741.34,1486.95}, + {5439.47,-2771.02,1494.59}, + {5408.85,-2811.92,1505.68}, + {5423.87,-2857.80,1515.55}, + {5428.19,-2898.15,1524.61}, + {5394.59,-2930.05,1528.23}, + {5351.11,-2935.80,1532.24}, + {5312.37,-2959.06,1536.21}, + {5264.93,-2989.80,1545.70}, + {5256.63,-3056.16,1559.24}, + {5267.32,-3119.55,1575.36}, + {5305.61,-3139.88,1586.38}, + {5330.56,-3135.37,1588.58}, + {5365.87,-3139.78,1583.96}, + {5389.39,-3163.57,1582.57},//15 end + {5500.86,-2669.89,1481.04},//16 start + {5472.08,-2715.14,1483.55}, + {5450.11,-2721.47,1485.61}, + {5433.25,-2712.93,1493.02},//19 end 1 + {5429.91,-2718.44,1493.42}//20 end 2 +}; + +hyjal_trashAI::hyjal_trashAI(Creature *c) : npc_escortAI(c) +{ + pInstance = c->GetInstanceData(); + IsEvent = false; + Delay = 0; + LastOverronPos = 0; + IsOverrun = false; + OverrunType = 0; + SetupOverrun = false; + faction = 0; + useFlyPath = false; + damageTaken = 0; + Reset(); +} + +void hyjal_trashAI::DamageTaken(Unit *done_by, uint32 &damage) +{ + if (done_by->GetTypeId() == TYPEID_PLAYER || (done_by->GetTypeId() == TYPEID_UNIT && CAST_CRE(done_by)->isPet())) + { + damageTaken += damage; + if (pInstance) + pInstance->SetData(DATA_RAIDDAMAGE,damage);//store raid's damage + } +} + +void hyjal_trashAI::UpdateAI(const uint32 diff) +{ + if (IsOverrun && !SetupOverrun) + { + SetupOverrun = true; + if (faction == 0) + { + if (m_creature->GetEntry() == GARGOYLE) + { + DummyTarget[0] = AllianceOverrunWP[50+OverrunType][0]; //+OverrunType 0 - 4 + DummyTarget[1] = AllianceOverrunWP[50+OverrunType][1]; + DummyTarget[2] = AllianceOverrunWP[50+OverrunType][2]; + } + if (m_creature->GetEntry() == ABOMINATION) + { + for(uint8 i = 0; i < 4; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + switch(OverrunType) + { + case 0: + AddWaypoint(4, AllianceOverrunWP[22][0]+irand(-3,3), AllianceOverrunWP[22][1]+irand(-3,3), AllianceOverrunWP[22][2]); + AddWaypoint(5, AllianceOverrunWP[23][0]+irand(-3,3), AllianceOverrunWP[23][1]+irand(-3,3), AllianceOverrunWP[23][2]); + AddWaypoint(6, AllianceOverrunWP[24][0]+irand(-3,3), AllianceOverrunWP[24][1]+irand(-3,3), AllianceOverrunWP[24][2]); + AddWaypoint(7, AllianceOverrunWP[25][0]+irand(-3,3), AllianceOverrunWP[25][1]+irand(-3,3), AllianceOverrunWP[25][2]); + AddWaypoint(8, AllianceOverrunWP[26][0]+irand(-3,3), AllianceOverrunWP[26][1]+irand(-3,3), AllianceOverrunWP[26][2]); + AddWaypoint(9, AllianceOverrunWP[27][0]+irand(-3,3), AllianceOverrunWP[27][1]+irand(-3,3), AllianceOverrunWP[27][2]); + AddWaypoint(10, AllianceOverrunWP[28][0]+irand(-3,3), AllianceOverrunWP[28][1]+irand(-3,3), AllianceOverrunWP[28][2]); + + AddWaypoint(11, AllianceOverrunWP[36][0]+irand(-3,3), AllianceOverrunWP[36][1]+irand(-3,3), AllianceOverrunWP[36][2]); + AddWaypoint(12, AllianceOverrunWP[37][0]+irand(-3,3), AllianceOverrunWP[37][1]+irand(-3,3), AllianceOverrunWP[37][2]); + AddWaypoint(13, AllianceOverrunWP[38][0]+irand(-3,3), AllianceOverrunWP[38][1]+irand(-3,3), AllianceOverrunWP[38][2]); + AddWaypoint(14, AllianceOverrunWP[39][0]+irand(-3,3), AllianceOverrunWP[39][1]+irand(-3,3), AllianceOverrunWP[39][2]); + AddWaypoint(15, AllianceOverrunWP[40][0]+irand(-3,3), AllianceOverrunWP[40][1]+irand(-3,3), AllianceOverrunWP[40][2]); + AddWaypoint(16, AllianceOverrunWP[41][0]+irand(-3,3), AllianceOverrunWP[41][1]+irand(-3,3), AllianceOverrunWP[41][2]); + AddWaypoint(17, AllianceOverrunWP[42][0]+irand(-3,3), AllianceOverrunWP[42][1]+irand(-3,3), AllianceOverrunWP[42][2]); + AddWaypoint(18, AllianceOverrunWP[43][0]+irand(-3,3), AllianceOverrunWP[43][1]+irand(-3,3), AllianceOverrunWP[43][2]); + m_creature->SetHomePosition(AllianceOverrunWP[43][0]+irand(-3,3), AllianceOverrunWP[43][1]+irand(-3,3), AllianceOverrunWP[43][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 18; + Start(true, true); + break; + case 1: + AddWaypoint(4, AllianceOverrunWP[22][0]+irand(-3,3), AllianceOverrunWP[22][1]+irand(-3,3), AllianceOverrunWP[22][2]); + AddWaypoint(5, AllianceOverrunWP[23][0]+irand(-3,3), AllianceOverrunWP[23][1]+irand(-3,3), AllianceOverrunWP[23][2]); + AddWaypoint(6, AllianceOverrunWP[24][0]+irand(-3,3), AllianceOverrunWP[24][1]+irand(-3,3), AllianceOverrunWP[24][2]); + AddWaypoint(7, AllianceOverrunWP[25][0]+irand(-3,3), AllianceOverrunWP[25][1]+irand(-3,3), AllianceOverrunWP[25][2]); + AddWaypoint(8, AllianceOverrunWP[26][0]+irand(-3,3), AllianceOverrunWP[26][1]+irand(-3,3), AllianceOverrunWP[26][2]); + AddWaypoint(9, AllianceOverrunWP[27][0]+irand(-3,3), AllianceOverrunWP[27][1]+irand(-3,3), AllianceOverrunWP[27][2]); + AddWaypoint(10, AllianceOverrunWP[28][0]+irand(-3,3), AllianceOverrunWP[28][1]+irand(-3,3), AllianceOverrunWP[28][2]); + + AddWaypoint(11, AllianceOverrunWP[36][0]+irand(-3,3), AllianceOverrunWP[36][1]+irand(-3,3), AllianceOverrunWP[36][2]); + AddWaypoint(12, AllianceOverrunWP[37][0]+irand(-3,3), AllianceOverrunWP[37][1]+irand(-3,3), AllianceOverrunWP[37][2]); + AddWaypoint(13, AllianceOverrunWP[38][0]+irand(-3,3), AllianceOverrunWP[38][1]+irand(-3,3), AllianceOverrunWP[38][2]); + AddWaypoint(14, AllianceOverrunWP[39][0]+irand(-3,3), AllianceOverrunWP[39][1]+irand(-3,3), AllianceOverrunWP[39][2]); + AddWaypoint(15, AllianceOverrunWP[40][0]+irand(-3,3), AllianceOverrunWP[40][1]+irand(-3,3), AllianceOverrunWP[40][2]); + AddWaypoint(16, AllianceOverrunWP[41][0]+irand(-3,3), AllianceOverrunWP[41][1]+irand(-3,3), AllianceOverrunWP[41][2]); + AddWaypoint(17, AllianceOverrunWP[42][0]+irand(-3,3), AllianceOverrunWP[42][1]+irand(-3,3), AllianceOverrunWP[42][2]); + AddWaypoint(18, AllianceOverrunWP[44][0]+irand(-3,3), AllianceOverrunWP[44][1]+irand(-3,3), AllianceOverrunWP[44][2]); + m_creature->SetHomePosition(AllianceOverrunWP[44][0]+irand(-3,3), AllianceOverrunWP[44][1]+irand(-3,3), AllianceOverrunWP[44][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 18; + Start(true, true); + break; + default: + for(uint8 i = 22; i < 36; ++i) + AddWaypoint(i-18, AllianceOverrunWP[i][0]+irand(-3,3), AllianceOverrunWP[i][1]+irand(-3,3), AllianceOverrunWP[i][2]); + + SetDespawnAtEnd(true); + LastOverronPos = 17; + Start(true, true); + break; + } + } + if (m_creature->GetEntry() == GHOUL) + { + for(uint8 i = 0; i < 4; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + switch(OverrunType) + { + case 0: + AddWaypoint(4, AllianceOverrunWP[1][0]+irand(-3,3), AllianceOverrunWP[1][1]+irand(-3,3), AllianceOverrunWP[1][2]); + AddWaypoint(5, AllianceOverrunWP[2][0]+irand(-3,3), AllianceOverrunWP[2][1]+irand(-3,3), AllianceOverrunWP[2][2]); + m_creature->SetHomePosition(AllianceOverrunWP[2][0]+irand(-3,3), AllianceOverrunWP[2][1]+irand(-3,3), AllianceOverrunWP[2][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 5; + Start(true, true); + break; + case 1: + AddWaypoint(4, AllianceOverrunWP[3][0]+irand(-3,3), AllianceOverrunWP[3][1]+irand(-3,3), AllianceOverrunWP[3][2]); + AddWaypoint(5, AllianceOverrunWP[4][0]+irand(-3,3), AllianceOverrunWP[4][1]+irand(-3,3), AllianceOverrunWP[4][2]); + AddWaypoint(6, AllianceOverrunWP[5][0]+irand(-3,3), AllianceOverrunWP[5][1]+irand(-3,3), AllianceOverrunWP[5][2]); + m_creature->SetHomePosition(AllianceOverrunWP[5][0]+irand(-3,3), AllianceOverrunWP[5][1]+irand(-3,3), AllianceOverrunWP[5][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 6; + Start(true, true); + break; + case 2: + AddWaypoint(4, AllianceOverrunWP[6][0]+irand(-3,3), AllianceOverrunWP[6][1]+irand(-3,3), AllianceOverrunWP[6][2]); + AddWaypoint(5, AllianceOverrunWP[7][0]+irand(-3,3), AllianceOverrunWP[7][1]+irand(-3,3), AllianceOverrunWP[7][2]); + AddWaypoint(6, AllianceOverrunWP[8][0]+irand(-3,3), AllianceOverrunWP[8][1]+irand(-3,3), AllianceOverrunWP[8][2]); + AddWaypoint(7, AllianceOverrunWP[9][0]+irand(-3,3), AllianceOverrunWP[9][1]+irand(-3,3), AllianceOverrunWP[9][2]); + m_creature->SetHomePosition(AllianceOverrunWP[9][0]+irand(-3,3), AllianceOverrunWP[9][1]+irand(-3,3), AllianceOverrunWP[9][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 7; + Start(true, true); + break; + case 3: + AddWaypoint(4, AllianceOverrunWP[10][0]+irand(-3,3), AllianceOverrunWP[10][1]+irand(-3,3), AllianceOverrunWP[10][2]); + AddWaypoint(5, AllianceOverrunWP[11][0]+irand(-3,3), AllianceOverrunWP[11][1]+irand(-3,3), AllianceOverrunWP[11][2]); + AddWaypoint(6, AllianceOverrunWP[12][0]+irand(-3,3), AllianceOverrunWP[12][1]+irand(-3,3), AllianceOverrunWP[12][2]); + m_creature->SetHomePosition(AllianceOverrunWP[12][0]+irand(-3,3), AllianceOverrunWP[12][1]+irand(-3,3), AllianceOverrunWP[12][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 6; + Start(true, true); + break; + case 4: + AddWaypoint(4, AllianceOverrunWP[13][0]+irand(-3,3), AllianceOverrunWP[13][1]+irand(-3,3), AllianceOverrunWP[13][2]); + AddWaypoint(5, AllianceOverrunWP[14][0]+irand(-3,3), AllianceOverrunWP[14][1]+irand(-3,3), AllianceOverrunWP[14][2]); + AddWaypoint(6, AllianceOverrunWP[15][0]+irand(-3,3), AllianceOverrunWP[15][1]+irand(-3,3), AllianceOverrunWP[15][2]); + m_creature->SetHomePosition(AllianceOverrunWP[15][0]+irand(-3,3), AllianceOverrunWP[15][1]+irand(-3,3), AllianceOverrunWP[15][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 6; + Start(true, true); + break; + case 5: + AddWaypoint(4, AllianceOverrunWP[16][0]+irand(-3,3), AllianceOverrunWP[16][1]+irand(-3,3), AllianceOverrunWP[16][2]); + AddWaypoint(5, AllianceOverrunWP[17][0]+irand(-3,3), AllianceOverrunWP[17][1]+irand(-3,3), AllianceOverrunWP[17][2]); + AddWaypoint(6, AllianceOverrunWP[18][0]+irand(-3,3), AllianceOverrunWP[18][1]+irand(-3,3), AllianceOverrunWP[18][2]); + AddWaypoint(7, AllianceOverrunWP[19][0]+irand(-3,3), AllianceOverrunWP[19][1]+irand(-3,3), AllianceOverrunWP[19][2]); + AddWaypoint(8, AllianceOverrunWP[20][0]+irand(-3,3), AllianceOverrunWP[20][1]+irand(-3,3), AllianceOverrunWP[20][2]); + AddWaypoint(9, AllianceOverrunWP[21][0]+irand(-3,3), AllianceOverrunWP[21][1]+irand(-3,3), AllianceOverrunWP[21][2]); + m_creature->SetHomePosition(AllianceOverrunWP[21][0]+irand(-3,3), AllianceOverrunWP[21][1]+irand(-3,3), AllianceOverrunWP[21][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 9; + Start(true, true); + break; + default: + for(uint8 i = 22; i < 36; ++i) + AddWaypoint(i-18, AllianceOverrunWP[i][0]+irand(-3,3), AllianceOverrunWP[i][1]+irand(-3,3), AllianceOverrunWP[i][2]); + SetDespawnAtEnd(true); + LastOverronPos = 17; + Start(true, true); + break; + } + } + } + if (faction == 1) + { + if (m_creature->GetEntry() == GHOUL) + { + for(uint8 i = 0; i < 6; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + switch(OverrunType) + { + case 0: + AddWaypoint(5, HordeOverrunWP[16][0]+irand(-10,10), HordeOverrunWP[16][1]+irand(-10,10), HordeOverrunWP[16][2]); + AddWaypoint(6, HordeOverrunWP[17][0]+irand(-10,10), HordeOverrunWP[17][1]+irand(-10,10), HordeOverrunWP[17][2]); + AddWaypoint(7, HordeOverrunWP[18][0], HordeOverrunWP[18][1], HordeOverrunWP[18][2]); + AddWaypoint(8, HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2]); + m_creature->SetHomePosition(HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 8; + Start(true, true); + break; + case 1: + AddWaypoint(5, HordeOverrunWP[16][0]+irand(-10,10), HordeOverrunWP[16][1]+irand(-10,10), HordeOverrunWP[16][2]); + AddWaypoint(6, HordeOverrunWP[17][0]+irand(-10,10), HordeOverrunWP[17][1]+irand(-10,10), HordeOverrunWP[17][2]); + AddWaypoint(7, HordeOverrunWP[18][0], HordeOverrunWP[18][1], HordeOverrunWP[18][2]); + AddWaypoint(8, HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2]); + m_creature->SetHomePosition(HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2],0); + SetDespawnAtEnd(false); + LastOverronPos = 8; + Start(true, true); + break; + default: + for(uint8 i = 0; i < 16; ++i) + AddWaypoint(i+6, HordeOverrunWP[i][0]+irand(-10,10), HordeOverrunWP[i][1]+irand(-10,10), HordeOverrunWP[i][2]); + SetDespawnAtEnd(true); + LastOverronPos = 21; + Start(true, true); + break; + } + } + if (m_creature->GetEntry() == ABOMINATION) + { + for(uint8 i = 0; i < 6; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-10,10), HordeWPs[i][1]+irand(-10,10), HordeWPs[i][2]); + for(uint8 i = 0; i < 16; ++i) + AddWaypoint(i+6, HordeOverrunWP[i][0]+irand(-10,10), HordeOverrunWP[i][1]+irand(-10,10), HordeOverrunWP[i][2]); + SetDespawnAtEnd(true); + LastOverronPos = 21; + Start(true, true); + } + } + } +} + +void hyjal_trashAI::JustDied(Unit *victim) +{ + if (!pInstance)return; + if (IsEvent && !m_creature->isWorldBoss()) + pInstance->SetData(DATA_TRASH, 0);//signal trash is dead + + if ((pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !m_creature->isWorldBoss()) || (damageTaken < m_creature->GetMaxHealth()/4 && m_creature->isWorldBoss())) + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot +} + +struct mob_giant_infernalAI : public hyjal_trashAI +{ + mob_giant_infernalAI(Creature* c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + meteor = false;//call once! + CanMove = false; + Delay = rand()%30000; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetDisplayId(MODEL_INVIS); + pGo = false; + pos = 0; + Reset(); + } + + bool meteor; + bool CanMove; + bool WpEnabled; + bool pGo; + uint32 pos; + uint32 spawnTimer; + uint32 FlameBuffetTimer; + bool imol; + + void Reset() + { + spawnTimer = 2000; + FlameBuffetTimer= 2000; + imol = false; + } + + void EnterCombat(Unit* who) {} + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 0 && pInstance && !IsOverrun) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (DelayGetPosition(x,y,z); + Creature* trigger = m_creature->SummonCreature(NPC_TRIGGER,x+8,y+8,z+25+rand()%10,m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,1000); + if (trigger) + { + trigger->SetVisibility(VISIBILITY_OFF); + trigger->setFaction(m_creature->getFaction()); + trigger->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + trigger->CastSpell(m_creature,SPELL_METEOR,true); + } + m_creature->GetMotionMaster()->Clear(); + meteor = true; + }else if (!CanMove){ + if (spawnTimerRemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetDisplayId(m_creature->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID)); + CanMove = true; + if (pInstance) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && !pInstance->GetData(DATA_HORDE_RETREAT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + }else if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && pInstance->GetData(DATA_HORDE_RETREAT)){ + //do overrun + } + } + }else spawnTimer -= diff; + } + if (!CanMove)return; + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + npc_escortAI::UpdateAI(diff); + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + AddWaypoint(0, HordeWPs[7][0]+irand(-3,3), HordeWPs[7][1]+irand(-3,3), HordeWPs[7][2]);//HordeWPs[7] infront of thrall + Start(true, true); + SetDespawnAtEnd(false); + } + } + } + + if (!UpdateVictim()) + return; + if (!imol) + { + DoCast(m_creature,SPELL_IMMOLATION); + imol=true; + } + if (FlameBuffetTimergetVictim(),SPELL_FLAME_BUFFET,true); + FlameBuffetTimer = 7000; + }else FlameBuffetTimer -= diff; + DoMeleeAttackIfReady(); + } +}; + + +CreatureAI* GetAI_mob_giant_infernal(Creature* pCreature) +{ + return new mob_giant_infernalAI(pCreature); +} + +#define SPELL_DISEASE_CLOUD 31607 +#define SPELL_KNOCKDOWN 31610 + +struct mob_abominationAI : public hyjal_trashAI +{ + mob_abominationAI(Creature* c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + Reset(); + } + + bool pGo; + uint32 KnockDownTimer; + uint32 pos; + void Reset() + { + KnockDownTimer = 10000; + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance && !IsOverrun) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + }else{ + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + if (i == LastOverronPos && IsOverrun) + { + if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) + { + m_creature->setDeathState(DEAD); + m_creature->RemoveCorpse(); + } + } + } + + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + npc_escortAI::UpdateAI(diff); + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + }else//use alliance WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + } + if (!m_creature->HasAura(SPELL_DISEASE_CLOUD)) + DoCast(m_creature,SPELL_DISEASE_CLOUD); + if (!UpdateVictim()) + return; + if (KnockDownTimergetVictim(),SPELL_KNOCKDOWN); + KnockDownTimer = 15000+rand()%10000; + }else KnockDownTimer -= diff; + DoMeleeAttackIfReady(); + } +}; + + +CreatureAI* GetAI_mob_abomination(Creature* pCreature) +{ + return new mob_abominationAI(pCreature); +} + +#define SPELL_FRENZY 31540 + +struct mob_ghoulAI : public hyjal_trashAI +{ + mob_ghoulAI(Creature* c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + Reset(); + } + + bool pGo; + uint32 FrenzyTimer; + uint32 pos; + uint32 MoveTimer; + bool RandomMove; + void Reset() + { + FrenzyTimer = 5000+rand()%5000; + MoveTimer = 2000; + RandomMove = false; + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance && !IsOverrun) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + }else{ + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + if (i == LastOverronPos && IsOverrun) + { + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED); + if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) + { + m_creature->setDeathState(DEAD); + m_creature->RemoveCorpse(); + } + + } + } + + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + npc_escortAI::UpdateAI(diff); + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + }else//use alliance WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + } + if (FrenzyTimerGetInstanceData(); + pGo = false; + pos = 0; + Reset(); + } + SummonList summons; + bool pGo; + uint32 ShadowBoltTimer; + uint32 pos; + void Reset() + { + ShadowBoltTimer = 1000+rand()%5000; + summons.DespawnAll(); + } + + void JustSummoned(Creature* summon) + { + Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,30,true); + if (target && summon) + summon->Attack(target,false); + summons.Summon(summon); + } + void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance && !IsOverrun) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + }else{ + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + } + + void KilledUnit(Unit* victim) + { + switch (rand()%3) + { + case 0: + DoSpawnCreature(17902,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); + DoSpawnCreature(17902,-3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); + break; + case 1: + DoSpawnCreature(17903,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); + DoSpawnCreature(17903,-3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); + break; + case 2: + if (rand()%2) + DoSpawnCreature(17902,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); + else + DoSpawnCreature(17903,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); + break; + } + } + + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + npc_escortAI::UpdateAI(diff); + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(true, true); + SetDespawnAtEnd(false); + }else//use alliance WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(true, true); + SetDespawnAtEnd(false); + } + } + } + } + if (!UpdateVictim()) + return; + if (ShadowBoltTimergetVictim(),SPELL_SHADOW_BOLT); + ShadowBoltTimer = 20000+rand()%10000; + }else ShadowBoltTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + + +CreatureAI* GetAI_mob_necromancer(Creature* pCreature) +{ + return new mob_necromancerAI(pCreature); +} + +#define SPELL_BANSHEE_CURSE 31651 +#define SPELL_BANSHEE_WAIL 38183 +#define SPELL_ANTI_MAGIC_SHELL 31662 + +struct mob_bansheeAI : public hyjal_trashAI +{ + mob_bansheeAI(Creature* c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + Reset(); + } + + bool pGo; + uint32 CourseTimer; + uint32 WailTimer; + uint32 ShellTimer; + uint32 pos; + void Reset() + { + CourseTimer = 20000+rand()%5000; + WailTimer = 15000+rand()%5000; + ShellTimer = 50000+rand()%10000; + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance && !IsOverrun) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + }else{ + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + } + + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + npc_escortAI::UpdateAI(diff); + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + }else//use alliance WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + } + if (!UpdateVictim()) + return; + if (CourseTimergetVictim(),SPELL_BANSHEE_CURSE); + CourseTimer = 20000+rand()%5000; + }else CourseTimer -= diff; + if (WailTimergetVictim(),SPELL_BANSHEE_WAIL); + WailTimer = 15000+rand()%5000; + }else WailTimer -= diff; + if (ShellTimerGetInstanceData(); + pGo = false; + pos = 0; + Reset(); + } + + bool pGo; + uint32 WebTimer; + uint32 pos; + void Reset() + { + WebTimer = 20000+rand()%5000; + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance && !IsOverrun) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + }else{ + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + } + + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + npc_escortAI::UpdateAI(diff); + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + }else//use alliance WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + } + + } + } + } + if (!UpdateVictim()) + return; + if (WebTimergetVictim(),SPELL_WEB); + WebTimer = 20000+rand()%5000; + }else WebTimer -= diff; + DoMeleeAttackIfReady(); + } +}; + + +CreatureAI* GetAI_mob_crypt_fiend(Creature* pCreature) +{ + return new mob_crypt_fiendAI(pCreature); +} + +#define SPELL_MANA_BURN 31729 + +struct mob_fel_stalkerAI : public hyjal_trashAI +{ + mob_fel_stalkerAI(Creature* c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + Reset(); + } + + bool pGo; + uint32 ManaBurnTimer; + uint32 pos; + void Reset() + { + ManaBurnTimer = 9000+rand()%5000; + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 7 && pInstance && !IsOverrun) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + }else{ + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); + if (target && target->isAlive()) + m_creature->AddThreat(target,0.0); + } + } + } + + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + npc_escortAI::UpdateAI(diff); + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + }else//use alliance WPs + { + for (uint8 i = 0; i < 8; ++i) + AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + } + + } + } + } + if (!UpdateVictim()) + return; + if (ManaBurnTimergetVictim(),SPELL_MANA_BURN); + ManaBurnTimer = 9000+rand()%5000; + }else ManaBurnTimer -= diff; + DoMeleeAttackIfReady(); + } +}; + + +CreatureAI* GetAI_mob_fel_stalker(Creature* pCreature) +{ + return new mob_fel_stalkerAI(pCreature); +} + +#define SPELL_FROST_BREATH 31688 + +struct mob_frost_wyrmAI : public hyjal_trashAI +{ + mob_frost_wyrmAI(Creature* c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + Reset(); + } + + bool pGo; + uint32 FrostBreathTimer; + uint32 pos; + uint32 MoveTimer; + + void Reset() + { + FrostBreathTimer = 5000; + MoveTimer = 0; + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 2 && pInstance && !IsOverrun) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + { + m_creature->AddThreat(target,0.0); + DoCast(target,SPELL_FROST_BREATH,true); + } + } + } + + void JustDied(Unit *victim) + { + if (pInstance && IsEvent) + pInstance->SetData(DATA_TRASH, 0);//signal trash is dead + + float x,y,z; + m_creature->GetPosition(x,y,z); + z = m_creature->GetMap()->GetVmapHeight(x, y, z, true); + m_creature->GetMotionMaster()->MovePoint(0,x,y,z); + m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z,0); + } + + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + { + CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanMelee(false); + npc_escortAI::UpdateAI(diff); + } + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (!useFlyPath) + { + for (uint8 i = 0; i < 3; ++i) + AddWaypoint(i, FrostWyrmWPs[i][0], FrostWyrmWPs[i][1], FrostWyrmWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + }else{//fly path FlyPathWPs + for (uint8 i = 0; i < 3; ++i) + AddWaypoint(i, FlyPathWPs[i][0]+irand(-10,10), FlyPathWPs[i][1]+irand(-10,10), FlyPathWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + } + if (!UpdateVictim()) + return; + if (!m_creature->IsWithinDist(m_creature->getVictim(), 25)){ + if (MoveTimerGetMotionMaster()->MoveChase(m_creature->getVictim()); + MoveTimer = 2000; + }else MoveTimer-=diff; + } + + if (FrostBreathTimerIsWithinDist(m_creature->getVictim(), 25)) + { + DoCast(m_creature->getVictim(),SPELL_FROST_BREATH); + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + FrostBreathTimer = 4000; + } + }else FrostBreathTimer -= diff; + } +}; + + +CreatureAI* GetAI_mob_frost_wyrm(Creature* pCreature) +{ + return new mob_frost_wyrmAI(pCreature); +} + +#define SPELL_GARGOYLE_STRIKE 31664 + +struct mob_gargoyleAI : public hyjal_trashAI +{ + mob_gargoyleAI(Creature* c) : hyjal_trashAI(c) + { + pInstance = c->GetInstanceData(); + pGo = false; + pos = 0; + DummyTarget[0] = 0;DummyTarget[1] = 0;DummyTarget[2] = 0; + Reset(); + } + + bool pGo; + uint32 StrikeTimer; + uint32 pos; + uint32 MoveTimer; + float Zpos; + bool forcemove; + + void Reset() + { + forcemove = true; + Zpos = 10.0; + StrikeTimer = 2000+rand()%5000; + MoveTimer = 0; + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + } + + void WaypointReached(uint32 i) + { + pos = i; + if (i == 2 && pInstance && !IsOverrun) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); + if (target && target->isAlive()) + { + m_creature->AddThreat(target,0.0); + DoCast(target,SPELL_GARGOYLE_STRIKE,true); + } + } + } + + void JustDied(Unit *victim) + { + float x,y,z; + m_creature->GetPosition(x,y,z); + z = m_creature->GetMap()->GetVmapHeight(x, y, z, true); + m_creature->GetMotionMaster()->MovePoint(0,x,y,z); + m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z,0); + hyjal_trashAI::JustDied(victim); + } + + void UpdateAI(const uint32 diff) + { + hyjal_trashAI::UpdateAI(diff); + if (IsEvent || IsOverrun) + { + CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanMelee(false); + npc_escortAI::UpdateAI(diff); + } + if (IsEvent) + { + if (!pGo) + { + pGo = true; + if (pInstance) + { + if (!useFlyPath) + { + for (uint8 i = 0; i < 3; ++i) + AddWaypoint(i, GargoyleWPs[i][0]+irand(-10,10), GargoyleWPs[i][1]+irand(-10,10), GargoyleWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + }else{//fly path FlyPathWPs + for (uint8 i = 0; i < 3; ++i) + AddWaypoint(i, FlyPathWPs[i][0]+irand(-10,10), FlyPathWPs[i][1]+irand(-10,10), FlyPathWPs[i][2]); + Start(false, true); + SetDespawnAtEnd(false); + } + } + } + } + if (IsOverrun && !UpdateVictim()) + { + if (faction == 0)//alliance + { + if (StrikeTimerCastSpell(DummyTarget[0],DummyTarget[1],DummyTarget[2],SPELL_GARGOYLE_STRIKE,false); + StrikeTimer = 2000+rand()%1000; + }else StrikeTimer -= diff; + } + } + if (!UpdateVictim()) + return; + if (!m_creature->IsWithinDist(m_creature->getVictim(), 20) || forcemove) + { + forcemove = false; + if (forcemove) + { + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + m_creature->Attack(target,false); + } + if (MoveTimergetVictim()->GetPosition(x,y,z); + m_creature->GetMotionMaster()->MovePoint(0,x,y,z+Zpos); + Zpos-=1.0; + if (Zpos<=0)Zpos=0; + MoveTimer = 2000; + }else MoveTimer-=diff; + } + if (StrikeTimerIsWithinDist(m_creature->getVictim(), 20)) + { + DoCast(m_creature->getVictim(),SPELL_GARGOYLE_STRIKE); + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + StrikeTimer = 2000+rand()%1000; + }else StrikeTimer=0; + }else StrikeTimer -= diff; + } +}; + + +CreatureAI* GetAI_mob_gargoyle(Creature* pCreature) +{ + return new mob_gargoyleAI(pCreature); +} + +#define SPELL_EXPLODING_SHOT 7896 + +struct TRINITY_DLL_DECL alliance_riflemanAI : public Scripted_NoMovementAI +{ + alliance_riflemanAI(Creature *c) : Scripted_NoMovementAI(c) + { + Reset(); + } + + uint32 ExplodeTimer; + + void JustDied(Unit* who) + { + } + + void Reset() + { + ExplodeTimer = 5000+rand()%5000; + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, 30)) + { + AttackStart(who); + } + } + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!UpdateVictim()) + return; + if (ExplodeTimer < diff) + { + if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 30)) + { + EnterEvadeMode(); + return; + } + int dmg = 500+rand()%700; + m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_EXPLODING_SHOT, &dmg, 0, 0, false); + ExplodeTimer = 5000+rand()%5000; + }else ExplodeTimer -= diff; + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_alliance_rifleman(Creature* pCreature) +{ + return new alliance_riflemanAI(pCreature); +} + +void AddSC_hyjal_trash() +{ + Script *newscript = new Script; + newscript->Name = "mob_giant_infernal"; + newscript->GetAI = &GetAI_mob_giant_infernal; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_abomination"; + newscript->GetAI = &GetAI_mob_abomination; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_ghoul"; + newscript->GetAI = &GetAI_mob_ghoul; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_necromancer"; + newscript->GetAI = &GetAI_mob_necromancer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_banshee"; + newscript->GetAI = &GetAI_mob_banshee; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_crypt_fiend"; + newscript->GetAI = &GetAI_mob_crypt_fiend; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_fel_stalker"; + newscript->GetAI = &GetAI_mob_fel_stalker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_frost_wyrm"; + newscript->GetAI = &GetAI_mob_frost_wyrm; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_gargoyle"; + newscript->GetAI = &GetAI_mob_gargoyle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "alliance_rifleman"; + newscript->GetAI = &GetAI_alliance_rifleman; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.h new file mode 100644 index 00000000000..9eeff8a03f4 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.h @@ -0,0 +1,35 @@ + +#ifndef SC_HYJAL_TRASH_AI_H +#define SC_HYJAL_TRASH_AI_H + +#include "def_hyjal.h" +#include "escortAI.h" + +#define MINRAIDDAMAGE 700000//minimal damage before trash can drop loot and reputation, resets if faction leader dies + +struct TRINITY_DLL_DECL hyjal_trashAI : public npc_escortAI +{ + hyjal_trashAI(Creature *c); + + void UpdateAI(const uint32 diff); + + void JustDied(Unit* killer); + + void DamageTaken(Unit *done_by, uint32 &damage); + + public: + ScriptedInstance* pInstance; + bool IsEvent; + uint32 Delay; + uint32 LastOverronPos; + bool IsOverrun; + bool SetupOverrun; + uint32 OverrunType; + uint8 faction; + bool useFlyPath; + uint32 damageTaken; + float DummyTarget[3]; + + //private: +}; +#endif \ No newline at end of file diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp new file mode 100644 index 00000000000..83fbbc67b73 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/instance_hyjal.cpp @@ -0,0 +1,322 @@ + /* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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_Mount_Hyjal +SD%Complete: 100 +SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Hyjal Scripts +SDCategory: Caverns of Time, Mount Hyjal +EndScriptData */ + +#include "precompiled.h" +#include "def_hyjal.h" +#include "hyjal_trash.h" + +enum +{ + MAX_ENCOUNTER = 5, + + GO_ANCIENT_GEM = 185557 +}; +/* Battle of Mount Hyjal encounters: +0 - Rage Winterchill event +1 - Anetheron event +2 - Kaz'rogal event +3 - Azgalor event +4 - Archimonde event +*/ + +struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance +{ + instance_mount_hyjal(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + std::list m_uiAncientGemGUID; + + uint64 RageWinterchill; + uint64 Anetheron; + uint64 Kazrogal; + uint64 Azgalor; + uint64 Archimonde; + uint64 JainaProudmoore; + uint64 Thrall; + uint64 TyrandeWhisperwind; + uint64 HordeGate; + uint64 ElfGate; + + uint32 Trash; + + + uint32 hordeRetreat; + uint32 allianceRetreat; + bool ArchiYell; + + uint32 RaidDamage; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiAncientGemGUID.clear(); + + RageWinterchill = 0; + Anetheron = 0; + Kazrogal = 0; + Azgalor = 0; + Archimonde = 0; + JainaProudmoore = 0; + Thrall = 0; + TyrandeWhisperwind = 0; + HordeGate = 0; + ElfGate = 0; + ArchiYell = false; + RaidDamage = 0; + + Trash = 0; + + hordeRetreat = 0; + allianceRetreat = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 182060: + HordeGate = pGo->GetGUID(); + if (allianceRetreat) + HandleGameObject(0, true, pGo); + else + HandleGameObject(0, false, pGo); + break; + case 182061: + ElfGate = pGo->GetGUID(); + if (hordeRetreat) + HandleGameObject(0, true, pGo); + else + HandleGameObject(0, false, pGo); + break; + case GO_ANCIENT_GEM: + m_uiAncientGemGUID.push_back(pGo->GetGUID()); + break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 17767: RageWinterchill = pCreature->GetGUID(); break; + case 17808: Anetheron = pCreature->GetGUID(); break; + case 17888: Kazrogal = pCreature->GetGUID(); break; + case 17842: Azgalor = pCreature->GetGUID(); break; + case 17968: Archimonde = pCreature->GetGUID(); break; + case 17772: JainaProudmoore = pCreature->GetGUID(); break; + case 17852: Thrall = pCreature->GetGUID(); break; + case 17948: TyrandeWhisperwind = pCreature->GetGUID(); break; + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_RAGEWINTERCHILL: return RageWinterchill; + case DATA_ANETHERON: return Anetheron; + case DATA_KAZROGAL: return Kazrogal; + case DATA_AZGALOR: return Azgalor; + case DATA_ARCHIMONDE: return Archimonde; + case DATA_JAINAPROUDMOORE: return JainaProudmoore; + case DATA_THRALL: return Thrall; + case DATA_TYRANDEWHISPERWIND: return TyrandeWhisperwind; + } + + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_RAGEWINTERCHILLEVENT: m_auiEncounter[0] = data; break; + case DATA_ANETHERONEVENT: + m_auiEncounter[1] = data; + break; + case DATA_KAZROGALEVENT: m_auiEncounter[2] = data; break; + case DATA_AZGALOREVENT: + { + m_auiEncounter[3] = data; + if (data==DONE) + { + if (ArchiYell)break; + ArchiYell = true; + + Creature* pCreature = instance->GetCreature(Azgalor); + if (pCreature) + { + Creature* pUnit = pCreature->SummonCreature(21987,pCreature->GetPositionX(),pCreature->GetPositionY(),pCreature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000); + + Map* pMap = pCreature->GetMap(); + if (pMap->IsDungeon() && pUnit) + { + pUnit->SetVisibility(VISIBILITY_OFF); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + if (PlayerList.isEmpty()) + return; + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()) + { + WorldPacket data(SMSG_MESSAGECHAT, 200); + pUnit->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,"All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more.",0,"Archimonde",i->getSource()->GetGUID()); + i->getSource()->GetSession()->SendPacket(&data); + + WorldPacket data2(SMSG_PLAY_SOUND, 4); + data2 << 10986; + i->getSource()->GetSession()->SendPacket(&data2); + } + } + } + } + } + } + break; + case DATA_ARCHIMONDEEVENT: m_auiEncounter[4] = data; break; + case DATA_RESET_TRASH_COUNT: Trash = 0; break; + + case DATA_TRASH: + if (data) Trash = data; + else Trash--; + DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, Trash); + break; + case TYPE_RETREAT: + if (data == SPECIAL) + { + if (!m_uiAncientGemGUID.empty()) + { + for(std::list::iterator itr = m_uiAncientGemGUID.begin(); itr != m_uiAncientGemGUID.end(); ++itr) + { + //don't know how long it expected + DoRespawnGameObject(*itr,DAY); + } + } + } + break; + case DATA_ALLIANCE_RETREAT: + allianceRetreat = data; + HandleGameObject(HordeGate, true); + SaveToDB(); + break; + case DATA_HORDE_RETREAT: + hordeRetreat = data; + HandleGameObject(ElfGate, true); + SaveToDB(); + break; + case DATA_RAIDDAMAGE: + RaidDamage += data; + if (RaidDamage >= MINRAIDDAMAGE) + RaidDamage = MINRAIDDAMAGE; + break; + case DATA_RESET_RAIDDAMAGE: + RaidDamage = 0; + break; + } + + debug_log("TSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data); + + if (data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] + << " " << allianceRetreat << " " << hordeRetreat + << " " << RaidDamage; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_RAGEWINTERCHILLEVENT: return m_auiEncounter[0]; + case DATA_ANETHERONEVENT: return m_auiEncounter[1]; + case DATA_KAZROGALEVENT: return m_auiEncounter[2]; + case DATA_AZGALOREVENT: return m_auiEncounter[3]; + case DATA_ARCHIMONDEEVENT: return m_auiEncounter[4]; + case DATA_TRASH: return Trash; + case DATA_ALLIANCE_RETREAT: return allianceRetreat; + case DATA_HORDE_RETREAT: return hordeRetreat; + case DATA_RAIDDAMAGE: return RaidDamage; + } + 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] >> allianceRetreat >> hordeRetreat >> RaidDamage; + 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_mount_hyjal(Map* pMap) +{ + return new instance_mount_hyjal(pMap); +} + +void AddSC_instance_mount_hyjal() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_hyjal"; + newscript->GetInstanceData = &GetInstanceData_instance_mount_hyjal; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp new file mode 100644 index 00000000000..0c6c98d9758 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp @@ -0,0 +1,156 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Captain_Skarloc +SD%Complete: 75 +SDComment: Missing adds, missing waypoints to move up to Thrall once spawned + speech before enter combat. +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +#include "precompiled.h" +#include "def_old_hillsbrad.h" + +#define SAY_ENTER -1560000 +#define SAY_TAUNT1 -1560001 +#define SAY_TAUNT2 -1560002 +#define SAY_SLAY1 -1560003 +#define SAY_SLAY2 -1560004 +#define SAY_DEATH -1560005 + +#define SPELL_HOLY_LIGHT 29427 +#define SPELL_CLEANSE 29380 +#define SPELL_HAMMER_OF_JUSTICE 13005 +#define SPELL_HOLY_SHIELD 31904 +#define SPELL_DEVOTION_AURA 8258 +#define SPELL_CONSECRATION 38385 + +struct TRINITY_DLL_DECL boss_captain_skarlocAI : public ScriptedAI +{ + boss_captain_skarlocAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 Holy_Light_Timer; + uint32 Cleanse_Timer; + uint32 HammerOfJustice_Timer; + uint32 HolyShield_Timer; + uint32 DevotionAura_Timer; + uint32 Consecration_Timer; + + void Reset() + { + Holy_Light_Timer = 20000 + rand()%10000; + Cleanse_Timer = 10000; + HammerOfJustice_Timer = 20000 + rand()%15000; + HolyShield_Timer = 240000; + DevotionAura_Timer = 3000; + Consecration_Timer = 8000; + } + + void EnterCombat(Unit *who) + { + //This is not correct. Should taunt Thrall before engage in combat + DoScriptText(SAY_TAUNT1, m_creature); + DoScriptText(SAY_TAUNT2, m_creature); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) + pInstance->SetData(TYPE_THRALL_PART1, DONE); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Holy_Light + if (Holy_Light_Timer < diff) + { + DoCast(m_creature, SPELL_HOLY_LIGHT); + Holy_Light_Timer = 30000; + }else Holy_Light_Timer -= diff; + + //Cleanse + if (Cleanse_Timer < diff) + { + DoCast(m_creature, SPELL_CLEANSE); + Cleanse_Timer = 10000; + } else Cleanse_Timer -= diff; + + //Hammer of Justice + if (HammerOfJustice_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); + HammerOfJustice_Timer = 60000; + }else HammerOfJustice_Timer -= diff; + + //Holy Shield + if (HolyShield_Timer < diff) + { + DoCast(m_creature, SPELL_HOLY_SHIELD); + HolyShield_Timer = 240000; + }else HolyShield_Timer -= diff; + + //Devotion_Aura + if (DevotionAura_Timer < diff) + { + DoCast(m_creature, SPELL_DEVOTION_AURA); + DevotionAura_Timer = 45000 + rand()%10000; + }else DevotionAura_Timer -= diff; + + //Consecration + if (Consecration_Timer < diff) + { + //DoCast(m_creature->getVictim(), SPELL_CONSECRATION); + Consecration_Timer = 5000 + rand()%5000; + }else Consecration_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_captain_skarloc(Creature* pCreature) +{ + return new boss_captain_skarlocAI (pCreature); +} + +void AddSC_boss_captain_skarloc() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_captain_skarloc"; + newscript->GetAI = &GetAI_boss_captain_skarloc; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp new file mode 100644 index 00000000000..138a59cce93 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp @@ -0,0 +1,150 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Epoch_Hunter +SD%Complete: 60 +SDComment: Missing spawns pre-event, missing speech to be coordinated with rest of escort event. +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +#include "precompiled.h" +#include "def_old_hillsbrad.h" + +#define SAY_ENTER1 -1560013 +#define SAY_ENTER2 -1560014 +#define SAY_ENTER3 -1560015 +#define SAY_AGGRO1 -1560016 +#define SAY_AGGRO2 -1560017 +#define SAY_SLAY1 -1560018 +#define SAY_SLAY2 -1560019 +#define SAY_BREATH1 -1560020 +#define SAY_BREATH2 -1560021 +#define SAY_DEATH -1560022 + +#define SPELL_SAND_BREATH 31914 +#define SPELL_IMPENDING_DEATH 31916 +#define SPELL_MAGIC_DISRUPTION_AURA 33834 +#define SPELL_WING_BUFFET 31475 + +struct TRINITY_DLL_DECL boss_epoch_hunterAI : public ScriptedAI +{ + boss_epoch_hunterAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 SandBreath_Timer; + uint32 ImpendingDeath_Timer; + uint32 WingBuffet_Timer; + uint32 Mda_Timer; + + void Reset() + { + SandBreath_Timer = 8000 + rand()%8000; + ImpendingDeath_Timer = 25000 + rand()%5000; + WingBuffet_Timer = 35000; + Mda_Timer = 40000; + } + + void EnterCombat(Unit *who) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + } + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) + pInstance->SetData(TYPE_THRALL_PART4, DONE); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Sand Breath + if (SandBreath_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCast(m_creature->getVictim(),SPELL_SAND_BREATH); + + switch(rand()%2) + { + case 0: DoScriptText(SAY_BREATH1, m_creature); break; + case 1: DoScriptText(SAY_BREATH2, m_creature); break; + } + + SandBreath_Timer = 10000 + rand()%10000; + }else SandBreath_Timer -= diff; + + if (ImpendingDeath_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_IMPENDING_DEATH); + ImpendingDeath_Timer = 25000+rand()%5000; + }else ImpendingDeath_Timer -= diff; + + if (WingBuffet_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_WING_BUFFET); + WingBuffet_Timer = 25000+rand()%10000; + }else WingBuffet_Timer -= diff; + + if (Mda_Timer < diff) + { + DoCast(m_creature,SPELL_MAGIC_DISRUPTION_AURA); + Mda_Timer = 15000; + }else Mda_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_epoch_hunter(Creature* pCreature) +{ + return new boss_epoch_hunterAI (pCreature); +} + +void AddSC_boss_epoch_hunter() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_epoch_hunter"; + newscript->GetAI = &GetAI_boss_epoch_hunter; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp new file mode 100644 index 00000000000..266f61354c0 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp @@ -0,0 +1,194 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Luetenant_Drake +SD%Complete: 70 +SDComment: Missing proper code for patrolling area after being spawned. Script for GO (barrels) quest 10283 +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +#include "precompiled.h" +#include "def_old_hillsbrad.h" +#include "escortAI.h" + +/*###### +## go_barrel_old_hillsbrad +######*/ + +bool GOHello_go_barrel_old_hillsbrad(Player* pPlayer, GameObject* pGO) +{ + if (ScriptedInstance* pInstance = pGO->GetInstanceData()) + { + if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE) + return false; + + pInstance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS); + } + + return false; +} + +/*###### +## boss_lieutenant_drake +######*/ + +#define SAY_ENTER -1560006 +#define SAY_AGGRO -1560007 +#define SAY_SLAY1 -1560008 +#define SAY_SLAY2 -1560009 +#define SAY_MORTAL -1560010 +#define SAY_SHOUT -1560011 +#define SAY_DEATH -1560012 + +#define SPELL_WHIRLWIND 31909 +#define SPELL_HAMSTRING 9080 +#define SPELL_MORTAL_STRIKE 31911 +#define SPELL_FRIGHTENING_SHOUT 33789 + +struct Location +{ + uint32 wpId; + float x; + float y; + float z; +}; + +static Location DrakeWP[]= +{ + {0, 2125.84, 88.2535, 54.8830}, + {1, 2111.01, 93.8022, 52.6356}, + {2, 2106.70, 114.753, 53.1965}, + {3, 2107.76, 138.746, 52.5109}, + {4, 2114.83, 160.142, 52.4738}, + {5, 2125.24, 178.909, 52.7283}, + {6, 2151.02, 208.901, 53.1551}, + {7, 2177.00, 233.069, 52.4409}, + {8, 2190.71, 227.831, 53.2742}, + {9, 2178.14, 214.219, 53.0779}, + {10, 2154.99, 202.795, 52.6446}, + {11, 2132.00, 191.834, 52.5709}, + {12, 2117.59, 166.708, 52.7686}, + {13, 2093.61, 139.441, 52.7616}, + {14, 2086.29, 104.950, 52.9246}, + {15, 2094.23, 81.2788, 52.6946}, + {16, 2108.70, 85.3075, 53.3294}, + {17, 2125.50, 88.9481, 54.7953}, + {18, 2128.20, 70.9763, 64.4221} +}; + +struct TRINITY_DLL_DECL boss_lieutenant_drakeAI : public ScriptedAI +{ + boss_lieutenant_drakeAI(Creature *c) : ScriptedAI(c) {} + + bool CanPatrol; + uint32 wpId; + + uint32 Whirlwind_Timer; + uint32 Fear_Timer; + uint32 MortalStrike_Timer; + uint32 ExplodingShout_Timer; + + void Reset() + { + CanPatrol = true; + wpId = 0; + + Whirlwind_Timer = 20000; + Fear_Timer = 30000; + MortalStrike_Timer = 45000; + ExplodingShout_Timer = 25000; + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + //TODO: make this work + if (CanPatrol && wpId == 0) + { + m_creature->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z); + wpId++; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Whirlwind + if (Whirlwind_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WHIRLWIND); + Whirlwind_Timer = 20000+rand()%5000; + }else Whirlwind_Timer -= diff; + + //Fear + if (Fear_Timer < diff) + { + DoScriptText(SAY_SHOUT, m_creature); + DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT); + Fear_Timer = 25000+rand()%10000; + }else Fear_Timer -= diff; + + //Mortal Strike + if (MortalStrike_Timer < diff) + { + DoScriptText(SAY_MORTAL, m_creature); + DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + MortalStrike_Timer = 20000+rand()%10000; + }else MortalStrike_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_lieutenant_drake(Creature* pCreature) +{ + return new boss_lieutenant_drakeAI (pCreature); +} + +void AddSC_boss_lieutenant_drake() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="go_barrel_old_hillsbrad"; + newscript->pGOHello = &GOHello_go_barrel_old_hillsbrad; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_lieutenant_drake"; + newscript->GetAI = &GetAI_boss_lieutenant_drake; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h new file mode 100644 index 00000000000..3253a384217 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/def_old_hillsbrad.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_OLD_HILLSBRAD_H +#define DEF_OLD_HILLSBRAD_H + +#define TYPE_BARREL_DIVERSION 1 +#define TYPE_THRALL_EVENT 2 +#define TYPE_THRALL_PART1 3 +#define TYPE_THRALL_PART2 4 +#define TYPE_THRALL_PART3 5 +#define TYPE_THRALL_PART4 6 +#define DATA_THRALL 7 +#define DATA_TARETHA 8 +#define DATA_EPOCH 9 +#define WORLD_STATE_OH 2436 +#endif + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp new file mode 100644 index 00000000000..b8ec8f2e111 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp @@ -0,0 +1,238 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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_Old_Hillsbrad +SD%Complete: 75 +SDComment: If thrall escort fail, all parts will reset. In future, save sub-parts and continue from last known. +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +#include "precompiled.h" +#include "def_old_hillsbrad.h" + +#define MAX_ENCOUNTER 6 + +#define THRALL_ENTRY 17876 +#define TARETHA_ENTRY 18887 +#define EPOCH_ENTRY 18096 + +#define DRAKE_ENTRY 17848 + +#define QUEST_ENTRY_DIVERSION 10283 +#define LODGE_QUEST_TRIGGER 20155 + +struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance +{ + instance_old_hillsbrad(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint32 mBarrelCount; + uint32 mThrallEventCount; + + uint64 ThrallGUID; + uint64 TarethaGUID; + uint64 EpochGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + mBarrelCount = 0; + mThrallEventCount = 0; + ThrallGUID = 0; + TarethaGUID = 0; + EpochGUID = 0; + } + + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("TSCR: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void UpdateQuestCredit() + { + 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()) + pPlayer->KilledMonsterCredit(LODGE_QUEST_TRIGGER,0); + } + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case THRALL_ENTRY: + ThrallGUID = pCreature->GetGUID(); + break; + case TARETHA_ENTRY: + TarethaGUID = pCreature->GetGUID(); + break; + case EPOCH_ENTRY: + EpochGUID = pCreature->GetGUID(); + break; + } + } + + void SetData(uint32 type, uint32 data) + { + Player* pPlayer = GetPlayerInMap(); + + if (!pPlayer) + { + debug_log("TSCR: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data); + return; + } + + switch(type) + { + case TYPE_BARREL_DIVERSION: + { + if (data == IN_PROGRESS) + { + if (mBarrelCount >= 5) + return; + + ++mBarrelCount; + DoUpdateWorldState(WORLD_STATE_OH, mBarrelCount); + + debug_log("TSCR: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount); + + m_auiEncounter[0] = IN_PROGRESS; + + if (mBarrelCount == 5) + { + UpdateQuestCredit(); + pPlayer->SummonCreature(DRAKE_ENTRY, 2128.43, 71.01, 64.42, 1.74, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); + m_auiEncounter[0] = DONE; + } + } + break; + } + case TYPE_THRALL_EVENT: + { + if (data == FAIL) + { + if (mThrallEventCount <= 20) + { + mThrallEventCount++; + m_auiEncounter[1] = NOT_STARTED; + debug_log("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); + m_auiEncounter[2] = NOT_STARTED; + m_auiEncounter[3] = NOT_STARTED; + m_auiEncounter[4] = NOT_STARTED; + m_auiEncounter[5] = NOT_STARTED; + } + else if (mThrallEventCount > 20) + { + m_auiEncounter[1] = data; + m_auiEncounter[2] = data; + m_auiEncounter[3] = data; + m_auiEncounter[4] = data; + m_auiEncounter[5] = data; + debug_log("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); + } + } + else + m_auiEncounter[1] = data; + debug_log("TSCR: Instance Old Hillsbrad: Thrall escort event adjusted to data %u.",data); + break; + } + case TYPE_THRALL_PART1: + m_auiEncounter[2] = data; + debug_log("TSCR: Instance Old Hillsbrad: Thrall event part I adjusted to data %u.",data); + break; + case TYPE_THRALL_PART2: + m_auiEncounter[3] = data; + debug_log("TSCR: Instance Old Hillsbrad: Thrall event part II adjusted to data %u.",data); + break; + case TYPE_THRALL_PART3: + m_auiEncounter[4] = data; + debug_log("TSCR: Instance Old Hillsbrad: Thrall event part III adjusted to data %u.",data); + break; + case TYPE_THRALL_PART4: + m_auiEncounter[5] = data; + debug_log("TSCR: Instance Old Hillsbrad: Thrall event part IV adjusted to data %u.",data); + break; + } + } + + uint32 GetData(uint32 data) + { + switch(data) + { + case TYPE_BARREL_DIVERSION: + return m_auiEncounter[0]; + case TYPE_THRALL_EVENT: + return m_auiEncounter[1]; + case TYPE_THRALL_PART1: + return m_auiEncounter[2]; + case TYPE_THRALL_PART2: + return m_auiEncounter[3]; + case TYPE_THRALL_PART3: + return m_auiEncounter[4]; + case TYPE_THRALL_PART4: + return m_auiEncounter[5]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_THRALL: + return ThrallGUID; + case DATA_TARETHA: + return TarethaGUID; + case DATA_EPOCH: + return EpochGUID; + } + return 0; + } +}; +InstanceData* GetInstanceData_instance_old_hillsbrad(Map* pMap) +{ + return new instance_old_hillsbrad(pMap); +} + +void AddSC_instance_old_hillsbrad() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_old_hillsbrad"; + newscript->GetInstanceData = &GetInstanceData_instance_old_hillsbrad; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp new file mode 100644 index 00000000000..5559989ef65 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp @@ -0,0 +1,682 @@ + /* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Old_Hillsbrad +SD%Complete: 40 +SDComment: Quest support: 10283, 10284. All friendly NPC's. Thrall waypoints fairly complete, missing many details, but possible to complete escort. +SDCategory: Caverns of Time, Old Hillsbrad Foothills +EndScriptData */ + +/* ContentData +npc_erozion +npc_thrall_old_hillsbrad +npc_taretha +EndContentData */ + +#include "precompiled.h" +#include "escortAI.h" +#include "def_old_hillsbrad.h" + +#define QUEST_ENTRY_HILLSBRAD 10282 +#define QUEST_ENTRY_DIVERSION 10283 +#define QUEST_ENTRY_ESCAPE 10284 +#define QUEST_ENTRY_RETURN 10285 +#define ITEM_ENTRY_BOMBS 25853 + +/*###### +## npc_erozion +######*/ + +bool GossipHello_npc_erozion(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + ScriptedInstance* pInstance = (pCreature->GetInstanceData()); + if (pInstance && pInstance->GetData(TYPE_BARREL_DIVERSION) != DONE && !pPlayer->HasItemCount(ITEM_ENTRY_BOMBS,1)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I need a pack of Incendiary Bombs.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + + if (!pPlayer->GetQuestRewardStatus(QUEST_ENTRY_RETURN) && pPlayer->GetQuestStatus(QUEST_ENTRY_RETURN) == QUEST_STATUS_COMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] Teleport please, i'm tired.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + + pPlayer->SEND_GOSSIP_MENU(9778, pCreature->GetGUID()); + + return true; +} + +bool GossipSelect_npc_erozion(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + ItemPosCountVec dest; + uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_ENTRY_BOMBS, 1); + if (msg == EQUIP_ERR_OK) + { + pPlayer->StoreNewItem(dest, ITEM_ENTRY_BOMBS, true); + } + pPlayer->SEND_GOSSIP_MENU(9515, pCreature->GetGUID()); + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pPlayer->CLOSE_GOSSIP_MENU(); + } + return true; +} + +/*###### +## npc_thrall_old_hillsbrad +######*/ + +//Thrall texts +#define SAY_TH_START_EVENT_PART1 -1560023 +#define SAY_TH_ARMORY -1560024 +#define SAY_TH_SKARLOC_MEET -1560025 +#define SAY_TH_SKARLOC_TAUNT -1560026 +#define SAY_TH_START_EVENT_PART2 -1560027 +#define SAY_TH_MOUNTS_UP -1560028 +#define SAY_TH_CHURCH_END -1560029 +#define SAY_TH_MEET_TARETHA -1560030 +#define SAY_TH_EPOCH_WONDER -1560031 +#define SAY_TH_EPOCH_KILL_TARETHA -1560032 +#define SAY_TH_EVENT_COMPLETE -1560033 + +#define SAY_TH_RANDOM_LOW_HP1 -1560034 +#define SAY_TH_RANDOM_LOW_HP2 -1560035 + +#define SAY_TH_RANDOM_DIE1 -1560036 +#define SAY_TH_RANDOM_DIE2 -1560037 + +#define SAY_TH_RANDOM_AGGRO1 -1560038 +#define SAY_TH_RANDOM_AGGRO2 -1560039 +#define SAY_TH_RANDOM_AGGRO3 -1560040 +#define SAY_TH_RANDOM_AGGRO4 -1560041 + +#define SAY_TH_RANDOM_KILL1 -1560042 +#define SAY_TH_RANDOM_KILL2 -1560043 +#define SAY_TH_RANDOM_KILL3 -1560044 + +#define SAY_TH_LEAVE_COMBAT1 -1560045 +#define SAY_TH_LEAVE_COMBAT2 -1560046 +#define SAY_TH_LEAVE_COMBAT3 -1560047 + +//Taretha texts +#define SAY_TA_FREE -1560048 +#define SAY_TA_ESCAPED -1560049 + +//Misc for Thrall +#define SPELL_STRIKE 14516 +#define SPELL_SHIELD_BLOCK 12169 +#define SPELL_SUMMON_EROZION_IMAGE 33954 //if thrall dies during escort? + +#define SPEED_WALK (0.5f) +#define SPEED_RUN (1.0f) +#define SPEED_MOUNT (1.6f) + +#define THRALL_WEAPON_MODEL 22106 +#define THRALL_WEAPON_INFO 218169346 +#define THRALL_SHIELD_MODEL 18662 +#define THRALL_SHIELD_INFO 234948100 +#define THRALL_MODEL_UNEQUIPPED 17292 +#define THRALL_MODEL_EQUIPPED 18165 + +//Misc Creature entries +#define ENTRY_ARMORER 18764 +#define ENTRY_SCARLOC 17862 + +#define MOB_ENTRY_RIFLE 17820 +#define MOB_ENTRY_WARDEN 17833 +#define MOB_ENTRY_VETERAN 17860 +#define MOB_ENTRY_WATCHMAN 17814 +#define MOB_ENTRY_SENTRY 17815 + +#define MOB_ENTRY_BARN_GUARDSMAN 18092 +#define MOB_ENTRY_BARN_PROTECTOR 18093 +#define MOB_ENTRY_BARN_LOOKOUT 18094 + +#define MOB_ENTRY_CHURCH_GUARDSMAN 23175 +#define MOB_ENTRY_CHURCH_PROTECTOR 23179 +#define MOB_ENTRY_CHURCH_LOOKOUT 23177 + +#define MOB_ENTRY_INN_GUARDSMAN 23176 +#define MOB_ENTRY_INN_PROTECTOR 23180 +#define MOB_ENTRY_INN_LOOKOUT 23178 + +#define SKARLOC_MOUNT 18798 +#define SKARLOC_MOUNT_MODEL 18223 +#define EROZION_ENTRY 18723 +#define ENTRY_EPOCH 18096 + +//gossip items +#define GOSSIP_ID_START 9568 +#define GOSSIP_ID_SKARLOC1 9614 //I'm glad Taretha is alive. We now must find a way to free her... +#define GOSSIP_ITEM_SKARLOC1 "Taretha cannot see you, Thrall." +#define GOSSIP_ID_SKARLOC2 9579 //What do you mean by this? Is Taretha in danger? +#define GOSSIP_ITEM_SKARLOC2 "The situation is rather complicated, Thrall. It would be best for you to head into the mountains now, before more of Blackmoore's men show up. We'll make sure Taretha is safe." +#define GOSSIP_ID_SKARLOC3 9580 + +#define GOSSIP_ID_TARREN 9597 //tarren mill is beyond these trees +#define GOSSIP_ITEM_TARREN "We're ready, Thrall." + +#define GOSSIP_ID_COMPLETE 9578 //Thank you friends, I owe my freedom to you. Where is Taretha? I hoped to see her + +struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI +{ + npc_thrall_old_hillsbradAI(Creature *c) : npc_escortAI(c) + { + pInstance = c->GetInstanceData(); + HadMount = false; + m_creature->setActive(true); + } + + ScriptedInstance *pInstance; + + uint64 TarethaGUID; + + bool LowHp; + bool HadMount; + + void WaypointReached(uint32 i) + { + if (!pInstance) + return; + + switch(i) + { + case 8: + SetRun(false); + m_creature->SummonCreature(18764,2181.87,112.46,89.45,0.26,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 9: + DoScriptText(SAY_TH_ARMORY, m_creature); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_MODEL); + //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO); + //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_MODEL); + //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO); + //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038); + break; + case 10: + m_creature->SetDisplayId(THRALL_MODEL_EQUIPPED); + break; + case 11: + SetRun(); + break; + case 15: + m_creature->SummonCreature(MOB_ENTRY_RIFLE,2200.28,137.37,87.93,5.07,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_WARDEN,2197.44,131.83,87.93,0.78,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_VETERAN,2203.62,135.40,87.93,3.70,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_VETERAN,2200.75,130.13,87.93,1.48,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 21: + m_creature->SummonCreature(MOB_ENTRY_RIFLE,2135.80,154.01,67.45,4.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_WARDEN,2144.36,151.87,67.74,4.46,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_VETERAN,2142.12,154.41,67.12,4.56,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_VETERAN,2138.08,155.38,67.24,4.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 25: + m_creature->SummonCreature(MOB_ENTRY_RIFLE,2102.98,192.17,65.24,6.02,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_WARDEN,2108.48,198.75,65.18,5.15,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_VETERAN,2106.11,197.29,65.18,5.63,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_VETERAN,2104.18,194.82,65.18,5.75,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 29: + DoScriptText(SAY_TH_SKARLOC_MEET, m_creature); + m_creature->SummonCreature(ENTRY_SCARLOC,2036.48,271.22,63.43,5.27,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + //temporary,skarloc should rather be triggered to walk up to thrall + break; + case 30: + IsOnHold = true; + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + SetRun(false); + break; + case 31: + DoScriptText(SAY_TH_MOUNTS_UP, m_creature); + DoMount(); + SetRun(); + break; + case 37: + //possibly regular patrollers? If so, remove this and let database handle them + m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2124.26,522.16,56.87,3.99,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2121.69,525.37,57.11,4.01,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_SENTRY,2124.65,524.55,56.63,3.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 59: + m_creature->SummonCreature(SKARLOC_MOUNT,2488.64,625.77,58.26,4.71,TEMPSUMMON_TIMED_DESPAWN,10000); + DoUnmount(); + HadMount = false; + SetRun(false); + break; + case 60: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); + //make horsie run off + IsOnHold = true; + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + pInstance->SetData(TYPE_THRALL_PART2, DONE); + SetRun(); + break; + case 64: + SetRun(false); + break; + case 68: + m_creature->SummonCreature(MOB_ENTRY_BARN_PROTECTOR,2500.22,692.60,55.50,2.84,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_BARN_LOOKOUT,2500.13,696.55,55.51,3.38,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.55,693.64,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.94,695.81,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 71: + SetRun(); + break; + case 81: + SetRun(false); + break; + case 83: + m_creature->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR,2627.33,646.82,56.03,4.28,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); + m_creature->SummonCreature(MOB_ENTRY_CHURCH_LOOKOUT,2624.14,648.03,56.03,4.50,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); + m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2625.32,649.60,56.03,4.38,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); + m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2627.22,649.00,56.03,4.34,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); + break; + case 84: + DoScriptText(SAY_TH_CHURCH_END, m_creature); + SetRun(); + break; + case 91: + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + SetRun(false); + break; + case 93: + m_creature->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_INN_LOOKOUT,2648.96,662.59,61.93,0.79,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2657.36,662.34,61.93,2.68,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2656.39,659.77,61.93,2.61,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); + break; + case 94: + if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) + { + if (Unit* Taretha = Unit::GetUnit((*m_creature), TarethaGUID)) + DoScriptText(SAY_TA_ESCAPED, Taretha, m_creature); + } + break; + case 95: + DoScriptText(SAY_TH_MEET_TARETHA, m_creature); + pInstance->SetData(TYPE_THRALL_PART3,DONE); + IsOnHold = true; + break; + case 96: + DoScriptText(SAY_TH_EPOCH_WONDER, m_creature); + break; + case 97: + DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, m_creature); + SetRun(); + break; + case 98: + //trigger epoch Yell("Thrall! Come outside and face your fate! ....") + //from here, thrall should not never be allowed to move to point 106 which he currently does. + break; + + case 106: + { + if (!PlayerGUID) + break; + + //trigger taretha to run down outside + if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) + { + if (Creature* Taretha = (Unit::GetCreature(*m_creature, TarethaGUID))) + CAST_AI(npc_escortAI, (Taretha->AI()))->Start(false, true, PlayerGUID); + } + + //kill credit Creature for quest + Map* pMap = m_creature->GetMap(); + Map::PlayerList const& players = pMap->GetPlayers(); + if (!players.isEmpty() && pMap->IsDungeon()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* pPlayer = itr->getSource()) + pPlayer->KilledMonsterCredit(20156,m_creature->GetGUID()); + } + } + + //alot will happen here, thrall and taretha talk, erozion appear at spot to explain + m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000); + } + break; + case 108: + //last waypoint, just set Thrall invisible, respawn is turned off + m_creature->SetVisibility(VISIBILITY_OFF); + break; + } + } + + + void Reset() + { + LowHp = false; + + if (HadMount) + DoMount(); + + if (!IsBeingEscorted) + { + DoUnmount(); + HadMount = false; + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); + m_creature->SetDisplayId(THRALL_MODEL_UNEQUIPPED); + } + if (IsBeingEscorted) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_TH_LEAVE_COMBAT1, m_creature); break; + case 1: DoScriptText(SAY_TH_LEAVE_COMBAT2, m_creature); break; + case 2: DoScriptText(SAY_TH_LEAVE_COMBAT3, m_creature); break; + } + } + } + void StartWP() + { + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + IsOnHold = false; + } + void DoMount() + { + m_creature->Mount(SKARLOC_MOUNT_MODEL); + m_creature->SetSpeed(MOVE_RUN,SPEED_MOUNT); + } + void DoUnmount() + { + m_creature->Unmount(); + m_creature->SetSpeed(MOVE_RUN,SPEED_RUN); + } + void EnterCombat(Unit* who) + { + switch(rand()%4) + { + case 0: DoScriptText(SAY_TH_RANDOM_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_TH_RANDOM_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_TH_RANDOM_AGGRO3, m_creature); break; + case 3: DoScriptText(SAY_TH_RANDOM_AGGRO4, m_creature); break; + } + if (m_creature->IsMounted()) + { + DoUnmount(); + HadMount = true; + } + } + + void JustSummoned(Creature* summoned) + { + switch(summoned->GetEntry()) + { + //TODO: make Scarloc start into event instead, and not start attack directly + case MOB_ENTRY_BARN_GUARDSMAN: + case MOB_ENTRY_BARN_PROTECTOR: + case MOB_ENTRY_BARN_LOOKOUT: + case SKARLOC_MOUNT: + case EROZION_ENTRY: + break; + default: + summoned->AI()->AttackStart(m_creature); + break; + } + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_TH_RANDOM_KILL1, m_creature); break; + case 1: DoScriptText(SAY_TH_RANDOM_KILL2, m_creature); break; + case 2: DoScriptText(SAY_TH_RANDOM_KILL3, m_creature); break; + } + } + void JustDied(Unit *slayer) + { + if (pInstance) + pInstance->SetData(TYPE_THRALL_EVENT,FAIL); + + // Don't do a yell if he kills self (if player goes too far or at the end). + if (slayer == m_creature) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_TH_RANDOM_DIE1, m_creature); break; + case 1: DoScriptText(SAY_TH_RANDOM_DIE2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + //TODO: add his abilities'n-crap here + if (!LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_TH_RANDOM_LOW_HP1, m_creature); break; + case 1: DoScriptText(SAY_TH_RANDOM_LOW_HP2, m_creature); break; + } + LowHp = true; + } + } +}; + +CreatureAI* GetAI_npc_thrall_old_hillsbrad(Creature* pCreature) +{ + return new npc_thrall_old_hillsbradAI(pCreature); +} + +bool GossipHello_npc_thrall_old_hillsbrad(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + { + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + pPlayer->SendPreparedQuest(pCreature->GetGUID()); + } + + ScriptedInstance* pInstance = (pCreature->GetInstanceData()); + if (pInstance) + { + if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE && !pInstance->GetData(TYPE_THRALL_EVENT)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] Start walking.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_START, pCreature->GetGUID()); + } + + if (pInstance->GetData(TYPE_THRALL_PART1) == DONE && !pInstance->GetData(TYPE_THRALL_PART2)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC1, pCreature->GetGUID()); + } + + if (pInstance->GetData(TYPE_THRALL_PART2) == DONE && !pInstance->GetData(TYPE_THRALL_PART3)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TARREN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_TARREN, pCreature->GetGUID()); + } + } + return true; +} + +bool GossipSelect_npc_thrall_old_hillsbrad(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + ScriptedInstance* pInstance = (pCreature->GetInstanceData()); + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->CLOSE_GOSSIP_MENU(); + if (pInstance) + { + pInstance->SetData(TYPE_THRALL_EVENT,IN_PROGRESS); + pInstance->SetData(TYPE_THRALL_PART1,IN_PROGRESS); + } + + DoScriptText(SAY_TH_START_EVENT_PART1, pCreature); + + if (npc_escortAI* pEscortAI = CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI())) + pEscortAI->Start(true, true, pPlayer->GetGUID()); + + CAST_AI(npc_escortAI, (pCreature->AI()))->SetMaxPlayerDistance(100.0f);//not really needed, because it will not despawn if player is too far + CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtEnd(false); + CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtFar(false); + break; + + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC2, pCreature->GetGUID()); + break; + + case GOSSIP_ACTION_INFO_DEF+20: + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC3, pCreature->GetGUID()); + pCreature->SummonCreature(SKARLOC_MOUNT,2038.81,270.26,63.20,5.41,TEMPSUMMON_TIMED_DESPAWN,12000); + if (pInstance) + pInstance->SetData(TYPE_THRALL_PART2,IN_PROGRESS); + + DoScriptText(SAY_TH_START_EVENT_PART2, pCreature); + + CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI())->StartWP(); + break; + + case GOSSIP_ACTION_INFO_DEF+3: + pPlayer->CLOSE_GOSSIP_MENU(); + if (pInstance) + pInstance->SetData(TYPE_THRALL_PART3,IN_PROGRESS); + CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI())->StartWP(); + break; + } + return true; +} + +/*###### +## npc_taretha +######*/ + +#define GOSSIP_ID_EPOCH1 9610 //Thank you for helping Thrall escape, friends. Now I only hope +#define GOSSIP_ITEM_EPOCH1 "Strange wizard?" +#define GOSSIP_ID_EPOCH2 9613 //Yes, friends. This man was no wizard of +#define GOSSIP_ITEM_EPOCH2 "We'll get you out. Taretha. Don't worry. I doubt the wizard would wander too far away." + +struct TRINITY_DLL_DECL npc_tarethaAI : public npc_escortAI +{ + npc_tarethaAI(Creature *c) : npc_escortAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + void WaypointReached(uint32 i) + { + switch(i) + { + case 6: + DoScriptText(SAY_TA_FREE, m_creature); + break; + case 7: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_CHEER); + break; + } + } + void Reset() {} + void EnterCombat(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; +CreatureAI* GetAI_npc_taretha(Creature* pCreature) +{ + return new npc_tarethaAI(pCreature); +} + +bool GossipHello_npc_taretha(Player* pPlayer, Creature* pCreature) +{ + ScriptedInstance* pInstance = (pCreature->GetInstanceData()); + if (pInstance && pInstance->GetData(TYPE_THRALL_PART3) == DONE && pInstance->GetData(TYPE_THRALL_PART4) == NOT_STARTED) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH1, pCreature->GetGUID()); + } + return true; +} + +bool GossipSelect_npc_taretha(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + ScriptedInstance* pInstance = (pCreature->GetInstanceData()); + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH2, pCreature->GetGUID()); + } + if (uiAction == GOSSIP_ACTION_INFO_DEF+2) + { + pPlayer->CLOSE_GOSSIP_MENU(); + + if (pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) + { + if (pInstance) + pInstance->SetData(TYPE_THRALL_PART4,IN_PROGRESS); + if (pInstance->GetData64(DATA_EPOCH) == 0) + pCreature->SummonCreature(ENTRY_EPOCH,2639.13,698.55,65.43,4.59,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000); + + if (uint64 ThrallGUID = pInstance->GetData64(DATA_THRALL)) + { + Creature* Thrall = (Unit::GetCreature((*pCreature), ThrallGUID)); + if (Thrall) + CAST_AI(npc_thrall_old_hillsbradAI, Thrall->AI())->StartWP(); + } + } + } + return true; +} + +/*###### +## AddSC +######*/ + +void AddSC_old_hillsbrad() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_erozion"; + newscript->pGossipHello = &GossipHello_npc_erozion; + newscript->pGossipSelect = &GossipSelect_npc_erozion; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_thrall_old_hillsbrad"; + newscript->pGossipHello = &GossipHello_npc_thrall_old_hillsbrad; + newscript->pGossipSelect = &GossipSelect_npc_thrall_old_hillsbrad; + newscript->GetAI = &GetAI_npc_thrall_old_hillsbrad; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_taretha"; + newscript->pGossipHello = &GossipHello_npc_taretha; + newscript->pGossipSelect = &GossipSelect_npc_taretha; + newscript->GetAI = &GetAI_npc_taretha; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_celebras_the_cursed.cpp new file mode 100644 index 00000000000..f2ac8ff08e1 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_celebras_the_cursed.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_Celebras_the_Cursed +SD%Complete: 100 +SDComment: +SDCategory: Maraudon +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_WRATH 21807 +#define SPELL_ENTANGLINGROOTS 12747 +#define SPELL_CORRUPT_FORCES 21968 + +struct TRINITY_DLL_DECL celebras_the_cursedAI : public ScriptedAI +{ + celebras_the_cursedAI(Creature *c) : ScriptedAI(c) {} + + uint32 Wrath_Timer; + uint32 EntanglingRoots_Timer; + uint32 CorruptForces_Timer; + + void Reset() + { + Wrath_Timer = 8000; + EntanglingRoots_Timer = 2000; + CorruptForces_Timer = 30000; + } + + void EnterCombat(Unit *who) { } + + void JustDied(Unit* Killer) + { + m_creature->SummonCreature(13716, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 600000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Wrath + if (Wrath_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + DoCast(target,SPELL_WRATH); + Wrath_Timer = 8000; + }else Wrath_Timer -= diff; + + //EntanglingRoots + if (EntanglingRoots_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ENTANGLINGROOTS); + EntanglingRoots_Timer = 20000; + }else EntanglingRoots_Timer -= diff; + + //CorruptForces + if (CorruptForces_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_CORRUPT_FORCES); + CorruptForces_Timer = 20000; + }else CorruptForces_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_celebras_the_cursed(Creature* pCreature) +{ + return new celebras_the_cursedAI (pCreature); +} + +void AddSC_boss_celebras_the_cursed() +{ + Script *newscript; + newscript = new Script; + newscript->Name="celebras_the_cursed"; + newscript->GetAI = &GetAI_celebras_the_cursed; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/maraudon/boss_landslide.cpp b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_landslide.cpp new file mode 100644 index 00000000000..353b9c1e3c0 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_landslide.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_Landslide +SD%Complete: 100 +SDComment: +SDCategory: Maraudon +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_KNOCKAWAY 18670 +#define SPELL_TRAMPLE 5568 +#define SPELL_LANDSLIDE 21808 + +struct TRINITY_DLL_DECL boss_landslideAI : public ScriptedAI +{ + boss_landslideAI(Creature *c) : ScriptedAI(c) {} + + uint32 KnockAway_Timer; + uint32 Trample_Timer; + uint32 Landslide_Timer; + + void Reset() + { + KnockAway_Timer = 8000; + Trample_Timer = 2000; + Landslide_Timer = 0; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //KnockAway_Timer + if (KnockAway_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY); + KnockAway_Timer = 15000; + }else KnockAway_Timer -= diff; + + //Trample_Timer + if (Trample_Timer < diff) + { + DoCast(m_creature,SPELL_TRAMPLE); + Trample_Timer = 8000; + }else Trample_Timer -= diff; + + //Landslide + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) + { + if (Landslide_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_LANDSLIDE); + Landslide_Timer = 60000; + } else Landslide_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_landslide(Creature* pCreature) +{ + return new boss_landslideAI (pCreature); +} + +void AddSC_boss_landslide() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_landslide"; + newscript->GetAI = &GetAI_boss_landslide; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/maraudon/boss_noxxion.cpp b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_noxxion.cpp new file mode 100644 index 00000000000..62190d4192a --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_noxxion.cpp @@ -0,0 +1,150 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Noxxion +SD%Complete: 100 +SDComment: +SDCategory: Maraudon +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_TOXICVOLLEY 21687 +#define SPELL_UPPERCUT 22916 + +struct TRINITY_DLL_DECL boss_noxxionAI : public ScriptedAI +{ + boss_noxxionAI(Creature *c) : ScriptedAI(c) {} + + uint32 ToxicVolley_Timer; + uint32 Uppercut_Timer; + uint32 Adds_Timer; + uint32 Invisible_Timer; + bool Invisible; + int Rand; + int RandX; + int RandY; + Creature* Summoned; + + void Reset() + { + ToxicVolley_Timer = 7000; + Uppercut_Timer = 16000; + Adds_Timer = 19000; + Invisible_Timer = 15000; //Too much too low? + Invisible = false; + } + + void EnterCombat(Unit *who) + { + } + + void SummonAdds(Unit* victim) + { + Rand = rand()%8; + switch (rand()%2) + { + case 0: RandX = 0 - Rand; break; + case 1: RandX = 0 + Rand; break; + } + Rand = 0; + Rand = rand()%8; + switch (rand()%2) + { + case 0: RandY = 0 - Rand; break; + case 1: RandY = 0 + Rand; break; + } + Rand = 0; + Summoned = DoSpawnCreature(13456, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000); + if (Summoned) + (Summoned->AI())->AttackStart(victim); + } + + void UpdateAI(const uint32 diff) + { + if (Invisible && Invisible_Timer < diff) + { + //Become visible again + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //Noxxion model + m_creature->SetDisplayId(11172); + Invisible = false; + //m_creature->m_canMove = true; + } else if (Invisible) + { + Invisible_Timer -= diff; + //Do nothing while invisible + return; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //ToxicVolley_Timer + if (ToxicVolley_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_TOXICVOLLEY); + ToxicVolley_Timer = 9000; + }else ToxicVolley_Timer -= diff; + + //Uppercut_Timer + if (Uppercut_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_UPPERCUT); + Uppercut_Timer = 12000; + }else Uppercut_Timer -= diff; + + //Adds_Timer + if (!Invisible && Adds_Timer < diff) + { + //Inturrupt any spell casting + //m_creature->m_canMove = true; + m_creature->InterruptNonMeleeSpells(false); + m_creature->setFaction(35); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // Invisible Model + m_creature->SetDisplayId(11686); + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + SummonAdds(m_creature->getVictim()); + Invisible = true; + Invisible_Timer = 15000; + + Adds_Timer = 40000; + }else Adds_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_noxxion(Creature* pCreature) +{ + return new boss_noxxionAI (pCreature); +} + +void AddSC_boss_noxxion() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_noxxion"; + newscript->GetAI = &GetAI_boss_noxxion; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/maraudon/boss_princess_theradras.cpp b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_princess_theradras.cpp new file mode 100644 index 00000000000..7199c18cf75 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/maraudon/boss_princess_theradras.cpp @@ -0,0 +1,109 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Princess_Theradras +SD%Complete: 100 +SDComment: +SDCategory: Maraudon +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_DUSTFIELD 21909 +#define SPELL_BOULDER 21832 +#define SPELL_THRASH 3391 +#define SPELL_REPULSIVEGAZE 21869 + +struct TRINITY_DLL_DECL boss_ptheradrasAI : public ScriptedAI +{ + boss_ptheradrasAI(Creature *c) : ScriptedAI(c) {} + + uint32 Dustfield_Timer; + uint32 Boulder_Timer; + uint32 Thrash_Timer; + uint32 RepulsiveGaze_Timer; + + void Reset() + { + Dustfield_Timer = 8000; + Boulder_Timer = 2000; + Thrash_Timer = 5000; + RepulsiveGaze_Timer = 23000; + } + + void EnterCombat(Unit *who) + { + } + + void JustDied(Unit* Killer) + { + m_creature->SummonCreature(12238,28.067,61.875,-123.405,4.67,TEMPSUMMON_TIMED_DESPAWN,600000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Dustfield_Timer + if (Dustfield_Timer < diff) + { + DoCast(m_creature,SPELL_DUSTFIELD); + Dustfield_Timer = 14000; + }else Dustfield_Timer -= diff; + + //Boulder_Timer + if (Boulder_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + DoCast(target,SPELL_BOULDER); + Boulder_Timer = 10000; + }else Boulder_Timer -= diff; + + //RepulsiveGaze_Timer + if (RepulsiveGaze_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_REPULSIVEGAZE); + RepulsiveGaze_Timer = 20000; + }else RepulsiveGaze_Timer -= diff; + + //Thrash_Timer + if (Thrash_Timer < diff) + { + DoCast(m_creature,SPELL_THRASH); + Thrash_Timer = 18000; + }else Thrash_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_ptheradras(Creature* pCreature) +{ + return new boss_ptheradrasAI (pCreature); +} + +void AddSC_boss_ptheradras() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_princess_theradras"; + newscript->GetAI = &GetAI_boss_ptheradras; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp b/src/bindings/scripts/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp new file mode 100644 index 00000000000..35608557dad --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/onyxias_lair/boss_onyxia.cpp @@ -0,0 +1,307 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Onyxia +SD%Complete: 90 +SDComment: Spell Heated Ground is wrong, flying animation, visual for area effect +SDCategory: Onyxia's Lair +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1249000 +#define SAY_KILL -1249001 +#define SAY_PHASE_2_TRANS -1249002 +#define SAY_PHASE_3_TRANS -1249003 +#define EMOTE_BREATH -1249004 + +#define SPELL_WINGBUFFET 18500 +#define SPELL_FLAMEBREATH 18435 +#define SPELL_CLEAVE 19983 +#define SPELL_TAILSWEEP 15847 +#define SPELL_KNOCK_AWAY 19633 + +#define SPELL_ENGULFINGFLAMES 20019 +#define SPELL_DEEPBREATH 23461 +#define SPELL_FIREBALL 18392 + +#define SPELL_BELLOWINGROAR 18431 +#define SPELL_HEATED_GROUND 22191 //Wrong Spell + +#define SPELL_SUMMONWHELP 17646 + +#define CREATURE_WHELP 11262 + +static float MovementLocations[4][3]= +{ + {-64.0523, -213.0619, -68.2985}, + {12.4636, -220.01490, -68.0548}, + {-38.8391, -182.3220, -68.9457}, + {-37.0390, -244.8760, -68.1278} +}; + +static float SpawnLocations[4][3]= +{ + {-30.127, -254.463, -89.440}, + {-30.817, -177.106, -89.258}, + {14.480, -241.560, -85.6300}, + {17.372, -190.840, -85.2810}, +}; + +struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI +{ + boss_onyxiaAI(Creature* c) : ScriptedAI(c) {} + + uint32 Phase; + + uint32 FlameBreathTimer; + uint32 CleaveTimer; + uint32 TailSweepTimer; + uint32 MovementTimer; + uint32 EngulfingFlamesTimer; + uint32 SummonWhelpsTimer; + uint32 BellowingRoarTimer; + uint32 WingBuffetTimer; + uint32 KnockAwayTimer; + uint32 FireballTimer; + + bool InitialSpawn; + + void Reset() + { + Phase = 1; + + FlameBreathTimer = 20000; + TailSweepTimer = 2000; + CleaveTimer = 15000; + MovementTimer = 3000; + EngulfingFlamesTimer = 15000; + SummonWhelpsTimer = 45000; + BellowingRoarTimer = 30000; + WingBuffetTimer = 17000; + KnockAwayTimer = 15000; + FireballTimer = 18000; + + InitialSpawn = true; + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + } + + void JustDied(Unit* Killer) + { + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 60) && (Phase == 1)) + { + Phase = 2; + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->SetHover(true); + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + DoScriptText(SAY_PHASE_2_TRANS, m_creature); + } + + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40) && (Phase == 2)) + { + Phase = 3; + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->SetHover(false); + m_creature->GetMotionMaster()->MovePoint(0, -10.6155, -219.357, -87.7344); + DoStartMovement(m_creature->getVictim()); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + DoScriptText(SAY_PHASE_3_TRANS, m_creature); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + + if (Phase == 1 || Phase == 3) + { + if (FlameBreathTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH); + FlameBreathTimer = 15000; + }else FlameBreathTimer -= diff; + + if (TailSweepTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (target && !m_creature->HasInArc(M_PI, target)) + DoCast(target, SPELL_TAILSWEEP); + + TailSweepTimer = 10000; + }else TailSweepTimer -= diff; + + if (CleaveTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + CleaveTimer = 10000; + }else CleaveTimer -= diff; + + if (WingBuffetTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WINGBUFFET); + WingBuffetTimer = 7000 + ((rand()%8)*1000); + }else WingBuffetTimer -= diff; + + if (KnockAwayTimer < diff) + { + if (rand() <= 30) + { + DoCast(m_creature->getVictim(), SPELL_KNOCK_AWAY); + } + KnockAwayTimer = 15000; + }else KnockAwayTimer -= diff; + + if (Phase == 3) + { + if (BellowingRoarTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR); + + BellowingRoarTimer = 30000; + }else BellowingRoarTimer -= diff; + + if (SummonWhelpsTimer < diff) + { + SummonWhelps(Phase); + + SummonWhelpsTimer = 45000; + }else SummonWhelpsTimer -= diff; + } + + DoMeleeAttackIfReady(); + } + + if (Phase == 2) + { + if (InitialSpawn) + { + InitialSpawn = false; + + for(uint32 i = 0; i < 10; ++i) + { + uint32 random = rand()%4; + Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Whelp) + Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + + if (EngulfingFlamesTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_ENGULFINGFLAMES); + m_creature->HandleEmoteCommand(ANIM_FLY); + + EngulfingFlamesTimer = 10000; + } + else EngulfingFlamesTimer -= diff; + + if (FireballTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); + + FireballTimer = 18000; + } + else FireballTimer -= diff; + + if (MovementTimer < diff) + { + if (rand()%100 < 30) + { + DoScriptText(EMOTE_BREATH, m_creature); + DoCast(m_creature->getVictim(), SPELL_DEEPBREATH); + } + else ChangePosition(); + + MovementTimer = 25000; + }else MovementTimer -= diff; + + if (SummonWhelpsTimer < diff) + { + SummonWhelps(Phase); + + SummonWhelpsTimer = 45000; + } + else SummonWhelpsTimer -= diff; + } + } + + void ChangePosition() + { + uint32 random = rand() % 4; + if (random<4){ + m_creature->GetMotionMaster()->MovePoint(0, MovementLocations[random][0], MovementLocations[random][1], MovementLocations[random][2]);} + } + + void SummonWhelps(uint32 Phase) + { + if (Phase == 2) + { + uint32 max = rand()%10; + for(uint32 i = 0; i < max; ++i) + { + uint32 random = rand()%3; + Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Whelp) + Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + + if (Phase == 3) + { + uint32 max = rand() % 10 +1; + if (max < 5) + { + for(uint32 i = 0; i < max; ++i) + { + uint32 random = rand()%4; + Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Whelp) + Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + } + } +}; + +CreatureAI* GetAI_boss_onyxiaAI(Creature* pCreature) +{ + return new boss_onyxiaAI (pCreature); +} + +void AddSC_boss_onyxia() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_onyxia"; + newscript->GetAI = &GetAI_boss_onyxiaAI; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp b/src/bindings/scripts/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp new file mode 100644 index 00000000000..2ecccaf2980 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp @@ -0,0 +1,130 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Amnennar_the_coldbringer +SD%Complete: 100 +SDComment: +SDCategory: Razorfen Downs +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1129000 +#define SAY_SUMMON60 -1129001 +#define SAY_SUMMON30 -1129002 +#define SAY_HP -1129003 +#define SAY_KILL -1129004 + +#define SPELL_AMNENNARSWRATH 13009 +#define SPELL_FROSTBOLT 15530 +#define SPELL_FROST_NOVA 15531 +#define SPELL_FROST_SPECTRES 12642 + +struct TRINITY_DLL_DECL boss_amnennar_the_coldbringerAI : public ScriptedAI +{ + boss_amnennar_the_coldbringerAI(Creature *c) : ScriptedAI(c) {} + + uint32 AmnenarsWrath_Timer; + uint32 FrostBolt_Timer; + uint32 FrostNova_Timer; + bool Spectrals60; + bool Spectrals30; + bool Hp; + + void Reset() + { + AmnenarsWrath_Timer = 8000; + FrostBolt_Timer = 1000; + FrostNova_Timer = 10000 + rand()%5000; + Spectrals30 = false; + Spectrals60 = false; + Hp = false; + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit() + { + DoScriptText(SAY_KILL, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //AmnenarsWrath_Timer + if (AmnenarsWrath_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_AMNENNARSWRATH); + AmnenarsWrath_Timer = 12000; + } else AmnenarsWrath_Timer -= diff; + + //FrostBolt_Timer + if (FrostBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); + FrostBolt_Timer = 8000; + } else FrostBolt_Timer -= diff; + + if (FrostNova_Timer < diff) + { + DoCast(m_creature,SPELL_FROST_NOVA); + FrostNova_Timer = 15000; + } else FrostNova_Timer -= diff; + + if (!Spectrals60 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 60) + { + DoScriptText(SAY_SUMMON60, m_creature); + DoCast(m_creature->getVictim(),SPELL_FROST_SPECTRES); + Spectrals60 = true; + } + + if (!Hp && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) + { + DoScriptText(SAY_HP, m_creature); + Hp = true; + } + + if (!Spectrals30 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30) + { + DoScriptText(SAY_SUMMON30, m_creature); + DoCast(m_creature->getVictim(),SPELL_FROST_SPECTRES); + Spectrals30 = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_amnennar_the_coldbringer(Creature* pCreature) +{ + return new boss_amnennar_the_coldbringerAI (pCreature); +} + +void AddSC_boss_amnennar_the_coldbringer() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_amnennar_the_coldbringer"; + newscript->GetAI = &GetAI_boss_amnennar_the_coldbringer; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp b/src/bindings/scripts/scripts/kalimdor/razorfen_downs/razorfen_downs.cpp new file mode 100644 index 00000000000..7515c5a9195 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/razorfen_downs/razorfen_downs.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: Razorfen_Downs +SD%Complete: 100 +SDComment: Support for Henry Stern(2 recipes) +SDCategory: Razorfen Downs +EndScriptData */ + +/* ContentData +npc_henry_stern +EndContentData */ + +#include "precompiled.h" + +/*### +# npc_henry_stern +####*/ + +enum +{ + SPELL_GOLDTHORN_TEA = 13028, + SPELL_TEACHING_GOLDTHORN_TEA = 13029, + SPELL_MIGHT_TROLLS_BLOOD_POTION = 3451, + SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION = 13030, + GOSSIP_TEXT_TEA_ANSWER = 2114, + GOSSIP_TEXT_POTION_ANSWER = 2115, +}; + +#define GOSSIP_ITEM_TEA "Teach me the cooking recipe" +#define GOSSIP_ITEM_POTION "Teach me the alchemy recipe" + +bool GossipHello_npc_henry_stern (Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->GetBaseSkillValue(SKILL_COOKING) >= 175 && !pPlayer->HasSpell(SPELL_GOLDTHORN_TEA)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + if (pPlayer->GetBaseSkillValue(SKILL_ALCHEMY) >= 180 && !pPlayer->HasSpell(SPELL_MIGHT_TROLLS_BLOOD_POTION)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_POTION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_henry_stern (Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + pCreature->CastSpell(pPlayer, SPELL_TEACHING_GOLDTHORN_TEA, true); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_TEA_ANSWER, pCreature->GetGUID()); + } + + if (uiAction == GOSSIP_ACTION_INFO_DEF + 2) + { + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_POTION_ANSWER, pCreature->GetGUID()); + pCreature->CastSpell(pPlayer, SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION, true); + } + + return true; +} + +void AddSC_razorfen_downs() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "npc_henry_stern"; + newscript->pGossipHello = &GossipHello_npc_henry_stern; + newscript->pGossipSelect = &GossipSelect_npc_henry_stern; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/def_razorfen_kraul.h b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/def_razorfen_kraul.h new file mode 100644 index 00000000000..96917fcd4bf --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/def_razorfen_kraul.h @@ -0,0 +1,21 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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_RAZORFEN_KRAUL_H +#define DEF_RAZORFEN_KRAUL_H + +#define TYPE_WARD_KEEPERS 1 +#endif \ No newline at end of file diff --git a/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp new file mode 100644 index 00000000000..94b0943cf3d --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/instance_razorfen_kraul.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: Instance_Razorfen_Kraul +SD%Complete: +SDComment: +SDCategory: Razorfen Kraul +EndScriptData */ + +#include "precompiled.h" +#include "def_razorfen_kraul.h" + + +#define WARD_KEEPERS_NR 2 + +struct TRINITY_DLL_DECL instance_razorfen_kraul : public ScriptedInstance +{ + instance_razorfen_kraul(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 DoorWardGUID; + uint32 WardCheck_Timer; + int WardKeeperAlive; + + void Initialize() + { + WardKeeperAlive = 1; + WardCheck_Timer = 4000; + DoorWardGUID = 0; + } + + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + debug_log("TSCR: Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void OnGameObjectCreate(GameObject* pGo, bool apply) + { + switch(pGo->GetEntry()) + { + case 21099: DoorWardGUID = pGo->GetGUID(); break; + } + } + + void Update(uint32 diff) + { + if (WardCheck_Timer < diff) + { + HandleGameObject(DoorWardGUID, WardKeeperAlive); + WardKeeperAlive = 0; + WardCheck_Timer = 4000; + }else + WardCheck_Timer -= diff; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_WARD_KEEPERS: + if (data == NOT_STARTED) + WardKeeperAlive = 1; + break; + } + } + +}; + +InstanceData* GetInstanceData_instance_razorfen_kraul(Map* pMap) +{ + return new instance_razorfen_kraul(pMap); +} + +void AddSC_instance_razorfen_kraul() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_razorfen_kraul"; + newscript->GetInstanceData = &GetInstanceData_instance_razorfen_kraul; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp new file mode 100644 index 00000000000..a6bd845b13e --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp @@ -0,0 +1,252 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Razorfen Kraul +SD%Complete: 100 +SDComment: Quest support: 1144 +SDCategory: Razorfen Kraul +EndScriptData */ + +/* ContentData +npc_willix +EndContentData */ + +#include "precompiled.h" +#include "escortAI.h" +#include "def_razorfen_kraul.h" + +#define SAY_READY -1047000 +#define SAY_POINT -10470001 +#define SAY_AGGRO1 -1047002 +#define SAY_BLUELEAF -1047003 +#define SAY_DANGER -1047004 +#define SAY_BAD -1047005 +#define SAY_THINK -1047006 +#define SAY_SOON -1047007 +#define SAY_FINALY -1047008 +#define SAY_WIN -1047009 +#define SAY_END -1047010 + +#define QUEST_WILLIX_THE_IMPORTER 1144 +#define ENTRY_BOAR 4514 +#define SPELL_QUILLBOAR_CHANNELING 7083 + +struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI +{ + npc_willixAI(Creature *c) : npc_escortAI(c) {} + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch (i) + { + case 3: + m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); + DoScriptText(SAY_POINT, m_creature, pPlayer); + break; + case 4: + m_creature->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 8: + DoScriptText(SAY_BLUELEAF, m_creature, pPlayer); + break; + case 9: + DoScriptText(SAY_DANGER, m_creature, pPlayer); + break; + case 13: + DoScriptText(SAY_BAD, m_creature, pPlayer); + break; + case 14: + m_creature->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 25: + DoScriptText(SAY_THINK, m_creature, pPlayer); + break; + case 31: + DoScriptText(SAY_SOON, m_creature, pPlayer); + break; + case 42: + DoScriptText(SAY_FINALY, m_creature, pPlayer); + break; + case 43: + m_creature->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + break; + case 45: + DoScriptText(SAY_WIN, m_creature, pPlayer); + if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature); + break; + case 46: + DoScriptText(SAY_END, m_creature, pPlayer); + break; + } + } + + void Reset() {} + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO1, m_creature, NULL); + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + CAST_PLR(pPlayer)->FailQuest(QUEST_WILLIX_THE_IMPORTER); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + } +}; + +bool QuestAccept_npc_willix(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER) + { + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID()); + DoScriptText(SAY_READY, pCreature, pPlayer); + pCreature->setFaction(113); + } + + return true; +} + +struct TRINITY_DLL_DECL npc_deaths_head_ward_keeperAI : public ScriptedAI +{ + npc_deaths_head_ward_keeperAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Reset(); + } + + ScriptedInstance *pInstance; + uint32 QuillboarChanneling_Timer; + + void Reset() + { + QuillboarChanneling_Timer = 1500; + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->isAlive()) + return; + + if (pInstance) + pInstance->SetData(TYPE_WARD_KEEPERS, NOT_STARTED); + + if (QuillboarChanneling_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + DoCast(m_creature, SPELL_QUILLBOAR_CHANNELING); + QuillboarChanneling_Timer = 1100; + }else QuillboarChanneling_Timer -= diff; + + } +}; + +CreatureAI* GetAI_npc_deaths_head_ward_keeper(Creature* pCreature) +{ + return new npc_deaths_head_ward_keeperAI(pCreature); +} + +CreatureAI* GetAI_npc_willix(Creature* pCreature) +{ + npc_willixAI* thisAI = new npc_willixAI(pCreature); + + thisAI->AddWaypoint(0, 2194.38, 1791.65, 65.48, 5000); + thisAI->AddWaypoint(1, 2188.56, 1805.87, 64.45); + thisAI->AddWaypoint(2, 2187, 1843.49, 59.33); + thisAI->AddWaypoint(3, 2163.27, 1851.67, 56.73, 5000); + thisAI->AddWaypoint(4, 2137.66, 1843.98, 48.08, 5000); + thisAI->AddWaypoint(5, 2140.22, 1845.02, 48.32); + thisAI->AddWaypoint(6, 2131.5, 1804.29, 46.85); + thisAI->AddWaypoint(7, 2096.18, 1789.03, 51.13); + thisAI->AddWaypoint(8, 2074.46, 1780.09, 55.64, 3000); + thisAI->AddWaypoint(9, 2055.12, 1768.67, 58.46, 5000); + thisAI->AddWaypoint(10, 2037.83, 1748.62, 60.27); + thisAI->AddWaypoint(11, 2037.51, 1728.94, 60.85); + thisAI->AddWaypoint(12, 2044.7, 1711.71, 59.71); + thisAI->AddWaypoint(13, 2067.66, 1701.84, 57.77, 3000); + thisAI->AddWaypoint(14, 2078.91, 1704.54, 56.77, 3000); + thisAI->AddWaypoint(15, 2097.65, 1715.24, 54.74); + thisAI->AddWaypoint(16, 2106.44, 1720.98, 54.41); + thisAI->AddWaypoint(17, 2123.96, 1732.56, 52.27); + thisAI->AddWaypoint(18, 2153.82, 1728.73, 51.92); + thisAI->AddWaypoint(19, 2163.49, 1706.33, 54.42); + thisAI->AddWaypoint(20, 2158.75, 1695.98, 55.70); + thisAI->AddWaypoint(21, 2142.6, 1680.72, 58.24); + thisAI->AddWaypoint(22, 2118.31, 1671.54, 59.21); + thisAI->AddWaypoint(23, 2086.02, 1672.04, 61.24); + thisAI->AddWaypoint(24, 2068.81, 1658.93, 61.24); + thisAI->AddWaypoint(25, 2062.82, 1633.31, 64.35, 3000); + thisAI->AddWaypoint(26, 2063.05, 1589.16, 63.26); + thisAI->AddWaypoint(27, 2063.67, 1577.22, 65.89); + thisAI->AddWaypoint(28, 2057.94, 1560.68, 68.40); + thisAI->AddWaypoint(29, 2052.56, 1548.05, 73.35); + thisAI->AddWaypoint(30, 2045.22, 1543.4, 76.65); + thisAI->AddWaypoint(31, 2034.35, 1543.01, 79.70); + thisAI->AddWaypoint(32, 2029.95, 1542.94, 80.79); + thisAI->AddWaypoint(33, 2021.34, 1538.67, 80.8); + thisAI->AddWaypoint(34, 2012.45, 1549.48, 79.93); + thisAI->AddWaypoint(35, 2008.05, 1554.92, 80.44); + thisAI->AddWaypoint(36, 2006.54, 1562.72, 81.11); + thisAI->AddWaypoint(37, 2003.8, 1576.43, 81.57); + thisAI->AddWaypoint(38, 2000.57, 1590.06, 80.62); + thisAI->AddWaypoint(39, 1998.96, 1596.87, 80.22); + thisAI->AddWaypoint(40, 1991.19, 1600.82, 79.39); + thisAI->AddWaypoint(41, 1980.71, 1601.44, 79.77, 3000); + thisAI->AddWaypoint(42, 1967.22, 1600.18, 80.62, 3000); + thisAI->AddWaypoint(43, 1956.43, 1596.97, 81.75, 3000); + thisAI->AddWaypoint(44, 1954.87, 1592.02, 82.18); + thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000); + thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000); + + return thisAI; +} + +void AddSC_razorfen_kraul() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_willix"; + newscript->GetAI = &GetAI_npc_willix; + newscript->pQuestAccept = &QuestAccept_npc_willix; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_deaths_head_ward_keeper"; + newscript->GetAI = &GetAI_npc_deaths_head_ward_keeper; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.cpp new file mode 100644 index 00000000000..eefedb2c0d5 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ayamiss.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_Ayamiss +SD%Complete: 50 +SDComment: VERIFY SCRIPT +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +/* +To do: +make him fly from 70-100% +*/ + +#define SPELL_STINGERSPRAY 25749 +#define SPELL_POISONSTINGER 25748 //only used in phase1 +#define SPELL_SUMMONSWARMER 25844 //might be 25708 +// #define SPELL_PARALYZE 23414 doesnt work correct (core) + +struct TRINITY_DLL_DECL boss_ayamissAI : public ScriptedAI +{ + boss_ayamissAI(Creature *c) : ScriptedAI(c) {} + + Unit *pTarget; + uint32 STINGERSPRAY_Timer; + uint32 POISONSTINGER_Timer; + uint32 SUMMONSWARMER_Timer; + uint32 phase; + + void Reset() + { + pTarget = NULL; + STINGERSPRAY_Timer = 30000; + POISONSTINGER_Timer = 30000; + SUMMONSWARMER_Timer = 60000; + phase=1; + } + + void EnterCombat(Unit *who) + { + pTarget = who; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //If he is 70% start phase 2 + if (phase==1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 70 && !m_creature->IsNonMeleeSpellCasted(false)) + { + phase=2; + } + + //STINGERSPRAY_Timer (only in phase2) + if (phase==2 && STINGERSPRAY_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_STINGERSPRAY); + STINGERSPRAY_Timer = 30000; + }else STINGERSPRAY_Timer -= diff; + + //POISONSTINGER_Timer (only in phase1) + if (phase==1 && POISONSTINGER_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_POISONSTINGER); + POISONSTINGER_Timer = 30000; + }else POISONSTINGER_Timer -= diff; + + //SUMMONSWARMER_Timer (only in phase1) + if (SUMMONSWARMER_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SUMMONSWARMER); + SUMMONSWARMER_Timer = 60000; + }else SUMMONSWARMER_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_ayamiss(Creature* pCreature) +{ + return new boss_ayamissAI (pCreature); +} + +void AddSC_boss_ayamiss() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_ayamiss"; + newscript->GetAI = &GetAI_boss_ayamiss; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp new file mode 100644 index 00000000000..58c48540362 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_buru.cpp @@ -0,0 +1,27 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Buru +SD%Complete: 0 +SDComment: Place Holder +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + + #define EMOTE_TARGET -1509002 + diff --git a/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp new file mode 100644 index 00000000000..e781c749d0d --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_kurinnaxx.cpp @@ -0,0 +1,94 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kurinnaxx +SD%Complete: 100 +SDComment: VERIFY SCRIPT AND SQL +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_MORTALWOUND 25646 +#define SPELL_SANDTRAP 25656 +#define SPELL_ENRAGE 28798 + +struct TRINITY_DLL_DECL boss_kurinnaxxAI : public ScriptedAI +{ + boss_kurinnaxxAI(Creature *c) : ScriptedAI(c) {} + + Unit *pTarget; + uint32 MORTALWOUND_Timer; + uint32 SANDTRAP_Timer; + uint32 i; + + void Reset() + { + i=0; + pTarget = NULL; + MORTALWOUND_Timer = 30000; + SANDTRAP_Timer = 30000; + } + + void EnterCombat(Unit *who) + { + pTarget = who; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //If we are <30% cast enrage + if (i==0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false)) + { + i=1; + DoCast(m_creature->getVictim(),SPELL_ENRAGE); + } + + //MORTALWOUND_Timer + if (MORTALWOUND_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MORTALWOUND); + MORTALWOUND_Timer = 30000; + }else MORTALWOUND_Timer -= diff; + + //SANDTRAP_Timer + if (SANDTRAP_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SANDTRAP); + SANDTRAP_Timer = 30000; + }else SANDTRAP_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_kurinnaxx(Creature* pCreature) +{ + return new boss_kurinnaxxAI (pCreature); +} + +void AddSC_boss_kurinnaxx() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_kurinnaxx"; + newscript->GetAI = &GetAI_boss_kurinnaxx; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.cpp new file mode 100644 index 00000000000..4d62a923e16 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_moam.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_Moam +SD%Complete: 100 +SDComment: VERIFY SCRIPT AND SQL +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define EMOTE_AGGRO -1509000 +#define EMOTE_MANA_FULL -1509001 + +#define SPELL_TRAMPLE 15550 +#define SPELL_DRAINMANA 27256 +#define SPELL_ARCANEERUPTION 25672 +#define SPELL_SUMMONMANA 25681 +#define SPELL_GRDRSLEEP 24360 //Greater Dreamless Sleep + +struct TRINITY_DLL_DECL boss_moamAI : public ScriptedAI +{ + boss_moamAI(Creature *c) : ScriptedAI(c) {} + + Unit *pTarget; + uint32 TRAMPLE_Timer; + uint32 DRAINMANA_Timer; + uint32 SUMMONMANA_Timer; + uint32 i; + uint32 j; + + void Reset() + { + i=0; + j=0; + pTarget = NULL; + TRAMPLE_Timer = 30000; + DRAINMANA_Timer = 30000; + } + + void EnterCombat(Unit *who) + { + DoScriptText(EMOTE_AGGRO, m_creature); + pTarget = who; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //If we are 100%MANA cast Arcane Erruption + //if (j==1 && m_creature->GetMana()*100 / m_creature->GetMaxMana() == 100 && !m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(m_creature->getVictim(),SPELL_ARCANEERUPTION); + DoScriptText(EMOTE_MANA_FULL, m_creature); + } + + //If we are <50%HP cast MANA FIEND (Summon Mana) and Sleep + //if (i==0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false)) + { + i=1; + DoCast(m_creature->getVictim(),SPELL_SUMMONMANA); + DoCast(m_creature->getVictim(),SPELL_GRDRSLEEP); + } + + //SUMMONMANA_Timer + if (i==1 && SUMMONMANA_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SUMMONMANA); + SUMMONMANA_Timer = 90000; + }else SUMMONMANA_Timer -= diff; + + //TRAMPLE_Timer + if (TRAMPLE_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_TRAMPLE); + j=1; + + TRAMPLE_Timer = 30000; + }else TRAMPLE_Timer -= diff; + + //DRAINMANA_Timer + if (DRAINMANA_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_DRAINMANA); + DRAINMANA_Timer = 30000; + }else DRAINMANA_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_moam(Creature* pCreature) +{ + return new boss_moamAI (pCreature); +} + +void AddSC_boss_moam() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_moam"; + newscript->GetAI = &GetAI_boss_moam; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp new file mode 100644 index 00000000000..5652b706917 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_ossirian.cpp @@ -0,0 +1,38 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ossirian +SD%Complete: 0 +SDComment: Place holder +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SAY_SURPREME2 -1509019 +#define SAY_SURPREME3 -1509020 + +#define SAY_RAND_INTRO1 -1509021 +#define SAY_RAND_INTRO2 -1509022 +#define SAY_RAND_INTRO3 -1509023 +#define SAY_RAND_INTRO4 -1509024 //possibly old? + +#define SAY_AGGRO -1509025 + +#define SAY_SLAY -1509026 +#define SAY_DEATH -1509027 + diff --git a/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp new file mode 100644 index 00000000000..fb2c92ff59f --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/boss_rajaxx.cpp @@ -0,0 +1,45 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Rajaxx +SD%Complete: 0 +SDComment: Place Holder +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SAY_ANDOROV_INTRO -1509003 +#define SAY_ANDOROV_ATTACK -1509004 + +#define SAY_WAVE3 -1509005 +#define SAY_WAVE4 -1509006 +#define SAY_WAVE5 -1509007 +#define SAY_WAVE6 -1509008 +#define SAY_WAVE7 -1509009 +#define SAY_INTRO -1509010 + +#define SAY_UNK1 -1509011 +#define SAY_UNK2 -1509012 +#define SAY_UNK3 -1509013 +#define SAY_UNK4 -1509014 + +#define SAY_DEAGGRO -1509015 +#define SAY_KILLS_ANDOROV -1509016 + +#define SAY_COMPLETE_QUEST -1509017 //Yell when realm complete quest 8743 for world event + diff --git a/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp new file mode 100644 index 00000000000..b94e6f16a80 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.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_Ruins_of_Ahnqiraj +SD%Complete: 0 +SDComment: Place holder +SDCategory: Ruins of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp new file mode 100644 index 00000000000..042dd5d53f5 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_bug_trio.cpp @@ -0,0 +1,346 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_kri, boss_yauj, boss_vem : The Bug Trio +SD%Complete: 100 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "def_temple_of_ahnqiraj.h" + +#define SPELL_CLEAVE 26350 +#define SPELL_TOXIC_VOLLEY 25812 +#define SPELL_POISON_CLOUD 38718 //Only Spell with right dmg. +#define SPELL_ENRAGE 34624 //Changed cause 25790 is casted on gamers too. Same prob with old explosion of twin emperors. + +#define SPELL_CHARGE 26561 +#define SPELL_KNOCKBACK 26027 + +#define SPELL_HEAL 25807 +#define SPELL_FEAR 19408 + +struct TRINITY_DLL_DECL boss_kriAI : public ScriptedAI +{ + boss_kriAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 Cleave_Timer; + uint32 ToxicVolley_Timer; + uint32 Check_Timer; + + bool VemDead; + bool Death; + + void Reset() + { + Cleave_Timer = 4000 + rand()%4000; + ToxicVolley_Timer = 6000 + rand()%6000; + Check_Timer = 2000; + + VemDead = false; + Death = false; + } + + void EnterCombat(Unit *who) + { + } + + void JustDied(Unit* killer) + { + if (pInstance) + { + if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) + // Unlootable if death + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + + pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); + } + } + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Cleave_Timer + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 5000 + rand()%7000; + }else Cleave_Timer -= diff; + + //ToxicVolley_Timer + if (ToxicVolley_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_TOXIC_VOLLEY); + ToxicVolley_Timer = 10000 + rand()%5000; + }else ToxicVolley_Timer -= diff; + + if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05 && !Death) + { + DoCast(m_creature->getVictim(),SPELL_POISON_CLOUD); + Death = true; + } + + if (!VemDead) + { + //Checking if Vem is dead. If yes we will enrage. + if (Check_Timer < diff) + { + if (pInstance && pInstance->GetData(DATA_VEMISDEAD)) + { + DoCast(m_creature, SPELL_ENRAGE); + VemDead = true; + } + Check_Timer = 2000; + }else Check_Timer -=diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_vemAI : public ScriptedAI +{ + boss_vemAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 Charge_Timer; + uint32 KnockBack_Timer; + uint32 Enrage_Timer; + + bool Enraged; + + void Reset() + { + Charge_Timer = 15000 + rand()%12000; + KnockBack_Timer = 8000 + rand()%12000; + Enrage_Timer = 120000; + + Enraged = false; + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + pInstance->SetData(DATA_VEM_DEATH, 0); + if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) + // Unlootable if death + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); + } + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Charge_Timer + if (Charge_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + { + DoCast(target, SPELL_CHARGE); + //m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); + AttackStart(target); + } + + Charge_Timer = 8000 + rand()%8000; + }else Charge_Timer -= diff; + + //KnockBack_Timer + if (KnockBack_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KNOCKBACK); + if (DoGetThreat(m_creature->getVictim())) + DoModifyThreatPercent(m_creature->getVictim(),-80); + KnockBack_Timer = 15000 + rand()%10000; + }else KnockBack_Timer -= diff; + + //Enrage_Timer + if (!Enraged && Enrage_Timer < diff) + { + DoCast(m_creature,SPELL_ENRAGE); + Enraged = true; + }else Charge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_yaujAI : public ScriptedAI +{ + boss_yaujAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 Heal_Timer; + uint32 Fear_Timer; + uint32 Check_Timer; + + bool VemDead; + + void Reset() + { + Heal_Timer = 25000 + rand()%15000; + Fear_Timer = 12000 + rand()%12000; + Check_Timer = 2000; + + VemDead = false; + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) + // Unlootable if death + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); + } + + for(uint8 i = 0; i < 10; ++i) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + Creature* Summoned = m_creature->SummonCreature(15621,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,90000); + if (Summoned && target) + (Summoned->AI())->AttackStart(target); + } + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Fear_Timer + if (Fear_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FEAR); + DoResetThreat(); + Fear_Timer = 20000; + }else Fear_Timer -= diff; + + //Casting Heal to other twins or herself. + if (Heal_Timer < diff) + { + if (pInstance) + { + Unit *pKri = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KRI)); + Unit *pVem = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_VEM)); + + switch(rand()%3) + { + case 0: + if (pKri) + DoCast(pKri, SPELL_HEAL); + break; + case 1: + if (pVem) + DoCast(pVem, SPELL_HEAL); + break; + case 2: + DoCast(m_creature, SPELL_HEAL); + break; + } + } + + Heal_Timer = 15000+rand()%15000; + }else Heal_Timer -= diff; + + //Checking if Vem is dead. If yes we will enrage. + if (Check_Timer < diff) + { + if (!VemDead) + { + if (pInstance) + { + if (pInstance->GetData(DATA_VEMISDEAD)) + { + DoCast(m_creature, SPELL_ENRAGE); + VemDead = true; + } + } + } + Check_Timer = 2000; + }else Check_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_yauj(Creature* pCreature) +{ + return new boss_yaujAI (pCreature); +} + +CreatureAI* GetAI_boss_vem(Creature* pCreature) +{ + return new boss_vemAI (pCreature); +} + +CreatureAI* GetAI_boss_kri(Creature* pCreature) +{ + return new boss_kriAI (pCreature); +} + +void AddSC_bug_trio() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_kri"; + newscript->GetAI = &GetAI_boss_kri; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_vem"; + newscript->GetAI = &GetAI_boss_vem; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_yauj"; + newscript->GetAI = &GetAI_boss_yauj; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp new file mode 100644 index 00000000000..905f46070f7 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_cthun.cpp @@ -0,0 +1,1335 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Cthun +SD%Complete: 95 +SDComment: Darkglare tracking issue +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "def_temple_of_ahnqiraj.h" + +//Text emote +#define EMOTE_WEAKENED -1531011 + +#define PI 3.14 + +//****** Out of Combat ****** +//Random Wispers - No txt only sound +#define RANDOM_SOUND_WHISPER 8663 + +//***** Phase 1 ******** + +//Mobs +#define BOSS_EYE_OF_CTHUN 15589 +#define MOB_CLAW_TENTACLE 15725 +#define MOB_EYE_TENTACLE 15726 +#define MOB_SMALL_PORTAL 15904 + +//Eye Spells +#define SPELL_GREEN_BEAM 26134 +#define SPELL_DARK_GLARE 26029 +#define SPELL_RED_COLORATION 22518 //Probably not the right spell but looks similar + +//Eye Tentacles Spells +#define SPELL_MIND_FLAY 26143 + +//Claw Tentacles Spells +#define SPELL_GROUND_RUPTURE 26139 +#define SPELL_HAMSTRING 26141 + +#define MOB_ + +//*****Phase 2****** +//Body spells +//#define SPELL_CARAPACE_CTHUN 26156 //Was removed from client dbcs +#define SPELL_TRANSFORM 26232 + +//Eye Tentacles Spells +//SAME AS PHASE1 + +//Giant Claw Tentacles +#define SPELL_MASSIVE_GROUND_RUPTURE 26100 + +//Also casts Hamstring +#define SPELL_THRASH 3391 + +//Giant Eye Tentacles +//CHAIN CASTS "SPELL_GREEN_BEAM" + +//Stomach Spells +#define SPELL_MOUTH_TENTACLE 26332 +#define SPELL_EXIT_STOMACH_KNOCKBACK 25383 +#define SPELL_DIGESTIVE_ACID 26476 + +//Mobs +#define MOB_BODY_OF_CTHUN 15809 +#define MOB_GIANT_CLAW_TENTACLE 15728 +#define MOB_GIANT_EYE_TENTACLE 15334 +#define MOB_FLESH_TENTACLE 15802 +#define MOB_GIANT_PORTAL 15910 + +//Stomach Teleport positions +#define STOMACH_X -8562.0f +#define STOMACH_Y 2037.0f +#define STOMACH_Z -70.0f +#define STOMACH_O 5.05f + +//Flesh tentacle positions +#define TENTACLE_POS1_X -8571.0f +#define TENTACLE_POS1_Y 1990.0f +#define TENTACLE_POS1_Z -98.0f +#define TENTACLE_POS1_O 1.22f + +#define TENTACLE_POS2_X -8525.0f +#define TENTACLE_POS2_Y 1994.0f +#define TENTACLE_POS2_Z -98.0f +#define TENTACLE_POS2_O 2.12f + +//Kick out position +#define KICK_X -8545.0f +#define KICK_Y 1984.0f +#define KICK_Z -96.0f + +struct TRINITY_DLL_DECL flesh_tentacleAI : public ScriptedAI +{ + flesh_tentacleAI(Creature *c) : ScriptedAI(c), Parent(0) + { + SetCombatMovement(false); + } + + uint64 Parent; + uint32 CheckTimer; + + void SpawnedByCthun(uint64 p) + { + Parent = p; + } + + void Reset() + { + CheckTimer = 1000; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff); + + void JustDied(Unit* killer); +}; + +struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI +{ + eye_of_cthunAI(Creature *c) : Scripted_NoMovementAI(c) + { + pInst = c->GetInstanceData(); + if (!pInst) + error_log("TSCR: No Instance eye_of_cthunAI"); + } + + ScriptedInstance* pInst; + + //Global variables + uint32 PhaseTimer; + + //Eye beam phase + uint32 BeamTimer; + uint32 EyeTentacleTimer; + uint32 ClawTentacleTimer; + + //Dark Glare phase + uint32 DarkGlareTick; + uint32 DarkGlareTickTimer; + float DarkGlareAngle; + bool ClockWise; + + void Reset() + { + //Phase information + PhaseTimer = 50000; //First dark glare in 50 seconds + + //Eye beam phase 50 seconds + BeamTimer = 3000; + EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam + ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn durring Dark beam) + + //Dark Beam phase 35 seconds (each tick = 1 second, 35 ticks) + DarkGlareTick = 0; + DarkGlareTickTimer = 1000; + DarkGlareAngle = 0; + ClockWise = false; + + //Reset flags + m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + //Reset Phase + if (pInst) + pInst->SetData(DATA_CTHUN_PHASE, 0); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + } + + void SpawnEyeTentacle(float x, float y) + { + Creature* Spawned; + Spawned = me->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + if (Spawned) + { + Unit* target; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (target) + Spawned->AI()->AttackStart(target); + } + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!UpdateVictim()) + return; + + //No instance + if (!pInst) + return; + + switch (pInst->GetData(DATA_CTHUN_PHASE)) + { + case 0: + { + //BeamTimer + if (BeamTimer < diff) + { + //SPELL_GREEN_BEAM + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(target,SPELL_GREEN_BEAM); + + //Correctly update our target + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID()); + } + + //Beam every 3 seconds + BeamTimer = 3000; + }else BeamTimer -= diff; + + //ClawTentacleTimer + if (ClawTentacleTimer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + { + Creature* Spawned = NULL; + + //Spawn claw tentacle on the random target + Spawned = me->SummonCreature(MOB_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + + if (Spawned) + Spawned->AI()->AttackStart(target); + } + + //One claw tentacle every 12.5 seconds + ClawTentacleTimer = 12500; + }else ClawTentacleTimer -= diff; + + //EyeTentacleTimer + if (EyeTentacleTimer < diff) + { + //Spawn the 8 Eye Tentacles in the corret spots + SpawnEyeTentacle(0, 20); //south + SpawnEyeTentacle(10, 10); //south west + SpawnEyeTentacle(20, 0); //west + SpawnEyeTentacle(10, -10); //north west + + SpawnEyeTentacle(0, -20); //north + SpawnEyeTentacle(-10, -10); //north east + SpawnEyeTentacle(-20, 0); // east + SpawnEyeTentacle(-10, 10); // south east + + //No point actually putting a timer here since + //These shouldn't trigger agian until after phase shifts + EyeTentacleTimer = 45000; + }else EyeTentacleTimer -= diff; + + //PhaseTimer + if (PhaseTimer < diff) + { + //Switch to Dark Beam + pInst->SetData(DATA_CTHUN_PHASE, 1); + + m_creature->InterruptNonMeleeSpells(false); + + //Select random target for dark beam to start on + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (target) + { + //Correctly update our target + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID()); + + //Face our target + DarkGlareAngle = m_creature->GetAngle(target); + DarkGlareTickTimer = 1000; + DarkGlareTick = 0; + ClockWise = rand()%2; + } + + //Add red coloration to C'thun + DoCast(m_creature,SPELL_RED_COLORATION); + + //Freeze animation + + //Darkbeam for 35 seconds + PhaseTimer = 35000; + }else PhaseTimer -= diff; + + } + break; + case 1: + { + //EyeTentacleTimer + if (DarkGlareTick < 35) + if (DarkGlareTickTimer < diff) + { + //Remove any target + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + + //Set angle and cast + if (ClockWise) + m_creature->SetOrientation(DarkGlareAngle + ((float)DarkGlareTick*PI/35)); + else m_creature->SetOrientation(DarkGlareAngle - ((float)DarkGlareTick*PI/35)); + + m_creature->StopMoving(); + + //Actual dark glare cast, maybe something missing here? + m_creature->CastSpell(m_creature, SPELL_DARK_GLARE, false); + + //Increase tick + DarkGlareTick++; + + //1 second per tick + DarkGlareTickTimer = 1000; + }else DarkGlareTickTimer -= diff; + + //PhaseTimer + if (PhaseTimer < diff) + { + //Switch to Eye Beam + pInst->SetData(DATA_CTHUN_PHASE, 0); + + BeamTimer = 3000; + EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam + ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn durring Dark beam) + + m_creature->InterruptNonMeleeSpells(false); + + //Remove Red coloration from c'thun + m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); + + //Freeze animation + m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, 0); + + //Eye Beam for 50 seconds + PhaseTimer = 50000; + }else PhaseTimer -= diff; + }break; + + //Transition phase + case 2: + { + //Remove any target + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetHealth(0); + } + + //Dead phase + case 5: + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + } + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + //No instance + if (!pInst) + return; + + switch (pInst->GetData(DATA_CTHUN_PHASE)) + { + case 0: + case 1: + { + //Only if it will kill + if (damage < m_creature->GetHealth()) + return; + + //Fake death in phase 0 or 1 (green beam or dark glare phase) + m_creature->InterruptNonMeleeSpells(false); + + //Remove Red coloration from c'thun + m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); + + //Reset to normal emote state and prevent select and attack + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + //Remove Target field + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + + //Death animation/respawning; + pInst->SetData(DATA_CTHUN_PHASE, 2); + + m_creature->SetHealth(0); + damage = 0; + + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + } + break; + + case 5: + { + //Allow death here + return; + } + + default: + { + //Prevent death in this phase + damage = 0; + return; + } + break; + } + } +}; + +struct TRINITY_DLL_DECL cthunAI : public ScriptedAI +{ + cthunAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + + pInst = c->GetInstanceData(); + if (!pInst) + error_log("TSCR: No Instance eye_of_cthunAI"); + } + + ScriptedInstance* pInst; + + //Out of combat whisper timer + uint32 WisperTimer; + + //Global variables + uint32 PhaseTimer; + + //------------------- + + //Phase transition + uint64 HoldPlayer; + + //Body Phase + uint32 EyeTentacleTimer; + uint8 FleshTentaclesKilled; + uint32 GiantClawTentacleTimer; + uint32 GiantEyeTentacleTimer; + uint32 StomachAcidTimer; + uint32 StomachEnterTimer; + uint32 StomachEnterVisTimer; + uint64 StomachEnterTarget; + + //Stomach map, bool = true then in stomach + UNORDERED_MAP Stomach_Map; + + void Reset() + { + //One random wisper every 90 - 300 seconds + WisperTimer = 90000; + + //Phase information + PhaseTimer = 10000; //Emerge in 10 seconds + + //No hold player for transition + HoldPlayer = 0; + + //Body Phase + EyeTentacleTimer = 30000; + FleshTentaclesKilled = 0; + GiantClawTentacleTimer = 15000; //15 seconds into body phase (1 min repeat) + GiantEyeTentacleTimer = 45000; //15 seconds into body phase (1 min repeat) + StomachAcidTimer = 4000; //Every 4 seconds + StomachEnterTimer = 10000; //Every 10 seconds + StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer + StomachEnterTarget = 0; //Target to be teleported to stomach + + //Clear players in stomach and outside + Stomach_Map.clear(); + + //Reset flags + m_creature->RemoveAurasDueToSpell(SPELL_TRANSFORM); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + if (pInst) + pInst->SetData(DATA_CTHUN_PHASE, 0); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + } + + void SpawnEyeTentacle(float x, float y) + { + Creature* Spawned; + Spawned = me->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + if (Spawned) + { + Unit* target; + + target = SelectRandomNotStomach(); + + if (target) + Spawned->AI()->AttackStart(target); + } + } + + Unit* SelectRandomNotStomach() + { + if (Stomach_Map.empty()) + return NULL; + + UNORDERED_MAP::iterator i = Stomach_Map.begin(); + + std::list temp; + std::list::iterator j; + + //Get all players in map + while (i != Stomach_Map.end()) + { + //Check for valid player + Unit* pUnit = Unit::GetUnit(*m_creature, i->first); + + //Only units out of stomach + if (pUnit && i->second == false) + { + temp.push_back(pUnit); + } + ++i; + } + + if (temp.empty()) + return NULL; + + j = temp.begin(); + + //Get random but only if we have more than one unit on threat list + if (temp.size() > 1) + advance (i , rand() % (temp.size() - 1)); + + return (*j); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!UpdateVictim()) + { + //No target so we'll use this section to do our random wispers instance wide + //WisperTimer + if (WisperTimer < diff) + { + Map* pMap = m_creature->GetMap(); + if (!pMap->IsDungeon()) return; + + //Play random sound to the zone + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (!PlayerList.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr) + { + if (Player* pPlr = itr->getSource()) + pPlr->PlayDirectSound(RANDOM_SOUND_WHISPER,pPlr); + } + } + + //One random wisper every 90 - 300 seconds + WisperTimer = 90000 + (rand()% 210000); + }else WisperTimer -= diff; + + return; + } + + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + + //No instance + if (!pInst) + return; + + switch (pInst->GetData(DATA_CTHUN_PHASE)) + { + //Transition phase + case 2: + { + //PhaseTimer + if (PhaseTimer < diff) + { + //Switch + pInst->SetData(DATA_CTHUN_PHASE, 3); + + //Switch to c'thun model + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, SPELL_TRANSFORM, false); + m_creature->SetHealth(m_creature->GetMaxHealth()); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); + + //Emerging phase + //AttackStart(Unit::GetUnit(*m_creature, HoldpPlayer)); + DoZoneInCombat(); + + //Place all units in threat list on outside of stomach + Stomach_Map.clear(); + + std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); + for (; i != m_creature->getThreatManager().getThreatList().end(); ++i) + { + //Outside stomach + Stomach_Map[(*i)->getUnitGuid()] = false; + } + + //Spawn 2 flesh tentacles + FleshTentaclesKilled = 0; + + Creature* Spawned; + + //Spawn flesh tentacle + Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (!Spawned) + FleshTentaclesKilled++; + else + CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); + + //Spawn flesh tentacle + Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (!Spawned) + FleshTentaclesKilled++; + else + CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); + + PhaseTimer = 0; + }else PhaseTimer -= diff; + + }break; + + //Body Phase + case 3: + { + //Remove Target field + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + + //Weaken + if (FleshTentaclesKilled > 1) + { + pInst->SetData(DATA_CTHUN_PHASE, 4); + + DoScriptText(EMOTE_WEAKENED, m_creature); + PhaseTimer = 45000; + + DoCast(m_creature, SPELL_RED_COLORATION, true); + + UNORDERED_MAP::iterator i = Stomach_Map.begin(); + + //Kick all players out of stomach + while (i != Stomach_Map.end()) + { + //Check for valid player + Unit* pUnit = Unit::GetUnit(*m_creature, i->first); + + //Only move units in stomach + if (pUnit && i->second == true) + { + //Teleport each player out + DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6); + + //Cast knockback on them + DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true); + + //Remove the acid debuff + pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); + + i->second = false; + } + ++i; + } + + return; + } + + //Stomach acid + if (StomachAcidTimer < diff) + { + //Apply aura to all players in stomach + UNORDERED_MAP::iterator i = Stomach_Map.begin(); + + while (i != Stomach_Map.end()) + { + //Check for valid player + Unit* pUnit = Unit::GetUnit(*m_creature, i->first); + + //Only apply to units in stomach + if (pUnit && i->second == true) + { + //Cast digestive acid on them + DoCast(pUnit, SPELL_DIGESTIVE_ACID, true); + + //Check if player should be kicked from stomach + if (pUnit->IsWithinDist3d(KICK_X, KICK_Y, KICK_Z, 15.0f)) + { + //Teleport each player out + DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6); + + //Cast knockback on them + DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true); + + //Remove the acid debuff + pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); + + i->second = false; + } + } + ++i; + } + + StomachAcidTimer = 4000; + }else StomachAcidTimer -= diff; + + //Stomach Enter Timer + if (StomachEnterTimer < diff) + { + Unit* target = NULL; + target = SelectRandomNotStomach(); + + if (target) + { + //Set target in stomach + Stomach_Map[target->GetGUID()] = true; + target->InterruptNonMeleeSpells(false); + target->CastSpell(target, SPELL_MOUTH_TENTACLE, true, NULL, NULL, m_creature->GetGUID()); + StomachEnterTarget = target->GetGUID(); + StomachEnterVisTimer = 3800; + } + + StomachEnterTimer = 13800; + }else StomachEnterTimer -= diff; + + if (StomachEnterVisTimer && StomachEnterTarget) + if (StomachEnterVisTimer <= diff) + { + //Check for valid player + Unit* pUnit = Unit::GetUnit(*m_creature, StomachEnterTarget); + + if (pUnit) + { + DoTeleportPlayer(pUnit, STOMACH_X, STOMACH_Y, STOMACH_Z, STOMACH_O); + } + + StomachEnterTarget = 0; + StomachEnterVisTimer = 0; + }else StomachEnterVisTimer -= diff; + + //GientClawTentacleTimer + if (GiantClawTentacleTimer < diff) + { + Unit* target = NULL; + target = SelectRandomNotStomach(); + if (target) + { + Creature* Spawned = NULL; + + //Spawn claw tentacle on the random target + Spawned = me->SummonCreature(MOB_GIANT_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + + if (Spawned) + Spawned->AI()->AttackStart(target); + } + + //One giant claw tentacle every minute + GiantClawTentacleTimer = 60000; + }else GiantClawTentacleTimer -= diff; + + //GiantEyeTentacleTimer + if (GiantEyeTentacleTimer < diff) + { + Unit* target = NULL; + target = SelectRandomNotStomach(); + if (target) + { + + Creature* Spawned = NULL; + + //Spawn claw tentacle on the random target + Spawned = me->SummonCreature(MOB_GIANT_EYE_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); + + if (Spawned) + Spawned->AI()->AttackStart(target); + } + + //One giant eye tentacle every minute + GiantEyeTentacleTimer = 60000; + }else GiantEyeTentacleTimer -= diff; + + //EyeTentacleTimer + if (EyeTentacleTimer < diff) + { + //Spawn the 8 Eye Tentacles in the corret spots + SpawnEyeTentacle(0, 25); //south + SpawnEyeTentacle(12, 12); //south west + SpawnEyeTentacle(25, 0); //west + SpawnEyeTentacle(12, -12); //north west + + SpawnEyeTentacle(0, -25); //north + SpawnEyeTentacle(-12, -12); //north east + SpawnEyeTentacle(-25, 0); // east + SpawnEyeTentacle(-12, 12); // south east + + //These spawn at every 30 seconds + EyeTentacleTimer = 30000; + }else EyeTentacleTimer -= diff; + + }break; + + //Weakened state + case 4: + { + //PhaseTimer + if (PhaseTimer < diff) + { + //Switch + pInst->SetData(DATA_CTHUN_PHASE, 3); + + //Remove red coloration + m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); + + //Spawn 2 flesh tentacles + FleshTentaclesKilled = 0; + + Creature* Spawned; + + //Spawn flesh tentacle + Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (!Spawned) + FleshTentaclesKilled++; + else + CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); + + //Spawn flesh tentacle + Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (!Spawned) + FleshTentaclesKilled++; + else + CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); + + PhaseTimer = 0; + }else PhaseTimer -= diff; + } + } + } + + void JustDied(Unit* pKiller) + { + //Switch + if (pInst) + pInst->SetData(DATA_CTHUN_PHASE, 5); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + //No instance + if (!pInst) + return; + + switch (pInst->GetData(DATA_CTHUN_PHASE)) + { + case 3: + { + //Not weakened so reduce damage by 99% + if (damage / 99 > 0) damage/= 99; + else damage = 1; + + //Prevent death in non-weakened state + if (damage >= m_creature->GetHealth()) + damage = 0; + + return; + } + break; + + case 4: + { + //Weakened - takes normal damage + return; + } + + default: + damage = 0; + break; + } + } + + void FleshTentcleKilled() + { + FleshTentaclesKilled++; + } +}; + +struct TRINITY_DLL_DECL eye_tentacleAI : public ScriptedAI +{ + eye_tentacleAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + + if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + } + + uint32 MindflayTimer; + uint32 KillSelfTimer; + uint64 Portal; + + void JustDied(Unit* who) + { + if (Unit* p = Unit::GetUnit(*m_creature, Portal)) + p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + + void Reset() + { + //Mind flay half a second after we spawn + MindflayTimer = 500; + + //This prevents eyes from overlapping + KillSelfTimer = 35000; + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!UpdateVictim()) + return; + + //KillSelfTimer + if (KillSelfTimer < diff) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + + return; + }else KillSelfTimer -= diff; + + //MindflayTimer + if (MindflayTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target && !target->HasAura(SPELL_DIGESTIVE_ACID)) + DoCast(target,SPELL_MIND_FLAY); + + //Mindflay every 10 seconds + MindflayTimer = 10100; + }else MindflayTimer -= diff; + } +}; + +struct TRINITY_DLL_DECL claw_tentacleAI : public ScriptedAI +{ + claw_tentacleAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + + if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + } + + uint32 GroundRuptureTimer; + uint32 HamstringTimer; + uint32 EvadeTimer; + uint64 Portal; + + void JustDied(Unit* who) + { + if (Unit* p = Unit::GetUnit(*m_creature, Portal)) + p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + + void Reset() + { + //First rupture should happen half a second after we spawn + GroundRuptureTimer = 500; + HamstringTimer = 2000; + EvadeTimer = 5000; + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!UpdateVictim()) + return; + + //EvadeTimer + if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) + if (EvadeTimer < diff) + { + if (Unit* p = Unit::GetUnit(*m_creature, Portal)) + p->DealDamage(p, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + + //Dissapear and reappear at new position + m_creature->SetVisibility(VISIBILITY_OFF); + + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (!target) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + return; + } + + if (!target->HasAura(SPELL_DIGESTIVE_ACID)) + { + m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); + if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + + GroundRuptureTimer = 500; + HamstringTimer = 2000; + EvadeTimer = 5000; + AttackStart(target); + } + + m_creature->SetVisibility(VISIBILITY_ON); + + }else EvadeTimer -= diff; + + //GroundRuptureTimer + if (GroundRuptureTimer < diff) + { + DoCast(m_creature->getVictim(),SPELL_GROUND_RUPTURE); + GroundRuptureTimer = 30000; + }else GroundRuptureTimer -= diff; + + //HamstringTimer + if (HamstringTimer < diff) + { + DoCast(m_creature->getVictim(),SPELL_HAMSTRING); + HamstringTimer = 5000; + }else HamstringTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL giant_claw_tentacleAI : public ScriptedAI +{ + giant_claw_tentacleAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + + if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + } + + uint32 GroundRuptureTimer; + uint32 ThrashTimer; + uint32 HamstringTimer; + uint32 EvadeTimer; + uint64 Portal; + + void JustDied(Unit* who) + { + if (Unit* p = Unit::GetUnit(*m_creature, Portal)) + p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + + void Reset() + { + //First rupture should happen half a second after we spawn + GroundRuptureTimer = 500; + HamstringTimer = 2000; + ThrashTimer = 5000; + EvadeTimer = 5000; + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!UpdateVictim()) + return; + + //EvadeTimer + if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) + if (EvadeTimer < diff) + { + if (Unit* p = Unit::GetUnit(*m_creature, Portal)) + p->DealDamage(p, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + + //Dissapear and reappear at new position + m_creature->SetVisibility(VISIBILITY_OFF); + + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (!target) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + return; + } + + if (!target->HasAura(SPELL_DIGESTIVE_ACID)) + { + m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); + if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + + GroundRuptureTimer = 500; + HamstringTimer = 2000; + ThrashTimer = 5000; + EvadeTimer = 5000; + AttackStart(target); + } + + m_creature->SetVisibility(VISIBILITY_ON); + + }else EvadeTimer -= diff; + + //GroundRuptureTimer + if (GroundRuptureTimer < diff) + { + DoCast(m_creature->getVictim(),SPELL_GROUND_RUPTURE); + GroundRuptureTimer = 30000; + }else GroundRuptureTimer -= diff; + + //ThrashTimer + if (ThrashTimer < diff) + { + DoCast(m_creature->getVictim(),SPELL_THRASH); + ThrashTimer = 10000; + }else ThrashTimer -= diff; + + //HamstringTimer + if (HamstringTimer < diff) + { + DoCast(m_creature->getVictim(),SPELL_HAMSTRING); + HamstringTimer = 10000; + }else HamstringTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL giant_eye_tentacleAI : public ScriptedAI +{ + giant_eye_tentacleAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + + if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) + Portal = pPortal->GetGUID(); + } + + uint32 BeamTimer; + uint64 Portal; + + void JustDied(Unit* who) + { + if (Unit* p = Unit::GetUnit(*m_creature, Portal)) + p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + } + + void Reset() + { + //Green Beam half a second after we spawn + BeamTimer = 500; + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + //Check if we have a target + if (!UpdateVictim()) + return; + + //BeamTimer + if (BeamTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target && !target->HasAura(SPELL_DIGESTIVE_ACID)) + DoCast(target,SPELL_GREEN_BEAM); + + //Beam every 2 seconds + BeamTimer = 2100; + }else BeamTimer -= diff; + } +}; + +//Flesh tentacle functions +void flesh_tentacleAI::UpdateAI(const uint32 diff) +{ + //Check if we have a target + if (!UpdateVictim()) + return; + + if (Parent) + if (CheckTimer < diff) + { + Unit* pUnit = Unit::GetUnit(*m_creature, Parent); + + if (!pUnit || !pUnit->isAlive() || !pUnit->isInCombat()) + { + Parent = 0; + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); + return; + } + + CheckTimer = 1000; + }else CheckTimer -= diff; + + DoMeleeAttackIfReady(); +} + +void flesh_tentacleAI::JustDied(Unit* killer) +{ + if (!Parent) + { + error_log("TSCR: flesh_tentacle: No Parent variable"); + return; + } + + Creature* Cthun = Unit::GetCreature(*m_creature, Parent); + + if (Cthun) + CAST_AI(cthunAI, (Cthun->AI()))->FleshTentcleKilled(); + else error_log("TSCR: flesh_tentacle: No Cthun"); +} + +//GetAIs +CreatureAI* GetAI_eye_of_cthun(Creature* pCreature) +{ + return new eye_of_cthunAI (pCreature); +} + +CreatureAI* GetAI_cthun(Creature* pCreature) +{ + return new cthunAI (pCreature); +} + +CreatureAI* GetAI_eye_tentacle(Creature* pCreature) +{ + return new eye_tentacleAI (pCreature); +} + +CreatureAI* GetAI_claw_tentacle(Creature* pCreature) +{ + return new claw_tentacleAI (pCreature); +} + +CreatureAI* GetAI_giant_claw_tentacle(Creature* pCreature) +{ + return new giant_claw_tentacleAI (pCreature); +} + +CreatureAI* GetAI_giant_eye_tentacle(Creature* pCreature) +{ + return new giant_eye_tentacleAI (pCreature); +} + +CreatureAI* GetAI_flesh_tentacle(Creature* pCreature) +{ + return new flesh_tentacleAI (pCreature); +} + +void AddSC_boss_cthun() +{ + Script *newscript; + + //Eye + newscript = new Script; + newscript->Name="boss_eye_of_cthun"; + newscript->GetAI = &GetAI_eye_of_cthun; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_cthun"; + newscript->GetAI = &GetAI_cthun; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_eye_tentacle"; + newscript->GetAI = &GetAI_eye_tentacle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_claw_tentacle"; + newscript->GetAI = &GetAI_claw_tentacle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_giant_claw_tentacle"; + newscript->GetAI = &GetAI_giant_claw_tentacle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_giant_eye_tentacle"; + newscript->GetAI = &GetAI_giant_eye_tentacle; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_giant_flesh_tentacle"; + newscript->GetAI = &GetAI_flesh_tentacle; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp new file mode 100644 index 00000000000..6e5992556e3 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_fankriss.cpp @@ -0,0 +1,206 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Fankriss +SD%Complete: 100 +SDComment: sound not implemented +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SOUND_SENTENCE_YOU 8588 +#define SOUND_SERVE_TO 8589 +#define SOUND_LAWS 8590 +#define SOUND_TRESPASS 8591 +#define SOUND_WILL_BE 8592 + +#define SPELL_MORTAL_WOUND 28467 +#define SPELL_ROOT 28858 + +// Enrage for his spawns +#define SPELL_ENRAGE 28798 + +struct TRINITY_DLL_DECL boss_fankrissAI : public ScriptedAI +{ + boss_fankrissAI(Creature *c) : ScriptedAI(c) {} + + uint32 MortalWound_Timer; + uint32 SpawnHatchlings_Timer; + uint32 SpawnSpawns_Timer; + int Rand; + int RandX; + int RandY; + + Creature* Hatchling; + Creature* Spawn; + + void Reset() + { + MortalWound_Timer = 10000 + rand()%5000; + SpawnHatchlings_Timer = 6000 + rand()%6000; + SpawnSpawns_Timer = 15000 + rand()%30000; + } + + void SummonSpawn(Unit* victim) + { + if (!victim) + return; + + Rand = 10 + (rand()%10); + switch (rand()%2) + { + case 0: RandX = 0 - Rand; break; + case 1: RandX = 0 + Rand; break; + } + Rand = 0; + Rand = 10 + (rand()%10); + switch (rand()%2) + { + case 0: RandY = 0 - Rand; break; + case 1: RandY = 0 + Rand; break; + } + Rand = 0; + Spawn = DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); + if (Spawn) + (Spawn->AI())->AttackStart(victim); + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //MortalWound_Timer + if (MortalWound_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MORTAL_WOUND); + MortalWound_Timer = 10000 + rand()%10000; + }else MortalWound_Timer -= diff; + + //Summon 1-3 Spawns of Fankriss at random time. + if (SpawnSpawns_Timer < diff) + { + switch(rand()%3) + { + case 0: + SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + break; + case 1: + SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + break; + case 2: + SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); + break; + } + SpawnSpawns_Timer = 30000 + rand()%30000; + }else SpawnSpawns_Timer -= diff; + + // Teleporting Random Target to one of the three tunnels and spawn 4 hatchlings near the gamer. + //We will only telport if fankriss has more than 3% of hp so teleported gamers can always loot. + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 3) + { + if (SpawnHatchlings_Timer< diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + DoCast(target, SPELL_ROOT); + + if (DoGetThreat(target)) + DoModifyThreatPercent(target, -100); + + switch(rand()%3) + { + case 0: + DoTeleportPlayer(target, -8106.0142,1289.2900,-74.419533,5.112); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + break; + case 1: + DoTeleportPlayer(target, -7990.135354,1155.1907,-78.849319,2.608); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + break; + case 2: + DoTeleportPlayer(target,-8159.7753,1127.9064,-76.868660,0.675); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + if (Hatchling) + (Hatchling->AI())->AttackStart(target); + break; + } + } + SpawnHatchlings_Timer = 45000 + rand()%15000; + }else SpawnHatchlings_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_fankriss(Creature* pCreature) +{ + return new boss_fankrissAI (pCreature); +} + +void AddSC_boss_fankriss() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_fankriss"; + newscript->GetAI = &GetAI_boss_fankriss; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp new file mode 100644 index 00000000000..705e2275d33 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_huhuran.cpp @@ -0,0 +1,148 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Huhuran +SD%Complete: 100 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define EMOTE_GENERIC_FRENZY_KILL -1000001 +#define EMOTE_GENERIC_BERSERK -1000004 + +#define SPELL_FRENZY 26051 +#define SPELL_BERSERK 26068 +#define SPELL_POISONBOLT 26052 +#define SPELL_NOXIOUSPOISON 26053 +#define SPELL_WYVERNSTING 26180 +#define SPELL_ACIDSPIT 26050 + +struct TRINITY_DLL_DECL boss_huhuranAI : public ScriptedAI +{ + boss_huhuranAI(Creature *c) : ScriptedAI(c) {} + + uint32 Frenzy_Timer; + uint32 Wyvern_Timer; + uint32 Spit_Timer; + uint32 PoisonBolt_Timer; + uint32 NoxiousPoison_Timer; + uint32 FrenzyBack_Timer; + + bool Frenzy; + bool Berserk; + + void Reset() + { + Frenzy_Timer = 25000 + rand()%10000; + Wyvern_Timer = 18000 + rand()%10000; + Spit_Timer = 8000; + PoisonBolt_Timer = 4000; + NoxiousPoison_Timer = 10000 + rand()%10000; + FrenzyBack_Timer = 15000; + + Frenzy = false; + Berserk = false; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Frenzy_Timer + if (!Frenzy && Frenzy_Timer < diff) + { + DoCast(m_creature, SPELL_FRENZY); + DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); + Frenzy = true; + PoisonBolt_Timer = 3000; + Frenzy_Timer = 25000 + rand()%10000; + }else Frenzy_Timer -= diff; + + // Wyvern Timer + if (Wyvern_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_WYVERNSTING); + Wyvern_Timer = 15000 + rand()%17000; + }else Wyvern_Timer -= diff; + + //Spit Timer + if (Spit_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ACIDSPIT); + Spit_Timer = 5000 + rand()%5000; + }else Spit_Timer -= diff; + + //NoxiousPoison_Timer + if (NoxiousPoison_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_NOXIOUSPOISON); + NoxiousPoison_Timer = 12000 + rand()%12000; + }else NoxiousPoison_Timer -= diff; + + //PoisonBolt only if frenzy or berserk + if (Frenzy || Berserk) + { + if (PoisonBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_POISONBOLT); + PoisonBolt_Timer = 3000; + }else PoisonBolt_Timer -= diff; + } + + //FrenzyBack_Timer + if (Frenzy && FrenzyBack_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + Frenzy = false; + FrenzyBack_Timer = 15000; + }else FrenzyBack_Timer -= diff; + + if (!Berserk && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 31) + { + m_creature->InterruptNonMeleeSpells(false); + DoScriptText(EMOTE_GENERIC_BERSERK, m_creature); + DoCast(m_creature, SPELL_BERSERK); + Berserk = true; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_huhuran(Creature* pCreature) +{ + return new boss_huhuranAI (pCreature); +} + +void AddSC_boss_huhuran() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_huhuran"; + newscript->GetAI = &GetAI_boss_huhuran; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp new file mode 100644 index 00000000000..d7f6a186316 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_ouro.cpp @@ -0,0 +1,140 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ouro +SD%Complete: 85 +SDComment: No model for submerging. Currently just invisible. +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "def_temple_of_ahnqiraj.h" + +#define SPELL_SWEEP 26103 +#define SPELL_SANDBLAST 26102 +#define SPELL_GROUND_RUPTURE 26100 +#define SPELL_BIRTH 26262 //The Birth Animation + +#define SPELL_DIRTMOUND_PASSIVE 26092 + +struct TRINITY_DLL_DECL boss_ouroAI : public ScriptedAI +{ + boss_ouroAI(Creature *c) : ScriptedAI(c) {} + + uint32 Sweep_Timer; + uint32 SandBlast_Timer; + uint32 Submerge_Timer; + uint32 Back_Timer; + uint32 ChangeTarget_Timer; + uint32 Spawn_Timer; + + bool Enrage; + bool Submerged; + + void Reset() + { + Sweep_Timer = 5000 + rand()%5000; + SandBlast_Timer = 20000 + rand()%15000; + Submerge_Timer = 90000 + rand()%60000; + Back_Timer = 30000 + rand()%15000; + ChangeTarget_Timer = 5000 + rand()%3000; + Spawn_Timer = 10000 + rand()%10000; + + Enrage = false; + Submerged = false; + } + + void EnterCombat(Unit *who) + { + DoCast(m_creature->getVictim(), SPELL_BIRTH); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Sweep_Timer + if (!Submerged && Sweep_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SWEEP); + Sweep_Timer = 15000 + rand()%15000; + }else Sweep_Timer -= diff; + + //SandBlast_Timer + if (!Submerged && SandBlast_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SANDBLAST); + SandBlast_Timer = 20000 + rand()%15000; + }else SandBlast_Timer -= diff; + + //Submerge_Timer + if (!Submerged && Submerge_Timer < diff) + { + //Cast + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->setFaction(35); + DoCast(m_creature, SPELL_DIRTMOUND_PASSIVE); + + Submerged = true; + Back_Timer = 30000 + rand()%15000; + }else Submerge_Timer -= diff; + + //ChangeTarget_Timer + if (Submerged && ChangeTarget_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (target) + DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); + + ChangeTarget_Timer = 10000 + rand()%10000; + }else ChangeTarget_Timer -= diff; + + //Back_Timer + if (Submerged && Back_Timer < diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->setFaction(14); + + DoCast(m_creature->getVictim(), SPELL_GROUND_RUPTURE); + + Submerged = false; + Submerge_Timer = 60000 + rand()%60000; + }else Back_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ouro(Creature* pCreature) +{ + return new boss_ouroAI (pCreature); +} + +void AddSC_boss_ouro() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_ouro"; + newscript->GetAI = &GetAI_boss_ouro; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp new file mode 100644 index 00000000000..dd5aa9bae87 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_sartura.cpp @@ -0,0 +1,298 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Sartura +SD%Complete: 95 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1531008 +#define SAY_SLAY -1531009 +#define SAY_DEATH -1531010 + +#define SPELL_WHIRLWIND 26083 +#define SPELL_ENRAGE 28747 //Not sure if right ID. +#define SPELL_ENRAGEHARD 28798 + +//Guard Spell +#define SPELL_WHIRLWINDADD 26038 +#define SPELL_KNOCKBACK 26027 + + +struct TRINITY_DLL_DECL boss_sarturaAI : public ScriptedAI +{ + boss_sarturaAI(Creature *c) : ScriptedAI(c) {} + + uint32 WhirlWind_Timer; + uint32 WhirlWindRandom_Timer; + uint32 WhirlWindEnd_Timer; + uint32 AggroReset_Timer; + uint32 AggroResetEnd_Timer; + uint32 EnrageHard_Timer; + + bool Enraged; + bool EnragedHard; + bool WhirlWind; + bool AggroReset; + + void Reset() + { + WhirlWind_Timer = 30000; + WhirlWindRandom_Timer = 3000 + rand()%4000; + WhirlWindEnd_Timer = 15000; + AggroReset_Timer = 45000 + rand()%10000; + AggroResetEnd_Timer = 5000; + EnrageHard_Timer = 10*60000; + + WhirlWind = false; + AggroReset = false; + Enraged = false; + EnragedHard = false; + + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (WhirlWind) + { + if (WhirlWindRandom_Timer < diff) + { + //Attack random Gamers + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target, 1.0f); + m_creature->TauntApply(target); + AttackStart(target); + + WhirlWindRandom_Timer = 3000 + rand()%4000; + }else WhirlWindRandom_Timer -= diff; + + if (WhirlWindEnd_Timer < diff) + { + WhirlWind = false; + WhirlWind_Timer = 25000 + rand()%15000; + }else WhirlWindEnd_Timer -= diff; + } + + if (!WhirlWind) + { + if (WhirlWind_Timer < diff) + { + DoCast(m_creature, SPELL_WHIRLWIND); + WhirlWind = true; + WhirlWindEnd_Timer = 15000; + }else WhirlWind_Timer -= diff; + + if (AggroReset_Timer < diff) + { + //Attack random Gamers + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target, 1.0f); + m_creature->TauntApply(target); + AttackStart(target); + + AggroReset = true; + AggroReset_Timer = 2000 + rand()%3000; + }else AggroReset_Timer -= diff; + + if (AggroReset) + { + if (AggroResetEnd_Timer GetHealth()*100 / m_creature->GetMaxHealth() <= 20 && !m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(m_creature, SPELL_ENRAGE); + Enraged = true; + } + } + + //After 10 minutes hard enrage + if (!EnragedHard) + { + if (EnrageHard_Timer < diff) + { + DoCast(m_creature, SPELL_ENRAGEHARD); + EnragedHard = true; + } else EnrageHard_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } + } +}; + +struct TRINITY_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI +{ + mob_sartura_royal_guardAI(Creature *c) : ScriptedAI(c) {} + + uint32 WhirlWind_Timer; + uint32 WhirlWindRandom_Timer; + uint32 WhirlWindEnd_Timer; + uint32 AggroReset_Timer; + uint32 AggroResetEnd_Timer; + uint32 KnockBack_Timer; + + bool WhirlWind; + bool AggroReset; + + void Reset() + { + WhirlWind_Timer = 30000; + WhirlWindRandom_Timer = 3000 + rand()%4000; + WhirlWindEnd_Timer = 15000; + AggroReset_Timer = 45000 + rand()%10000; + AggroResetEnd_Timer = 5000; + KnockBack_Timer = 10000; + + WhirlWind = false; + AggroReset = false; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (!WhirlWind && WhirlWind_Timer < diff) + { + DoCast(m_creature, SPELL_WHIRLWINDADD); + WhirlWind = true; + WhirlWind_Timer = 25000 + rand()%15000; + WhirlWindEnd_Timer = 15000; + }else WhirlWind_Timer -= diff; + + if (WhirlWind) + { + if (WhirlWindRandom_Timer < diff) + { + //Attack random Gamers + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target, 1.0f); + m_creature->TauntApply(target); + AttackStart(target); + + WhirlWindRandom_Timer = 3000 + rand()%4000; + }else WhirlWindRandom_Timer -= diff; + + if (WhirlWindEnd_Timer < diff) + { + WhirlWind = false; + }else WhirlWindEnd_Timer -= diff; + } + + if (!WhirlWind) + { + if (AggroReset_Timer < diff) + { + //Attack random Gamers + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target) + m_creature->AddThreat(target, 1.0f); + m_creature->TauntApply(target); + AttackStart(target); + + AggroReset = true; + AggroReset_Timer = 2000 + rand()%3000; + }else AggroReset_Timer -= diff; + + if (KnockBack_Timer < diff) + { + DoCast(m_creature, SPELL_WHIRLWINDADD); + KnockBack_Timer = 10000 + rand()%10000; + }else KnockBack_Timer -= diff; + } + + if (AggroReset) + { + if (AggroResetEnd_Timer Name="boss_sartura"; + newscript->GetAI = &GetAI_boss_sartura; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_sartura_royal_guard"; + newscript->GetAI = &GetAI_mob_sartura_royal_guard; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp new file mode 100644 index 00000000000..780a0c28f22 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_skeram.cpp @@ -0,0 +1,316 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Skeram +SD%Complete: 75 +SDComment: Mind Control buggy. +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "def_temple_of_ahnqiraj.h" +#include "Group.h" + +#define SAY_AGGRO1 -1531000 +#define SAY_AGGRO2 -1531001 +#define SAY_AGGRO3 -1531002 +#define SAY_SLAY1 -1531003 +#define SAY_SLAY2 -1531004 +#define SAY_SLAY3 -1531005 +#define SAY_SPLIT -1531006 +#define SAY_DEATH -1531007 + +#define SPELL_ARCANE_EXPLOSION 25679 +#define SPELL_EARTH_SHOCK 26194 +#define SPELL_TRUE_FULFILLMENT4 26526 +#define SPELL_BLINK 28391 + +class ov_mycoordinates +{ + public: + float x,y,z,r; + ov_mycoordinates(float cx, float cy, float cz, float cr) + { + x = cx; y = cy; z = cz; r = cr; + } +}; + +struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI +{ + boss_skeramAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + IsImage = false; + } + + ScriptedInstance *pInstance; + + uint32 ArcaneExplosion_Timer; + uint32 EarthShock_Timer; + uint32 FullFillment_Timer; + uint32 Blink_Timer; + uint32 Invisible_Timer; + + Creature *Image1, *Image2; + + bool Images75; + bool Images50; + bool Images25; + bool IsImage; + bool Invisible; + + void Reset() + { + ArcaneExplosion_Timer = 6000 + rand()%6000; + EarthShock_Timer = 2000; + FullFillment_Timer = 15000; + Blink_Timer = 8000 + rand()%12000; + Invisible_Timer = 500; + + Images75 = false; + Images50 = false; + Images25 = false; + Invisible = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + + if (IsImage) + m_creature->setDeathState(JUST_DIED); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + if (!IsImage) + DoScriptText(SAY_DEATH, m_creature); + } + + void EnterCombat(Unit *who) + { + if (IsImage || Images75) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); + ArcaneExplosion_Timer = 8000 + rand()%10000; + }else ArcaneExplosion_Timer -= diff; + + //If we are within range melee the target + if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + //Make sure our attack is ready and we arn't currently casting + if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) + { + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + }else + { + //EarthShock_Timer + if (EarthShock_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_EARTH_SHOCK); + EarthShock_Timer = 1000; + }else EarthShock_Timer -= diff; + } + + //Blink_Timer + if (Blink_Timer < diff) + { + //DoCast(m_creature, SPELL_BLINK); + switch(rand()%3) + { + case 0: + m_creature->GetMap()->CreatureRelocation(m_creature, -8340.782227,2083.814453,125.648788,0.0f); + DoResetThreat(); + break; + case 1: + m_creature->GetMap()->CreatureRelocation(m_creature, -8341.546875,2118.504639,133.058151,0.0f); + DoResetThreat(); + break; + case 2: + m_creature->GetMap()->CreatureRelocation(m_creature, -8318.822266,2058.231201,133.058151,0.0f); + DoResetThreat(); + break; + } + DoStopAttack(); + + Blink_Timer= 20000 + rand()%20000; + }else Blink_Timer -= diff; + + int procent = (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5); + + //Summoning 2 Images and teleporting to a random position on 75% health + if ((!Images75 && !IsImage) && (procent <= 75 && procent > 70)) + DoSplit(75); + + //Summoning 2 Images and teleporting to a random position on 50% health + if ((!Images50 && !IsImage) && + (procent <= 50 && procent > 45)) + DoSplit(50); + + //Summoning 2 Images and teleporting to a random position on 25% health + if ((!Images25 && !IsImage) && (procent <= 25 && procent > 20)) + DoSplit(25); + + //Invisible_Timer + if (Invisible) + { + if (Invisible_Timer < diff) + { + //Making Skeram visible after telporting + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + Invisible_Timer = 2500; + Invisible = false; + }else Invisible_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } + + void DoSplit(int atPercent /* 75 50 25 */) + { + DoScriptText(SAY_SPLIT, m_creature); + + ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227,2083.814453,125.648788,0); + ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875,2118.504639,133.058151,0); + ov_mycoordinates *place3 = new ov_mycoordinates(-8318.822266,2058.231201,133.058151,0); + + ov_mycoordinates *bossc=place1, *i1=place2, *i2=place3; + + switch(rand()%3) + { + case 0: + bossc=place1; + i1=place2; + i2=place3; + break; + case 1: + bossc=place2; + i1=place1; + i2=place3; + break; + case 2: + bossc=place3; + i1=place1; + i2=place2; + break; + } + + for (int tryi = 0; tryi < 41; tryi ++) + { + Unit *targetpl = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (targetpl->GetTypeId() == TYPEID_PLAYER) + { + Group *grp = CAST_PLR(targetpl)->GetGroup(); + if (grp) + { + for (int ici = 0; ici < TARGETICONCOUNT; ++ici) + { + //if (grp ->m_targetIcons[ici] == m_creature->GetGUID()) -- private member:( + grp->SetTargetIcon(ici, 0); + } + } + break; + } + } + + m_creature->RemoveAllAuras(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->GetMap()->CreatureRelocation(m_creature, bossc->x, bossc->y, bossc->z, bossc->r); + Invisible = true; + delete place1; + delete place2; + delete place3; + DoResetThreat(); + DoStopAttack(); + + switch (atPercent) + { + case 75: Images75 = true; break; + case 50: Images50 = true; break; + case 25: Images25 = true; break; + } + + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + + Image1 = m_creature->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); + if (Image1) + { + Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5); + Image1->SetHealth(m_creature->GetHealth() / 5); + if (target) + Image1->AI()->AttackStart(target); + CAST_AI(boss_skeramAI, Image1->AI())->IsImage = true; + } + + Image2 = m_creature->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); + if (Image2) + { + Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5); + Image2->SetHealth(m_creature->GetHealth() / 5); + if (target) + Image2->AI()->AttackStart(target); + CAST_AI(boss_skeramAI, Image2->AI())->IsImage = true; + } + Invisible = true; + } + +}; + +CreatureAI* GetAI_boss_skeram(Creature* pCreature) +{ + return new boss_skeramAI (pCreature); +} + +void AddSC_boss_skeram() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_skeram"; + newscript->GetAI = &GetAI_boss_skeram; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp new file mode 100644 index 00000000000..fdc1b6ae408 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_twinemperors.cpp @@ -0,0 +1,618 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Twinemperors +SD%Complete: 95 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "def_temple_of_ahnqiraj.h" +#include "WorldPacket.h" + +#include "Item.h" +#include "Spell.h" + +#define SPELL_HEAL_BROTHER 7393 +#define SPELL_TWIN_TELEPORT 800 // CTRA watches for this spell to start its teleport timer +#define SPELL_TWIN_TELEPORT_VISUAL 26638 // visual + +#define SPELL_EXPLODEBUG 804 +#define SPELL_MUTATE_BUG 802 + +#define SOUND_VN_DEATH 8660 //8660 - Death - Feel +#define SOUND_VN_AGGRO 8661 //8661 - Aggro - Let none +#define SOUND_VN_KILL 8662 //8661 - Kill - your fate + +#define SOUND_VL_AGGRO 8657 //8657 - Aggro - To Late +#define SOUND_VL_KILL 8658 //8658 - Kill - You will not +#define SOUND_VL_DEATH 8659 //8659 - Death + +#define PULL_RANGE 50 +#define ABUSE_BUG_RANGE 20 +#define SPELL_BERSERK 26662 +#define TELEPORTTIME 30000 + +#define SPELL_UPPERCUT 26007 +#define SPELL_UNBALANCING_STRIKE 26613 + +#define VEKLOR_DIST 20 // VL will not come to melee when attacking + +#define SPELL_SHADOWBOLT 26006 +#define SPELL_BLIZZARD 26607 +#define SPELL_ARCANEBURST 568 + +struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI +{ + ScriptedInstance *pInstance; + uint32 Heal_Timer; + uint32 Teleport_Timer; + bool AfterTeleport; + uint32 AfterTeleportTimer; + bool DontYellWhenDead; + uint32 Abuse_Bug_Timer, BugsTimer; + bool tspellcasted; + uint32 EnrageTimer; + + virtual bool IAmVeklor() = 0; + virtual void Reset() = 0; + virtual void CastSpellOnBug(Creature *target) = 0; + + boss_twinemperorsAI(Creature *c): ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + void TwinReset() + { + Heal_Timer = 0; // first heal immediately when they get close together + Teleport_Timer = TELEPORTTIME; + AfterTeleport = false; + tspellcasted = false; + AfterTeleportTimer = 0; + Abuse_Bug_Timer = 10000 + rand()%7000; + BugsTimer = 2000; + m_creature->clearUnitState(UNIT_STAT_STUNNED); + DontYellWhenDead = false; + EnrageTimer = 15*60000; + } + + Creature *GetOtherBoss() + { + if (pInstance) + { + return Unit::GetCreature(*m_creature, pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR)); + } + else + { + return NULL; + } + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + Unit *pOtherBoss = GetOtherBoss(); + if (pOtherBoss) + { + float dPercent = ((float)damage) / ((float)m_creature->GetMaxHealth()); + int odmg = (int)(dPercent * ((float)pOtherBoss->GetMaxHealth())); + int ohealth = pOtherBoss->GetHealth()-odmg; + pOtherBoss->SetHealth(ohealth > 0 ? ohealth : 0); + if (ohealth <= 0) + { + pOtherBoss->setDeathState(JUST_DIED); + pOtherBoss->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + } + } + + void JustDied(Unit* Killer) + { + Creature *pOtherBoss = GetOtherBoss(); + if (pOtherBoss) + { + pOtherBoss->SetHealth(0); + pOtherBoss->setDeathState(JUST_DIED); + pOtherBoss->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->DontYellWhenDead = true; + } + if (!DontYellWhenDead) // I hope AI is not threaded + DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_DEATH : SOUND_VN_DEATH); + } + + void KilledUnit(Unit* victim) + { + DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_KILL : SOUND_VN_KILL); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + Creature *pOtherBoss = GetOtherBoss(); + if (pOtherBoss) + { + // TODO: we should activate the other boss location so he can start attackning even if nobody + // is near I dont know how to do that + ScriptedAI *otherAI = CAST_AI(ScriptedAI, pOtherBoss->AI()); + if (!pOtherBoss->isInCombat()) + { + DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO); + otherAI->AttackStart(who); + otherAI->DoZoneInCombat(); + } + } + } + + void SpellHit(Unit *caster, const SpellEntry *entry) + { + if (caster == m_creature) + return; + + Creature *pOtherBoss = GetOtherBoss(); + if (entry->Id != SPELL_HEAL_BROTHER || !pOtherBoss) + return; + + // add health so we keep same percentage for both brothers + uint32 mytotal = m_creature->GetMaxHealth(), histotal = pOtherBoss->GetMaxHealth(); + float mult = ((float)mytotal) / ((float)histotal); + if (mult < 1) + mult = 1.0f/mult; + #define HEAL_BROTHER_AMOUNT 30000.0f + uint32 largerAmount = (uint32)((HEAL_BROTHER_AMOUNT * mult) - HEAL_BROTHER_AMOUNT); + + uint32 myh = m_creature->GetHealth(); + uint32 hish = pOtherBoss->GetHealth(); + if (mytotal > histotal) + { + uint32 h = m_creature->GetHealth()+largerAmount; + m_creature->SetHealth(std::min(mytotal, h)); + } + else + { + uint32 h = pOtherBoss->GetHealth()+largerAmount; + pOtherBoss->SetHealth(std::min(histotal, h)); + } + } + + void TryHealBrother(uint32 diff) + { + if (IAmVeklor()) // this spell heals caster and the other brother so let VN cast it + return; + + if (Heal_Timer < diff) + { + Unit *pOtherBoss = GetOtherBoss(); + if (pOtherBoss && pOtherBoss->IsWithinDist(m_creature,60)) + { + DoCast(pOtherBoss, SPELL_HEAL_BROTHER); + Heal_Timer = 1000; + } + } else Heal_Timer -= diff; + } + + void TeleportToMyBrother() + { + if (!pInstance) + return; + + Teleport_Timer = TELEPORTTIME; + + if (IAmVeklor()) + return; // mechanics handled by veknilash so they teleport exactly at the same time and to correct coordinates + + Creature *pOtherBoss = GetOtherBoss(); + if (pOtherBoss) + { + //m_creature->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0); + float other_x = pOtherBoss->GetPositionX(); + float other_y = pOtherBoss->GetPositionY(); + float other_z = pOtherBoss->GetPositionZ(); + float other_o = pOtherBoss->GetOrientation(); + + Map *thismap = m_creature->GetMap(); + thismap->CreatureRelocation(pOtherBoss, m_creature->GetPositionX(), + m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation()); + thismap->CreatureRelocation(m_creature, other_x, other_y, other_z, other_o); + + SetAfterTeleport(); + CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->SetAfterTeleport(); + } + } + + void SetAfterTeleport() + { + m_creature->InterruptNonMeleeSpells(false); + DoStopAttack(); + DoResetThreat(); + DoCast(m_creature, SPELL_TWIN_TELEPORT_VISUAL); + m_creature->addUnitState(UNIT_STAT_STUNNED); + AfterTeleport = true; + AfterTeleportTimer = 2000; + tspellcasted = false; + } + + bool TryActivateAfterTTelep(uint32 diff) + { + if (AfterTeleport) + { + if (!tspellcasted) + { + m_creature->clearUnitState(UNIT_STAT_STUNNED); + DoCast(m_creature, SPELL_TWIN_TELEPORT); + m_creature->addUnitState(UNIT_STAT_STUNNED); + } + + tspellcasted = true; + + if (AfterTeleportTimer < diff) + { + AfterTeleport = false; + m_creature->clearUnitState(UNIT_STAT_STUNNED); + Unit *nearu = m_creature->SelectNearestTarget(100); + //DoYell(nearu->GetName(), LANG_UNIVERSAL, 0); + if (nearu) + { + AttackStart(nearu); + m_creature->getThreatManager().addThreat(nearu, 10000); + } + return true; + } + else + { + AfterTeleportTimer -= diff; + // update important timers which would otherwise get skipped + if (EnrageTimer > diff) + EnrageTimer -= diff; + else + EnrageTimer = 0; + if (Teleport_Timer > diff) + Teleport_Timer -= diff; + else + Teleport_Timer = 0; + return false; + } + } + else + { + return true; + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (attackRadius < PULL_RANGE) + attackRadius = PULL_RANGE; + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= /*CREATURE_Z_ATTACK_RANGE*/7 /*there are stairs*/) + { + //if (who->HasStealthAura()) + // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + } + + Creature *RespawnNearbyBugsAndGetOne() + { + std::list lUnitList; + m_creature->GetCreatureListWithEntryInGrid(lUnitList,15316,150.0f); + m_creature->GetCreatureListWithEntryInGrid(lUnitList,15317,150.0f); + + if (lUnitList.empty()) + return NULL; + + Creature *nearb = NULL; + + for(std::list::iterator iter = lUnitList.begin(); iter != lUnitList.end(); ++iter) + { + Creature *c = *iter; + if (c) + { + if (c->isDead()) + { + c->Respawn(); + c->setFaction(7); + c->RemoveAllAuras(); + } + if (c->IsWithinDistInMap(m_creature, ABUSE_BUG_RANGE)) + { + if (!nearb || (rand()%4) == 0) + nearb = c; + } + } + } + return nearb; + } + + void HandleBugs(uint32 diff) + { + if (BugsTimer < diff || Abuse_Bug_Timer < diff) + { + Creature *c = RespawnNearbyBugsAndGetOne(); + if (Abuse_Bug_Timer < diff) + { + if (c) + { + CastSpellOnBug(c); + Abuse_Bug_Timer = 10000 + rand()%7000; + } + else + { + Abuse_Bug_Timer = 1000; + } + } + else + { + Abuse_Bug_Timer -= diff; + } + BugsTimer = 2000; + } + else + { + BugsTimer -= diff; + Abuse_Bug_Timer -= diff; + } + } + + void CheckEnrage(uint32 diff) + { + if (EnrageTimer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(true)) + { + DoCast(m_creature, SPELL_BERSERK); + EnrageTimer = 60*60000; + } else EnrageTimer = 0; + } else EnrageTimer-=diff; + } +}; + +struct TRINITY_DLL_DECL boss_veknilashAI : public boss_twinemperorsAI +{ + bool IAmVeklor() {return false;} + boss_veknilashAI(Creature *c) : boss_twinemperorsAI(c) {} + + uint32 UpperCut_Timer; + uint32 UnbalancingStrike_Timer; + uint32 Scarabs_Timer; + int Rand; + int RandX; + int RandY; + + Creature* Summoned; + + void Reset() + { + TwinReset(); + UpperCut_Timer = 14000 + rand()%15000; + UnbalancingStrike_Timer = 8000 + rand()%10000; + Scarabs_Timer = 7000 + rand()%7000; + + //Added. Can be removed if its included in DB. + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); + } + + void CastSpellOnBug(Creature *target) + { + target->setFaction(14); + (target->AI())->AttackStart(m_creature->getThreatManager().getHostilTarget()); + SpellEntry *spell = GET_SPELL(SPELL_MUTATE_BUG); + uint8 eff_mask=0; + for (int i=0; i<3; ++i) + { + if (!spell->Effect[i]) + continue; + eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, target, target)); + target->SetHealth(target->GetMaxHealth()); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (!TryActivateAfterTTelep(diff)) + return; + + //UnbalancingStrike_Timer + if (UnbalancingStrike_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_UNBALANCING_STRIKE); + UnbalancingStrike_Timer = 8000+rand()%12000; + }else UnbalancingStrike_Timer -= diff; + + if (UpperCut_Timer < diff) + { + Unit* randomMelee = SelectTarget(SELECT_TARGET_RANDOM, 0, NOMINAL_MELEE_RANGE, true); + if (randomMelee) + DoCast(randomMelee,SPELL_UPPERCUT); + UpperCut_Timer = 15000+rand()%15000; + }else UpperCut_Timer -= diff; + + HandleBugs(diff); + + //Heal brother when 60yrds close + TryHealBrother(diff); + + //Teleporting to brother + if (Teleport_Timer < diff) + { + TeleportToMyBrother(); + }else Teleport_Timer -= diff; + + CheckEnrage(diff); + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_veklorAI : public boss_twinemperorsAI +{ + bool IAmVeklor() {return true;} + boss_veklorAI(Creature *c) : boss_twinemperorsAI(c) {} + + uint32 ShadowBolt_Timer; + uint32 Blizzard_Timer; + uint32 ArcaneBurst_Timer; + uint32 Scorpions_Timer; + int Rand; + int RandX; + int RandY; + + Creature* Summoned; + + void Reset() + { + TwinReset(); + ShadowBolt_Timer = 0; + Blizzard_Timer = 15000 + rand()%5000;; + ArcaneBurst_Timer = 1000; + Scorpions_Timer = 7000 + rand()%7000; + + //Added. Can be removed if its included in DB. + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 0); + m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0); + } + + void CastSpellOnBug(Creature *target) + { + target->setFaction(14); + SpellEntry *spell = GET_SPELL(SPELL_EXPLODEBUG); + uint8 eff_mask=0; + for (int i=0; i<3; ++i) + { + if (!spell->Effect[i]) + continue; + eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, target, target)); + target->SetHealth(target->GetMaxHealth()); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + // reset arcane burst after teleport - we need to do this because + // when VL jumps to VN's location there will be a warrior who will get only 2s to run away + // which is almost impossible + if (AfterTeleport) + ArcaneBurst_Timer = 5000; + if (!TryActivateAfterTTelep(diff)) + return; + + //ShadowBolt_Timer + if (ShadowBolt_Timer < diff) + { + if (!m_creature->IsWithinDist(m_creature->getVictim(), 45.0f)) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), VEKLOR_DIST, 0); + else + DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT); + ShadowBolt_Timer = 2000; + }else ShadowBolt_Timer -= diff; + + //Blizzard_Timer + if (Blizzard_Timer < diff) + { + Unit* target = NULL; + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45, true); + if (target) + DoCast(target,SPELL_BLIZZARD); + Blizzard_Timer = 15000+rand()%15000; + }else Blizzard_Timer -= diff; + + if (ArcaneBurst_Timer < diff) + { + Unit *mvic; + if ((mvic=SelectTarget(SELECT_TARGET_NEAREST, 0, NOMINAL_MELEE_RANGE, true))!=NULL) + { + DoCast(mvic,SPELL_ARCANEBURST); + ArcaneBurst_Timer = 5000; + } + }else ArcaneBurst_Timer -= diff; + + HandleBugs(diff); + + //Heal brother when 60yrds close + TryHealBrother(diff); + + //Teleporting to brother + if (Teleport_Timer < diff) + { + TeleportToMyBrother(); + }else Teleport_Timer -= diff; + + CheckEnrage(diff); + + //VL doesn't melee + //DoMeleeAttackIfReady(); + } + + void AttackStart(Unit* who) + { + if (!who) + return; + + if (who->isTargetableForAttack()) + { + // VL doesn't melee + if (m_creature->Attack(who, false)) + { + m_creature->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0); + m_creature->AddThreat(who, 0.0f); + } + } + } +}; + +CreatureAI* GetAI_boss_veknilash(Creature* pCreature) +{ + return new boss_veknilashAI (pCreature); +} + +CreatureAI* GetAI_boss_veklor(Creature* pCreature) +{ + return new boss_veklorAI (pCreature); +} + +void AddSC_boss_twinemperors() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_veknilash"; + newscript->GetAI = &GetAI_boss_veknilash; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_veklor"; + newscript->GetAI = &GetAI_boss_veklor; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp new file mode 100644 index 00000000000..2bb9f1bfb0b --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/boss_viscidus.cpp @@ -0,0 +1,30 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Viscidus +SD%Complete: 0 +SDComment: place holder +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_POISON_SHOCK 25993 +#define SPELL_POISONBOLT_VOLLEY 25991 + +#define SPELL_TOXIN_CLOUD 25989 + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h new file mode 100644 index 00000000000..5d545ed7c74 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h @@ -0,0 +1,23 @@ +/* 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_TEMPLE_OF_AHNQIRAJ_H +#define DEF_TEMPLE_OF_AHNQIRAJ_H + +#define DATA_SKERAM 1 +#define DATA_KRI 2 +#define DATA_VEM 3 +#define DATA_VEMISDEAD 4 +#define DATA_VEM_DEATH 5 +#define DATA_VEKLOR 6 +#define DATA_VEKLORISDEAD 7 +#define DATA_VEKLOR_DEATH 8 +#define DATA_VEKNILASH 9 +#define DATA_VEKNILASHISDEAD 10 +#define DATA_VEKNILASH_DEATH 11 +#define DATA_BUG_TRIO_DEATH 14 + +#define DATA_CTHUN_PHASE 20 +#endif + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp new file mode 100644 index 00000000000..489a415cf81 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp @@ -0,0 +1,166 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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_Temple_of_Ahnqiraj +SD%Complete: 80 +SDComment: +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "def_temple_of_ahnqiraj.h" + +struct TRINITY_DLL_DECL instance_temple_of_ahnqiraj : public ScriptedInstance +{ + instance_temple_of_ahnqiraj(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + //If Vem is dead... + bool IsBossDied[3]; + + //Storing Skeram, Vem and Kri. + uint64 SkeramGUID; + uint64 VemGUID; + uint64 KriGUID; + uint64 VeklorGUID; + uint64 VeknilashGUID; + + uint32 BugTrioDeathCount; + + uint32 CthunPhase; + + void Initialize() + { + IsBossDied[0] = false; + IsBossDied[1] = false; + IsBossDied[2] = false; + + SkeramGUID = 0; + VemGUID = 0; + KriGUID = 0; + VeklorGUID = 0; + VeknilashGUID = 0; + + BugTrioDeathCount = 0; + + CthunPhase = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch (pCreature->GetEntry()) + { + case 15263: SkeramGUID = pCreature->GetGUID(); break; + case 15544: VemGUID = pCreature->GetGUID(); break; + case 15511: KriGUID = pCreature->GetGUID(); break; + case 15276: VeklorGUID = pCreature->GetGUID(); break; + case 15275: VeknilashGUID = pCreature->GetGUID(); break; + } + } + + bool IsEncounterInProgress() const + { + //not active in AQ40 + return false; + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_VEMISDEAD: + if (IsBossDied[0]) + return 1; + break; + + case DATA_VEKLORISDEAD: + if (IsBossDied[1]) + return 1; + break; + + case DATA_VEKNILASHISDEAD: + if (IsBossDied[2]) + return 1; + break; + + case DATA_BUG_TRIO_DEATH: + return BugTrioDeathCount; + + case DATA_CTHUN_PHASE: + return CthunPhase; + } + return 0; + } + + uint64 GetData64 (uint32 identifier) + { + switch(identifier) + { + case DATA_SKERAM: + return SkeramGUID; + case DATA_VEM: + return VemGUID; + case DATA_KRI: + return KriGUID; + case DATA_VEKLOR: + return VeklorGUID; + case DATA_VEKNILASH: + return VeknilashGUID; + } + return 0; + } // end GetData64 + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_VEM_DEATH: + IsBossDied[0] = true; + break; + + case DATA_BUG_TRIO_DEATH: + BugTrioDeathCount++; + break; + + case DATA_VEKLOR_DEATH: + IsBossDied[1] = true; + break; + + case DATA_VEKNILASH_DEATH: + IsBossDied[2] = true; + break; + + case DATA_CTHUN_PHASE: + CthunPhase = data; + break; + } + } +}; + +InstanceData* GetInstanceData_instance_temple_of_ahnqiraj(Map* pMap) +{ + return new instance_temple_of_ahnqiraj(pMap); +} + +void AddSC_instance_temple_of_ahnqiraj() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_temple_of_ahnqiraj"; + newscript->GetInstanceData = &GetInstanceData_instance_temple_of_ahnqiraj; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp new file mode 100644 index 00000000000..35882b86ac7 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp @@ -0,0 +1,318 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: mob_anubisath_sentinel +SD%Complete: 95 +SDComment: Shadow storm is not properly implemented in core it should only target ppl outside of melee range. +SDCategory: Temple of Ahn'Qiraj +EndScriptData */ + +#include "precompiled.h" +#include "WorldPacket.h" + +#include "Item.h" +#include "Player.h" +#include "Spell.h" + +#include "Cell.h" +#include "CellImpl.h" +#include "GridNotifiers.h" +#include "GridNotifiersImpl.h" + +#define SPELL_MENDING_BUFF 2147 + +#define SPELL_KNOCK_BUFF 21737 +#define SPELL_KNOCK 25778 +#define SPELL_MANAB_BUFF 812 +#define SPELL_MANAB 25779 + +#define SPELL_REFLECTAF_BUFF 13022 +#define SPELL_REFLECTSFr_BUFF 19595 +#define SPELL_THORNS_BUFF 25777 + +#define SPELL_THUNDER_BUFF 2834 +#define SPELL_THUNDER 8732 + +#define SPELL_MSTRIKE_BUFF 9347 +#define SPELL_MSTRIKE 24573 + +#define SPELL_STORM_BUFF 2148 +#define SPELL_STORM 26546 + +struct TRINITY_DLL_DECL aqsentinelAI; +class TRINITY_DLL_DECL SentinelAbilityAura : public Aura +{ + public: + ~SentinelAbilityAura(); + Unit* GetTriggerTarget() const; + SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry *spell, uint32 ability, uint32 eff); + protected: + aqsentinelAI *aOwner; + int32 currentBasePoints; + uint32 abilityId; +}; + +struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI +{ + uint32 ability; + int abselected; + + void selectAbility(int asel) + { + switch (asel) + { + case 0: ability = SPELL_MENDING_BUFF;break; + case 1: ability = SPELL_KNOCK_BUFF;break; + case 2: ability = SPELL_MANAB_BUFF;break; + case 3: ability = SPELL_REFLECTAF_BUFF;break; + case 4: ability = SPELL_REFLECTSFr_BUFF;break; + case 5: ability = SPELL_THORNS_BUFF;break; + case 6: ability = SPELL_THUNDER_BUFF;break; + case 7: ability = SPELL_MSTRIKE_BUFF;break; + case 8: ability = SPELL_STORM_BUFF;break; + } + } + + aqsentinelAI(Creature *c) : ScriptedAI(c) + { + ClearBudyList(); + abselected = 0; // just initialization of variable + } + + Creature *nearby[3]; + + void ClearBudyList() + { + nearby[0] = nearby[1] = nearby[2] = NULL; + } + + void AddBuddyToList(Creature *c) + { + if (c==m_creature) + return; + for (int i=0; i<3; ++i) + { + if (nearby[i] == c) + return; + if (!nearby[i]) + { + nearby[i] = c; + return; + } + } + } + + void GiveBuddyMyList(Creature *c) + { + aqsentinelAI *cai = CAST_AI(aqsentinelAI, (c)->AI()); + for (int i=0; i<3; ++i) + if (nearby[i] && nearby[i]!=c) + cai->AddBuddyToList(nearby[i]); + cai->AddBuddyToList(m_creature); + } + + void SendMyListToBuddies() + { + for (int i=0; i<3; ++i) + if (nearby[i]) + GiveBuddyMyList(nearby[i]); + } + + void CallBuddiesToAttack(Unit *who) + { + for (int i=0; i<3; ++i) + { + Creature *c = nearby[i]; + if (c) + { + if (!c->isInCombat()) + { + c->SetNoCallAssistance(true); + if (c->AI()) + c->AI()->AttackStart(who); + } + } + } + } + + void AddSentinelsNear(Unit *nears) + { + std::list assistList; + m_creature->GetCreatureListWithEntryInGrid(assistList,15264,70.0f); + + if (assistList.empty()) + return; + + for(std::list::iterator iter = assistList.begin(); iter != assistList.end(); ++iter) + AddBuddyToList((*iter)); + } + + int pickAbilityRandom(bool *chosenAbilities) + { + for (int t = 0; t < 2; ++t) + { + for (int i = !t ? (rand()%9) : 0; i < 9; ++i) + { + if (!chosenAbilities[i]) + { + chosenAbilities[i] = true; + return i; + } + } + } + return 0; // should never happen + } + + void GetOtherSentinels(Unit *who) + { + bool *chosenAbilities = new bool[9]; + memset(chosenAbilities, 0, 9*sizeof(bool)); + selectAbility(pickAbilityRandom(chosenAbilities)); + + ClearBudyList(); + AddSentinelsNear(m_creature); + int bli; + for (bli = 0; bli < 3; ++bli) + { + if (!nearby[bli]) + break; + AddSentinelsNear(nearby[bli]); + CAST_AI(aqsentinelAI, nearby[bli]->AI())->gatherOthersWhenAggro = false; + CAST_AI(aqsentinelAI, nearby[bli]->AI())->selectAbility(pickAbilityRandom(chosenAbilities)); + } + /*if (bli < 3) + DoYell("I dont have enough buddies.", LANG_NEUTRAL, 0);*/ + SendMyListToBuddies(); + CallBuddiesToAttack(who); + + delete[] chosenAbilities; + } + + bool gatherOthersWhenAggro; + + void Reset() + { + if (!m_creature->isDead()) + { + for (int i=0; i<3; ++i) + { + if (!nearby[i]) + continue; + if (nearby[i]->isDead()) + nearby[i]->Respawn(); + } + } + ClearBudyList(); + gatherOthersWhenAggro = true; + } + + void GainSentinelAbility(uint32 id) + { + const SpellEntry *spell = GetSpellStore()->LookupEntry(id); + uint8 eff_mask=0; + for (int i=0; i<3; ++i) + { + if (!spell->Effect[i]) + continue; + eff_mask=1<AddAura(a); + } + + void EnterCombat(Unit *who) + { + if (gatherOthersWhenAggro) + GetOtherSentinels(who); + + GainSentinelAbility(ability); + DoZoneInCombat(); + } + + void JustDied(Unit* who) + { + for (int ni=0; ni<3; ++ni) + { + Creature *sent = nearby[ni]; + if (!sent) + continue; + if (sent->isDead()) + continue; + int h = sent->GetHealth() + (sent->GetMaxHealth() / 2); + if (h > sent->GetMaxHealth()) + h = sent->GetMaxHealth(); + sent->SetHealth(h); + CAST_AI(aqsentinelAI, sent->AI())->GainSentinelAbility(ability); + } + } + + Unit *GetHatedManaUser() + { + std::list::iterator i; + for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit->getPowerType()==POWER_MANA) + return pUnit; + } + return NULL; + } +}; +CreatureAI* GetAI_mob_anubisath_sentinelAI(Creature* pCreature) +{ + return new aqsentinelAI (pCreature); +} + +void AddSC_mob_anubisath_sentinel() +{ + Script *newscript; + newscript = new Script; + newscript->Name="mob_anubisath_sentinel"; + newscript->GetAI = &GetAI_mob_anubisath_sentinelAI; + newscript->RegisterSelf(); +} + +SentinelAbilityAura::~SentinelAbilityAura() {} +Unit* SentinelAbilityAura::GetTriggerTarget() const +{ + switch (abilityId) + { + case SPELL_KNOCK_BUFF: + case SPELL_THUNDER_BUFF: + case SPELL_MSTRIKE_BUFF: + case SPELL_STORM_BUFF: + return aOwner->m_creature->getVictim(); + + case SPELL_MANAB_BUFF: + return aOwner->GetHatedManaUser(); + + case SPELL_MENDING_BUFF: + case SPELL_REFLECTAF_BUFF: + case SPELL_REFLECTSFr_BUFF: + case SPELL_THORNS_BUFF: + default: + return aOwner->m_creature; + } +} + +SentinelAbilityAura::SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry *spell, uint32 ability, uint32 eff) +: Aura(spell, eff, NULL, abilityOwner->m_creature, abilityOwner->m_creature, NULL) +{ + aOwner = abilityOwner; + abilityId = ability; +} + diff --git a/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp b/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp new file mode 100644 index 00000000000..426b7fa2217 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp @@ -0,0 +1,210 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Ungoro Crater +SD%Complete: 100 +SDComment: Support for Quest: 4245 +SDCategory: Ungoro Crater +EndScriptData */ + +/* ContentData +npc_a-me +EndContentData */ + +#include "precompiled.h" +#include "escortAI.h" + +#define SAY_READY -1000200 +#define SAY_AGGRO1 -1000201 +#define SAY_SEARCH -1000202 +#define SAY_AGGRO2 -1000203 +#define SAY_AGGRO3 -1000204 +#define SAY_FINISH -1000205 + +#define SPELL_DEMORALIZINGSHOUT 13730 + +#define QUEST_CHASING_AME 4245 +#define ENTRY_TARLORD 6519 +#define ENTRY_TARLORD1 6519 +#define ENTRY_STOMPER 6513 + + +struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI +{ + npc_ameAI(Creature *c) : npc_escortAI(c) {} + + uint32 DEMORALIZINGSHOUT_Timer; + + void WaypointReached(uint32 i) + { + Player* pPlayer = Unit::GetPlayer(PlayerGUID); + + if (!pPlayer) + return; + + switch (i) + { + + case 19: + m_creature->SummonCreature(ENTRY_STOMPER, -6391.69, -1730.49, -272.83, 4.96, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_AGGRO1, m_creature, pPlayer); + break; + case 28: + DoScriptText(SAY_SEARCH, m_creature, pPlayer); + break; + case 38: + m_creature->SummonCreature(ENTRY_TARLORD, -6370.75, -1382.84, -270.51, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_AGGRO2, m_creature, pPlayer); + break; + case 49: + m_creature->SummonCreature(ENTRY_TARLORD1, -6324.44, -1181.05, -270.17, 4.34, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + DoScriptText(SAY_AGGRO3, m_creature, pPlayer); + break; + case 55: + DoScriptText(SAY_FINISH, m_creature, pPlayer); + if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_CHASING_AME,m_creature); + break; + + } + } + + void Reset() + { + DEMORALIZINGSHOUT_Timer = 5000; + } + + void EnterCombat(Unit* who) + {} + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void JustDied(Unit* killer) + { + if (PlayerGUID) + { + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + CAST_PLR(pPlayer)->FailQuest(QUEST_CHASING_AME); + } + } + + void UpdateAI(const uint32 diff) + { + npc_escortAI::UpdateAI(diff); + if (!UpdateVictim()) + return; + + if (DEMORALIZINGSHOUT_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_DEMORALIZINGSHOUT); + DEMORALIZINGSHOUT_Timer = 70000; + }else DEMORALIZINGSHOUT_Timer -= diff; + + } +}; + +bool QuestAccept_npc_ame(Player* pPlayer, Creature* pCreature, Quest const* quest) +{ + if (quest->GetQuestId() == QUEST_CHASING_AME) + { + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(false, false, pPlayer->GetGUID()); + DoScriptText(SAY_READY, pCreature, pPlayer); + pCreature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); + // Change faction so mobs attack + pCreature->setFaction(113); + } + return true; +} + +CreatureAI* GetAI_npc_ame(Creature* pCreature) +{ + npc_ameAI* thisAI = new npc_ameAI(pCreature); + + thisAI->AddWaypoint(1, -6380.38, -1965.14, -258.292, 5000); + thisAI->AddWaypoint(2, -6383.06, -1962.9, -258.936); + thisAI->AddWaypoint(3, -6391.09, -1956.13, -260.291); + thisAI->AddWaypoint(4, -6395.29, -1933.58, -262.949); + thisAI->AddWaypoint(5, -6396.58, -1919.93, -263.838); + thisAI->AddWaypoint(6, -6389.01, -1912.64, -260.689); + thisAI->AddWaypoint(7, -6369.19, -1892.87, -255.924); + thisAI->AddWaypoint(8, -6373.77, -1879.36, -259.268); + thisAI->AddWaypoint(9, -6377.55, -1869.56, -260.503); + thisAI->AddWaypoint(10, -6376.58, -1860.79, -260.026); + thisAI->AddWaypoint(11, -6373.13, -1847.22, -259.249); + thisAI->AddWaypoint(12, -6370.54, -1837.04, -260.007); + thisAI->AddWaypoint(13, -6372.52, -1829.16, -260.071); + thisAI->AddWaypoint(14, -6377.13, -1815.94, -262.632); + thisAI->AddWaypoint(15, -6380.27, -1806.95, -265.53); + thisAI->AddWaypoint(16, -6386.04, -1790.43, -268.546); + thisAI->AddWaypoint(17, -6386.72, -1776.29, -269.851); + thisAI->AddWaypoint(18, -6385.92, -1762.31, -271.494); + thisAI->AddWaypoint(19, -6384.69, -1744.86, -272.196); + thisAI->AddWaypoint(20, -6383.8, -1732.66, -272.222); + thisAI->AddWaypoint(21, -6382.66, -1716.96, -272.235); + thisAI->AddWaypoint(22, -6381.5, -1703.01, -272.964); + thisAI->AddWaypoint(23, -6379.96, -1685.58, -272.842); + thisAI->AddWaypoint(24, -6379.34, -1678.61, -272.34); + thisAI->AddWaypoint(25, -6364.45, -1636.27, -271.065); + thisAI->AddWaypoint(26, -6371.85, -1626.36, -272.188); + thisAI->AddWaypoint(27, -6383.5, -1629.01, -272.206); + thisAI->AddWaypoint(28, -6388.09, -1635.37, -272.105, 5000); + thisAI->AddWaypoint(29, -6375.42, -1637.33, -272.193); + thisAI->AddWaypoint(30, -6365.46, -1617.25, -272.141); + thisAI->AddWaypoint(31, -6353.79, -1603.48, -271.932); + thisAI->AddWaypoint(32, -6340.24, -1592.41, -269.435); + thisAI->AddWaypoint(33, -6329.45, -1566.89, -269.895); + thisAI->AddWaypoint(34, -6312.2, -1499.06, -269.507); + thisAI->AddWaypoint(35, -6304.55, -1468.5, -269.431); + thisAI->AddWaypoint(36, -6310.36, -1440.94, -268.427); + thisAI->AddWaypoint(37, -6321, -1418.91, -266.525); + thisAI->AddWaypoint(38, -6358.76, -1389.97, -267.522); + thisAI->AddWaypoint(39, -6378.65, -1375.67, -271.749); + thisAI->AddWaypoint(40, -6387.22, -1360.95, -272.109); + thisAI->AddWaypoint(41, -6406.95, -1323.87, -271.586); + thisAI->AddWaypoint(42, -6405, -1311.92, -271.906); + thisAI->AddWaypoint(43, -6395.56, -1303.62, -271.902); + thisAI->AddWaypoint(44, -6375.97, -1296.08, -271.865); + thisAI->AddWaypoint(45, -6364.39, -1281.23, -269.012); + thisAI->AddWaypoint(46, -6353.71, -1263.19, -267.95); + thisAI->AddWaypoint(47, -6340.09, -1248.65, -267.441); + thisAI->AddWaypoint(48, -6338.21, -1237.11, -267.844); + thisAI->AddWaypoint(49, -6336.6, -1219.69, -269.196); + thisAI->AddWaypoint(50, -6334.44, -1202.33, -271.527); + thisAI->AddWaypoint(51, -6329.56, -1189.82, -270.947); + thisAI->AddWaypoint(52, -6324.66, -1179.46, -270.103); + thisAI->AddWaypoint(53, -6315.08, -1176.74, -269.735); + thisAI->AddWaypoint(54, -6308.49, -1179.12, -269.57); + thisAI->AddWaypoint(55, -6302.43, -1181.32, -269.328, 5000); + thisAI->AddWaypoint(56, -6298.87, -1185.79, -269.278); + + return thisAI; +} + +void AddSC_ungoro_crater() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_ame"; + newscript->GetAI = &GetAI_npc_ame; + newscript->pQuestAccept = &QuestAccept_npc_ame; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/kalimdor/wailing_caverns/def_wailing_caverns.h b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/def_wailing_caverns.h new file mode 100644 index 00000000000..ee03ade365e --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/def_wailing_caverns.h @@ -0,0 +1,24 @@ +/* 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_WAILING_CAVERNS_H +#define DEF_WAILING_CAVERNS_H + +enum +{ + TYPE_LORD_COBRAHN = 1, + TYPE_LORD_PYTHAS = 2, + TYPE_LADY_ANACONDRA = 3, + TYPE_LORD_SERPENTIS = 4, + TYPE_NARALEX_EVENT = 5, + TYPE_NARALEX_PART1 = 6, + TYPE_NARALEX_PART2 = 7, + TYPE_NARALEX_PART3 = 8, + TYPE_MUTANUS_THE_DEVOURER = 9, + TYPE_NARALEX_YELLED = 10, + + DATA_NARALEX = 3679, +}; + +#endif \ No newline at end of file diff --git a/src/bindings/scripts/scripts/kalimdor/wailing_caverns/instance_wailing_caverns.cpp b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/instance_wailing_caverns.cpp new file mode 100644 index 00000000000..e535a20a2c1 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/instance_wailing_caverns.cpp @@ -0,0 +1,142 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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_Wailing_Caverns +SD%Complete: 99 +SDComment: Everything seems to work, still need some checking +SDCategory: Wailing Caverns +EndScriptData */ + +#include "precompiled.h" +#include "def_wailing_caverns.h" + +#define MAX_ENCOUNTER 9 + +struct TRINITY_DLL_DECL instance_wailing_caverns : public ScriptedInstance +{ + instance_wailing_caverns(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + bool yelled; + uint64 NaralexGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + yelled = false; + NaralexGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == DATA_NARALEX) + NaralexGUID = pCreature->GetGUID(); + } + + void SetData(uint32 type, uint32 data) + { + switch (type) + { + case TYPE_LORD_COBRAHN: m_auiEncounter[0] = data;break; + case TYPE_LORD_PYTHAS: m_auiEncounter[1] = data;break; + case TYPE_LADY_ANACONDRA: m_auiEncounter[2] = data;break; + case TYPE_LORD_SERPENTIS: m_auiEncounter[3] = data;break; + case TYPE_NARALEX_EVENT: m_auiEncounter[4] = data;break; + case TYPE_NARALEX_PART1: m_auiEncounter[5] = data;break; + case TYPE_NARALEX_PART2: m_auiEncounter[6] = data;break; + case TYPE_NARALEX_PART3: m_auiEncounter[7] = data;break; + case TYPE_MUTANUS_THE_DEVOURER: m_auiEncounter[8] = data;break; + case TYPE_NARALEX_YELLED: yelled = true; break; + } + if (data == DONE)SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch (type) + { + case TYPE_LORD_COBRAHN: return m_auiEncounter[0]; + case TYPE_LORD_PYTHAS: return m_auiEncounter[1]; + case TYPE_LADY_ANACONDRA: return m_auiEncounter[2]; + case TYPE_LORD_SERPENTIS: return m_auiEncounter[3]; + case TYPE_NARALEX_EVENT: return m_auiEncounter[4]; + case TYPE_NARALEX_PART1: return m_auiEncounter[5]; + case TYPE_NARALEX_PART2: return m_auiEncounter[6]; + case TYPE_NARALEX_PART3: return m_auiEncounter[7]; + case TYPE_MUTANUS_THE_DEVOURER: return m_auiEncounter[8]; + case TYPE_NARALEX_YELLED: return yelled; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + if (data == DATA_NARALEX)return NaralexGUID; + return 0; + } + + std::string GetSaveData() + { + 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]; + + 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 >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] + >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7] >> m_auiEncounter[8]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] != DONE) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } + +}; + +InstanceData* GetInstanceData_instance_wailing_caverns(Map* pMap) +{ + return new instance_wailing_caverns(pMap); +} + +void AddSC_instance_wailing_caverns() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_wailing_caverns"; + newscript->GetInstanceData = &GetInstanceData_instance_wailing_caverns; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp new file mode 100644 index 00000000000..622800127db --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp @@ -0,0 +1,411 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Wailing Caverns +SD%Complete: 95 +SDComment: Need to add skill usage for Disciple of Naralex +SDCategory: Wailing Caverns +EndScriptData */ + +/* ContentData +EndContentData */ + +#include "precompiled.h" +#include "escortAI.h" +#include "def_wailing_caverns.h" + +/*###### +## npc_disciple_of_naralex +######*/ + +enum +{ + //say + SAY_MAKE_PREPARATIONS = -1043001, + SAY_TEMPLE_OF_PROMISE = -1043002, + SAY_MUST_CONTINUE = -1043003, + SAY_BANISH_THE_SPIRITS = -1043004, + SAY_CAVERNS_PURIFIED = -1043005, + SAY_BEYOND_THIS_CORRIDOR = -1043006, + SAY_EMERALD_DREAM = -1043007, + SAY_MUTANUS_THE_DEVOURER = -1043012, + SAY_NARALEX_AWAKES = -1043014, + SAY_THANK_YOU = -1043015, + SAY_FAREWELL = -1043016, + SAY_ATTACKED = -1043017, + //yell + SAY_AT_LAST = -1043000, + SAY_I_AM_AWAKE = -1043013, + //emote + EMOTE_AWAKENING_RITUAL = -1043008, + EMOTE_TROUBLED_SLEEP = -1043009, + EMOTE_WRITHE_IN_AGONY = -1043010, + EMOTE_HORRENDOUS_VISION = -1043011, + //spell + SPELL_MARK_OF_THE_WILD_RANK_2 = 5232, + SPELL_SERPENTINE_CLEANSING = 6270, + SPELL_NARALEXS_AWAKENING = 6271, + SPELL_FLIGHT_FORM = 33943, + //npc entry + NPC_DEVIATE_RAVAGER = 3636, + NPC_DEVIATE_VIPER = 5755, + NPC_DEVIATE_MOCCASIN = 5762, + NPC_NIGHTMARE_ECTOPLASM = 5763, + NPC_MUTANUS_THE_DEVOURER = 3654, +}; + +#define GOSSIP_ID_START_1 698 //Naralex sleeps again! +#define GOSSIP_ID_START_2 699 //The fanglords are dead! +#define GOSSIP_ITEM_NARALEX "Let the event begin!" +#define ACHIEVEMENT_WAILING_CAVERNS 630 + +struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI +{ + npc_disciple_of_naralexAI(Creature *c) : npc_escortAI(c) + { + pInstance = c->GetInstanceData(); + eventTimer = 0; + currentEvent = 0; + eventProgress = 0; + m_creature->setActive(true); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + } + + uint32 eventTimer; + uint32 currentEvent; + uint32 eventProgress; + ScriptedInstance *pInstance; + + void WaypointReached(uint32 i) + { + if (!pInstance) + return; + + switch (i) + { + case 4: + eventProgress = 1; + currentEvent = TYPE_NARALEX_PART1; + pInstance->SetData(TYPE_NARALEX_PART1, IN_PROGRESS); + break; + case 5: + DoScriptText(SAY_MUST_CONTINUE, m_creature); + pInstance->SetData(TYPE_NARALEX_PART1, DONE); + break; + case 11: + eventProgress = 1; + currentEvent = TYPE_NARALEX_PART2; + pInstance->SetData(TYPE_NARALEX_PART2, IN_PROGRESS); + break; + case 19: + DoScriptText(SAY_BEYOND_THIS_CORRIDOR, m_creature); + break; + case 24: + eventProgress = 1; + currentEvent = TYPE_NARALEX_PART3; + pInstance->SetData(TYPE_NARALEX_PART3, IN_PROGRESS); + break; + } + } + + void Reset() + { + + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_ATTACKED, m_creature, who); + } + + void JustDied(Unit *slayer) + { + if (pInstance) + { + pInstance->SetData(TYPE_NARALEX_EVENT, FAIL); + pInstance->SetData(TYPE_NARALEX_PART1, FAIL); + pInstance->SetData(TYPE_NARALEX_PART2, FAIL); + pInstance->SetData(TYPE_NARALEX_PART3, FAIL); + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AI()->AttackStart(m_creature); + } + + void EnterEvadeMode() + { + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(false);//do not interrupt channeling + m_creature->SetLootRecipient(NULL); + if (GetIsBeingEscorted()) + { + SetReturning(true); + ReturnToLastPoint(); + debug_log("TSCR: EscortAI (EnterEvadeMode() Override) has left combat and is now returning to last point"); + } + else + m_creature->GetMotionMaster()->MoveTargetedHome(); + } + + void UpdateAI(const uint32 diff) + { + if (currentEvent != TYPE_NARALEX_PART3) + npc_escortAI::UpdateAI(diff); + + if (!pInstance) + return; + if (eventTimer <= diff) + { + eventTimer = 0; + if (pInstance->GetData(currentEvent) == IN_PROGRESS) + { + switch (currentEvent) + { + case TYPE_NARALEX_PART1: + if (eventProgress == 1) + { + eventProgress++; + DoScriptText(SAY_TEMPLE_OF_PROMISE, m_creature); + m_creature->SummonCreature(NPC_DEVIATE_RAVAGER, -82.1763, 227.874, -93.3233, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + m_creature->SummonCreature(NPC_DEVIATE_RAVAGER, -72.9506, 216.645, -93.6756, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + } + break; + case TYPE_NARALEX_PART2: + if (eventProgress == 1) + { + eventProgress++; + DoScriptText(SAY_BANISH_THE_SPIRITS, m_creature); + DoCast(m_creature, SPELL_SERPENTINE_CLEANSING); + //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(false); + eventTimer = 30000; + m_creature->SummonCreature(NPC_DEVIATE_VIPER, -61.5261, 273.676, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + m_creature->SummonCreature(NPC_DEVIATE_VIPER, -58.4658, 280.799, -92.8393, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + m_creature->SummonCreature(NPC_DEVIATE_VIPER, -50.002, 278.578, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + } + else + if (eventProgress == 2) + { + //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(true); + DoScriptText(SAY_CAVERNS_PURIFIED, m_creature); + pInstance->SetData(TYPE_NARALEX_PART2, DONE); + if (m_creature->HasAura(SPELL_SERPENTINE_CLEANSING)) + m_creature->RemoveAura(SPELL_SERPENTINE_CLEANSING); + } + break; + case TYPE_NARALEX_PART3: + if (eventProgress == 1) + { + eventProgress++; + eventTimer = 4000; + m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); + DoScriptText(SAY_EMERALD_DREAM, m_creature); + } + else + if (eventProgress == 2) + { + eventProgress++; + eventTimer = 15000; + //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(false); + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + DoCast(naralex, SPELL_NARALEXS_AWAKENING, true); + DoScriptText(EMOTE_AWAKENING_RITUAL, m_creature); + } + else + if (eventProgress == 3) + { + eventProgress++; + eventTimer = 15000; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + DoScriptText(EMOTE_TROUBLED_SLEEP, naralex); + m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 135.943, 199.701, -103.529, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 151.08, 221.13, -103.609, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 128.007, 227.428, -97.421, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + } + else + if (eventProgress == 4) + { + eventProgress++; + eventTimer = 30000; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + DoScriptText(EMOTE_WRITHE_IN_AGONY, naralex); + m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 133.413, 207.188, -102.469, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 142.857, 218.645, -102.905, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 105.102, 227.211, -102.752, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 153.372, 235.149, -102.826, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 149.524, 251.113, -102.558, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 136.208, 266.466, -102.977, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 126.167, 274.759, -102.962, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); + } + else + if (eventProgress == 5) + { + eventProgress++; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + DoScriptText(EMOTE_HORRENDOUS_VISION, naralex); + m_creature->SummonCreature(NPC_MUTANUS_THE_DEVOURER, 150.872, 262.905, -103.503, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); + DoScriptText(SAY_MUTANUS_THE_DEVOURER, m_creature); + pInstance->SetData(TYPE_MUTANUS_THE_DEVOURER, IN_PROGRESS); + } + else + if (eventProgress == 6 && pInstance->GetData(TYPE_MUTANUS_THE_DEVOURER) == DONE) + { + eventProgress++; + eventTimer = 3000; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + { + AchievementEntry const *AchievWC = GetAchievementStore()->LookupEntry(ACHIEVEMENT_WAILING_CAVERNS); + if (AchievWC) + { + Map* pMap = m_creature->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + itr->getSource()->CompletedAchievement(AchievWC); + } + } + if (m_creature->HasAura(SPELL_NARALEXS_AWAKENING)) + m_creature->RemoveAura(SPELL_NARALEXS_AWAKENING); + naralex->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_I_AM_AWAKE, naralex); + } + DoScriptText(SAY_NARALEX_AWAKES, m_creature); + } + else + if (eventProgress == 7) + { + eventProgress++; + eventTimer = 6000; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + DoScriptText(SAY_THANK_YOU, naralex); + } + else + if (eventProgress == 8) + { + eventProgress++; + eventTimer = 8000; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + { + DoScriptText(SAY_FAREWELL, naralex); + naralex->AddAura(SPELL_FLIGHT_FORM, naralex); + } + SetRun(); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->AddAura(SPELL_FLIGHT_FORM, m_creature); + } + else + if (eventProgress == 9) + { + eventProgress++; + eventTimer = 1500; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + naralex->GetMotionMaster()->MovePoint(25, naralex->GetPositionX(), naralex->GetPositionY(), naralex->GetPositionZ()); + } + else + if (eventProgress == 10) + { + eventProgress++; + eventTimer = 2500; + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + { + naralex->GetMotionMaster()->MovePoint(0, 117.095512, 247.107971, -96.167870); + naralex->GetMotionMaster()->MovePoint(1, 90.388809, 276.135406, -83.389801); + } + m_creature->GetMotionMaster()->MovePoint(26, 117.095512, 247.107971, -96.167870); + m_creature->GetMotionMaster()->MovePoint(27, 144.375443, 281.045837, -82.477135); + } + else + if (eventProgress == 11) + { + if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) + naralex->SetVisibility(VISIBILITY_OFF); + m_creature->SetVisibility(VISIBILITY_OFF); + pInstance->SetData(TYPE_NARALEX_PART3, DONE); + } + break; + } + } + }else eventTimer -= diff; + } +}; + +CreatureAI* GetAI_npc_disciple_of_naralex(Creature* pCreature) +{ + return new npc_disciple_of_naralexAI(pCreature); +} + +bool GossipHello_npc_disciple_of_naralex(Player* pPlayer, Creature* pCreature) +{ + ScriptedInstance *pInstance = (pCreature->GetInstanceData()); + + if (pInstance) + { + pCreature->CastSpell(pPlayer, SPELL_MARK_OF_THE_WILD_RANK_2, true); + if ((pInstance->GetData(TYPE_LORD_COBRAHN) == DONE) && (pInstance->GetData(TYPE_LORD_PYTHAS) == DONE) && + (pInstance->GetData(TYPE_LADY_ANACONDRA) == DONE) && (pInstance->GetData(TYPE_LORD_SERPENTIS) == DONE)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NARALEX, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_START_2, pCreature->GetGUID()); + + if (!pInstance->GetData(TYPE_NARALEX_YELLED)) + { + DoScriptText(SAY_AT_LAST, pCreature); + pInstance->SetData(TYPE_NARALEX_YELLED, 1); + } + } + else + { + pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_START_1, pCreature->GetGUID()); + } + } + return true; +} + +bool GossipSelect_npc_disciple_of_naralex(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + ScriptedInstance *pInstance = (pCreature->GetInstanceData()); + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + if (pInstance)pInstance->SetData(TYPE_NARALEX_EVENT, IN_PROGRESS); + + DoScriptText(SAY_MAKE_PREPARATIONS, pCreature); + + pCreature->setFaction(250); + pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + + CAST_AI(npc_escortAI, (pCreature->AI()))->Start(false, false, pPlayer->GetGUID()); + CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtFar(false); + CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtEnd(false); + } + return true; +} + +void AddSC_wailing_caverns() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_disciple_of_naralex"; + newscript->pGossipHello = &GossipHello_npc_disciple_of_naralex; + newscript->pGossipSelect = &GossipSelect_npc_disciple_of_naralex; + newscript->GetAI = &GetAI_npc_disciple_of_naralex; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp b/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp new file mode 100644 index 00000000000..4e630368db1 --- /dev/null +++ b/src/bindings/scripts/scripts/kalimdor/zulfarrak/zulfarrak.cpp @@ -0,0 +1,223 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Zulfarrak +SD%Complete: 50 +SDComment: Consider it temporary, no instance script made for this instance yet. +SDCategory: Zul'Farrak +EndScriptData */ + +/* ContentData +npc_sergeant_bly +npc_weegli_blastfuse +EndContentData */ + +#include "precompiled.h" + +/*###### +## npc_sergeant_bly +######*/ + +#define FACTION_HOSTILE 14 +#define FACTION_FRIENDLY 35 + +#define SPELL_SHIELD_BASH 11972 +#define SPELL_REVENGE 12170 + +#define GOSSIP_BLY "[PH] In that case, i will take my reward!" + +struct TRINITY_DLL_DECL npc_sergeant_blyAI : public ScriptedAI +{ + npc_sergeant_blyAI(Creature *c) : ScriptedAI(c) + { + //pInstance = c->GetInstanceData(); + } + + //ScriptedInstance* pInstance; + + uint32 ShieldBash_Timer; + uint32 Revenge_Timer; //this is wrong, spell should never be used unless m_creature->getVictim() dodge, parry or block attack. Trinity support required. + + void Reset() + { + ShieldBash_Timer = 5000; + Revenge_Timer = 8000; + + m_creature->setFaction(FACTION_FRIENDLY); + + /*if (pInstance) + pInstance->SetData(0, NOT_STARTED);*/ + } + + void EnterCombat(Unit *who) + { + /*if (pInstance) + pInstance->SetData(0, IN_PROGRESS);*/ + } + + void JustDied(Unit *victim) + { + /*if (pInstance) + pInstance->SetData(0, DONE);*/ + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ShieldBash_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SHIELD_BASH); + ShieldBash_Timer = 15000; + }else ShieldBash_Timer -= diff; + + if (Revenge_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_REVENGE); + Revenge_Timer = 10000; + }else Revenge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_npc_sergeant_bly(Creature* pCreature) +{ + return new npc_sergeant_blyAI (pCreature); +} + +bool GossipHello_npc_sergeant_bly(Player* pPlayer, Creature* pCreature) +{ + /*if (pInstance->GetData(0) == DONE) + {*/ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(1517, pCreature->GetGUID()); + /*} + else if (pInstance->GetData(0) == IN_PROGRESS) + pPlayer->SEND_GOSSIP_MENU(1516, pCreature->GetGUID()); + else + pPlayer->SEND_GOSSIP_MENU(1515, pCreature->GetGUID());*/ + + return true; +} + +bool GossipSelect_npc_sergeant_bly(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + pCreature->setFaction(FACTION_HOSTILE); + CAST_AI(npc_sergeant_blyAI, pCreature->AI())->AttackStart(pPlayer); + } + return true; +} + +/*###### +## npc_weegli_blastfuse +######*/ + +#define SPELL_BOMB 8858 +#define SPELL_GOBLIN_LAND_MINE 21688 +#define SPELL_SHOOT 6660 +#define SPELL_WEEGLIS_BARREL 10772 + +#define GOSSIP_WEEGLI "[PH] Please blow up the door." + +struct TRINITY_DLL_DECL npc_weegli_blastfuseAI : public ScriptedAI +{ + npc_weegli_blastfuseAI(Creature *c) : ScriptedAI(c) + { + //pInstance = c->GetInstanceData(); + } + + //ScriptedInstance* pInstance; + + void Reset() + { + /*if (pInstance) + pInstance->SetData(0, NOT_STARTED);*/ + } + + void EnterCombat(Unit *who) + { + /*if (pInstance) + pInstance->SetData(0, IN_PROGRESS);*/ + } + + void JustDied(Unit *victim) + { + /*if (pInstance) + pInstance->SetData(0, DONE);*/ + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_npc_weegli_blastfuse(Creature* pCreature) +{ + return new npc_weegli_blastfuseAI (pCreature); +} + +bool GossipHello_npc_weegli_blastfuse(Player* pPlayer, Creature* pCreature) +{ + //event not implemented yet, this is only placeholder for future developement + /*if (pInstance->GetData(0) == DONE) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WEEGLI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->SEND_GOSSIP_MENU(1514, pCreature->GetGUID());//if event can proceed to end + } + else if (pInstance->GetData(0) == IN_PROGRESS) + pPlayer->SEND_GOSSIP_MENU(1513, pCreature->GetGUID());//if event are in progress + else*/ + pPlayer->SEND_GOSSIP_MENU(1511, pCreature->GetGUID()); //if event not started + return true; +} + +bool GossipSelect_npc_weegli_blastfuse(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF+1) + { + pPlayer->CLOSE_GOSSIP_MENU(); + //here we make him run to door, set the charge and run away off to nowhere + } + return true; +} + +void AddSC_zulfarrak() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_sergeant_bly"; + newscript->GetAI = &GetAI_npc_sergeant_bly; + newscript->pGossipHello = &GossipHello_npc_sergeant_bly; + newscript->pGossipSelect = &GossipSelect_npc_sergeant_bly; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_weegli_blastfuse"; + newscript->GetAI = &GetAI_npc_weegli_blastfuse; + newscript->pGossipHello = &GossipHello_npc_weegli_blastfuse; + newscript->pGossipSelect = &GossipSelect_npc_weegli_blastfuse; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/zone/blackfathom_depths/def_blackfathom_deeps.h b/src/bindings/scripts/scripts/zone/blackfathom_depths/def_blackfathom_deeps.h deleted file mode 100644 index 6a1b1974886..00000000000 --- a/src/bindings/scripts/scripts/zone/blackfathom_depths/def_blackfathom_deeps.h +++ /dev/null @@ -1,23 +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_BFD_H -#define DEF_BFD_H - -enum -{ - DATA_SHRINE1 = 1, - DATA_SHRINE2 = 2, - DATA_SHRINE3 = 3, - DATA_SHRINE4 = 4, - DATA_TWILIGHT_LORD_KELRIS = 5, - DATA_SHRINE_OF_GELIHAST = 6, - DATA_ALTAR_OF_THE_DEEPS = 7, - DATA_MAINDOOR = 8, - - TYPE_KELRIS = 10, - TYPE_SHRINE = 11 -}; - -#endif diff --git a/src/bindings/scripts/scripts/zone/blackfathom_depths/instance_blackfathom_deeps.cpp b/src/bindings/scripts/scripts/zone/blackfathom_depths/instance_blackfathom_deeps.cpp deleted file mode 100644 index 19203ce2d73..00000000000 --- a/src/bindings/scripts/scripts/zone/blackfathom_depths/instance_blackfathom_deeps.cpp +++ /dev/null @@ -1,145 +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_Blackfathom_Deeps -SD%Complete: 50 -SDComment: -SDCategory: Blackfathom Deeps -EndScriptData */ - -#include "precompiled.h" -#include "def_blackfathom_deeps.h" - -#define MAX_ENCOUNTER 2 - -/* Encounter 0 = Twilight Lord Kelris - Encounter 1 = Shrine event - Must kill twilight lord for shrine event to be possible - */ - -struct TRINITY_DLL_DECL instance_blackfathom_deeps : public ScriptedInstance -{ - instance_blackfathom_deeps(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 m_uiTwilightLordKelrisGUID; - uint64 m_uiShrine1GUID; - uint64 m_uiShrine2GUID; - uint64 m_uiShrine3GUID; - uint64 m_uiShrine4GUID; - uint64 m_uiShrineOfGelihastGUID; - uint64 m_uiAltarOfTheDeepsGUID; - uint64 m_uiMainDoorGUID; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiTwilightLordKelrisGUID = 0; - m_uiShrine1GUID = 0; - m_uiShrine2GUID = 0; - m_uiShrine3GUID = 0; - m_uiShrine4GUID = 0; - m_uiShrineOfGelihastGUID = 0; - m_uiAltarOfTheDeepsGUID = 0; - m_uiMainDoorGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (pCreature->GetEntry() == 4832) - m_uiTwilightLordKelrisGUID = pCreature->GetGUID(); - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 21118: m_uiShrine1GUID = pGo->GetGUID(); break; - case 21119: m_uiShrine2GUID = pGo->GetGUID(); break; - case 21120: m_uiShrine3GUID = pGo->GetGUID(); break; - case 21121: m_uiShrine4GUID = pGo->GetGUID(); break; - case 103015: m_uiShrineOfGelihastGUID = pGo->GetGUID(); break; - case 103016: m_uiAltarOfTheDeepsGUID = pGo->GetGUID(); break; - case 21117: m_uiMainDoorGUID = pGo->GetGUID(); break; - } - } - - void SetData(uint32 uiType, uint32 uiData) - { - switch(uiType) - { - case TYPE_KELRIS: - m_auiEncounter[0] = uiData; - break; - case TYPE_SHRINE: - m_auiEncounter[1] = uiData; - break; - } - } - - uint32 GetData(uint32 uiType) - { - switch(uiType) - { - case TYPE_KELRIS: - return m_auiEncounter[0]; - case TYPE_SHRINE: - return m_auiEncounter[1]; - } - - return 0; - } - - uint64 GetData64(uint32 uiData) - { - switch(uiData) - { - case DATA_TWILIGHT_LORD_KELRIS: - return m_uiTwilightLordKelrisGUID; - case DATA_SHRINE1: - return m_uiShrine1GUID; - case DATA_SHRINE2: - return m_uiShrine2GUID; - case DATA_SHRINE3: - return m_uiShrine3GUID; - case DATA_SHRINE4: - return m_uiShrine4GUID; - case DATA_SHRINE_OF_GELIHAST: - return m_uiShrineOfGelihastGUID; - case DATA_MAINDOOR: - return m_uiMainDoorGUID; - } - - return 0; - } -}; - -InstanceData* GetInstanceData_instance_blackfathom_deeps(Map* pMap) -{ - return new instance_blackfathom_deeps(pMap); -} - -void AddSC_instance_blackfathom_deeps() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_blackfathom_deeps"; - newscript->GetInstanceData = &GetInstanceData_instance_blackfathom_deeps; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp deleted file mode 100644 index 2e9877e97e2..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_epoch.cpp +++ /dev/null @@ -1,86 +0,0 @@ -/* Script Data Start -SDName: Boss epoch -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_CURSE_OF_EXERTION 52772 -#define SPELL_TIME_WARP 52766 //Time slows down, reducing attack, casting and movement speed by 70% for 6 sec. -#define SPELL_TIME_STOP 58848 //Stops time in a 50 yard sphere for 2 sec. -#define SPELL_WOUNDING_STRIKE_N 52771 //Used only on the tank -#define SPELL_WOUNDING_STRIKE_H 58830 - -//Say -#define SAY_INTRO -1595000 //"Prince Arthas Menethil, on this day, a powerful darkness has taken hold of your soul. The death you are destined to visit upon others will this day be your own." -#define SAY_AGGRO -1595001 //"We'll see about that, young prince." -#define SAY_TIME_WARP_1 -1595002 //"Tick tock, tick tock..." -#define SAY_TIME_WARP_2 -1595003 //"Not quick enough!" -#define SAY_TIME_WARP_3 -1595004 //"Let's get this over with. " -#define SAY_SLAY_1 -1595005 //"There is no future for you." -#define SAY_SLAY_2 -1595006 //"This is the hour of our greatest triumph!" -#define SAY_SLAY_3 -1595007 //"You were destined to fail. " -#define SAY_DEATH -1595008 //"*gurgles*" - -struct TRINITY_DLL_DECL boss_epochAI : public ScriptedAI -{ - boss_epochAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0:DoScriptText(SAY_SLAY_1, m_creature);break; - case 1:DoScriptText(SAY_SLAY_2, m_creature);break; - case 2:DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_epoch(Creature* pCreature) -{ - return new boss_epochAI (pCreature); -} - -void AddSC_boss_epoch() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_epoch"; - newscript->GetAI = &GetAI_boss_epoch; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp deleted file mode 100644 index bd68d94d994..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_mal_ganis.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* Script Data Start -SDName: Boss mal_ganis -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_mal_ganis' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_CARRION_SWARM_N 52720 //A cresting wave of chaotic magic splashes over enemies in front of the caster, dealing 3230 to 3570 Shadow damage and 380 to 420 Shadow damage every 3 sec. for 15 sec. -#define SPELL_CARRION_SWARM_H 58852 -#define SPELL_MIND_BLAST_N 52722 //Inflicts 4163 to 4837 Shadow damage to an enemy. -#define SPELL_MIND_BLAST_H 58850 -#define SPELL_SLEEP 52721 //Puts an enemy to sleep for up to 10 sec. Any damage caused will awaken the target. -#define SPELL_VAMPIRIC_TOUCH 52723 //Heals the caster for half the damage dealt by a melee attack. - -//Yell Mal'ganis -#define SAY_INTRO_1 -1595009 -#define SAY_INTRO_2 -1595010 -#define SAY_OUTRO -1595011 -#define SAY_AGGRO -1595012 -#define SAY_KILL_1 -1595013 -#define SAY_KILL_2 -1595014 -#define SAY_KILL_3 -1595015 -#define SAY_SLAY_1 -1595016 -#define SAY_SLAY_2 -1595017 -#define SAY_SLAY_3 -1595018 -#define SAY_SLAY_4 -1595019 -#define SAY_SLEEP_1 -1595020 -#define SAY_SLEEP_2 -1595021 -#define SAY_30HEALTH -1595022 -#define SAY_15HEALTH -1595023 -#define SAY_ESCAPE_SPEECH_1 -1595024 -#define SAY_ESCAPE_SPEECH_2 -1595025 - -struct TRINITY_DLL_DECL boss_mal_ganisAI : public ScriptedAI -{ - boss_mal_ganisAI(Creature *c) : ScriptedAI(c) {} - - bool yelled, - yelled2, - yelled3; - - void Reset() - { - yelled = false; - yelled2 = false; - yelled3 = false; - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (!yelled) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) - { - DoScriptText(SAY_30HEALTH, m_creature); - yelled = true; - } - } - - if (!yelled2) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15) - { - DoScriptText(SAY_15HEALTH, m_creature); - yelled2 = true; - } - } - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 1) - { - //Handle Escape Event - } - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%4) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - case 3: DoScriptText(SAY_SLAY_4, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_mal_ganis(Creature* pCreature) -{ - return new boss_mal_ganisAI (pCreature); -} - -void AddSC_boss_mal_ganis() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_mal_ganis"; - newscript->GetAI = &GetAI_boss_mal_ganis; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp deleted file mode 100644 index 117a17585c6..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_meathook.cpp +++ /dev/null @@ -1,138 +0,0 @@ -/* Script Data Start -SDName: Boss meathook -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_meathook' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spell -#define SPELL_CONSTRICTING_CHAINS_N 52696 //Encases the targets in chains, dealing 1800 Physical damage every 1 sec. and stunning the target for 5 sec. -#define SPELL_CONSTRICTING_CHAINS_H 58823 -#define SPELL_DISEASE_EXPULSION_N 52666 //Meathook belches out a cloud of disease, dealing 1710 to 1890 Nature damage and interrupting the spell casting of nearby enemy targets for 4 sec. -#define SPELL_DISEASE_EXPULSION_H 58824 -#define SPELL_FRENZY 58841 //Increases the caster's Physical damage by 10% for 30 sec. - -//Yell -#define SAY_AGGRO -1595026 -#define SAY_SLAY_1 -1595027 -#define SAY_SLAY_2 -1595028 -#define SAY_SLAY_3 -1595029 -#define SAY_SPAWN -1595030 -#define SAY_DEATH -1595031 - -struct TRINITY_DLL_DECL boss_meathookAI : public ScriptedAI -{ - boss_meathookAI(Creature *c) : ScriptedAI(c) {} - - uint32 Chain_Timer, - Disease_Timer, - Frenzy_Timer; - - void Reset() - { - Chain_Timer = 12000 + rand()%5000; //seen on video 13, 17, 15, 12, 16 - Disease_Timer = 2000 + rand()%1000; //approx 3s - Frenzy_Timer = 20000 + rand()%10000; //made it up - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void AttackStart(Unit* who) {} - - std::list pList; - void MoveInLineOfSight(Unit* who, const uint32 diff) - { - /*if (m_creature->isHostileTo(who)) - { - pList.append(who); - }*/ - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Disease_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_DISEASE_EXPULSION_N); - Disease_Timer = 1500 + rand()%2500; - }else Disease_Timer -= diff; - - if (Frenzy_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FRENZY); - Frenzy_Timer = 20000 + rand()%10000; - }else Frenzy_Timer -= diff; - - if (Chain_Timer < diff) - { - - /* - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - std::list::iterator itr; - - int st=0; - for(itr = m_threatlist.begin(); itr != m_threatlist.end(); ++itr) - { - //st++; - m_creature->getThreatManager(). - } - Unit* targets[st]; - int st2=0; - for(int i=1; i<=st; ++i){ - if (!IsWithinLOSInMap(targets[i]) - st2++; - } - Unit* targets_out_of_LOS[st2];*/ - - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_CONSTRICTING_CHAINS_N); //anyone but the tank - Chain_Timer = 2000 + rand()%1000; - }else Chain_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_meathook(Creature* pCreature) -{ - return new boss_meathookAI (pCreature); -} - -void AddSC_boss_meathook() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_meathook"; - newscript->GetAI = &GetAI_boss_meathook; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp deleted file mode 100644 index 418adb82ff4..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/boss_salramm.cpp +++ /dev/null @@ -1,155 +0,0 @@ -/* Script Data Start -SDName: Boss salramm -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_salramm' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_CURSE_OF_TWISTED_FLESH 58845 -#define SPELL_EXPLODE_GHOUL_N 52480 -#define SPELL_EXPLODE_GHOUL_H 58825 -#define SPELL_SHADOW_BOLT_N 57725 -#define SPELL_SHADOW_BOLT_H 58828 -#define SPELL_STEAL_FLESH 52708 -#define SPELL_SUMMON_GHOULS 52451 - -//Yell -#define SAY_AGGRO -1595032 -#define SAY_SPAWN -1595033 -#define SAY_SLAY_1 -1595034 -#define SAY_SLAY_2 -1595035 -#define SAY_SLAY_3 -1595036 -#define SAY_DEATH -1595037 -#define SAY_EXPLODE_GHOUL_1 -1595038 -#define SAY_EXPLODE_GHOUL_2 -1595039 -#define SAY_STEAL_FLESH_1 -1595040 -#define SAY_STEAL_FLESH_2 -1595041 -#define SAY_STEAL_FLESH_3 -1595042 -#define SAY_SUMMON_GHOULS_1 -1595043 -#define SAY_SUMMON_GHOULS_2 -1595044 - -struct TRINITY_DLL_DECL boss_salrammAI : public ScriptedAI -{ - boss_salrammAI(Creature *c) : ScriptedAI(c) {} - - uint32 Curse_flesh_Timer, - Explode_ghoul_Timer, - Shadow_bolt_Timer, - Steal_flesh_Timer, - Summon_ghouls_Timer; - - void Reset() - { - Curse_flesh_Timer = 30000; //30s DBM - Explode_ghoul_Timer = 25000 + rand()%3000; //approx 6 sec after summon ghouls - Shadow_bolt_Timer = 8000 + rand()%4000; // approx 10s - Steal_flesh_Timer = 12345; - Summon_ghouls_Timer = 19000 + rand()%5000; //on a video approx 24s after aggro - } - - void EnterCombat(Unit* who) - {DoScriptText(SAY_AGGRO, m_creature);} - - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - Unit* random_target = SelectUnit(SELECT_TARGET_RANDOM, 0); - - //Curse of twisted flesh timer - if (Curse_flesh_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CURSE_OF_TWISTED_FLESH); - Curse_flesh_Timer = 37000; - }else Curse_flesh_Timer -= diff; - - //Shadow bolt timer - if (Shadow_bolt_Timer < diff) - { - if (random_target) - DoCast(random_target,SPELL_SHADOW_BOLT_N); - Shadow_bolt_Timer = 8000 + rand()%4000; - }else Shadow_bolt_Timer -= diff; - - //Steal Flesh timer - if (Steal_flesh_Timer < diff) - { - switch(rand()%3) - { - case 0: - DoScriptText(SAY_STEAL_FLESH_1, m_creature); - break; - case 1: - DoScriptText(SAY_STEAL_FLESH_2, m_creature); - break; - case 2: - DoScriptText(SAY_STEAL_FLESH_3, m_creature); - break; - } - if (random_target) - DoCast(random_target,SPELL_STEAL_FLESH); - Steal_flesh_Timer = 10000; - }else Steal_flesh_Timer -= diff; - - //Summon ghouls timer - if (Summon_ghouls_Timer < diff) - { - switch(rand()%2) - { - case 0: - DoScriptText(SAY_SUMMON_GHOULS_1, m_creature); - break; - case 1: - DoScriptText(SAY_SUMMON_GHOULS_2, m_creature); - break; - } - if (random_target) - DoCast(random_target,SPELL_SUMMON_GHOULS); - Summon_ghouls_Timer = 10000; - }else Summon_ghouls_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* killer) - {DoScriptText(SAY_DEATH, m_creature);} - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_salramm(Creature* pCreature) -{ - return new boss_salrammAI (pCreature); -} - -void AddSC_boss_salramm() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_salramm"; - newscript->GetAI = &GetAI_boss_salramm; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h deleted file mode 100644 index 849549e8f99..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/def_culling_of_stratholme.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_CULLING_OF_STRATHOLME_H -#define DEF_CULLING_OF_STRATHOLME_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp deleted file mode 100644 index 35ee68ea991..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/culling_of_stratholme/instance_culling_of_stratholme.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_culling_of_stratholme.h" - -struct TRINITY_DLL_DECL instance_culling_of_stratholme : public ScriptedInstance -{ - instance_culling_of_stratholme(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_culling_of_stratholme(Map* pMap) -{ - return new instance_culling_of_stratholme(pMap); -} - -void AddSC_instance_culling_of_stratholme() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_culling_of_stratholme"; - newscript->GetInstanceData = &GetInstanceData_instance_culling_of_stratholme; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp deleted file mode 100644 index 5667f5ae0b1..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_aeonus.cpp +++ /dev/null @@ -1,151 +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_Aeonus -SD%Complete: 80 -SDComment: Some spells not implemented -SDCategory: Caverns of Time, The Dark Portal -EndScriptData */ - -#include "precompiled.h" -#include "def_dark_portal.h" - -enum -{ - SAY_ENTER = -1269012, - SAY_AGGRO = -1269013, - SAY_BANISH = -1269014, - SAY_SLAY1 = -1269015, - SAY_SLAY2 = -1269016, - SAY_DEATH = -1269017, - EMOTE_FRENZY = -1269018, - - SPELL_CLEAVE = 40504, - SPELL_TIME_STOP = 31422, - SPELL_ENRAGE = 37605, - SPELL_SAND_BREATH = 31473, - H_SPELL_SAND_BREATH = 39049 -}; - -struct TRINITY_DLL_DECL boss_aeonusAI : public ScriptedAI -{ - boss_aeonusAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - bool HeroicMode; - - uint32 SandBreath_Timer; - uint32 TimeStop_Timer; - uint32 Frenzy_Timer; - - void Reset() - { - SandBreath_Timer = 15000+rand()%15000; - TimeStop_Timer = 10000+rand()%5000; - Frenzy_Timer = 30000+rand()%15000; - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void MoveInLineOfSight(Unit *who) - { - //Despawn Time Keeper - if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) - { - if (m_creature->IsWithinDistInMap(who,20.0f)) - { - DoScriptText(SAY_BANISH, m_creature); - m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - { - pInstance->SetData(TYPE_RIFT,DONE); - pInstance->SetData(TYPE_MEDIVH,DONE);//FIXME: later should be removed - } - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Sand Breath - if (SandBreath_Timer < diff) - { - DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_SAND_BREATH : SPELL_SAND_BREATH); - SandBreath_Timer = 15000+rand()%10000; - }else SandBreath_Timer -= diff; - - //Time Stop - if (TimeStop_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_TIME_STOP); - TimeStop_Timer = 20000+rand()%15000; - }else TimeStop_Timer -= diff; - - //Frenzy - if (Frenzy_Timer < diff) - { - DoScriptText(EMOTE_FRENZY, m_creature); - DoCast(m_creature, SPELL_ENRAGE); - Frenzy_Timer = 20000+rand()%15000; - }else Frenzy_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_aeonus(Creature* pCreature) -{ - return new boss_aeonusAI (pCreature); -} - -void AddSC_boss_aeonus() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_aeonus"; - newscript->GetAI = &GetAI_boss_aeonus; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp deleted file mode 100644 index 2a1d3c4fe03..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_chrono_lord_deja.cpp +++ /dev/null @@ -1,160 +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_Chrono_Lord_Deja -SD%Complete: 65 -SDComment: All abilities not implemented -SDCategory: Caverns of Time, The Dark Portal -EndScriptData */ - -#include "precompiled.h" -#include "def_dark_portal.h" - -enum -{ - SAY_ENTER = -1269006, - SAY_AGGRO = -1269007, - SAY_BANISH = -1269008, - SAY_SLAY1 = -1269009, - SAY_SLAY2 = -1269010, - SAY_DEATH = -1269011, - - SPELL_ARCANE_BLAST = 31457, - H_SPELL_ARCANE_BLAST = 38538, - SPELL_ARCANE_DISCHARGE = 31472, - H_SPELL_ARCANE_DISCHARGE = 38539, - SPELL_TIME_LAPSE = 31467, - SPELL_ATTRACTION = 38540 //Not Implemented (Heroic mode) -}; - -struct TRINITY_DLL_DECL boss_chrono_lord_dejaAI : public ScriptedAI -{ - boss_chrono_lord_dejaAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - bool HeroicMode; - - uint32 ArcaneBlast_Timer; - uint32 TimeLapse_Timer; - uint32 Attraction_Timer; - uint32 ArcaneDischarge_Timer; - - void Reset() - { - ArcaneBlast_Timer = 18000+rand()%5000; - TimeLapse_Timer = 10000+rand()%5000; - ArcaneDischarge_Timer = 20000+rand()%10000; - Attraction_Timer = 25000+rand()%10000; - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void MoveInLineOfSight(Unit *who) - { - //Despawn Time Keeper - if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) - { - if (m_creature->IsWithinDistInMap(who,20.0f)) - { - DoScriptText(SAY_BANISH, m_creature); - m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(TYPE_RIFT,SPECIAL); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Arcane Blast - if (ArcaneBlast_Timer < diff) - { - DoCast(m_creature->getVictim(), HeroicMode ? H_SPELL_ARCANE_BLAST : SPELL_ARCANE_BLAST); - ArcaneBlast_Timer = 15000+rand()%10000; - }else ArcaneBlast_Timer -= diff; - - //Arcane Discharge - if (ArcaneDischarge_Timer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - DoCast(target,HeroicMode ? H_SPELL_ARCANE_DISCHARGE : SPELL_ARCANE_DISCHARGE); - ArcaneDischarge_Timer = 20000+rand()%10000; - }else ArcaneDischarge_Timer -= diff; - - //Time Lapse - if (TimeLapse_Timer < diff) - { - DoScriptText(SAY_BANISH, m_creature); - DoCast(m_creature, SPELL_TIME_LAPSE); - TimeLapse_Timer = 15000+rand()%10000; - }else TimeLapse_Timer -= diff; - - if (HeroicMode) - { - if (Attraction_Timer < diff) - { - DoCast(m_creature,SPELL_ATTRACTION); - Attraction_Timer = 25000+rand()%10000; - }else Attraction_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_chrono_lord_deja(Creature* pCreature) -{ - return new boss_chrono_lord_dejaAI (pCreature); -} - -void AddSC_boss_chrono_lord_deja() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_chrono_lord_deja"; - newscript->GetAI = &GetAI_boss_chrono_lord_deja; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.cpp deleted file mode 100644 index 0d1a6eec214..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/boss_temporus.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_Temporus -SD%Complete: 75 -SDComment: More abilities need to be implemented -SDCategory: Caverns of Time, The Dark Portal -EndScriptData */ - -#include "precompiled.h" -#include "def_dark_portal.h" - -enum -{ - SAY_ENTER = -1269000, - SAY_AGGRO = -1269001, - SAY_BANISH = -1269002, - SAY_SLAY1 = -1269003, - SAY_SLAY2 = -1269004, - SAY_DEATH = -1269005, - - SPELL_HASTE = 31458, - SPELL_MORTAL_WOUND = 31464, - SPELL_WING_BUFFET = 31475, - H_SPELL_WING_BUFFET = 38593, - SPELL_REFLECT = 38592 //Not Implemented (Heroic mod) -}; - -struct TRINITY_DLL_DECL boss_temporusAI : public ScriptedAI -{ - boss_temporusAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - bool HeroicMode; - - uint32 Haste_Timer; - uint32 SpellReflection_Timer; - uint32 MortalWound_Timer; - uint32 WingBuffet_Timer; - - void Reset() - { - Haste_Timer = 15000+rand()%8000; - SpellReflection_Timer = 30000; - MortalWound_Timer = 8000; - WingBuffet_Timer = 25000+rand()%10000; - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(TYPE_RIFT,SPECIAL); - } - - void MoveInLineOfSight(Unit *who) - { - //Despawn Time Keeper - if (who->GetTypeId() == TYPEID_UNIT && who->GetEntry() == C_TIME_KEEPER) - { - if (m_creature->IsWithinDistInMap(who,20.0f)) - { - DoScriptText(SAY_BANISH, m_creature); - - m_creature->DealDamage(who, who->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - ScriptedAI::MoveInLineOfSight(who); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Attack Haste - if (Haste_Timer < diff) - { - DoCast(m_creature, SPELL_HASTE); - Haste_Timer = 20000+rand()%5000; - }else Haste_Timer -= diff; - - //MortalWound_Timer - if (MortalWound_Timer < diff) - { - DoCast(m_creature, SPELL_MORTAL_WOUND); - MortalWound_Timer = 10000+rand()%10000; - }else MortalWound_Timer -= diff; - - //Wing ruffet - if (WingBuffet_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_WING_BUFFET : SPELL_WING_BUFFET); - WingBuffet_Timer = 20000+rand()%10000; - }else WingBuffet_Timer -= diff; - - if (HeroicMode) - { - if (SpellReflection_Timer < diff) - { - DoCast(m_creature,SPELL_REFLECT); - SpellReflection_Timer = 25000+rand()%10000; - }else SpellReflection_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_temporus(Creature* pCreature) -{ - return new boss_temporusAI (pCreature); -} - -void AddSC_boss_temporus() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_temporus"; - newscript->GetAI = &GetAI_boss_temporus; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp deleted file mode 100644 index b57abc8c5d6..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/dark_portal.cpp +++ /dev/null @@ -1,409 +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: Dark_Portal -SD%Complete: 30 -SDComment: Misc NPC's and mobs for instance. Most here far from complete. -SDCategory: Caverns of Time, The Dark Portal -EndScriptData */ - -/* ContentData -npc_medivh_bm -npc_time_rift -npc_saat -EndContentData */ - -#include "precompiled.h" -#include "def_dark_portal.h" - -#define SAY_ENTER -1269020 //where does this belong? -#define SAY_INTRO -1269021 -#define SAY_WEAK75 -1269022 -#define SAY_WEAK50 -1269023 -#define SAY_WEAK25 -1269024 -#define SAY_DEATH -1269025 -#define SAY_WIN -1269026 -#define SAY_ORCS_ENTER -1269027 -#define SAY_ORCS_ANSWER -1269028 - -#define SPELL_CHANNEL 31556 -#define SPELL_PORTAL_RUNE 32570 //aura(portal on ground effect) - -#define SPELL_BLACK_CRYSTAL 32563 //aura -#define SPELL_PORTAL_CRYSTAL 32564 //summon - -#define SPELL_BANISH_PURPLE 32566 //aura -#define SPELL_BANISH_GREEN 32567 //aura - -#define SPELL_CORRUPT 31326 -#define SPELL_CORRUPT_AEONUS 37853 - -#define C_COUNCIL_ENFORCER 17023 - -struct TRINITY_DLL_DECL npc_medivh_bmAI : public ScriptedAI -{ - npc_medivh_bmAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 SpellCorrupt_Timer; - uint32 Check_Timer; - - bool Life75; - bool Life50; - bool Life25; - - void Reset() - { - SpellCorrupt_Timer = 0; - - if (!pInstance) - return; - - if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) - m_creature->CastSpell(m_creature,SPELL_CHANNEL,true); - else if (m_creature->HasAura(SPELL_CHANNEL)) - m_creature->RemoveAura(SPELL_CHANNEL); - - m_creature->CastSpell(m_creature,SPELL_PORTAL_RUNE,true); - } - - void MoveInLineOfSight(Unit *who) - { - if (!pInstance) - return; - - if (who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 10.0f)) - { - if (pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS || pInstance->GetData(TYPE_MEDIVH) == DONE) - return; - - DoScriptText(SAY_INTRO, m_creature); - pInstance->SetData(TYPE_MEDIVH,IN_PROGRESS); - m_creature->CastSpell(m_creature,SPELL_CHANNEL,false); - Check_Timer = 5000; - } - else if (who->GetTypeId() == TYPEID_UNIT && m_creature->IsWithinDistInMap(who, 15.0f)) - { - if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) - return; - - uint32 entry = who->GetEntry(); - if (entry == C_ASSAS || entry == C_WHELP || entry == C_CHRON || entry == C_EXECU || entry == C_VANQU) - { - who->StopMoving(); - who->CastSpell(m_creature,SPELL_CORRUPT,false); - } - else if (entry == C_AEONUS) - { - who->StopMoving(); - who->CastSpell(m_creature,SPELL_CORRUPT_AEONUS,false); - } - } - } - - void AttackStart(Unit *who) - { - //if (pInstance && pInstance->GetData(TYPE_MEDIVH) == IN_PROGRESS) - //return; - - //ScriptedAI::AttackStart(who); - } - - void EnterCombat(Unit *who) {} - - void SpellHit(Unit* caster, const SpellEntry* spell) - { - if (SpellCorrupt_Timer) - return; - - if (spell->Id == SPELL_CORRUPT_AEONUS) - SpellCorrupt_Timer = 1000; - - if (spell->Id == SPELL_CORRUPT) - SpellCorrupt_Timer = 3000; - } - - void JustDied(Unit* Killer) - { - if (Killer->GetEntry() == m_creature->GetEntry()) - return; - - DoScriptText(SAY_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!pInstance) - return; - - if (SpellCorrupt_Timer) - { - if (SpellCorrupt_Timer <= diff) - { - pInstance->SetData(TYPE_MEDIVH,SPECIAL); - - if (m_creature->HasAura(SPELL_CORRUPT_AEONUS)) - SpellCorrupt_Timer = 1000; - else if (m_creature->HasAura(SPELL_CORRUPT)) - SpellCorrupt_Timer = 3000; - else - SpellCorrupt_Timer = 0; - }else SpellCorrupt_Timer -= diff; - } - - if (Check_Timer) - { - if (Check_Timer <= diff) - { - uint32 pct = pInstance->GetData(DATA_SHIELD); - - Check_Timer = 5000; - - if (Life25 && pct <= 25) - { - DoScriptText(SAY_WEAK25, m_creature); - Life25 = false; - } - else if (Life50 && pct <= 50) - { - DoScriptText(SAY_WEAK50, m_creature); - Life50 = false; - } - else if (Life75 && pct <= 75) - { - DoScriptText(SAY_WEAK75, m_creature); - Life75 = false; - } - - //if we reach this it means event was running but at some point reset. - if (pInstance->GetData(TYPE_MEDIVH) == NOT_STARTED) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - m_creature->Respawn(); - return; - } - - if (pInstance->GetData(TYPE_RIFT) == DONE) - { - DoScriptText(SAY_WIN, m_creature); - Check_Timer = 0; - - if (m_creature->HasAura(SPELL_CHANNEL)) - m_creature->RemoveAura(SPELL_CHANNEL); - - //TODO: start the post-event here - pInstance->SetData(TYPE_MEDIVH,DONE); - } - }else Check_Timer -= diff; - } - - //if (!UpdateVictim()) - //return; - - //DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_medivh_bm(Creature* pCreature) -{ - return new npc_medivh_bmAI (pCreature); -} - -struct Wave -{ - uint32 PortalMob[4]; //spawns for portal waves (in order) -}; - -static Wave PortalWaves[]= -{ - {C_ASSAS, C_WHELP, C_CHRON, 0}, - {C_EXECU, C_CHRON, C_WHELP, C_ASSAS}, - {C_EXECU, C_VANQU, C_CHRON, C_ASSAS} -}; - -struct TRINITY_DLL_DECL npc_time_riftAI : public ScriptedAI -{ - npc_time_riftAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 TimeRiftWave_Timer; - uint8 mRiftWaveCount; - uint8 mPortalCount; - uint8 mWaveId; - - void Reset() - { - - TimeRiftWave_Timer = 15000; - mRiftWaveCount = 0; - - if (!pInstance) - return; - - mPortalCount = pInstance->GetData(DATA_PORTAL_COUNT); - - if (mPortalCount < 6) - mWaveId = 0; - else if (mPortalCount > 12) - mWaveId = 2; - else mWaveId = 1; - - } - void EnterCombat(Unit *who) {} - - void DoSummonAtRift(uint32 creature_entry) - { - if (!creature_entry) - return; - - if (pInstance->GetData(TYPE_MEDIVH) != IN_PROGRESS) - { - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - return; - } - - float x,y,z; - m_creature->GetRandomPoint(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),10.0f,x,y,z); - - //normalize Z-level if we can, if rift is not at ground level. - z = std::max(m_creature->GetMap()->GetHeight(x, y, MAX_HEIGHT), m_creature->GetMap()->GetWaterLevel(x, y)); - - Unit *Summon = m_creature->SummonCreature(creature_entry,x,y,z,m_creature->GetOrientation(), - TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - - if (Summon) - { - if (Unit *temp = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MEDIVH))) - Summon->AddThreat(temp,0.0f); - } - } - - void DoSelectSummon() - { - uint32 entry = 0; - - if ((mRiftWaveCount > 2 && mWaveId < 1) || mRiftWaveCount > 3) - mRiftWaveCount = 0; - - entry = PortalWaves[mWaveId].PortalMob[mRiftWaveCount]; - debug_log("TSCR: npc_time_rift: summoning wave Creature (Wave %u, Entry %u).",mRiftWaveCount,entry); - - ++mRiftWaveCount; - - if (entry == C_WHELP) - { - for(uint8 i = 0; i < 3; ++i) - DoSummonAtRift(entry); - }else DoSummonAtRift(entry); - } - - void UpdateAI(const uint32 diff) - { - if (!pInstance) - return; - - if (TimeRiftWave_Timer < diff) - { - DoSelectSummon(); - TimeRiftWave_Timer = 15000; - }else TimeRiftWave_Timer -= diff; - - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - debug_log("TSCR: npc_time_rift: not casting anylonger, i need to die."); - m_creature->setDeathState(JUST_DIED); - - if (pInstance->GetData(TYPE_RIFT) == IN_PROGRESS) - pInstance->SetData(TYPE_RIFT,SPECIAL); - } -}; - -CreatureAI* GetAI_npc_time_rift(Creature* pCreature) -{ - return new npc_time_riftAI (pCreature); -} - -#define SAY_SAAT_WELCOME -1269019 - -#define GOSSIP_ITEM_OBTAIN "[PH] Obtain Chrono-Beacon" -#define SPELL_CHRONO_BEACON 34975 -#define ITEM_CHRONO_BEACON 24289 - -bool GossipHello_npc_saat(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE && !pPlayer->HasItemCount(ITEM_CHRONO_BEACON,1)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(10000, pCreature->GetGUID()); - return true; - } - else if (pPlayer->GetQuestRewardStatus(QUEST_OPENING_PORTAL) && !pPlayer->HasItemCount(ITEM_CHRONO_BEACON,1)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT,GOSSIP_ITEM_OBTAIN,GOSSIP_SENDER_MAIN,GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(10001, pCreature->GetGUID()); - return true; - } - - pPlayer->SEND_GOSSIP_MENU(10002, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_saat(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->CastSpell(pPlayer,SPELL_CHRONO_BEACON,false); - } - return true; -} - -void AddSC_dark_portal() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_medivh_bm"; - newscript->GetAI = &GetAI_npc_medivh_bm; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_time_rift"; - newscript->GetAI = &GetAI_npc_time_rift; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_saat"; - newscript->pGossipHello = &GossipHello_npc_saat; - newscript->pGossipSelect = &GossipSelect_npc_saat; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h deleted file mode 100644 index 7bfd8c917d7..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/def_dark_portal.h +++ /dev/null @@ -1,35 +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_DARKPORTAL_H -#define DEF_DARKPORTAL_H - -#define TYPE_MEDIVH 1 -#define TYPE_RIFT 2 - -#define DATA_MEDIVH 10 -#define DATA_PORTAL_COUNT 11 -#define DATA_SHIELD 12 - -#define WORLD_STATE_BM 2541 -#define WORLD_STATE_BM_SHIELD 2540 -#define WORLD_STATE_BM_RIFT 2784 - -#define QUEST_OPENING_PORTAL 10297 -#define QUEST_MASTER_TOUCH 9836 - -#define C_TIME_KEEPER 17918 -#define C_RKEEP 21104 -#define C_RLORD 17839 -#define C_DEJA 17879 -#define C_TEMPO 17880 -#define C_AEONUS 17881 -#define C_ASSAS 17835 -#define C_WHELP 21818 -#define C_CHRON 17892 -#define C_EXECU 18994 -#define C_VANQU 18995 - -#endif - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp deleted file mode 100644 index f406bca7113..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/dark_portal/instance_dark_portal.cpp +++ /dev/null @@ -1,351 +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_Dark_Portal -SD%Complete: 50 -SDComment: Quest support: 9836, 10297. Currently in progress. -SDCategory: Caverns of Time, The Dark Portal -EndScriptData */ - -#include "precompiled.h" -#include "def_dark_portal.h" - -#define MAX_ENCOUNTER 2 - -#define C_MEDIVH 15608 -#define C_TIME_RIFT 17838 - -#define SPELL_RIFT_CHANNEL 31387 - -#define RIFT_BOSS 1 - -inline uint32 RandRiftBoss() { return ((rand()%2) ? C_RKEEP : C_RLORD); } - -float PortalLocation[4][4]= -{ - {-2041.06, 7042.08, 29.99, 1.30}, - {-1968.18, 7042.11, 21.93, 2.12}, - {-1885.82, 7107.36, 22.32, 3.07}, - {-1928.11, 7175.95, 22.11, 3.44} -}; - -struct Wave -{ - uint32 PortalBoss; //protector of current portal - uint32 NextPortalTime; //time to next portal, or 0 if portal boss need to be killed -}; - -static Wave RiftWaves[]= -{ - {RIFT_BOSS, 0}, - {C_DEJA, 0}, - {RIFT_BOSS, 120000}, - {C_TEMPO, 140000}, - {RIFT_BOSS, 120000}, - {C_AEONUS, 0} -}; - -struct TRINITY_DLL_DECL instance_dark_portal : public ScriptedInstance -{ - instance_dark_portal(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint32 mRiftPortalCount; - uint32 mShieldPercent; - uint8 mRiftWaveCount; - uint8 mRiftWaveId; - - uint32 NextPortal_Timer; - - uint64 MedivhGUID; - uint8 CurrentRiftId; - - void Initialize() - { - MedivhGUID = 0; - Clear(); - } - - void Clear() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - mRiftPortalCount = 0; - mShieldPercent = 100; - mRiftWaveCount = 0; - mRiftWaveId = 0; - - CurrentRiftId = 0; - - NextPortal_Timer = 0; - } - - void InitWorldState(bool Enable = true) - { - DoUpdateWorldState(WORLD_STATE_BM,Enable ? 1 : 0); - DoUpdateWorldState(WORLD_STATE_BM_SHIELD, 100); - DoUpdateWorldState(WORLD_STATE_BM_RIFT, 0); - } - - bool IsEncounterInProgress() - { - if (GetData(TYPE_MEDIVH) == IN_PROGRESS) - return true; - - return false; - } - - void OnPlayerEnter(Player* pPlayer) - { - if (GetData(TYPE_MEDIVH) == IN_PROGRESS) - return; - - pPlayer->SendUpdateWorldState(WORLD_STATE_BM,0); - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (pCreature->GetEntry() == C_MEDIVH) - MedivhGUID = pCreature->GetGUID(); - } - - //what other conditions to check? - bool CanProgressEvent() - { - if (instance->GetPlayers().isEmpty()) - return false; - - return true; - } - - uint8 GetRiftWaveId() - { - switch(mRiftPortalCount) - { - case 6: - mRiftWaveId = 2; - return 1; - case 12: - mRiftWaveId = 4; - return 3; - case 18: - return 5; - default: - return mRiftWaveId; - } - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_MEDIVH: - if (data == SPECIAL && m_auiEncounter[0] == IN_PROGRESS) - { - --mShieldPercent; - - DoUpdateWorldState(WORLD_STATE_BM_SHIELD, mShieldPercent); - - if (!mShieldPercent) - { - if (Creature* pMedivh = instance->GetCreature(MedivhGUID)) - { - if (pMedivh->isAlive()) - { - pMedivh->DealDamage(pMedivh, pMedivh->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_auiEncounter[0] = FAIL; - m_auiEncounter[1] = NOT_STARTED; - } - } - } - } - else - { - if (data == IN_PROGRESS) - { - debug_log("TSCR: Instance Dark Portal: Starting event."); - InitWorldState(); - m_auiEncounter[1] = IN_PROGRESS; - NextPortal_Timer = 15000; - } - - if (data == DONE) - { - //this may be completed further out in the post-event - debug_log("TSCR: Instance Dark Portal: Event completed."); - 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->GetQuestStatus(QUEST_OPENING_PORTAL) == QUEST_STATUS_INCOMPLETE) - pPlayer->AreaExploredOrEventHappens(QUEST_OPENING_PORTAL); - - if (pPlayer->GetQuestStatus(QUEST_MASTER_TOUCH) == QUEST_STATUS_INCOMPLETE) - pPlayer->AreaExploredOrEventHappens(QUEST_MASTER_TOUCH); - } - } - } - } - - m_auiEncounter[0] = data; - } - break; - case TYPE_RIFT: - if (data == SPECIAL) - { - if (mRiftPortalCount < 7) - NextPortal_Timer = 5000; - } - else - m_auiEncounter[1] = data; - break; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_MEDIVH: - return m_auiEncounter[0]; - case TYPE_RIFT: - return m_auiEncounter[1]; - case DATA_PORTAL_COUNT: - return mRiftPortalCount; - case DATA_SHIELD: - return mShieldPercent; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - if (data == DATA_MEDIVH) - return MedivhGUID; - - return 0; - } - - Creature* SummonedPortalBoss(Creature* pSource) - { - uint32 entry = RiftWaves[GetRiftWaveId()].PortalBoss; - - if (entry == RIFT_BOSS) - entry = RandRiftBoss(); - - float x,y,z; - pSource->GetRandomPoint(pSource->GetPositionX(),pSource->GetPositionY(),pSource->GetPositionZ(),10.0f,x,y,z); - //normalize Z-level if we can, if rift is not at ground level. - z = std::max(instance->GetHeight(x, y, MAX_HEIGHT), instance->GetWaterLevel(x, y)); - - debug_log("TSCR: Instance Dark Portal: Summoning rift boss entry %u.",entry); - - Creature* pSummoned = pSource->SummonCreature(entry,x,y,z,pSource->GetOrientation(), - TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); - - if (pSummoned) - return pSummoned; - - debug_log("TSCR: Instance Dark Portal: what just happened there? No boss, no loot, no fun..."); - return NULL; - } - - void DoSpawnPortal() - { - if (Creature* pMedivh = instance->GetCreature(MedivhGUID)) - { - int tmp = rand()%(4-1); - - if (tmp >= CurrentRiftId) - tmp++; - debug_log("TSCR: Instance Dark Portal: Creating Time Rift at locationId %i (old locationId was %u).",tmp,CurrentRiftId); - - CurrentRiftId = tmp; - - Creature* pTemp = pMedivh->SummonCreature(C_TIME_RIFT, - PortalLocation[tmp][0],PortalLocation[tmp][1],PortalLocation[tmp][2],PortalLocation[tmp][3], - TEMPSUMMON_CORPSE_DESPAWN,0); - if (pTemp) - { - - pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pTemp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - - if (Creature* pBoss = SummonedPortalBoss(pTemp)) - { - if (pBoss->GetEntry() == C_AEONUS) - { - pBoss->AddThreat(pMedivh,0.0f); - } - else - { - pBoss->AddThreat(pTemp,0.0f); - pTemp->CastSpell(pBoss,SPELL_RIFT_CHANNEL,false); - } - } - } - } - } - - void Update(uint32 diff) - { - if (m_auiEncounter[1] != IN_PROGRESS) - return; - - //add delay timer? - if (!CanProgressEvent()) - { - Clear(); - return; - } - - if (NextPortal_Timer) - { - if (NextPortal_Timer <= diff) - { - ++mRiftPortalCount; - - DoUpdateWorldState(WORLD_STATE_BM_RIFT, mRiftPortalCount); - - DoSpawnPortal(); - NextPortal_Timer = RiftWaves[GetRiftWaveId()].NextPortalTime; - }else NextPortal_Timer -= diff; - } - } -}; - -InstanceData* GetInstanceData_instance_dark_portal(Map* pMap) -{ - return new instance_dark_portal(pMap); -} - -void AddSC_instance_dark_portal() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "instance_dark_portal"; - newscript->GetInstanceData = &GetInstanceData_instance_dark_portal; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp deleted file mode 100644 index 9f2971083e4..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_anetheron.cpp +++ /dev/null @@ -1,312 +0,0 @@ - -#include "precompiled.h" -#include "def_hyjal.h" -#include "hyjal_trash.h" - -#define SPELL_CARRION_SWARM 31306 -#define SPELL_SLEEP 31298 -#define SPELL_VAMPIRIC_AURA 38196 -#define SPELL_INFERNO 31299 - -#define SAY_ONDEATH "The clock... is still... ticking." -#define SOUND_ONDEATH 10982 - -#define SAY_ONSLAY1 "Your hopes are lost!" -#define SAY_ONSLAY2 "Scream for me!" -#define SAY_ONSLAY3 "Pity, no time for a slow death!" -#define SOUND_ONSLAY1 10981 -#define SOUND_ONSLAY2 11038 -#define SOUND_ONSLAY3 11039 - -#define SAY_SWARM1 "The swarm is eager to feed!" -#define SAY_SWARM2 "Pestilence upon you!" -#define SOUND_SWARM1 10979 -#define SOUND_SWARM2 11037 - -#define SAY_SLEEP1 "You look tired..." -#define SAY_SLEEP2 "Sweet dreams..." -#define SOUND_SLEEP1 10978 -#define SOUND_SLEEP2 11545 - -#define SAY_INFERNO1 "Let fire rain from above!" -#define SAY_INFERNO2 "Earth and sky shall burn!" -#define SOUND_INFERNO1 10980 -#define SOUND_INFERNO2 11036 - -#define SAY_ONAGGRO "You are defenders of a doomed world! Flee here, and perhaps you will prolong your pathetic lives!" -#define SOUND_ONAGGRO 10977 - -struct TRINITY_DLL_DECL boss_anetheronAI : public hyjal_trashAI -{ - boss_anetheronAI(Creature *c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - SpellEntry *TempSpell = GET_SPELL(SPELL_SLEEP); - if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) - { - TempSpell->EffectImplicitTargetA[0] = 1; - TempSpell->EffectImplicitTargetB[0] = 0; - } - } - - uint32 SwarmTimer; - uint32 SleepTimer; - uint32 AuraTimer; - uint32 InfernoTimer; - bool pGo; - uint32 pos; - - void Reset() - { - damageTaken = 0; - SwarmTimer = 45000; - SleepTimer = 60000; - AuraTimer = 5000; - InfernoTimer = 45000; - - if (pInstance && IsEvent) - pInstance->SetData(DATA_ANETHERONEVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance && IsEvent) - pInstance->SetData(DATA_ANETHERONEVENT, IN_PROGRESS); - DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); - m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); - m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); - m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, 0); - break; - case 2: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); - m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, 0); - break; - } - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - - void JustDied(Unit *victim) - { - hyjal_trashAI::JustDied(victim); - if (pInstance && IsEvent) - pInstance->SetData(DATA_ANETHERONEVENT, DONE); - DoPlaySoundToSet(m_creature, SOUND_ONDEATH); - m_creature->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, 0); - } - - void UpdateAI(const uint32 diff) - { - if (IsEvent) - { - //Must update npc_escortAI - npc_escortAI::UpdateAI(diff); - if (!pGo) - { - pGo = true; - if (pInstance) - { - AddWaypoint(0, 4896.08, -1576.35, 1333.65); - AddWaypoint(1, 4898.68, -1615.02, 1329.48); - AddWaypoint(2, 4907.12, -1667.08, 1321.00); - AddWaypoint(3, 4963.18, -1699.35, 1340.51); - AddWaypoint(4, 4989.16, -1716.67, 1335.74); - AddWaypoint(5, 5026.27, -1736.89, 1323.02); - AddWaypoint(6, 5037.77, -1770.56, 1324.36); - AddWaypoint(7, 5067.23, -1789.95, 1321.17); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (SwarmTimer < diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,100,true)) - DoCast(target,SPELL_CARRION_SWARM); - - SwarmTimer = 45000+rand()%15000; - switch(rand()%2) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_SWARM1); - m_creature->MonsterYell(SAY_SWARM1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_SWARM2); - m_creature->MonsterYell(SAY_SWARM2, LANG_UNIVERSAL, 0); - break; - } - }else SwarmTimer -= diff; - - if (SleepTimer < diff) - { - for(uint8 i=0;i<3; ++i) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,100,true)) - target->CastSpell(target,SPELL_SLEEP,true); - } - SleepTimer = 60000; - switch(rand()%2) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_SLEEP1); - m_creature->MonsterYell(SAY_SLEEP1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_SLEEP2); - m_creature->MonsterYell(SAY_SLEEP2, LANG_UNIVERSAL, 0); - break; - } - }else SleepTimer -= diff; - if (AuraTimer < diff) - { - DoCast(m_creature, SPELL_VAMPIRIC_AURA,true); - AuraTimer = 10000+rand()%10000; - }else AuraTimer -= diff; - if (InfernoTimer < diff) - { - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,100,true), SPELL_INFERNO); - InfernoTimer = 45000; - switch(rand()%2) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_INFERNO1); - m_creature->MonsterYell(SAY_INFERNO1, LANG_UNIVERSAL, 0); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_INFERNO2); - m_creature->MonsterYell(SAY_INFERNO2, LANG_UNIVERSAL, 0); - break; - } - }else InfernoTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_anetheron(Creature* pCreature) -{ - return new boss_anetheronAI (pCreature); -} - -#define SPELL_IMMOLATION 31303 -#define SPELL_INFERNO_EFFECT 31302 - -struct TRINITY_DLL_DECL mob_towering_infernalAI : public ScriptedAI -{ - mob_towering_infernalAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - if (pInstance) - AnetheronGUID = pInstance->GetData64(DATA_ANETHERON); - } - - uint32 ImmolationTimer; - uint32 CheckTimer; - uint64 AnetheronGUID; - ScriptedInstance* pInstance; - - void Reset() - { - DoCast(m_creature, SPELL_INFERNO_EFFECT); - ImmolationTimer = 5000; - CheckTimer = 5000; - } - - void EnterCombat(Unit *who) - { - - } - - void KilledUnit(Unit *victim) - { - - } - - void JustDied(Unit *victim) - { - - } - - void MoveInLineOfSight(Unit *who) - { - if (m_creature->IsWithinDist(who, 50) && !m_creature->isInCombat() && m_creature->IsHostileTo(who)) - AttackStart(who); - } - - void UpdateAI(const uint32 diff) - { - if (CheckTimer < diff) - { - if (AnetheronGUID) - { - Creature* boss = Unit::GetCreature((*m_creature),AnetheronGUID); - if (!boss || (boss && boss->isDead())) - { - m_creature->setDeathState(JUST_DIED); - m_creature->RemoveCorpse(); - return; - } - } - CheckTimer = 5000; - }else CheckTimer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (ImmolationTimer < diff) - { - DoCast(m_creature, SPELL_IMMOLATION); - ImmolationTimer = 5000; - }else ImmolationTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_towering_infernal(Creature* pCreature) -{ - return new mob_towering_infernalAI (pCreature); -} - -void AddSC_boss_anetheron() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_anetheron"; - newscript->GetAI = &GetAI_boss_anetheron; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_towering_infernal"; - newscript->GetAI = &GetAI_mob_towering_infernal; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp deleted file mode 100644 index 4819a74fc0c..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_archimonde.cpp +++ /dev/null @@ -1,640 +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_Archimonde -SD%Complete: 85 -SDComment: Doomfires not completely offlike due to core limitations for random moving. Tyrande and second phase not fully implemented. -SDCategory: Caverns of Time, Mount Hyjal -EndScriptData */ - -#include "precompiled.h" -#include "def_hyjal.h" -#include "SpellAuras.h" -#include "hyjal_trash.h" - -//text id -1534018 are the text used when previous events complete. Not part of this script. -#define SAY_AGGRO -1534019 -#define SAY_DOOMFIRE1 -1534020 -#define SAY_DOOMFIRE2 -1534021 -#define SAY_AIR_BURST1 -1534022 -#define SAY_AIR_BURST2 -1534023 -#define SAY_SLAY1 -1534024 -#define SAY_SLAY2 -1534025 -#define SAY_SLAY3 -1534026 -#define SAY_ENRAGE -1534027 -#define SAY_DEATH -1534028 -#define SAY_SOUL_CHARGE1 -1534029 -#define SAY_SOUL_CHARGE2 -1534030 - -#define SPELL_DENOUEMENT_WISP 32124 -#define SPELL_ANCIENT_SPARK 39349 -#define SPELL_PROTECTION_OF_ELUNE 38528 - -#define SPELL_DRAIN_WORLD_TREE 39140 -#define SPELL_DRAIN_WORLD_TREE_2 39141 - -#define SPELL_FINGER_OF_DEATH 31984 -#define SPELL_HAND_OF_DEATH 35354 -#define SPELL_AIR_BURST 32014 -#define SPELL_GRIP_OF_THE_LEGION 31972 -#define SPELL_DOOMFIRE_STRIKE 31903 //summons two creatures -#define SPELL_DOOMFIRE_SPAWN 32074 -#define SPELL_DOOMFIRE 31945 -#define SPELL_SOUL_CHARGE_YELLOW 32045 -#define SPELL_SOUL_CHARGE_GREEN 32051 -#define SPELL_SOUL_CHARGE_RED 32052 -#define SPELL_UNLEASH_SOUL_YELLOW 32054 -#define SPELL_UNLEASH_SOUL_GREEN 32057 -#define SPELL_UNLEASH_SOUL_RED 32053 -#define SPELL_FEAR 31970 - -#define CREATURE_ARCHIMONDE 17968 -#define CREATURE_DOOMFIRE 18095 -#define CREATURE_DOOMFIRE_SPIRIT 18104 -#define CREATURE_ANCIENT_WISP 17946 -#define CREATURE_CHANNEL_TARGET 22418 - -#define NORDRASSIL_X 5503.713 -#define NORDRASSIL_Y -3523.436 -#define NORDRASSIL_Z 1608.781 - -struct mob_ancient_wispAI : public ScriptedAI -{ - mob_ancient_wispAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - ArchimondeGUID = 0; - } - - ScriptedInstance* pInstance; - uint64 ArchimondeGUID; - uint32 CheckTimer; - - void Reset() - { - CheckTimer = 1000; - - if (pInstance) - ArchimondeGUID = pInstance->GetData64(DATA_ARCHIMONDE); - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - void EnterCombat(Unit* who) {} - - void DamageTaken(Unit* done_by, uint32 &damage) { damage = 0; } - - void UpdateAI(const uint32 diff) - { - if (CheckTimer < diff) - { - if (Unit* Archimonde = Unit::GetUnit((*m_creature), ArchimondeGUID)) - { - if ((((Archimonde->GetHealth()*100) / Archimonde->GetMaxHealth()) < 2) || !Archimonde->isAlive()) - DoCast(m_creature, SPELL_DENOUEMENT_WISP); - else - DoCast(Archimonde, SPELL_ANCIENT_SPARK); - } - CheckTimer = 1000; - }else CheckTimer -= diff; - } -}; - -/* This script is merely a placeholder for the Doomfire that triggers Doomfire spell. It will - MoveChase the Doomfire Spirit always, until despawn (AttackStart is called upon it's spawn) */ -struct TRINITY_DLL_DECL mob_doomfireAI : public ScriptedAI -{ - mob_doomfireAI(Creature* c) : ScriptedAI(c) {} - - void Reset() { } - - void MoveInLineOfSight(Unit* who) { } - void EnterCombat(Unit* who) { } - void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; } -}; - -/* This is the script for the Doomfire Spirit Mob. This mob simply follow players or - travels in random directions if target cannot be found. */ -struct TRINITY_DLL_DECL mob_doomfire_targettingAI : public ScriptedAI -{ - mob_doomfire_targettingAI(Creature* c) : ScriptedAI(c) {} - - uint64 TargetGUID; - uint32 ChangeTargetTimer; - - void Reset() - { - TargetGUID = 0; - ChangeTargetTimer = 5000; - } - - void MoveInLineOfSight(Unit* who) - { - //will update once TargetGUID is 0. In case noone actually moves(not likely) and this is 0 - //when UpdateAI needs it, it will be forced to select randomPoint - if (!TargetGUID && who->GetTypeId() == TYPEID_PLAYER) - TargetGUID = who->GetGUID(); - } - - void EnterCombat(Unit* who) {} - - void DamageTaken(Unit *done_by, uint32 &damage) { damage = 0; } - - void UpdateAI(const uint32 diff) - { - if (ChangeTargetTimer < diff) - { - if (Unit *temp = Unit::GetUnit(*m_creature,TargetGUID)) - { - m_creature->GetMotionMaster()->MoveFollow(temp,0.0f,0.0f); - TargetGUID = 0; - } - else - { - float x,y,z = 0.0; - m_creature->GetRandomPoint(m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 40, x, y, z); - m_creature->GetMotionMaster()->MovePoint(0, x, y, z); - } - - ChangeTargetTimer = 5000; - }else ChangeTargetTimer -= diff; - } -}; - -/* Finally, Archimonde's script. His script isn't extremely complex, most are simply spells on timers. - The only complicated aspect of the battle is Finger of Death and Doomfire, with Doomfire being the - hardest bit to code. Finger of Death is simply a distance check - if no one is in melee range, then - select a random target and cast the spell on them. However, if someone IS in melee range, and this - is NOT the main tank (creature's victim), then we aggro that player and they become the new victim. - For Doomfire, we summon a mob (Doomfire Spirit) for the Doomfire mob to follow. It's spirit will - randomly select it's target to follow and then we create the random movement making it unpredictable. */ - -struct TRINITY_DLL_DECL boss_archimondeAI : public hyjal_trashAI -{ - boss_archimondeAI(Creature *c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint64 DoomfireSpiritGUID; - uint64 WorldTreeGUID; - - uint32 DrainNordrassilTimer; - uint32 FearTimer; - uint32 AirBurstTimer; - uint32 GripOfTheLegionTimer; - uint32 DoomfireTimer; - uint32 SoulChargeTimer; - uint32 SoulChargeCount; - uint32 MeleeRangeCheckTimer; - uint32 HandOfDeathTimer; - uint32 SummonWispTimer; - uint32 WispCount; - uint32 EnrageTimer; - uint32 CheckDistanceTimer; - - bool Enraged; - bool BelowTenPercent; - bool HasProtected; - bool IsChanneling; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_ARCHIMONDEEVENT, NOT_STARTED); - - DoomfireSpiritGUID = 0; - damageTaken = 0; - WorldTreeGUID = 0; - - DrainNordrassilTimer = 0; - FearTimer = 42000; - AirBurstTimer = 30000; - GripOfTheLegionTimer = 5000 + rand()%20000; - DoomfireTimer = 20000; - SoulChargeTimer = 2000 + rand()%27000; - SoulChargeCount = 0; - MeleeRangeCheckTimer = 15000; - HandOfDeathTimer = 2000; - WispCount = 0; // When ~30 wisps are summoned, Archimonde dies - EnrageTimer = 600000; // 10 minutes - CheckDistanceTimer = 30000; // This checks if he's too close to the World Tree (75 yards from a point on the tree), if true then he will enrage - SummonWispTimer = 0; - - Enraged = false; - BelowTenPercent = false; - HasProtected = false; - IsChanneling = false; - } - - void EnterCombat(Unit *who) - { - m_creature->InterruptSpell(CURRENT_CHANNELED_SPELL); - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - - if (pInstance) - pInstance->SetData(DATA_ARCHIMONDEEVENT, IN_PROGRESS); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - - if (victim && (victim->GetTypeId() == TYPEID_PLAYER)) - GainSoulCharge(CAST_PLR(victim)); - } - - void GainSoulCharge(Player* victim) - { - switch(victim->getClass()) - { - case CLASS_PRIEST: - case CLASS_PALADIN: - case CLASS_WARLOCK: - victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_RED, true); - break; - case CLASS_MAGE: - case CLASS_ROGUE: - case CLASS_WARRIOR: - victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_YELLOW, true); - break; - case CLASS_DRUID: - case CLASS_SHAMAN: - case CLASS_HUNTER: - victim->CastSpell(m_creature, SPELL_SOUL_CHARGE_GREEN, true); - break; - } - - SoulChargeTimer = 2000 + rand()%28000; - ++SoulChargeCount; - } - - void JustDied(Unit *victim) - { - hyjal_trashAI::JustDied(victim); - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_ARCHIMONDEEVENT, DONE); - } - - bool CanUseFingerOfDeath() - { - // First we check if our current victim is in melee range or not. - Unit* victim = m_creature->getVictim(); - if (victim && m_creature->IsWithinDistInMap(victim, m_creature->GetAttackDistance(victim))) - return false; - - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - if (m_threatlist.empty()) - return false; - - std::list targets; - std::list::iterator itr = m_threatlist.begin(); - for(; itr != m_threatlist.end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); - if (pUnit && pUnit->isAlive()) - targets.push_back(pUnit); - } - - if (targets.empty()) - return false; - - targets.sort(ObjectDistanceOrder(m_creature)); - Unit* target = targets.front(); - if (target) - { - if (!m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target))) - return true; // Cast Finger of Death - else // This target is closest, he is our new tank - m_creature->AddThreat(target, m_creature->getThreatManager().getThreat(m_creature->getVictim())); - } - - return false; - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == CREATURE_ANCIENT_WISP) - summoned->AI()->AttackStart(m_creature); - else - { - summoned->setFaction(m_creature->getFaction()); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - if (summoned->GetEntry() == CREATURE_DOOMFIRE_SPIRIT) - { - DoomfireSpiritGUID = summoned->GetGUID(); - } - - if (summoned->GetEntry() == CREATURE_DOOMFIRE) - { - summoned->CastSpell(summoned,SPELL_DOOMFIRE_SPAWN,false); - summoned->CastSpell(summoned,SPELL_DOOMFIRE,true,0,0,m_creature->GetGUID()); - - if (Unit *DoomfireSpirit = Unit::GetUnit(*m_creature, DoomfireSpiritGUID)) - { - summoned->GetMotionMaster()->MoveFollow(DoomfireSpirit,0.0f,0.0f); - DoomfireSpiritGUID = 0; - } - } - } - - //this is code doing close to what the summoning spell would do (spell 31903) - void SummonDoomfire(Unit* target) - { - m_creature->SummonCreature(CREATURE_DOOMFIRE_SPIRIT, - target->GetPositionX()+15.0,target->GetPositionY()+15.0,target->GetPositionZ(),0, - TEMPSUMMON_TIMED_DESPAWN, 27000); - - m_creature->SummonCreature(CREATURE_DOOMFIRE, - target->GetPositionX()-15.0,target->GetPositionY()-15.0,target->GetPositionZ(),0, - TEMPSUMMON_TIMED_DESPAWN, 27000); - } - - void UnleashSoulCharge() - { - m_creature->InterruptNonMeleeSpells(false); - - bool HasCast = false; - uint32 chargeSpell = 0; - uint32 unleashSpell = 0; - - switch(rand()%3) - { - case 0: - chargeSpell = SPELL_SOUL_CHARGE_RED; - unleashSpell = SPELL_UNLEASH_SOUL_RED; - break; - case 1: - chargeSpell = SPELL_SOUL_CHARGE_YELLOW; - unleashSpell = SPELL_UNLEASH_SOUL_YELLOW; - break; - case 2: - chargeSpell = SPELL_SOUL_CHARGE_GREEN; - unleashSpell = SPELL_UNLEASH_SOUL_GREEN; - break; - } - - if (m_creature->HasAura(chargeSpell)) - { - m_creature->RemoveAuraFromStack(chargeSpell); - DoCast(m_creature->getVictim(), unleashSpell); - HasCast = true; - SoulChargeCount--; - } - - if (HasCast) - SoulChargeTimer = 2000 + rand()%28000; - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->isInCombat()) - { - if (pInstance) - { - // Do not let the raid skip straight to Archimonde. Visible and hostile ONLY if Azagalor is finished. - if ((pInstance->GetData(DATA_AZGALOREVENT) < DONE) && ((m_creature->GetVisibility() != VISIBILITY_OFF) || (m_creature->getFaction() != 35))) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->setFaction(35); - } - else if ((pInstance->GetData(DATA_AZGALOREVENT) >= DONE) && ((m_creature->GetVisibility() != VISIBILITY_ON) || (m_creature->getFaction() == 35))) - { - m_creature->setFaction(1720); - m_creature->SetVisibility(VISIBILITY_ON); - } - } - - if (DrainNordrassilTimer < diff) - { - if (!IsChanneling) - { - Creature *temp = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 1200000); - - if (temp) - WorldTreeGUID = temp->GetGUID(); - - if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID)) - { - Nordrassil->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Nordrassil->SetDisplayId(11686); - DoCast(Nordrassil, SPELL_DRAIN_WORLD_TREE); - IsChanneling = true; - } - } - - if (Unit *Nordrassil = Unit::GetUnit(*m_creature, WorldTreeGUID)) - { - Nordrassil->CastSpell(m_creature, SPELL_DRAIN_WORLD_TREE_2, true); - DrainNordrassilTimer = 1000; - } - }else DrainNordrassilTimer -= diff; - } - - if (!UpdateVictim()) - return; - - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !BelowTenPercent && !Enraged) - BelowTenPercent = true; - - if (!Enraged) - { - if (EnrageTimer < diff) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) > 10) - { - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveIdle(); - Enraged = true; - DoScriptText(SAY_ENRAGE, m_creature); - } - }else EnrageTimer -= diff; - - if (CheckDistanceTimer < diff) - { - // To simplify the check, we simply summon a Creature in the location and then check how far we are from the creature - Creature* Check = m_creature->SummonCreature(CREATURE_CHANNEL_TARGET, NORDRASSIL_X, NORDRASSIL_Y, NORDRASSIL_Z, 0, TEMPSUMMON_TIMED_DESPAWN, 2000); - if (Check) - { - Check->SetVisibility(VISIBILITY_OFF); - - if (m_creature->IsWithinDistInMap(Check, 75)) - { - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveIdle(); - Enraged = true; - DoScriptText(SAY_ENRAGE, m_creature); - } - } - CheckDistanceTimer = 5000; - }else CheckDistanceTimer -= diff; - } - - if (BelowTenPercent) - { - if (!HasProtected) - { - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveIdle(); - - //all members of raid must get this buff - DoCast(m_creature->getVictim(), SPELL_PROTECTION_OF_ELUNE); - HasProtected = true; - Enraged = true; - } - - if (SummonWispTimer < diff) - { - DoSpawnCreature(CREATURE_ANCIENT_WISP, rand()%40, rand()%40, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - SummonWispTimer = 1500; - ++WispCount; - }else SummonWispTimer -= diff; - - if (WispCount >= 30) - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - - if (Enraged) - { - if (HandOfDeathTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_HAND_OF_DEATH); - HandOfDeathTimer = 2000; - }else HandOfDeathTimer -= diff; - return; // Don't do anything after this point. - } - - if (SoulChargeCount) - { - if (SoulChargeTimer < diff) - UnleashSoulCharge(); - else SoulChargeTimer -= diff; - } - - if (GripOfTheLegionTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_GRIP_OF_THE_LEGION); - GripOfTheLegionTimer = 5000 + rand()%20000; - }else GripOfTheLegionTimer -= diff; - - if (AirBurstTimer < diff) - { - if (rand()%2 == 0) - DoScriptText(SAY_AIR_BURST1, m_creature); - else - DoScriptText(SAY_AIR_BURST2, m_creature); - - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_AIR_BURST);//not on tank - AirBurstTimer = 25000 + rand()%15000; - }else AirBurstTimer -= diff; - - if (FearTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FEAR); - FearTimer = 42000; - }else FearTimer -= diff; - - if (DoomfireTimer < diff) - { - if (rand()%2 == 0) - DoScriptText(SAY_DOOMFIRE1, m_creature); - else - DoScriptText(SAY_DOOMFIRE2, m_creature); - - Unit *temp = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!temp) - temp = m_creature->getVictim(); - - //replace with spell cast 31903 once implicitTarget 73 implemented - SummonDoomfire(temp); - - //supposedly three doomfire can be up at the same time - DoomfireTimer = 20000; - }else DoomfireTimer -= diff; - - if (MeleeRangeCheckTimer < diff) - { - if (CanUseFingerOfDeath()) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FINGER_OF_DEATH); - MeleeRangeCheckTimer = 1000; - } - - MeleeRangeCheckTimer = 5000; - }else MeleeRangeCheckTimer -= diff; - - DoMeleeAttackIfReady(); - } - void WaypointReached(uint32 i){} -}; - -CreatureAI* GetAI_boss_archimonde(Creature* pCreature) -{ - return new boss_archimondeAI (pCreature); -} - -CreatureAI* GetAI_mob_doomfire(Creature* pCreature) -{ - return new mob_doomfireAI(pCreature); -} - -CreatureAI* GetAI_mob_doomfire_targetting(Creature* pCreature) -{ - return new mob_doomfire_targettingAI(pCreature); -} - -CreatureAI* GetAI_mob_ancient_wisp(Creature* pCreature) -{ - return new mob_ancient_wispAI(pCreature); -} - -void AddSC_boss_archimonde() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_archimonde"; - newscript->GetAI = &GetAI_boss_archimonde; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_doomfire"; - newscript->GetAI = &GetAI_mob_doomfire; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_doomfire_targetting"; - newscript->GetAI = &GetAI_mob_doomfire_targetting; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_ancient_wisp"; - newscript->GetAI = &GetAI_mob_ancient_wisp; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp deleted file mode 100644 index c4c928359c1..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_azgalor.cpp +++ /dev/null @@ -1,288 +0,0 @@ - -#include "precompiled.h" -#include "def_hyjal.h" -#include "hyjal_trash.h" - -#define SPELL_RAIN_OF_FIRE 31340 -#define SPELL_DOOM 31347 -#define SPELL_HOWL_OF_AZGALOR 31344 -#define SPELL_CLEAVE 31345 -#define SPELL_BERSERK 26662 - -#define SAY_ONDEATH "Your time is almost... up" -#define SOUND_ONDEATH 11002 - -#define SAY_ONSLAY1 "Reesh, hokta!" -#define SAY_ONSLAY2 "Don't fight it" -#define SAY_ONSLAY3 "No one is going to save you" -#define SOUND_ONSLAY1 11001 -#define SOUND_ONSLAY2 11048 -#define SOUND_ONSLAY3 11047 - -#define SAY_DOOM1 "Just a taste... of what awaits you" -#define SAY_DOOM2 "Suffer you despicable insect!" -#define SOUND_DOOM1 11046 -#define SOUND_DOOM2 11000 - -#define SAY_ONAGGRO "Abandon all hope! The legion has returned to finish what was begun so many years ago. This time there will be no escape!" -#define SOUND_ONAGGRO 10999 - -struct TRINITY_DLL_DECL boss_azgalorAI : public hyjal_trashAI -{ - boss_azgalorAI(Creature *c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - SpellEntry *TempSpell = GET_SPELL(SPELL_HOWL_OF_AZGALOR); - if (TempSpell) - TempSpell->EffectRadiusIndex[0] = 12;//100yards instead of 50000?! - } - - uint32 RainTimer; - uint32 DoomTimer; - uint32 HowlTimer; - uint32 CleaveTimer; - uint32 EnrageTimer; - bool enraged; - - bool pGo; - uint32 pos; - - void Reset() - { - damageTaken = 0; - RainTimer = 20000; - DoomTimer = 50000; - HowlTimer = 30000; - CleaveTimer = 10000; - EnrageTimer = 600000; - enraged = false; - - if (pInstance && IsEvent) - pInstance->SetData(DATA_AZGALOREVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance && IsEvent) - pInstance->SetData(DATA_AZGALOREVENT, IN_PROGRESS); - DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); - m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); - m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); - m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); - break; - case 2: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); - m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL); - break; - } - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - - void JustDied(Unit *victim) - { - hyjal_trashAI::JustDied(victim); - if (pInstance && IsEvent) - pInstance->SetData(DATA_AZGALOREVENT, DONE); - DoPlaySoundToSet(m_creature, SOUND_ONDEATH); - } - - void UpdateAI(const uint32 diff) - { - if (IsEvent) - { - //Must update npc_escortAI - npc_escortAI::UpdateAI(diff); - if (!pGo) - { - pGo = true; - if (pInstance) - { - AddWaypoint(0, 5492.91, -2404.61, 1462.63); - AddWaypoint(1, 5531.76, -2460.87, 1469.55); - AddWaypoint(2, 5554.58, -2514.66, 1476.12); - AddWaypoint(3, 5554.16, -2567.23, 1479.90); - AddWaypoint(4, 5540.67, -2625.99, 1480.89); - AddWaypoint(5, 5508.16, -2659.2, 1480.15); - AddWaypoint(6, 5489.62, -2704.05, 1482.18); - AddWaypoint(7, 5457.04, -2726.26, 1485.10); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (RainTimer < diff) - { - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,30,true), SPELL_RAIN_OF_FIRE); - RainTimer = 20000+rand()%15000; - }else RainTimer -= diff; - - if (DoomTimer < diff) - { - DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,100,true), SPELL_DOOM);//never on tank - DoomTimer = 45000+rand()%5000; - }else DoomTimer -= diff; - - if (HowlTimer < diff) - { - DoCast(m_creature, SPELL_HOWL_OF_AZGALOR); - HowlTimer = 30000; - }else HowlTimer -= diff; - - if (CleaveTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_CLEAVE); - CleaveTimer = 10000+rand()%5000; - }else CleaveTimer -= diff; - - if (EnrageTimer < diff && !enraged) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_BERSERK, true); - enraged = true; - EnrageTimer = 600000; - }else EnrageTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_azgalor(Creature* pCreature) -{ - return new boss_azgalorAI (pCreature); -} - -#define SPELL_THRASH 12787 -#define SPELL_CRIPPLE 31406 -#define SPELL_WARSTOMP 31408 - -struct TRINITY_DLL_DECL mob_lesser_doomguardAI : public hyjal_trashAI -{ - mob_lesser_doomguardAI(Creature *c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - if (pInstance) - AzgalorGUID = pInstance->GetData64(DATA_AZGALOR); - } - - uint32 CrippleTimer; - uint32 WarstompTimer; - uint32 CheckTimer; - uint64 AzgalorGUID; - ScriptedInstance* pInstance; - - void Reset() - { - CrippleTimer = 50000; - WarstompTimer = 10000; - DoCast(m_creature, SPELL_THRASH); - CheckTimer = 5000; - } - - void EnterCombat(Unit *who) - { - } - - void KilledUnit(Unit *victim) - { - - } - - void WaypointReached(uint32 i) - { - - } - - void MoveInLineOfSight(Unit *who) - { - if (m_creature->IsWithinDist(who, 50) && !m_creature->isInCombat() && m_creature->IsHostileTo(who)) - AttackStart(who); - } - - void JustDied(Unit *victim) - { - - } - - void UpdateAI(const uint32 diff) - { - if (CheckTimer < diff) - { - if (AzgalorGUID) - { - Creature* boss = Unit::GetCreature((*m_creature),AzgalorGUID); - if (!boss || (boss && boss->isDead())) - { - m_creature->setDeathState(JUST_DIED); - m_creature->RemoveCorpse(); - return; - } - } - CheckTimer = 5000; - }else CheckTimer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (WarstompTimer < diff) - { - DoCast(m_creature, SPELL_WARSTOMP); - WarstompTimer = 10000+rand()%5000; - }else WarstompTimer -= diff; - - if (CrippleTimer < diff) - { - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,100,true), SPELL_CRIPPLE); - CrippleTimer = 25000+rand()%5000; - }else CrippleTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_lesser_doomguard(Creature* pCreature) -{ - return new mob_lesser_doomguardAI (pCreature); -} - -void AddSC_boss_azgalor() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_azgalor"; - newscript->GetAI = &GetAI_boss_azgalor; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_lesser_doomguard"; - newscript->GetAI = &GetAI_mob_lesser_doomguard; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp deleted file mode 100644 index 59700ddac0a..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_kazrogal.cpp +++ /dev/null @@ -1,197 +0,0 @@ - -#include "precompiled.h" -#include "def_hyjal.h" -#include "hyjal_trash.h" - -#define SPELL_CLEAVE 31436 -#define SPELL_WARSTOMP 31480 -#define SPELL_MARK 31447 - -#define SOUND_ONDEATH 11018 - -#define SAY_ONSLAY1 "Shaza-Kiel!" -#define SAY_ONSLAY2 "You... are nothing!" -#define SAY_ONSLAY3 "Miserable nuisance!" -#define SOUND_ONSLAY1 11017 -#define SOUND_ONSLAY2 11053 -#define SOUND_ONSLAY3 11054 - -#define SAY_MARK1 "Your death will be a painful one." -#define SAY_MARK2 "You... are marked." -#define SOUND_MARK1 11016 -#define SOUND_MARK2 11052 - -#define SAY_ONAGGRO "Cry for mercy! Your meaningless lives will soon be forfeit." -#define SOUND_ONAGGRO 11015 - -struct TRINITY_DLL_DECL boss_kazrogalAI : public hyjal_trashAI -{ - boss_kazrogalAI(Creature *c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - SpellEntry *TempSpell = GET_SPELL(SPELL_MARK); - if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 1) - { - TempSpell->EffectImplicitTargetA[0] = 1; - TempSpell->EffectImplicitTargetB[0] = 0; - } - } - - uint32 CleaveTimer; - uint32 WarStompTimer; - uint32 MarkTimer; - uint32 MarkTimerBase; - bool pGo; - uint32 pos; - - void Reset() - { - damageTaken = 0; - CleaveTimer = 5000; - WarStompTimer = 15000; - MarkTimer = 45000; - MarkTimerBase = 45000; - - if (pInstance && IsEvent) - pInstance->SetData(DATA_KAZROGALEVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance && IsEvent) - pInstance->SetData(DATA_KAZROGALEVENT, IN_PROGRESS); - DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); - m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, NULL); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); - m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); - m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); - break; - case 2: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY3); - m_creature->MonsterYell(SAY_ONSLAY3, LANG_UNIVERSAL, NULL); - break; - } - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - - void JustDied(Unit *victim) - { - hyjal_trashAI::JustDied(victim); - if (pInstance && IsEvent) - pInstance->SetData(DATA_KAZROGALEVENT, DONE); - DoPlaySoundToSet(m_creature, SOUND_ONDEATH); - } - - void UpdateAI(const uint32 diff) - { - if (IsEvent) - { - //Must update npc_escortAI - npc_escortAI::UpdateAI(diff); - if (!pGo) - { - pGo = true; - if (pInstance) - { - AddWaypoint(0, 5492.91, -2404.61, 1462.63); - AddWaypoint(1, 5531.76, -2460.87, 1469.55); - AddWaypoint(2, 5554.58, -2514.66, 1476.12); - AddWaypoint(3, 5554.16, -2567.23, 1479.90); - AddWaypoint(4, 5540.67, -2625.99, 1480.89); - AddWaypoint(5, 5508.16, -2659.2, 1480.15); - AddWaypoint(6, 5489.62, -2704.05, 1482.18); - AddWaypoint(7, 5457.04, -2726.26, 1485.10); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (CleaveTimer < diff) - { - DoCast(m_creature, SPELL_CLEAVE); - CleaveTimer = 6000+rand()%15000; - }else CleaveTimer -= diff; - - if (WarStompTimer < diff) - { - DoCast(m_creature, SPELL_WARSTOMP); - WarStompTimer = 60000; - }else WarStompTimer -= diff; - - if (m_creature->HasAura(SPELL_MARK)) - m_creature->RemoveAurasDueToSpell(SPELL_MARK); - if (MarkTimer < diff) - { - //cast dummy, useful for bos addons - m_creature->CastCustomSpell(m_creature, SPELL_MARK, NULL, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); - - std::list t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (target && target->GetTypeId() == TYPEID_PLAYER && target->getPowerType() == POWER_MANA) - { - target->CastSpell(target, SPELL_MARK,true);//only cast on mana users - } - } - MarkTimerBase -= 5000; - if (MarkTimerBase < 5500) - MarkTimerBase = 5500; - MarkTimer = MarkTimerBase; - switch(rand()%3) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_MARK1); - m_creature->MonsterYell(SAY_MARK1, LANG_UNIVERSAL, NULL); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_MARK2); - m_creature->MonsterYell(SAY_MARK2, LANG_UNIVERSAL, NULL); - break; - } - }else MarkTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_kazrogal(Creature* pCreature) -{ - return new boss_kazrogalAI (pCreature); -} - -void AddSC_boss_kazrogal() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_kazrogal"; - newscript->GetAI = &GetAI_boss_kazrogal; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp deleted file mode 100644 index a7a9adf1676..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/boss_rage_winterchill.cpp +++ /dev/null @@ -1,192 +0,0 @@ - -#include "precompiled.h" -#include "def_hyjal.h" -#include "hyjal_trash.h" - -#define SPELL_FROST_ARMOR 31256 -#define SPELL_DEATH_AND_DECAY 31258 - -#define SPELL_FROST_NOVA 31250 -#define SPELL_ICEBOLT 31249 - -#define SAY_ONDEATH "You have won this battle, but not... the... war" -#define SOUND_ONDEATH 11026 - -#define SAY_ONSLAY1 "All life must perish!" -#define SAY_ONSLAY2 "Victory to the Legion!" -#define SOUND_ONSLAY1 11025 -#define SOUND_ONSLAY2 11057 - -#define SAY_DECAY1 "Crumble and rot!" -#define SAY_DECAY2 "Ashes to ashes, dust to dust" -#define SOUND_DECAY1 11023 -#define SOUND_DECAY2 11055 - -#define SAY_NOVA1 "Succumb to the icy chill... of death!" -#define SAY_NOVA2 "It will be much colder in your grave" -#define SOUND_NOVA1 11024 -#define SOUND_NOVA2 11058 - -#define SAY_ONAGGRO "The Legion's final conquest has begun! Once again the subjugation of this world is within our grasp. Let none survive!" -#define SOUND_ONAGGRO 11022 - -struct TRINITY_DLL_DECL boss_rage_winterchillAI : public hyjal_trashAI -{ - boss_rage_winterchillAI(Creature *c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - } - - uint32 FrostArmorTimer; - uint32 DecayTimer; - uint32 NovaTimer; - uint32 IceboltTimer; - bool pGo; - uint32 pos; - - void Reset() - { - damageTaken = 0; - FrostArmorTimer = 37000; - DecayTimer = 45000; - NovaTimer = 15000; - IceboltTimer = 10000; - - if (pInstance && IsEvent) - pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance && IsEvent) - pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, IN_PROGRESS); - DoPlaySoundToSet(m_creature, SOUND_ONAGGRO); - m_creature->MonsterYell(SAY_ONAGGRO, LANG_UNIVERSAL, 0); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY1); - m_creature->MonsterYell(SAY_ONSLAY1, LANG_UNIVERSAL, NULL); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_ONSLAY2); - m_creature->MonsterYell(SAY_ONSLAY2, LANG_UNIVERSAL, NULL); - break; - } - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - - void JustDied(Unit *victim) - { - hyjal_trashAI::JustDied(victim); - if (pInstance && IsEvent) - pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, DONE); - DoPlaySoundToSet(m_creature, SOUND_ONDEATH); - m_creature->MonsterYell(SAY_ONDEATH, LANG_UNIVERSAL, NULL); - } - - void UpdateAI(const uint32 diff) - { - if (IsEvent) - { - //Must update npc_escortAI - npc_escortAI::UpdateAI(diff); - if (!pGo) - { - pGo = true; - if (pInstance) - { - AddWaypoint(0, 4896.08, -1576.35, 1333.65); - AddWaypoint(1, 4898.68, -1615.02, 1329.48); - AddWaypoint(2, 4907.12, -1667.08, 1321.00); - AddWaypoint(3, 4963.18, -1699.35, 1340.51); - AddWaypoint(4, 4989.16, -1716.67, 1335.74); - AddWaypoint(5, 5026.27, -1736.89, 1323.02); - AddWaypoint(6, 5037.77, -1770.56, 1324.36); - AddWaypoint(7, 5067.23, -1789.95, 1321.17); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (FrostArmorTimer < diff) - { - DoCast(m_creature, SPELL_FROST_ARMOR); - FrostArmorTimer = 40000+rand()%20000; - }else FrostArmorTimer -= diff; - if (DecayTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_DEATH_AND_DECAY); - DecayTimer = 60000+rand()%20000; - switch(rand()%2) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_DECAY1); - m_creature->MonsterYell(SAY_DECAY1, LANG_UNIVERSAL, NULL); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_DECAY2); - m_creature->MonsterYell(SAY_DECAY2, LANG_UNIVERSAL, NULL); - break; - } - }else DecayTimer -= diff; - if (NovaTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FROST_NOVA); - NovaTimer = 30000+rand()%15000; - switch(rand()%2) - { - case 0: - DoPlaySoundToSet(m_creature, SOUND_NOVA1); - m_creature->MonsterYell(SAY_NOVA1, LANG_UNIVERSAL, NULL); - break; - case 1: - DoPlaySoundToSet(m_creature, SOUND_NOVA2); - m_creature->MonsterYell(SAY_NOVA2, LANG_UNIVERSAL, NULL); - break; - } - }else NovaTimer -= diff; - if (IceboltTimer < diff) - { - DoCast(SelectTarget(SELECT_TARGET_RANDOM,0,40,true), SPELL_ICEBOLT); - IceboltTimer = 11000+rand()%20000; - }else IceboltTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_rage_winterchill(Creature* pCreature) -{ - return new boss_rage_winterchillAI (pCreature); -} - -void AddSC_boss_rage_winterchill() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_rage_winterchill"; - newscript->GetAI = &GetAI_boss_rage_winterchill; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h deleted file mode 100644 index c08f28a4f3d..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/def_hyjal.h +++ /dev/null @@ -1,38 +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_HYJAL_H -#define DEF_HYJAL_H - -#define ERROR_INST_DATA "TSCR: Instance data not set properly for Mount Hyjal. Encounters will be buggy" - -enum -{ - WORLD_STATE_WAVES = 2842, - WORLD_STATE_ENEMY = 2453, - WORLD_STATE_ENEMYCOUNT = 2454, - - DATA_ANETHERON = 1, - DATA_ANETHERONEVENT = 2, - DATA_ARCHIMONDE = 3, - DATA_ARCHIMONDEEVENT = 4, - DATA_AZGALOR = 5, - DATA_AZGALOREVENT = 6, - DATA_JAINAPROUDMOORE = 7, - DATA_KAZROGAL = 8, - DATA_KAZROGALEVENT = 9, - DATA_RAGEWINTERCHILL = 10, - DATA_RAGEWINTERCHILLEVENT = 11, - DATA_THRALL = 12, - DATA_TYRANDEWHISPERWIND = 13, - DATA_TRASH = 14, - DATA_RESET_TRASH_COUNT = 15, - DATA_ALLIANCE_RETREAT = 16, - DATA_HORDE_RETREAT = 17, - DATA_RAIDDAMAGE = 18, - DATA_RESET_RAIDDAMAGE = 19, - TYPE_RETREAT = 20 -}; -#endif - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp deleted file mode 100644 index a7861e11ccc..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal.cpp +++ /dev/null @@ -1,246 +0,0 @@ - /* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Hyjal -SD%Complete: 80 -SDComment: gossip text id's unknown -SDCategory: Caverns of Time, Mount Hyjal -EndScriptData */ - -/* ContentData -npc_jaina_proudmoore -npc_thrall -npc_tyrande_whisperwind -EndContentData */ - -#include "precompiled.h" -#include "hyjalAI.h" - -#define GOSSIP_ITEM_BEGIN_ALLY "My companions and I are with you, Lady Proudmoore." -#define GOSSIP_ITEM_ANETHERON "We are ready for whatever Archimonde might send our way, Lady Proudmoore." - -#define GOSSIP_ITEM_BEGIN_HORDE "I am with you, Thrall." -#define GOSSIP_ITEM_AZGALOR "We have nothing to fear." - -#define GOSSIP_ITEM_RETREAT "We can't keep this up. Let's retreat!" - -#define GOSSIP_ITEM_TYRANDE "Aid us in defending Nordrassil" -#define ITEM_TEAR_OF_GODDESS 24494 - - -CreatureAI* GetAI_npc_jaina_proudmoore(Creature* pCreature) -{ - hyjalAI* ai = new hyjalAI(pCreature); - - ai->Reset(); - ai->EnterEvadeMode(); - - ai->Spell[0].SpellId = SPELL_BLIZZARD; - ai->Spell[0].Cooldown = 15000 + rand()%20000; - ai->Spell[0].TargetType = TARGETTYPE_RANDOM; - - ai->Spell[1].SpellId = SPELL_PYROBLAST; - ai->Spell[1].Cooldown = 5500 + rand()%4000; - ai->Spell[1].TargetType = TARGETTYPE_RANDOM; - - ai->Spell[2].SpellId = SPELL_SUMMON_ELEMENTALS; - ai->Spell[2].Cooldown = 15000 + rand()%30000; - ai->Spell[2].TargetType = TARGETTYPE_SELF; - - return ai; -} - -bool GossipHello_npc_jaina_proudmoore(Player* pPlayer, Creature* pCreature) -{ - hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); - if (ai->EventBegun) - return false; - - uint32 RageEncounter = ai->GetInstanceData(DATA_RAGEWINTERCHILLEVENT); - uint32 AnetheronEncounter = ai->GetInstanceData(DATA_ANETHERONEVENT); - if (RageEncounter == NOT_STARTED) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_ALLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - else if (RageEncounter == DONE && AnetheronEncounter == NOT_STARTED) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_ANETHERON, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - else if (RageEncounter == DONE && AnetheronEncounter == DONE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - - if (pPlayer->isGameMaster()) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_jaina_proudmoore(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF + 1: - ai->StartEvent(pPlayer); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - ai->FirstBossDead = true; - ai->WaveCount = 9; - ai->StartEvent(pPlayer); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - ai->Retreat(); - break; - case GOSSIP_ACTION_INFO_DEF: - ai->Debug = !ai->Debug; - debug_log("TSCR: HyjalAI - Debug mode has been toggled"); - break; - } - return true; -} - -CreatureAI* GetAI_npc_thrall(Creature* pCreature) -{ - hyjalAI* ai = new hyjalAI(pCreature); - - ai->Reset(); - ai->EnterEvadeMode(); - - ai->Spell[0].SpellId = SPELL_CHAIN_LIGHTNING; - ai->Spell[0].Cooldown = 3000 + rand()%5000; - ai->Spell[0].TargetType = TARGETTYPE_VICTIM; - - ai->Spell[1].SpellId = SPELL_SUMMON_DIRE_WOLF; - ai->Spell[1].Cooldown = 6000 + rand()%35000; - ai->Spell[1].TargetType = TARGETTYPE_RANDOM; - - return ai; -} - -bool GossipHello_npc_thrall(Player* pPlayer, Creature* pCreature) -{ - hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); - if (ai->EventBegun) - return false; - - uint32 AnetheronEvent = ai->GetInstanceData(DATA_ANETHERONEVENT); - // Only let them start the Horde phases if Anetheron is dead. - if (AnetheronEvent == DONE && ai->GetInstanceData(DATA_ALLIANCE_RETREAT)) - { - uint32 KazrogalEvent = ai->GetInstanceData(DATA_KAZROGALEVENT); - uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT); - if (KazrogalEvent == NOT_STARTED) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BEGIN_HORDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - else if (KazrogalEvent == DONE && AzgalorEvent == NOT_STARTED) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_AZGALOR, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - else if (AzgalorEvent == DONE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_RETREAT, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3); - } - - if (pPlayer->isGameMaster()) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_TRAINER, "[GM] Toggle Debug Timers", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - - pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_thrall(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); - ai->DeSpawnVeins();//despawn the alliance veins - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF + 1: - ai->StartEvent(pPlayer); - break; - case GOSSIP_ACTION_INFO_DEF + 2: - ai->FirstBossDead = true; - ai->WaveCount = 9; - ai->StartEvent(pPlayer); - break; - case GOSSIP_ACTION_INFO_DEF + 3: - ai->Retreat(); - break; - case GOSSIP_ACTION_INFO_DEF: - ai->Debug = !ai->Debug; - debug_log("TSCR: HyjalAI - Debug mode has been toggled"); - break; - } - return true; -} - -CreatureAI* GetAI_npc_tyrande_whisperwind(Creature* pCreature) -{ - hyjalAI* ai = new hyjalAI(pCreature); - ai->Reset(); - ai->EnterEvadeMode(); - return ai; -} - -bool GossipHello_npc_tyrande_whisperwind(Player* pPlayer, Creature* pCreature) -{ - hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); - uint32 AzgalorEvent = ai->GetInstanceData(DATA_AZGALOREVENT); - - // Only let them get item if Azgalor is dead. - if (AzgalorEvent == DONE && !pPlayer->HasItemCount(ITEM_TEAR_OF_GODDESS,1)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TYRANDE, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_tyrande_whisperwind(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) - { - ItemPosCountVec dest; - uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_TEAR_OF_GODDESS, 1); - if (msg == EQUIP_ERR_OK) - { - Item* item = pPlayer->StoreNewItem(dest, ITEM_TEAR_OF_GODDESS, true); - if (item && pPlayer) - pPlayer->SendNewItem(item,1,true,false,true); - } - pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); - hyjalAI* ai = CAST_AI(hyjalAI, pCreature->AI()); - } - return true; -} - -void AddSC_hyjal() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_jaina_proudmoore"; - newscript->GetAI = &GetAI_npc_jaina_proudmoore; - newscript->pGossipHello = &GossipHello_npc_jaina_proudmoore; - newscript->pGossipSelect = &GossipSelect_npc_jaina_proudmoore; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_thrall"; - newscript->GetAI = &GetAI_npc_thrall; - newscript->pGossipHello = &GossipHello_npc_thrall; - newscript->pGossipSelect = &GossipSelect_npc_thrall; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_tyrande_whisperwind"; - newscript->pGossipHello = &GossipHello_npc_tyrande_whisperwind; - newscript->pGossipSelect = &GossipSelect_npc_tyrande_whisperwind; - newscript->GetAI = &GetAI_npc_tyrande_whisperwind; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp deleted file mode 100644 index 726ce62b4c9..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.cpp +++ /dev/null @@ -1,1159 +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: HyjalAI -SD%Complete: 90 -SDComment: -SDCategory: Caverns of Time, Mount Hyjal -EndScriptData */ - -#include "precompiled.h" -#include "hyjalAI.h" -#include "hyjal_trash.h" -#include "MapManager.h" -#include "Language.h" -#include "Chat.h" -#include "Object.h" - -#define SPAWN_GARG_GATE 0 -#define SPAWN_WYRM_GATE 1 -#define SPAWN_NEAR_TOWER 2 -// Locations for summoning gargoyls and frost wyrms in special cases -float SpawnPointSpecial[3][3]= -{ - {5497.08, -2493.23, 1535.72}, //spawn point for the gargoyles near the horde gate - {5624.53, -2548.12, 1551.54}, //spawn point for the frost wyrm near the horde gate - {5604.41, -2811.98, 1547.77} //spawn point for the gargoyles and wyrms near the horde tower -}; - -// Locations for summoning waves in Alliance base -float AllianceBase[4][3]= -{ - {4928.48, -1526.38, 1326.83}, - {4923.54, -1514.29, 1327.98}, - {4928.41, -1510.35, 1327.99}, - {4938.35, -1521.00, 1326.69} -}; - -float JainaDummySpawn[2][4]= -{ - {5497.01, -2719.03, 1483.08, 2.90426}, - {5484.98, -2721.69, 1483.39, 6.00656} -}; - - -// Locations for summoning waves in Horde base -float HordeBase[4][3]= -{ - {5458.01, -2340.27, 1459.60}, - {5466.01, -2334.69, 1460.06}, - {5468.45, -2355.13, 1459.99}, - {5479.06, -2344.16, 1461.74} -}; - -// Lady Jaina's waypoints when retreathing -float JainaWPs[2][3]= -{ - {5078.56, -1789.79, 1320.73},//next to the small stairs - {5037.38, -1778.39, 1322.61},//center of alliance base -}; - -float InfernalPos[8][3]=//spawn points for the infernals in the horde base -{ - {5453.59, -2764.52, 1493.50}, - {5478.4, -2781.77, 1497.52}, - {5506.09, -2780.53, 1496.32}, - {5532.1, -2763.42, 1492.37}, - {5544.16, -2733.99, 1487.14}, - {5536.19, -2708.18, 1480.01}, - {5510.16, -2691.75, 1479.66}, - {5482.39, -2689.19, 1481.09} -}; - -float InfernalSPWP[26][4]=//spawn points for the infernals in the horde base used in the cleaning wave -{ - {5490.96, -2718.72, 1482.96, 0.49773}, - {5449.51, -2723.32, 1485.69, 2.69685}, - {5520.83, -2624.68, 1483.82, 1.20459}, - {5558.28, -2629.26, 1485.76, 0.37992}, - {5567.97, -2758.69, 1494.10, 5.04125}, - {5384.90, -2793.47, 1503.90, 5.55412}, - {5495.33, -2814.06, 1501.56, 1.12055}, - {5472.63, -2929.39, 1538.31, 1.95777}, - {5334.72, -2952.29, 1534.34, 0.50869}, - {5398.36, -2872.46, 1512.38, 0.76787}, - {5514.39, -2768.63, 1492.30, 1.55721}, - {5598.91, -2703.75, 1495.64, 2.56644}, - {5467.80, -2655.93, 1482.27, 0.85819}, - {5399.83, -2985.24, 1545.04, 5.92559}, - {5232.13, -2967.05, 1553.09, 5.41351}, - {5272.02, -3082.52, 1567.09, 3.40681}, - {5343.26, -3120.71, 1582.92, 3.16727}, - {5371.26, -3175.24, 1587.41, 6.10466}, - {5434.67, -3177.91, 1579.25, 2.77850}, - {5237.39, -3149.25, 1593.59, 0.83855}, - {5202.15, -3016.64, 1566.28, 3.31256}, - {5302.54, -2914.37, 1528.53, 3.37146}, - {5439.04, -2834.81, 1508.80, 2.14231}, - {5421.33, -2771.04, 1494.28, 6.06223}, - {5549.76, -2692.93, 1482.68, 2.19414}, - {5459.78, -2755.71, 1490.68, 1.05139} -}; - -float VeinPos[14][8]=//spawn points of the ancient gem veins -{ - {5184.84, -1982.59, 1382.66, 2.58079, 0, 0, 0.960944, 0.276742}, //alliance - {5107.66, -2071.16, 1368.37, 2.65148, 0, 0, 0.970124, 0.242611}, //alliance - {5040.53, -2227.65, 1403.17, 3.35049, 0, 0, 0.99455, -0.104257}, //alliance - {5187.59, -2453.12, 1455.51, 5.87943, 0, 0, 0.20051, -0.979692}, //alliance - {5429.43, -2340.65, 1465.38, 4.7681, 0, 0, 0.687138, -0.726527}, //alliance - {5463.99, -2315.95, 1470.29, 1.52045, 0, 0, 0.689084, 0.724682}, //alliance - {5624.65, -2495.09, 1510.11, 0.0124869, 0, 0, 0.00624342, 0.999981}, //alliance - {5285.41, -3348.32, 1663.01, 1.57152, 0, 0, 0.707362, 0.706852}, //horde - {5417.69, -3372.52, 1656.31, 0.361993, 0, 0, 0.18001, 0.983665}, //horde - {5315.34, -3238.32, 1622.88, 3.03627, 0, 0, 0.998614, 0.0526347}, //horde - {5303.4, -3096.44, 1596.41, 1.72073, 0, 0, 0.758081, 0.65216}, //horde - {5265.13, -3177.27, 1616.22, 0.813604, 0, 0, 0.395674, 0.918391}, //horde - {5374.3, -3420.59, 1653.43, 1.45762, 0, 0, 0.665981, 0.745969}, //horde - {5441.54, -3321.59, 1651.55, 0.258306, 0, 0, 0.128794, 0.991671} //horde -}; - -float AllianceOverrunGargPos[5][4]=//gargoyle spawn points in the alliance overrun -{ - {5279.94, -2049.68, 1311.38, 0},//garg1 - {5289.15, -2219.06, 1291.12, 0},//garg2 - {5202.07, -2136.10, 1305.07, 2.8},//garg3 - {5071.52, -2425.63, 1454.48, 5.54},//garg4 - {5120.65, -2467.92, 1463.93, 2.54}//garg5 -}; - -float AllianceFirePos[92][8]=//spawn points for the fire visuals (GO) in the alliance base -{ - {5039.9, -1796.84, 1323.88, 2.59222, 0, 0, 0.962511, 0.271243}, - {5087.2, -1795.2, 1320.68, 1.03946, 0, 0, 0.496644, 0.867954}, - {5112.68, -1806.66, 1359.93, 1.37799, 0, 0, 0.63576, 0.771887}, - {5095.61, -1793.27, 1359.78, 0.580806, 0, 0, 0.286338, 0.958129}, - {5090.43, -1784.45, 1360.44, 0.796784, 0, 0, 0.387937, 0.921686}, - {5139.25, -1783.11, 1359.39, 3.30849, 0, 0, 0.99652, -0.0833509}, - {5112.16, -1763.72, 1361.35, 5.10312, 0, 0, 0.556388, -0.830922}, - {4981.18, -1793.98, 1335.7, 3.23072, 0, 0, 0.999007, -0.0445498}, - {4996.57, -1766.75, 1341.62, 3.5331, 0, 0, 0.980902, -0.194505}, - {4983.74, -1769.25, 1345.75, 3.79228, 0, 0, 0.947541, -0.319635}, - {4996.01, -1774.43, 1330.71, 3.07364, 0, 0, 0.999423, 0.0339693}, - {5094.2, -1726.13, 1330.55, 1.56175, 0, 0, 0.703901, 0.710298}, - {5079.82, -1721.24, 1336.26, 1.18868, 0, 0, 0.559964, 0.828517}, - {5077.68, -1717.15, 1327.78, 0.0145145, 0, 0, 0.00725717, 0.999974}, - {5122.27, -1738.22, 1341.67, 0.835256, 0, 0, 0.405593, 0.914054}, - {5131.88, -1741.15, 1335.25, 2.15472, 0, 0, 0.880712, 0.473653}, - {5196.93, -1772.99, 1345.2, 0.128397, 0, 0, 0.0641544, 0.99794}, - {5225.33, -1756.06, 1344.17, 3.04223, 0, 0, 0.998766, 0.0496599}, - {5224.84, -1767.05, 1360.06, 3.19538, 0, 0, 0.999638, -0.0268922}, - {5202.05, -1763.47, 1361.68, 2.59455, 0, 0, 0.962826, 0.270122}, - {5194.74, -1766.66, 1356.94, 0.0734191, 0, 0, 0.0367013, 0.999326}, - {5159.67, -1832.97, 1344.5, 5.17457, 0, 0, 0.526356, -0.850264}, - {5096.17, -1858.73, 1332.46, 5.30021, 0, 0, 0.471939, -0.881631}, - {5110.7, -1856.59, 1342.84, 5.97564, 0, 0, 0.153167, -0.9882}, - {5109.76, -1855.3, 1332.38, 4.89572, 0, 0, 0.639411, -0.768865}, - {5068.95, -1837.37, 1328.81, 2.61569, 0, 0, 0.965628, 0.25993}, - {5064.4, -1824.77, 1329.02, 2.16409, 0, 0, 0.88292, 0.469524}, - {5059.89, -1848.79, 1329.59, 0.0709955, 0, 0, 0.0354903, 0.99937}, - {5014.37, -1851.39, 1322.56, 4.66949, 0, 0, 0.722111, -0.691777}, - {5025.1, -1848.27, 1323.39, 4.44565, 0, 0, 0.794854, -0.606801}, - {4942.63, -1890.13, 1326.59, 3.28719, 0, 0, 0.997351, -0.0727343}, - {4937.95, -1888.71, 1352.41, 3.41678, 0, 0, 0.990549, -0.13716}, - {4922.48, -1881.92, 1352.41, 5.03077, 0, 0, 0.586075, -0.810257}, - {4915.35, -1894.32, 1351.24, 6.22457, 0, 0, 0.0293048, -0.999571}, - {4922.71, -1904.84, 1352.56, 1.37866, 0, 0, 0.63602, 0.771672}, - {4932.89, -1905.49, 1352.56, 1.89702, 0, 0, 0.812549, 0.582893}, - {5011.83, -1861.05, 1345.86, 4.43777, 0, 0, 0.797239, -0.603664}, - {5011.83, -1861.05, 1363.26, 4.748, 0, 0, 0.694406, -0.719583}, - {5021.46, -1858.35, 1342.17, 4.86188, 0, 0, 0.652329, -0.757936}, - {4995.02, -1698.3, 1370.38, 6.15779, 0, 0, 0.0626579, -0.998035}, - {5119.85, -1728.9, 1336.04, 5.87112, 0, 0, 0.204579, -0.97885}, - {5214.75, -1751.02, 1342.5, 5.08965, 0, 0, 0.561972, -0.827156}, - {5075.04, -1822.43, 1328.87, 3.99951, 0, 0, 0.9094, -0.415924}, - {5057.09, -1823.32, 1350.35, 3.88169, 0, 0, 0.93231, -0.361659}, - {4984.6, -1816.99, 1329.21, 3.05308, 0, 0, 0.999021, 0.0442417}, - {4983.35, -1811.55, 1356.82, 3.33975, 0, 0, 0.995096, -0.098917}, - {4984.11, -1825.73, 1350.76, 2.26375, 0, 0, 0.905211, 0.424962}, - {4968.47, -1786.46, 1354.09, 3.07663, 0, 0, 0.999473, 0.0324733}, - {5061.82, -1751.16, 1339.07, 5.94727, 0, 0, 0.167171, -0.985928}, - {5063.75, -1763, 1351.91, 0.759707, 0, 0, 0.370784, 0.928719}, - {5078.65, -1708.26, 1353.9, 1.27022, 0, 0, 0.593264, 0.805008}, - {4983.19, -1755.96, 1331.13, 4.28221, 0, 0, 0.841733, -0.539894}, - {4972.76, -1755.3, 1332.5, 4.21938, 0, 0, 0.858276, -0.513188}, - {4961.65, -1760.82, 1351.69, 3.56515, 0, 0, 0.977659, -0.210198}, - {5086.45, -1779.83, 1321.62, 6.23157, 0, 0, 0.0258051, -0.999667}, - {5063.15, -1756.74, 1328.56, 0.886926, 0, 0, 0.42907, 0.903271}, - {5042.45, -1800.61, 1323.88, 2.50093, 0, 0, 0.949131, 0.31488}, - {5084.74, -1725.35, 1327.89, 1.65034, 0, 0, 0.734663, 0.678432}, - {4993.25, -1758.1, 1331.07, 3.49995, 0, 0, 0.98399, -0.178223}, - {5078.53, -1867.85, 1348.91, 5.85612, 0, 0, 0.211913, -0.977288}, - {5080.74, -1869.73, 1333.18, 6.18206, 0, 0, 0.0505424, -0.998722}, - {5089.55, -1894.13, 1356.08, 1.52072, 0, 0, 0.689181, 0.724589}, - {5113.24, -1899.49, 1363.77, 1.50108, 0, 0, 0.682034, 0.731321}, - {4984.18, -1907.69, 1325.62, 3.82193, 0, 0, 0.942698, -0.333646}, - {5094.14, -2432.08, 1429.38, 4.70083, 0, 0, 0.711182, -0.703007}, - {5329.89, -2113.30, 1281.06, 5.60560, 0, 0, 0.332347, -0.943157}, - {5170.87, -2148.13, 1278.32, 1.63540, 0, 0, 0.729573, 0.683903 }, - {5132.94, -1960.25, 1367.8, 3.69787, 0, 0, 0.961568, -0.274566}, - {5280.82, -2351.55, 1431.57, 4.46913, 0, 0, 0.787677, -0.616088}, - {5176.78, -2121.43, 1295.27, 3.24153, 0, 0, 0.998752, -0.04995}, - {5332.75, -2101.41, 1296.37, 5.50350, 0, 0, 0.380043, -0.924969}, - {5265.70, -2050.27, 1287.57, 0.50051, 0, 0, 0.247655, 0.968848 }, - {5194.21, -2129.89, 1274.04, 3.08053, 0, 0, 0.999534, 0.0305272}, - {5225.81, -1985.50, 1364.15, 0.37247, 0, 0, 0.185163, 0.982708 }, - {5339.46, -2204.47, 1280.45, 0.99921, 0, 0, 0.479081, 0.877771 }, - {5269.63, -2020.57, 1299.62, 3.00201, 0, 0, 0.997566, 0.0697332}, - {5111.54, -2445.70, 1435.31, 2.70983, 0, 0, 0.976788, 0.214207 }, - {5111.24, -1901.14, 1355.33, 1.61028, 0, 0, 0.720929, 0.693009 }, - {5310.42, -2207.82, 1277.46, 0.50441, 0, 0, 0.249544, 0.968363 }, - {5150.81, -2042.13, 1394.3, 2.21031, 0, 0, 0.893534, 0.448995 }, - {5224.84, -2376.61, 1366.33, 5.0621, 0, 0, 0.573311, -0.819338}, - {5105.41, -2454.86, 1446.16, 4.64584, 0, 0, 0.730239, -0.683191}, - {5309.65, -2188.28, 1266.84, 5.56631, 0, 0, 0.350811, -0.936446}, - {5281.46, -2047.82, 1287.67, 2.44909, 0, 0, 0.940652, 0.339373 }, - {5325.45, -2189.41, 1309.6, 6.23783, 0, 0, 0.0226771, -0.999743}, - {5190.96, -2142.54, 1293.03, 6.25668, 0, 0, 0.0132544, -0.999912}, - {5089.99, -2467.49, 1441.8, 0.77381, 0, 0, 0.377326, 0.92608 }, - {5195.08, -2129.01, 1285.36, 3.55727, 0, 0, 0.978480, -0.206344}, - {5353.76, -2116.28, 1299.27, 6.17894, 0, 0, 0.0521006, -0.998642}, - {5271.14, -2037.38, 1299.24, 4.07879, 0, 0, 0.892201, -0.451638}, - {5332.5 , -2181.28, 1279.95, 4.6906, 0, 0, 0.714768, -0.699362}, - {5108.2 , -2429.84, 1427.73, 4.5194, 0, 0, 0.771943, -0.635691} -}; - -float HordeFirePos[65][8]=//spawn points for the fire visuals (GO) in the horde base -{ - {5524.11, -2612.73, 1483.38, 1.96198, 0, 0, 0.831047, 0.556202}, - {5514.42, -2617.19, 1505.77, 1.82453, 0, 0, 0.790892, 0.611956}, - {5510.21, -2624.77, 1485.34, 1.71065, 0, 0, 0.754783, 0.655974}, - {5570.72, -2619.04, 1487.62, 0.728898, 0, 0, 0.356435, 0.93432}, - {5570.29, -2639.37, 1487.31, 1.49308, 0, 0, 0.679104, 0.734042}, - {5583.56, -2637.2, 1503.78, 1.46559, 0, 0, 0.668951, 0.743307}, - {5571.53, -2626.81, 1510.99, 0.362107, 0, 0, 0.180066, 0.983654}, - {5545.97, -2659.62, 1489.64, 5.07055, 0, 0, 0.569845, -0.821752}, - {5557.44, -2675.91, 1482.58, 1.70118, 0, 0, 0.751671, 0.659539}, - {5594.98, -2742.31, 1495.51, 4.5993, 0, 0, 0.74594, -0.666013}, - {5599.65, -2755.6, 1505.05, 1.66896, 0, 0, 0.740947, 0.671564}, - {5565.95, -2774.75, 1499.48, 6.22425, 0, 0, 0.0294611, -0.999566}, - {5567.1, -2769.7, 1511.17, 5.99257, 0, 0, 0.144799, -0.989461}, - {5572.84, -2774.16, 1527.06, 0.836428, 0, 0, 0.406129, 0.913816}, - {5538.32, -2805.94, 1498.87, 4.30082, 0, 0, 0.836674, -0.547701}, - {5515.66, -2801.74, 1503.53, 5.57316, 0, 0, 0.347602, -0.937642}, - {5516.76, -2827.14, 1501.15, 0.35026, 0, 0, 0.174236, 0.984704}, - {5536.13, -2813.51, 1537.21, 4.51681, 0, 0, 0.772765, -0.634692}, - {5525.05, -2825.16, 1538.53, 0.489275, 0, 0, 0.242205, 0.970225}, - {5534.42, -2815.45, 1562.84, 4.62834, 0, 0, 0.736191, -0.676774}, - {5519.64, -2831.12, 1526.46, 0.611008, 0, 0, 0.300774, 0.953696}, - {5551.04, -2827.55, 1523.5, 3.35206, 0, 0, 0.994468, -0.10504}, - {5469.22, -2802.87, 1503.5, 4.99509, 0, 0, 0.600436, -0.799673}, - {5427.8, -2737.26, 1487.12, 1.78673, 0, 0, 0.779186, 0.626793}, - {5454.1, -2709.1, 1485.92, 3.03552, 0, 0, 0.998594, 0.0530137}, - {5436.3, -2718.2, 1506.02, 2.7567, 0, 0, 0.981539, 0.191261}, - {5412.6, -2740.55, 1510.79, 2.98446, 0, 0, 0.996915, 0.0784832}, - {5406.12, -2752.48, 1521.01, 2.05769, 0, 0, 0.856705, 0.515807}, - {5445.24, -2676.35, 1521.89, 2.91378, 0, 0, 0.99352, 0.113661}, - {5481.4, -2665.08, 1482.23, 4.30001, 0, 0, 0.836895, -0.547363}, - {5443.51, -2675.44, 1487.12, 2.90986, 0, 0, 0.993295, 0.115606}, - {5391.72, -2647.3, 1528.9, 3.76987, 0, 0, 0.951063, -0.308997}, - {5421.09, -2734.12, 1521.01, 2.70567, 0, 0, 0.97634, 0.216242}, - {5405.39, -2710.33, 1533.77, 2.51324, 0, 0, 0.951052, 0.309032}, - {5423.96, -2703.76, 1516.34, 2.79206, 0, 0, 0.984767, 0.173879}, - {5444.75, -2735.23, 1486.37, 2.22657, 0, 0, 0.897155, 0.441715}, - {5570.98, -2747.91, 1495.7, 5.14433, 0, 0, 0.53915, -0.84221}, - {5567.79, -2673.9, 1484.66, 2.72529, 0, 0, 0.978415, 0.20665}, - {5600.71, -2696.8, 1500.42, 0.443704, 0, 0, 0.220036, 0.975492}, - {5600.7, -2693.04, 1515.2, 5.16003, 0, 0, 0.532522, -0.846416}, - {5627.56, -2839.66, 1510.53, 5.41527, 0, 0, 0.420463, -0.907309}, - {5622.02, -2868.71, 1516.22, 2.25482, 0, 0, 0.903303, 0.429002}, - {5586.61, -2878.97, 1510.34, 4.55604, 0, 0, 0.76017, -0.649724}, - {5583.78, -2843.71, 1509.54, 5.35715, 0, 0, 0.44665, -0.894709}, - {5580.95, -2811.3, 1513.3, 3.57587, 0, 0, 0.976518, -0.215434}, - {5542.52, -2869.31, 1523.13, 5.23304, 0, 0, 0.501275, -0.865288}, - {5557.35, -2866.36, 1518.76, 4.48299, 0, 0, 0.783388, -0.621533}, - {5380.91, -2849.36, 1512.81, 3.90962, 0, 0, 0.927168, -0.374646}, - {5395.76, -2881.41, 1521.11, 4.28426, 0, 0, 0.84118, -0.540755}, - {5374.87, -2859.63, 1528.98, 3.30252, 0, 0, 0.996765, -0.0803745}, - {5356.07, -2854.66, 1520.34, 5.83933, 0, 0, 0.220108, -0.975475}, - {5363.01, -2975.72, 1539.02, 4.13738, 0, 0, 0.87859, -0.477576}, - {5336.85, -2980.74, 1561.24, 5.11126, 0, 0, 0.553001, -0.83318}, - {5335.23, -2974.62, 1540.05, 5.04451, 0, 0, 0.580496, -0.814263}, - {5422.37, -2998.87, 1549.98, 4.51831, 0, 0, 0.772288, -0.635272}, - {5405.54, -3014.6, 1562.16, 5.86761, 0, 0, 0.206298, -0.978489}, - {5427.96, -3019.4, 1561.58, 3.53498, 0, 0, 0.980718, -0.19543}, - {5348.12, -2977.84, 1582.47, 3.94025, 0, 0, 0.921323, -0.388799}, - {5331.12, -2993.71, 1576.14, 0.0642734, 0, 0, 0.0321311, 0.999484}, - {5321.63, -2986.55, 1552.2, 5.29503, 0, 0, 0.474219, -0.880407}, - {5292.1, -2914.36, 1529.52, 2.9742, 0, 0, 0.996499, 0.083601}, - {5281.77, -2926.5, 1530.62, 1.67829, 0, 0, 0.744071, 0.6681}, - {5287.19, -2909.94, 1543.49, 3.31192, 0, 0, 0.996376, -0.0850591}, - {5534.15, -2679.35, 1483.61, 0.428685, 0, 0, 0.212705, 0.977116}, - {5545.43, -2647.82, 1483.05, 5.38848, 0, 0, 0.432578, -0.901596} -}; - -hyjalAI::hyjalAI(Creature *c) : npc_escortAI(c), Summons(m_creature) -{ - pInstance = c->GetInstanceData(); - VeinsSpawned[0] = false; - VeinsSpawned[1] = false; - for(uint8 i=0;i<14; ++i) - VeinGUID[i] = 0; - InfernalCount = 0; - TeleportTimer = 1000; - Overrun = false; - Teleported = false; - WaitForTeleport = false; - OverrunCounter = 0; - OverrunCounter2 = 0; - InfernalPoint = 0; - RespawnTimer = 10000; - DoRespawn = false; - DoHide = false; - MassTeleportTimer = 0; - DoMassTeleport = false; -} - -void hyjalAI::JustSummoned(Creature *summoned) -{ - Summons.Summon(summoned); -} - -void hyjalAI::SummonedCreatureDespawn(Creature* summoned) -{ - Summons.Despawn(summoned); -} - -void hyjalAI::Reset() -{ - IsDummy = false; - m_creature->setActive(true); - // GUIDs - PlayerGUID = 0; - BossGUID[0] = 0; - BossGUID[1] = 0; - - // Timers - NextWaveTimer = 10000; - CheckTimer = 0; - RetreatTimer = 1000; - - // Misc - WaveCount = 0; - EnemyCount = 0; - - // Set faction properly based on Creature entry - switch(m_creature->GetEntry()) - { - case JAINA: - Faction = 0; - DoCast(m_creature, SPELL_BRILLIANCE_AURA, true); - break; - - case THRALL: - Faction = 1; - break; - - case TYRANDE: - Faction = 2; - break; - } - - //Bools - EventBegun = false; - FirstBossDead = false; - SecondBossDead = false; - Summon = false; - bRetreat = false; - Debug = false; - - - //Flags - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - //Initialize spells - memset(Spell, 0, sizeof(Spell)); - - - - //Reset Instance Data for trash count - if (pInstance) - { - if ((!pInstance->GetData(DATA_ALLIANCE_RETREAT) && m_creature->GetEntry() == JAINA) || (pInstance->GetData(DATA_ALLIANCE_RETREAT) && m_creature->GetEntry() == THRALL)) - { - //Reset World States - pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0); - pInstance->SetData(DATA_RESET_TRASH_COUNT, 0); - } - }else error_log(ERROR_INST_DATA); - - //Visibility - DoHide = true; -} - -void hyjalAI::EnterEvadeMode() -{ - if (m_creature->GetEntry() != JAINA) - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - m_creature->LoadCreaturesAddon(); - - if (m_creature->isAlive()) - m_creature->GetMotionMaster()->MoveTargetedHome(); - - m_creature->SetLootRecipient(NULL); -} - -void hyjalAI::EnterCombat(Unit *who) -{ - if (IsDummy)return; - for(uint8 i = 0; i < 3; ++i) - if (Spell[i].Cooldown) - SpellTimer[i] = Spell[i].Cooldown; - - Talk(ATTACKED); -} - -void hyjalAI::MoveInLineOfSight(Unit *who) -{ - if (IsDummy) - return; - - npc_escortAI::MoveInLineOfSight(who); -} - -void hyjalAI::SummonCreature(uint32 entry, float Base[4][3]) -{ - uint32 random = rand()%4; - float SpawnLoc[3]; - - for(uint8 i = 0; i < 3; ++i) - { - SpawnLoc[i] = Base[random][i]; - } - Creature* pCreature = NULL; - switch(entry) - { - case 17906: //GARGOYLE - - if (!FirstBossDead && (WaveCount == 1 || WaveCount == 3)) - {//summon at tower - pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][1]+irand(-20,20), SpawnPointSpecial[SPAWN_NEAR_TOWER][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - if (pCreature) - CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true; - }else{//summon at gate - pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_GARG_GATE][0]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][1]+irand(-10,10), SpawnPointSpecial[SPAWN_GARG_GATE][2]+irand(-10,10), 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - } - break; - case 17907: //FROST_WYRM , - if (FirstBossDead && WaveCount == 1) - {//summon at gate - pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_WYRM_GATE][0],SpawnPointSpecial[SPAWN_WYRM_GATE][1],SpawnPointSpecial[SPAWN_WYRM_GATE][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - }else{ - pCreature = m_creature->SummonCreature(entry, SpawnPointSpecial[SPAWN_NEAR_TOWER][0], SpawnPointSpecial[SPAWN_NEAR_TOWER][1],SpawnPointSpecial[SPAWN_NEAR_TOWER][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - if (pCreature) - CAST_AI(hyjal_trashAI, pCreature->AI())->useFlyPath = true; - } - break; - case 17908: //GIANT_INFERNAL - InfernalCount++; - if (InfernalCount > 7)InfernalCount = 0; - pCreature = m_creature->SummonCreature(entry, InfernalPos[InfernalCount][0], InfernalPos[InfernalCount][1], InfernalPos[InfernalCount][2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - break; - default: - pCreature = m_creature->SummonCreature(entry, SpawnLoc[0], SpawnLoc[1], SpawnLoc[2], 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 120000); - break; - - } - - if (pCreature) - { - // Increment Enemy Count to be used in World States and instance script - ++EnemyCount; - - pCreature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - pCreature->setActive(true); - switch(entry) - { - case NECROMANCER: - case ABOMINATION: - case GHOUL: - case BANSHEE: - case CRYPT_FIEND: - case GARGOYLE: - case FROST_WYRM: - case GIANT_INFERNAL: - case FEL_STALKER: - case RAGE_WINTERCHILL: - case ANETHERON: - case KAZROGAL: - case AZGALOR: - CAST_AI(hyjal_trashAI, pCreature->AI())->IsEvent = true; - break; - } - if (pInstance) - { - if (pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE) - pCreature->SetDisableReputationGain(true);//no repu for solo farming - } - // Check if Creature is a boss. - if (pCreature->isWorldBoss()) - { - if (!FirstBossDead) BossGUID[0] = pCreature->GetGUID(); - else BossGUID[1] = pCreature->GetGUID(); - CheckTimer = 5000; - } - } -} - -void hyjalAI::SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3]) -{ - // 1 in 4 chance we give a rally yell. Not sure if the chance is offilike. - if (rand()%4 == 0) - Talk(RALLY); - - if (!pInstance) - { - error_log(ERROR_INST_DATA); - return; - } - InfernalCount = 0;//reset infernal count every new wave - - EnemyCount = pInstance->GetData(DATA_TRASH); - for(uint8 i = 0; i < 18; ++i) - { - if (wave[Count].Mob[i]) - SummonCreature(wave[Count].Mob[i], Base); - } - - if (!wave[Count].IsBoss) - { - uint32 stateValue = Count+1; - if (FirstBossDead) - stateValue -= 9; // Subtract 9 from it to give the proper wave number if we are greater than 8 - - // Set world state to our current wave number - pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, stateValue); // Set world state to our current wave number - // Enable world state - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 1); // Enable world state - - pInstance->SetData(DATA_TRASH, EnemyCount); // Send data for instance script to update count - - if (!Debug) - NextWaveTimer = wave[Count].WaveTimer; - else - { - NextWaveTimer = 15000; - debug_log("TSCR: HyjalAI: debug mode is enabled. Next Wave in 15 seconds"); - } - } - else - { - // Set world state for waves to 0 to disable it. - pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 1); - - // Set World State for enemies invading to 1. - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 1); - - Summon = false; - } - CheckTimer = 5000; -} - -void hyjalAI::StartEvent(Player* pPlayer) -{ - if (!pPlayer || IsDummy || !pInstance) - return; - - Talk(BEGIN); - - EventBegun = true; - Summon = true; - - NextWaveTimer = 15000; - CheckTimer = 5000; - PlayerGUID = pPlayer->GetGUID(); - - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - - pInstance->DoUpdateWorldState(WORLD_STATE_WAVES, 0); - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, 0); - - DeSpawnVeins(); -} - -uint32 hyjalAI::GetInstanceData(uint32 Event) -{ - if (pInstance) - return pInstance->GetData(Event); - else error_log(ERROR_INST_DATA); - - return 0; -} - -void hyjalAI::Talk(uint32 id) -{ - std::list index; - for(uint8 i = 0; i < 9; ++i) - { - if (Faction == 0) // Alliance - { - if (JainaQuotes[i].id == id) - index.push_back(i); - } - else if (Faction == 1) // Horde - { - if (ThrallQuotes[i].id == id) - index.push_back(i); - } - } - - if (index.empty()) - return; // No quotes found, no use to continue - - uint8 ind = *(index.begin()) + rand()%index.size(); - - int32 YellId = 0; - if (Faction == 0) // Alliance - { - YellId = JainaQuotes[ind].textid; - } - else if (Faction == 1) // Horde - { - YellId = ThrallQuotes[ind].textid; - } - - if (YellId) - DoScriptText(YellId, m_creature); -} - -void hyjalAI::Retreat() -{ - if (pInstance) - { - pInstance->SetData(TYPE_RETREAT,SPECIAL); - - if (Faction == 0) - { - pInstance->SetData(DATA_ALLIANCE_RETREAT, 1); - AddWaypoint(0,JainaWPs[0][0],JainaWPs[0][1],JainaWPs[0][2]); - AddWaypoint(1,JainaWPs[1][0],JainaWPs[1][1],JainaWPs[1][2]); - Start(false, false); - SetDespawnAtEnd(false);//move to center of alliance base - } - if (Faction == 1) - { - pInstance->SetData(DATA_HORDE_RETREAT, 1); - Creature* JainaDummy = m_creature->SummonCreature(JAINA,JainaDummySpawn[0][0],JainaDummySpawn[0][1],JainaDummySpawn[0][2],JainaDummySpawn[0][3],TEMPSUMMON_TIMED_DESPAWN,60000); - if (JainaDummy) - { - JainaDummy->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - CAST_AI(hyjalAI, JainaDummy->AI())->IsDummy = true; - DummyGuid = JainaDummy->GetGUID(); - } - AddWaypoint(0,JainaDummySpawn[1][0],JainaDummySpawn[1][1],JainaDummySpawn[1][2]); - Start(false, false); - SetDespawnAtEnd(false);//move to center of alliance base - } - } - SpawnVeins(); - Overrun = true; - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//cant talk after overrun event started -} - -void hyjalAI::SpawnVeins() -{ - if (Faction == 0) - { - if (VeinsSpawned[0])//prevent any buggers - return; - for (uint8 i = 0; i<7; ++i) - { - GameObject* gem = m_creature->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0); - if (gem) - VeinGUID[i]=gem->GetGUID(); - } - VeinsSpawned[0] = true; - }else{ - if (VeinsSpawned[1]) - return; - for (uint8 i = 7; i<14; ++i) - { - GameObject* gem = m_creature->SummonGameObject(ANCIENT_VEIN,VeinPos[i][0],VeinPos[i][1],VeinPos[i][2],VeinPos[i][3],VeinPos[i][4],VeinPos[i][5],VeinPos[i][6],VeinPos[i][7],0); - if (gem) - VeinGUID[i]=gem->GetGUID(); - } - VeinsSpawned[1] = true; - } -} - -void hyjalAI::DeSpawnVeins() -{ - if (!pInstance)return; - if (Faction == 1) - { - Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (!pUnit)return; - hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI()); - if (!ai)return; - for (uint8 i = 0; i<7; ++i) - { - if (GameObject* gem = pInstance->instance->GetGameObject(pInstance->GetData64(ai->VeinGUID[i]))) - gem->Delete(); - } - }else if (Faction) - { - Creature* pUnit=Unit::GetCreature((*m_creature),pInstance->GetData64(DATA_THRALL)); - if (!pUnit)return; - hyjalAI* ai = CAST_AI(hyjalAI, pUnit->AI()); - if (!ai)return; - for (uint8 i = 7; i<14; ++i) - { - if (GameObject* gem = pInstance->instance->GetGameObject(pInstance->GetData64(ai->VeinGUID[i]))) - gem->Delete(); - } - } -} - -void hyjalAI::UpdateAI(const uint32 diff) -{ - if (IsDummy) - { - if (MassTeleportTimer < diff && DoMassTeleport) - { - m_creature->CastSpell(m_creature,SPELL_MASS_TELEPORT,false); - DoMassTeleport = false; - }else MassTeleportTimer -= diff; - return; - } - if (DoHide) - { - DoHide = false; - switch(m_creature->GetEntry()) - { - case JAINA: - if (pInstance->GetData(DATA_ALLIANCE_RETREAT)) - { - m_creature->SetVisibility(VISIBILITY_OFF); - HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); - HideNearPos(5037.76, -1889.71); - for(uint8 i = 0; i < 92; ++i)//summon fires - m_creature->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0); - - } - else m_creature->SetVisibility(VISIBILITY_ON); - break; - case THRALL: //thrall - if (pInstance->GetData(DATA_HORDE_RETREAT)) - { - m_creature->SetVisibility(VISIBILITY_OFF); - HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); - HideNearPos(5563, -2763.19); - HideNearPos(5542.2, -2629.36); - for(uint8 i = 0; i < 65; ++i)//summon fires - m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0); - - } - else m_creature->SetVisibility(VISIBILITY_ON); - break; - } - } - if (DoRespawn) - { - if (RespawnTimer < diff) - { - DoRespawn = false; - RespawnNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); - if (Faction == 0) - { - RespawnNearPos(5037.76, -1889.71); - }else if (Faction == 1) - { - RespawnNearPos(5563, -2763.19); - RespawnNearPos(5542.2, -2629.36); - } - m_creature->SetVisibility(VISIBILITY_ON); - }else{ - RespawnTimer -= diff; - m_creature->SetVisibility(VISIBILITY_OFF); - } - return; - } - if (Overrun) - DoOverrun(Faction, diff); - if (bRetreat) - { - if (RetreatTimer < diff) - { - IsDummy = true; - bRetreat = false; - HideNearPos(m_creature->GetPositionX(), m_creature->GetPositionY()); - switch(m_creature->GetEntry()) - { - case JAINA://jaina - HideNearPos(5037.76, -1889.71); - break; - case THRALL://thrall - HideNearPos(5563, -2763.19); - HideNearPos(5542.2, -2629.36); - HideNearPos(5603.75, -2853.12); - break; - } - m_creature->SetVisibility(VISIBILITY_OFF); - }else RetreatTimer -= diff; - } - - if (!EventBegun) - return; - - if (Summon) - { - if (pInstance && EnemyCount) - { - EnemyCount = pInstance->GetData(DATA_TRASH); - if (!EnemyCount) - NextWaveTimer = 5000; - } - - if (NextWaveTimer < diff) - { - if (Faction == 0) - SummonNextWave(AllianceWaves, WaveCount, AllianceBase); - else if (Faction == 1) - SummonNextWave(HordeWaves, WaveCount, HordeBase); - ++WaveCount; - }else NextWaveTimer -= diff; - } - - if (CheckTimer < diff) - { - for(uint8 i = 0; i < 2; ++i) - { - if (BossGUID[i]) - { - Unit* pUnit = Unit::GetUnit((*m_creature), BossGUID[i]); - if (pUnit && (!pUnit->isAlive())) - { - if (BossGUID[i] == BossGUID[0]) - { - Talk(INCOMING); - FirstBossDead = true; - } - else if (BossGUID[i] == BossGUID[1]) - { - Talk(SUCCESS); - SecondBossDead = true; - } - EventBegun = false; - CheckTimer = 0; - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - BossGUID[i] = 0; - pInstance->DoUpdateWorldState(WORLD_STATE_ENEMY, 0); // Reset world state for enemies to disable it - } - } - } - CheckTimer = 5000; - }else CheckTimer -= diff; - - if (!UpdateVictim()) - return; - - for(uint8 i = 0; i < 3; ++i) - { - if (Spell[i].SpellId) - { - if (SpellTimer[i] < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - Unit* target = NULL; - - switch(Spell[i].TargetType) - { - case TARGETTYPE_SELF: target = m_creature; break; - case TARGETTYPE_RANDOM: target = SelectUnit(SELECT_TARGET_RANDOM, 0); break; - case TARGETTYPE_VICTIM: target = m_creature->getVictim(); break; - } - - if (target && target->isAlive()) - { - DoCast(target, Spell[i].SpellId); - SpellTimer[i] = Spell[i].Cooldown; - } - }else SpellTimer[i] -= diff; - } - } - - DoMeleeAttackIfReady(); -} -void hyjalAI::JustDied(Unit* killer) -{ - if (IsDummy)return; - m_creature->Respawn(); - m_creature->SetVisibility(VISIBILITY_OFF); - DoRespawn = true; - RespawnTimer = 120000; - Talk(DEATH); - Summons.DespawnAll();//despawn all wave's summons - if (pInstance) - {//reset encounter if boss is despawned (ex: thrall is killed, boss despawns, event stucks at inprogress) - if (pInstance->GetData(DATA_RAGEWINTERCHILLEVENT) == IN_PROGRESS) - pInstance->SetData(DATA_RAGEWINTERCHILLEVENT, NOT_STARTED); - if (pInstance->GetData(DATA_ANETHERONEVENT) == IN_PROGRESS) - pInstance->SetData(DATA_ANETHERONEVENT, NOT_STARTED); - if (pInstance->GetData(DATA_KAZROGALEVENT) == IN_PROGRESS) - pInstance->SetData(DATA_KAZROGALEVENT, NOT_STARTED); - if (pInstance->GetData(DATA_AZGALOREVENT) == IN_PROGRESS) - pInstance->SetData(DATA_AZGALOREVENT, NOT_STARTED); - pInstance->SetData(DATA_RESET_RAIDDAMAGE, NULL);//reset damage on die - } -} -void hyjalAI::HideNearPos(float x, float y) -{ - CellPair pair(Trinity::ComputeCellPair(x, y)); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - // First get all creatures. - std::list creatures; - Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); - Trinity::CreatureListSearcher creature_searcher(m_creature, creatures, creature_check); - TypeContainerVisitor - , - GridTypeMapContainer> creature_visitor(creature_searcher); - - CellLock cell_lock(cell, pair); - // Get Creatures - cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap())); - - if (!creatures.empty()) - { - for(std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) - { - (*itr)->SetVisibility(VISIBILITY_OFF); - (*itr)->setFaction(35);//make them friendly so mobs won't attack them - } - } -} -void hyjalAI::RespawnNearPos(float x, float y) -{ - CellPair p(Trinity::ComputeCellPair(x, y)); - Cell cell(p); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - Trinity::RespawnDo u_do; - Trinity::WorldObjectWorker worker(m_creature, u_do); - TypeContainerVisitor, GridTypeMapContainer > obj_worker(worker); - CellLock cell_lock(cell, p); - cell_lock->Visit(cell_lock, obj_worker, *m_creature->GetMap()); -} -void hyjalAI::WaypointReached(uint32 i) -{ - if (i == 1 || (i == 0 && m_creature->GetEntry() == THRALL)) - { - m_creature->MonsterYell("Hurry, we don't have much time",0,0); - WaitForTeleport = true; - TeleportTimer = 20000; - if (m_creature->GetEntry() == JAINA) - m_creature->CastSpell(m_creature,SPELL_MASS_TELEPORT,false); - if (m_creature->GetEntry() == THRALL && DummyGuid) - { - Unit* Dummy = Unit::GetUnit((*m_creature),DummyGuid); - if (Dummy) - { - CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->DoMassTeleport = true; - CAST_AI(hyjalAI, CAST_CRE(Dummy)->AI())->MassTeleportTimer = 20000; - Dummy->CastSpell(m_creature,SPELL_MASS_TELEPORT,false); - } - } - //do some talking - //all alive guards walk near here - CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - // First get all creatures. - std::list creatures; - Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); - Trinity::CreatureListSearcher creature_searcher(m_creature, creatures, creature_check); - TypeContainerVisitor - , - GridTypeMapContainer> creature_visitor(creature_searcher); - - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap())); - - if (!creatures.empty()) - { - for(std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) - { - if ((*itr) && (*itr)->isAlive() && (*itr) != m_creature && (*itr)->GetEntry() != JAINA) - { - if (!(*itr)->IsWithinDist(m_creature, 60)) - (*itr)->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - float x, y, z; - (*itr)->SetDefaultMovementType(IDLE_MOTION_TYPE); - (*itr)->GetMotionMaster()->Initialize(); - float range = 10; - if (m_creature->GetEntry() == THRALL)range = 20; - m_creature->GetNearPoint(m_creature, x, y, z, range, 0, m_creature->GetAngle((*itr))); - (*itr)->GetMotionMaster()->MovePoint(0, x+irand(-5,5), y+irand(-5,5), m_creature->GetPositionZ()); - } - } - } - } -} -void hyjalAI::DoOverrun(uint32 faction, const uint32 diff) -{ - npc_escortAI::UpdateAI(diff); - if (WaitForTeleport) - { - if (TeleportTimer < diff) - { - CellPair pair(Trinity::ComputeCellPair(m_creature->GetPositionX(), m_creature->GetPositionY())); - Cell cell(pair); - cell.data.Part.reserved = ALL_DISTRICT; - cell.SetNoCreate(); - - std::list creatures; - Trinity::AllFriendlyCreaturesInGrid creature_check(m_creature); - Trinity::CreatureListSearcher creature_searcher(m_creature, creatures, creature_check); - TypeContainerVisitor - , - GridTypeMapContainer> creature_visitor(creature_searcher); - - CellLock cell_lock(cell, pair); - cell_lock->Visit(cell_lock, creature_visitor, *(m_creature->GetMap())); - - if (!creatures.empty()) - { - for(std::list::iterator itr = creatures.begin(); itr != creatures.end(); ++itr) - { - if ((*itr) && (*itr)->isAlive()) - { - (*itr)->CastSpell(*itr, SPELL_TELEPORT_VISUAL, true); - (*itr)->setFaction(35);//make them friendly so mobs won't attack them - (*itr)->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - } - DoCast(m_creature, SPELL_TELEPORT_VISUAL); - bRetreat = true; - RetreatTimer = 1000; - } - - WaitForTeleport = false; - Teleported = true; - }TeleportTimer -= diff; - } - if (!Teleported) - return; - Overrun = false;//execute once - switch(faction) - { - case 0://alliance - for(uint8 i = 0; i < 92; ++i)//summon fires - m_creature->SummonGameObject(FLAMEOBJECT,AllianceFirePos[i][0],AllianceFirePos[i][1],AllianceFirePos[i][2],AllianceFirePos[i][3],AllianceFirePos[i][4],AllianceFirePos[i][5],AllianceFirePos[i][6],AllianceFirePos[i][7],0); - - for(uint8 i = 0; i < 25; ++i)//summon 25 ghouls - { - uint8 r = rand()%4; - Creature* pUnit = m_creature->SummonCreature(GHOUL, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) - { - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); - } - } - for(uint8 i = 0; i < 3; ++i)//summon 3 abominations - { - uint8 r = rand()%4; - Creature* pUnit = m_creature->SummonCreature(ABOMINATION, AllianceBase[r][0]+irand(-15,15), AllianceBase[r][1]+irand(-15,15), AllianceBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) - { - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); - } - } - for(uint8 i = 0; i < 5; ++i)//summon 5 gargoyles - { - Creature* pUnit = m_creature->SummonCreature(GARGOYLE, AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) - { - pUnit->SetHomePosition(AllianceOverrunGargPos[i][0], AllianceOverrunGargPos[i][1], AllianceOverrunGargPos[i][2], AllianceOverrunGargPos[i][3]); - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); - } - } - break; - case 1://horde - for(uint8 i = 0; i < 65; ++i)//summon fires - m_creature->SummonGameObject(FLAMEOBJECT,HordeFirePos[i][0],HordeFirePos[i][1],HordeFirePos[i][2],HordeFirePos[i][3],HordeFirePos[i][4],HordeFirePos[i][5],HordeFirePos[i][6],HordeFirePos[i][7],0); - - for(uint8 i = 0; i < 26; ++i)//summon infernals - { - Creature* pUnit = m_creature->SummonCreature(GIANT_INFERNAL, InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3], TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) - { - pUnit->SetHomePosition(InfernalSPWP[i][0], InfernalSPWP[i][1], InfernalSPWP[i][2], InfernalSPWP[i][3]); - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); - } - } - for(uint8 i = 0; i < 25; ++i)//summon 25 ghouls - { - uint8 r = rand()%4; - Creature* pUnit = m_creature->SummonCreature(GHOUL, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) - { - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); - } - } - for(uint8 i = 0; i < 5; ++i)//summon 5 abominations - { - uint8 r = rand()%4; - Creature* pUnit = m_creature->SummonCreature(ABOMINATION, HordeBase[r][0]+irand(-15,15), HordeBase[r][1]+irand(-15,15), HordeBase[r][2], 0, TEMPSUMMON_MANUAL_DESPAWN, 2*60*1000); - if (pUnit) - { - CAST_AI(hyjal_trashAI, pUnit->AI())->faction = Faction; - CAST_AI(hyjal_trashAI, pUnit->AI())->IsOverrun = true; - CAST_AI(hyjal_trashAI, pUnit->AI())->OverrunType = i; - pUnit->setActive(true); - } - } - break; - } -} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h deleted file mode 100644 index 3b0ff32a429..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjalAI.h +++ /dev/null @@ -1,248 +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 SC_HYJALAI_H -#define SC_HYJALAI_H - -#include "def_hyjal.h" -#include "escortAI.h" - -// Trash Mobs summoned in waves -#define NECROMANCER 17899//done -#define ABOMINATION 17898//done -#define GHOUL 17895//done -#define BANSHEE 17905//done -#define CRYPT_FIEND 17897//done -#define GARGOYLE 17906//done -#define FROST_WYRM 17907//done -#define GIANT_INFERNAL 17908//done -#define FEL_STALKER 17916//done - -#define JAINA 17772 -#define THRALL 17852 -#define TYRANDE 17948 - -#define ANCIENT_VEIN 185557 -#define FLAMEOBJECT 182592 - -// Bosses summoned after every 8 waves -#define RAGE_WINTERCHILL 17767 -#define ANETHERON 17808 -#define KAZROGAL 17888 -#define AZGALOR 17842 -#define ARCHIMONDE 17968 - -#define SPELL_TELEPORT_VISUAL 41232 -#define SPELL_MASS_TELEPORT 16807 - -//Spells for Jaina -#define SPELL_BRILLIANCE_AURA 31260 // The database must handle this spell via creature_addon(it should, but is removed in evade..) -#define SPELL_BLIZZARD 31266 -#define SPELL_PYROBLAST 31263 -#define SPELL_SUMMON_ELEMENTALS 31264 - -//Thrall spells -#define SPELL_CHAIN_LIGHTNING 31330 -#define SPELL_SUMMON_DIRE_WOLF 31331 - -struct Wave -{ - uint32 Mob[18]; // Stores Creature Entries to be summoned in Waves - uint32 WaveTimer; // The timer before the next wave is summoned - bool IsBoss; // Simply used to inform the wave summoner that the next wave contains a boss to halt all waves after that -}; - -static Wave AllianceWaves[]= // Waves that will be summoned in the Alliance Base -{ // Rage Winterchill Wave 1-8 - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, - // All 8 Waves are summoned, summon Rage Winterchill, next few waves are for Anetheron - {RAGE_WINTERCHILL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}, - // Anetheron Wave 1-8 - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, 0, 0, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, - {NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 120000, false}, - {CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, BANSHEE, BANSHEE, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, GHOUL, GHOUL, 0, 0, 0, 0, 120000, false}, - {GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, - // All 8 Waves are summoned, summon Anatheron - {ANETHERON, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true} -}; - -static Wave HordeWaves[]= // Waves that are summoned in the Horde base -{ // Kaz'Rogal Wave 1-8 - {GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, - {CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, - {GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, FROST_WYRM, 0, 0, 0, 0, 0, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, FROST_WYRM, 0, 0, 0, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 240000, false}, - // All 8 Waves are summoned, summon Kaz'Rogal, next few waves are for Azgalor - {KAZROGAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true}, - // Azgalor Wave 1-8 - {ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, FROST_WYRM, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, GARGOYLE, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GHOUL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, 0, 0, 0, 0, 180000, false}, - {GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, 0, 0, 0, 0, 180000, false}, - {FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, FEL_STALKER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, 0, 0, 0, 0, 180000, false}, - {NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, NECROMANCER, BANSHEE, BANSHEE, BANSHEE, BANSHEE, BANSHEE, BANSHEE, 0, 0, 0, 0, 0, 0, 180000, false}, - {GHOUL, GHOUL, CRYPT_FIEND, CRYPT_FIEND, FEL_STALKER, FEL_STALKER, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, GIANT_INFERNAL, 0, 0, 0, 0, 180000, false}, - {CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, CRYPT_FIEND, FEL_STALKER, FEL_STALKER, ABOMINATION, ABOMINATION, ABOMINATION, ABOMINATION, BANSHEE, BANSHEE, BANSHEE, BANSHEE, NECROMANCER, NECROMANCER, 0, 0, 240000, false}, - // All 8 Waves are summoned, summon Azgalor - {AZGALOR, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true} -}; - -enum TargetType // Used in the spell cast system for the AI -{ - TARGETTYPE_SELF = 0, - TARGETTYPE_RANDOM = 1, - TARGETTYPE_VICTIM = 2, -}; - -struct Yells -{ - uint32 id; // Used to determine the type of yell (attack, rally, etc) - int32 textid; // The text id to be yelled -}; - -enum YellId -{ - ATTACKED = 0, // Used when attacked and set in combat - BEGIN = 1, // Used when the event is begun - INCOMING = 2, // Used to warn the raid that another wave phase is coming - RALLY = 3, // Used to rally the raid and warn that the next wave has been summoned - FAILURE = 4, // Used when raid has failed (unsure where to place) - SUCCESS = 5, // Used when the raid has sucessfully defeated a wave phase - DEATH = 6, // Used on death -}; - -static Yells JainaQuotes[]= -{ - {ATTACKED, -1534000}, - {ATTACKED, -1534001}, - {INCOMING, -1534002}, - {BEGIN, -1534003}, - {RALLY, -1534004}, - {RALLY, -1534005}, - {FAILURE, -1534006}, - {SUCCESS, -1534007}, - {DEATH, -1534008}, -}; - -static Yells ThrallQuotes[]= -{ - {ATTACKED, -1534009}, - {ATTACKED, -1534010}, - {INCOMING, -1534011}, - {BEGIN, -1534012}, - {RALLY, -1534013}, - {RALLY, -1534014}, - {FAILURE, -1534015}, - {SUCCESS, -1534016}, - {DEATH, -1534017}, -}; - -struct TRINITY_DLL_DECL hyjalAI : public npc_escortAI -{ - hyjalAI(Creature *c); - - void Reset(); // Generically used to reset our variables. Do *not* call in EnterEvadeMode as this may make problems if the raid is still in combat - - void EnterEvadeMode(); // Send creature back to spawn location and evade. - - void EnterCombat(Unit *who); // Used to reset cooldowns for our spells and to inform the raid that we're under attack - - void UpdateAI(const uint32 diff); // Called to summon waves, check for boss deaths and to cast our spells. - - void JustDied(Unit* killer); // Called on death, informs the raid that they have failed. - - void SetFaction(uint32 _faction) // Set the faction to either Alliance or Horde in Hyjal - { - Faction = _faction; - } - - void Retreat(); // "Teleport" (teleport visual + set invisible) all friendly creatures away from the base. - - void SpawnVeins(); - void DeSpawnVeins(); - void JustSummoned(Creature *summoned); - void SummonedCreatureDespawn(Creature* summoned); - void HideNearPos(float x, float y); - void RespawnNearPos(float x, float y); - void WaypointReached(uint32 i); - void DoOverrun(uint32 faction, const uint32 diff); - void MoveInLineOfSight(Unit *who); - - void SummonCreature(uint32 entry, float Base[4][3]); // Summons a creature for that wave in that base - - // Summons the next wave, calls SummonCreature - void SummonNextWave(Wave wave[18], uint32 Count, float Base[4][3]); - - void StartEvent(Player* player); // Begins the event by gossip click - - uint32 GetInstanceData(uint32 Event); // Gets instance data for this instance, used to check if raid has gotten past a certain point and can access the next phase - - void Talk(uint32 id); // Searches for the appropriate yell and sound and uses it to inform the raid of various things - - public: - ScriptedInstance* pInstance; - - uint64 PlayerGUID; - uint64 BossGUID[2]; - uint64 VeinGUID[14]; - - uint32 NextWaveTimer; - uint32 WaveCount; - uint32 CheckTimer; - uint32 Faction; - uint32 EnemyCount; - uint32 RetreatTimer; - - bool EventBegun; - bool FirstBossDead; - bool SecondBossDead; - bool Summon; - bool bRetreat; - bool Debug; - bool VeinsSpawned[2]; - uint8 InfernalCount; - SummonList Summons; - bool Overrun; - bool Teleported; - bool WaitForTeleport; - uint32 TeleportTimer; - uint32 OverrunCounter; - uint32 OverrunCounter2; - uint32 InfernalPoint; - uint32 RespawnTimer; - bool DoRespawn; - bool DoHide; - bool IsDummy; - uint32 MassTeleportTimer; - bool DoMassTeleport; - uint64 DummyGuid; - - struct Spell - { - uint32 SpellId; - uint32 Cooldown; - uint32 TargetType; - }Spell[3]; - - private: - uint32 SpellTimer[3]; - //std::list CreatureList; -}; -#endif - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp deleted file mode 100644 index b0739530fdc..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.cpp +++ /dev/null @@ -1,1453 +0,0 @@ - -#include "precompiled.h" -#include "def_hyjal.h" -#include "hyjal_trash.h" -#include "hyjalAI.h" - -#define SPELL_METEOR 33814 //infernal visual -#define SPELL_IMMOLATION 37059 -#define SPELL_FLAME_BUFFET 31724 -#define NPC_TRIGGER 21987 //World Trigger (Tiny) -#define MODEL_INVIS 11686 //invisible model - -float HordeWPs[8][3]=//basic waypoints from spawn to leader -{ - {5492.91, -2404.61, 1462.63}, - {5531.76, -2460.87, 1469.55}, - {5554.58, -2514.66, 1476.12}, - {5554.16, -2567.23, 1479.90}, - {5540.67, -2625.99, 1480.89}, - {5508.16, -2659.20, 1480.15},//random rush starts from here - {5489.62, -2704.05, 1482.18}, - {5457.04, -2726.26, 1485.10} -}; -float AllianceWPs[8][3]=//basic waypoints from spawn to leader -{ - {4896.08, -1576.35, 1333.65}, - {4898.68, -1615.02, 1329.48}, - {4907.12, -1667.08, 1321.00}, - {4963.18, -1699.35, 1340.51}, - {4989.16, -1716.67, 1335.74},//first WP in the base, after the gate - {5026.27, -1736.89, 1323.02}, - {5037.77, -1770.56, 1324.36}, - {5067.23, -1789.95, 1321.17} -}; - -float FrostWyrmWPs[3][3]=//waypoints for the frost wyrms in horde base -{ - {5580.82, -2628.83, 1528.28}, - {5550.90, -2667.16, 1505.45}, - {5459.64, -2725.91, 1484.83} -}; - -float GargoyleWPs[3][3]=//waypoints for the gargoyles in horde base -{ - {5533.66, -2634.32, 1495.33}, - {5517.88, -2712.05, 1490.54}, - {5459.64, -2725.91, 1484.83} -}; - -float FlyPathWPs[3][3]=//waypoints for the gargoyls and frost wyrms in horde base in wave 1/3 -{ - {5531.96, -2772.83, 1516.68}, - {5498.32, -2734.84, 1497.01}, - {5456.67, -2725.48, 1493.08} -}; - -float AllianceOverrunWP[55][3]=//waypoints in the alliance base used in the end in the cleaning wave -{ - {4976.37,-1708.02,1339.43},//0spawn - {4994.83,-1725.52,1333.25},//1 start - {4982.92,-1753.7,1330.69},//2 end - {4996.75,-1721.47,1332.95},//3 start - {5015.74,-1755.05,1322.49},//4 - {4998.68,-1773.44,1329.59},//5 - {4994.83,-1725.52,1333.25},//6 start - {5022.8,-1735.46,1323.53},//7 - {5052.15,-1729.02,1320.88},//8 - {5082.43,-1726.29,1327.87},//9 - {4994.83,-1725.52,1333.25},//10 start - {5018.92,-1751.14,1322.19},//11 - {5040.09,-1792.09,1322.1},//12 - {4994.83,-1725.52,1333.25},//13 start - {5023.47,-1748.1,1322.51},//14 - {5013.43,-1842.39,1322.07},//15 - {4994.83,-1725.52,1333.25},//16 start - {5020.8,-1756.86,1322.2},//17 - {5019.53,-1824.6,1321.96},//18 - {5043.42,-1853.75,1324.52},//19 - {5053.02,-1864.13,1330.36},//20 - {5062.49,-1852.47,1330.49},//21 - {5015.27, -1738.77, 1324.83},//35//start 22 - {5027.97, -1775.25, 1321.87},//34 23 - {5015.94, -1821.24, 1321.86},//33 24 - {4983.25, -1857.4, 1320.48},//32 25 - {4981.51, -1883.7, 1322.34},//31 26 - {5002.33, -1893.98, 1325.88},//30 27 - {5049.32, -1886.54, 1331.69},//29 28 - {5089.68, -1846.88, 1328.99},//28 29 - {5127.90, -1825.14, 1335.58},//27 30 - {5163.27, -1789.08, 1337.04},//26 31 - {5138.97, -1755.88, 1334.57},//25 32 - {5096.63, -1742.22, 1329.61},//24 33 - {5065.81, -1729.43, 1325.66},//23 34 - {5049.32, -1726.31, 1320.64},//22 start - {5081.07, -1902.10, 1346.36},//36 abo start - {5107.65, -1912.03, 1356.49},//37 - {5132.83, -1927.07, 1362.42},//38 - {5147.78, -1954.41, 1365.98},//39 - {5164.96, -1966.48, 1367.04},//40 - {5189.04, -1961.06, 1367.90},//41 - {5212.27, -1975.30, 1365.58},//42 - {5221.82, -1994.18, 1364.97},//43 end1 - {5202.23, -1994.94, 1367.59},//44 end2 - {5279.94, -2049.68, 1311.38},//45 garg1 - {5289.15, -2219.06, 1291.12},//46 garg2 - {5202.07, -2136.10, 1305.07},//47 garg3 - {5071.52, -2425.63, 1454.48},//48 garg4 - {5120.65, -2467.92, 1463.93},//49 garg5 - {5283.04, -2043.26, 1300.11},//50 garg target1 - {5313.22, -2207.60, 1290.06},//51 garg target2 - {5180.41, -2121.87, 1292.62},//52 garg target3 - {5088.68, -2432.04, 1441.73},//53 garg target4 - {5111.26, -2454.73, 1449.63}//54 garg target5 - -}; - -float HordeOverrunWP[21][3]=//waypoints in the horde base used in the end in the cleaning wave -{ - {5490.72,-2702.94,1482.14},//0 start - {5469.77,-2741.34,1486.95}, - {5439.47,-2771.02,1494.59}, - {5408.85,-2811.92,1505.68}, - {5423.87,-2857.80,1515.55}, - {5428.19,-2898.15,1524.61}, - {5394.59,-2930.05,1528.23}, - {5351.11,-2935.80,1532.24}, - {5312.37,-2959.06,1536.21}, - {5264.93,-2989.80,1545.70}, - {5256.63,-3056.16,1559.24}, - {5267.32,-3119.55,1575.36}, - {5305.61,-3139.88,1586.38}, - {5330.56,-3135.37,1588.58}, - {5365.87,-3139.78,1583.96}, - {5389.39,-3163.57,1582.57},//15 end - {5500.86,-2669.89,1481.04},//16 start - {5472.08,-2715.14,1483.55}, - {5450.11,-2721.47,1485.61}, - {5433.25,-2712.93,1493.02},//19 end 1 - {5429.91,-2718.44,1493.42}//20 end 2 -}; - -hyjal_trashAI::hyjal_trashAI(Creature *c) : npc_escortAI(c) -{ - pInstance = c->GetInstanceData(); - IsEvent = false; - Delay = 0; - LastOverronPos = 0; - IsOverrun = false; - OverrunType = 0; - SetupOverrun = false; - faction = 0; - useFlyPath = false; - damageTaken = 0; - Reset(); -} - -void hyjal_trashAI::DamageTaken(Unit *done_by, uint32 &damage) -{ - if (done_by->GetTypeId() == TYPEID_PLAYER || (done_by->GetTypeId() == TYPEID_UNIT && CAST_CRE(done_by)->isPet())) - { - damageTaken += damage; - if (pInstance) - pInstance->SetData(DATA_RAIDDAMAGE,damage);//store raid's damage - } -} - -void hyjal_trashAI::UpdateAI(const uint32 diff) -{ - if (IsOverrun && !SetupOverrun) - { - SetupOverrun = true; - if (faction == 0) - { - if (m_creature->GetEntry() == GARGOYLE) - { - DummyTarget[0] = AllianceOverrunWP[50+OverrunType][0]; //+OverrunType 0 - 4 - DummyTarget[1] = AllianceOverrunWP[50+OverrunType][1]; - DummyTarget[2] = AllianceOverrunWP[50+OverrunType][2]; - } - if (m_creature->GetEntry() == ABOMINATION) - { - for(uint8 i = 0; i < 4; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - switch(OverrunType) - { - case 0: - AddWaypoint(4, AllianceOverrunWP[22][0]+irand(-3,3), AllianceOverrunWP[22][1]+irand(-3,3), AllianceOverrunWP[22][2]); - AddWaypoint(5, AllianceOverrunWP[23][0]+irand(-3,3), AllianceOverrunWP[23][1]+irand(-3,3), AllianceOverrunWP[23][2]); - AddWaypoint(6, AllianceOverrunWP[24][0]+irand(-3,3), AllianceOverrunWP[24][1]+irand(-3,3), AllianceOverrunWP[24][2]); - AddWaypoint(7, AllianceOverrunWP[25][0]+irand(-3,3), AllianceOverrunWP[25][1]+irand(-3,3), AllianceOverrunWP[25][2]); - AddWaypoint(8, AllianceOverrunWP[26][0]+irand(-3,3), AllianceOverrunWP[26][1]+irand(-3,3), AllianceOverrunWP[26][2]); - AddWaypoint(9, AllianceOverrunWP[27][0]+irand(-3,3), AllianceOverrunWP[27][1]+irand(-3,3), AllianceOverrunWP[27][2]); - AddWaypoint(10, AllianceOverrunWP[28][0]+irand(-3,3), AllianceOverrunWP[28][1]+irand(-3,3), AllianceOverrunWP[28][2]); - - AddWaypoint(11, AllianceOverrunWP[36][0]+irand(-3,3), AllianceOverrunWP[36][1]+irand(-3,3), AllianceOverrunWP[36][2]); - AddWaypoint(12, AllianceOverrunWP[37][0]+irand(-3,3), AllianceOverrunWP[37][1]+irand(-3,3), AllianceOverrunWP[37][2]); - AddWaypoint(13, AllianceOverrunWP[38][0]+irand(-3,3), AllianceOverrunWP[38][1]+irand(-3,3), AllianceOverrunWP[38][2]); - AddWaypoint(14, AllianceOverrunWP[39][0]+irand(-3,3), AllianceOverrunWP[39][1]+irand(-3,3), AllianceOverrunWP[39][2]); - AddWaypoint(15, AllianceOverrunWP[40][0]+irand(-3,3), AllianceOverrunWP[40][1]+irand(-3,3), AllianceOverrunWP[40][2]); - AddWaypoint(16, AllianceOverrunWP[41][0]+irand(-3,3), AllianceOverrunWP[41][1]+irand(-3,3), AllianceOverrunWP[41][2]); - AddWaypoint(17, AllianceOverrunWP[42][0]+irand(-3,3), AllianceOverrunWP[42][1]+irand(-3,3), AllianceOverrunWP[42][2]); - AddWaypoint(18, AllianceOverrunWP[43][0]+irand(-3,3), AllianceOverrunWP[43][1]+irand(-3,3), AllianceOverrunWP[43][2]); - m_creature->SetHomePosition(AllianceOverrunWP[43][0]+irand(-3,3), AllianceOverrunWP[43][1]+irand(-3,3), AllianceOverrunWP[43][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 18; - Start(true, true); - break; - case 1: - AddWaypoint(4, AllianceOverrunWP[22][0]+irand(-3,3), AllianceOverrunWP[22][1]+irand(-3,3), AllianceOverrunWP[22][2]); - AddWaypoint(5, AllianceOverrunWP[23][0]+irand(-3,3), AllianceOverrunWP[23][1]+irand(-3,3), AllianceOverrunWP[23][2]); - AddWaypoint(6, AllianceOverrunWP[24][0]+irand(-3,3), AllianceOverrunWP[24][1]+irand(-3,3), AllianceOverrunWP[24][2]); - AddWaypoint(7, AllianceOverrunWP[25][0]+irand(-3,3), AllianceOverrunWP[25][1]+irand(-3,3), AllianceOverrunWP[25][2]); - AddWaypoint(8, AllianceOverrunWP[26][0]+irand(-3,3), AllianceOverrunWP[26][1]+irand(-3,3), AllianceOverrunWP[26][2]); - AddWaypoint(9, AllianceOverrunWP[27][0]+irand(-3,3), AllianceOverrunWP[27][1]+irand(-3,3), AllianceOverrunWP[27][2]); - AddWaypoint(10, AllianceOverrunWP[28][0]+irand(-3,3), AllianceOverrunWP[28][1]+irand(-3,3), AllianceOverrunWP[28][2]); - - AddWaypoint(11, AllianceOverrunWP[36][0]+irand(-3,3), AllianceOverrunWP[36][1]+irand(-3,3), AllianceOverrunWP[36][2]); - AddWaypoint(12, AllianceOverrunWP[37][0]+irand(-3,3), AllianceOverrunWP[37][1]+irand(-3,3), AllianceOverrunWP[37][2]); - AddWaypoint(13, AllianceOverrunWP[38][0]+irand(-3,3), AllianceOverrunWP[38][1]+irand(-3,3), AllianceOverrunWP[38][2]); - AddWaypoint(14, AllianceOverrunWP[39][0]+irand(-3,3), AllianceOverrunWP[39][1]+irand(-3,3), AllianceOverrunWP[39][2]); - AddWaypoint(15, AllianceOverrunWP[40][0]+irand(-3,3), AllianceOverrunWP[40][1]+irand(-3,3), AllianceOverrunWP[40][2]); - AddWaypoint(16, AllianceOverrunWP[41][0]+irand(-3,3), AllianceOverrunWP[41][1]+irand(-3,3), AllianceOverrunWP[41][2]); - AddWaypoint(17, AllianceOverrunWP[42][0]+irand(-3,3), AllianceOverrunWP[42][1]+irand(-3,3), AllianceOverrunWP[42][2]); - AddWaypoint(18, AllianceOverrunWP[44][0]+irand(-3,3), AllianceOverrunWP[44][1]+irand(-3,3), AllianceOverrunWP[44][2]); - m_creature->SetHomePosition(AllianceOverrunWP[44][0]+irand(-3,3), AllianceOverrunWP[44][1]+irand(-3,3), AllianceOverrunWP[44][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 18; - Start(true, true); - break; - default: - for(uint8 i = 22; i < 36; ++i) - AddWaypoint(i-18, AllianceOverrunWP[i][0]+irand(-3,3), AllianceOverrunWP[i][1]+irand(-3,3), AllianceOverrunWP[i][2]); - - SetDespawnAtEnd(true); - LastOverronPos = 17; - Start(true, true); - break; - } - } - if (m_creature->GetEntry() == GHOUL) - { - for(uint8 i = 0; i < 4; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - switch(OverrunType) - { - case 0: - AddWaypoint(4, AllianceOverrunWP[1][0]+irand(-3,3), AllianceOverrunWP[1][1]+irand(-3,3), AllianceOverrunWP[1][2]); - AddWaypoint(5, AllianceOverrunWP[2][0]+irand(-3,3), AllianceOverrunWP[2][1]+irand(-3,3), AllianceOverrunWP[2][2]); - m_creature->SetHomePosition(AllianceOverrunWP[2][0]+irand(-3,3), AllianceOverrunWP[2][1]+irand(-3,3), AllianceOverrunWP[2][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 5; - Start(true, true); - break; - case 1: - AddWaypoint(4, AllianceOverrunWP[3][0]+irand(-3,3), AllianceOverrunWP[3][1]+irand(-3,3), AllianceOverrunWP[3][2]); - AddWaypoint(5, AllianceOverrunWP[4][0]+irand(-3,3), AllianceOverrunWP[4][1]+irand(-3,3), AllianceOverrunWP[4][2]); - AddWaypoint(6, AllianceOverrunWP[5][0]+irand(-3,3), AllianceOverrunWP[5][1]+irand(-3,3), AllianceOverrunWP[5][2]); - m_creature->SetHomePosition(AllianceOverrunWP[5][0]+irand(-3,3), AllianceOverrunWP[5][1]+irand(-3,3), AllianceOverrunWP[5][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 6; - Start(true, true); - break; - case 2: - AddWaypoint(4, AllianceOverrunWP[6][0]+irand(-3,3), AllianceOverrunWP[6][1]+irand(-3,3), AllianceOverrunWP[6][2]); - AddWaypoint(5, AllianceOverrunWP[7][0]+irand(-3,3), AllianceOverrunWP[7][1]+irand(-3,3), AllianceOverrunWP[7][2]); - AddWaypoint(6, AllianceOverrunWP[8][0]+irand(-3,3), AllianceOverrunWP[8][1]+irand(-3,3), AllianceOverrunWP[8][2]); - AddWaypoint(7, AllianceOverrunWP[9][0]+irand(-3,3), AllianceOverrunWP[9][1]+irand(-3,3), AllianceOverrunWP[9][2]); - m_creature->SetHomePosition(AllianceOverrunWP[9][0]+irand(-3,3), AllianceOverrunWP[9][1]+irand(-3,3), AllianceOverrunWP[9][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 7; - Start(true, true); - break; - case 3: - AddWaypoint(4, AllianceOverrunWP[10][0]+irand(-3,3), AllianceOverrunWP[10][1]+irand(-3,3), AllianceOverrunWP[10][2]); - AddWaypoint(5, AllianceOverrunWP[11][0]+irand(-3,3), AllianceOverrunWP[11][1]+irand(-3,3), AllianceOverrunWP[11][2]); - AddWaypoint(6, AllianceOverrunWP[12][0]+irand(-3,3), AllianceOverrunWP[12][1]+irand(-3,3), AllianceOverrunWP[12][2]); - m_creature->SetHomePosition(AllianceOverrunWP[12][0]+irand(-3,3), AllianceOverrunWP[12][1]+irand(-3,3), AllianceOverrunWP[12][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 6; - Start(true, true); - break; - case 4: - AddWaypoint(4, AllianceOverrunWP[13][0]+irand(-3,3), AllianceOverrunWP[13][1]+irand(-3,3), AllianceOverrunWP[13][2]); - AddWaypoint(5, AllianceOverrunWP[14][0]+irand(-3,3), AllianceOverrunWP[14][1]+irand(-3,3), AllianceOverrunWP[14][2]); - AddWaypoint(6, AllianceOverrunWP[15][0]+irand(-3,3), AllianceOverrunWP[15][1]+irand(-3,3), AllianceOverrunWP[15][2]); - m_creature->SetHomePosition(AllianceOverrunWP[15][0]+irand(-3,3), AllianceOverrunWP[15][1]+irand(-3,3), AllianceOverrunWP[15][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 6; - Start(true, true); - break; - case 5: - AddWaypoint(4, AllianceOverrunWP[16][0]+irand(-3,3), AllianceOverrunWP[16][1]+irand(-3,3), AllianceOverrunWP[16][2]); - AddWaypoint(5, AllianceOverrunWP[17][0]+irand(-3,3), AllianceOverrunWP[17][1]+irand(-3,3), AllianceOverrunWP[17][2]); - AddWaypoint(6, AllianceOverrunWP[18][0]+irand(-3,3), AllianceOverrunWP[18][1]+irand(-3,3), AllianceOverrunWP[18][2]); - AddWaypoint(7, AllianceOverrunWP[19][0]+irand(-3,3), AllianceOverrunWP[19][1]+irand(-3,3), AllianceOverrunWP[19][2]); - AddWaypoint(8, AllianceOverrunWP[20][0]+irand(-3,3), AllianceOverrunWP[20][1]+irand(-3,3), AllianceOverrunWP[20][2]); - AddWaypoint(9, AllianceOverrunWP[21][0]+irand(-3,3), AllianceOverrunWP[21][1]+irand(-3,3), AllianceOverrunWP[21][2]); - m_creature->SetHomePosition(AllianceOverrunWP[21][0]+irand(-3,3), AllianceOverrunWP[21][1]+irand(-3,3), AllianceOverrunWP[21][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 9; - Start(true, true); - break; - default: - for(uint8 i = 22; i < 36; ++i) - AddWaypoint(i-18, AllianceOverrunWP[i][0]+irand(-3,3), AllianceOverrunWP[i][1]+irand(-3,3), AllianceOverrunWP[i][2]); - SetDespawnAtEnd(true); - LastOverronPos = 17; - Start(true, true); - break; - } - } - } - if (faction == 1) - { - if (m_creature->GetEntry() == GHOUL) - { - for(uint8 i = 0; i < 6; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - switch(OverrunType) - { - case 0: - AddWaypoint(5, HordeOverrunWP[16][0]+irand(-10,10), HordeOverrunWP[16][1]+irand(-10,10), HordeOverrunWP[16][2]); - AddWaypoint(6, HordeOverrunWP[17][0]+irand(-10,10), HordeOverrunWP[17][1]+irand(-10,10), HordeOverrunWP[17][2]); - AddWaypoint(7, HordeOverrunWP[18][0], HordeOverrunWP[18][1], HordeOverrunWP[18][2]); - AddWaypoint(8, HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2]); - m_creature->SetHomePosition(HordeOverrunWP[19][0], HordeOverrunWP[19][1], HordeOverrunWP[19][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 8; - Start(true, true); - break; - case 1: - AddWaypoint(5, HordeOverrunWP[16][0]+irand(-10,10), HordeOverrunWP[16][1]+irand(-10,10), HordeOverrunWP[16][2]); - AddWaypoint(6, HordeOverrunWP[17][0]+irand(-10,10), HordeOverrunWP[17][1]+irand(-10,10), HordeOverrunWP[17][2]); - AddWaypoint(7, HordeOverrunWP[18][0], HordeOverrunWP[18][1], HordeOverrunWP[18][2]); - AddWaypoint(8, HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2]); - m_creature->SetHomePosition(HordeOverrunWP[20][0], HordeOverrunWP[20][1], HordeOverrunWP[20][2],0); - SetDespawnAtEnd(false); - LastOverronPos = 8; - Start(true, true); - break; - default: - for(uint8 i = 0; i < 16; ++i) - AddWaypoint(i+6, HordeOverrunWP[i][0]+irand(-10,10), HordeOverrunWP[i][1]+irand(-10,10), HordeOverrunWP[i][2]); - SetDespawnAtEnd(true); - LastOverronPos = 21; - Start(true, true); - break; - } - } - if (m_creature->GetEntry() == ABOMINATION) - { - for(uint8 i = 0; i < 6; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-10,10), HordeWPs[i][1]+irand(-10,10), HordeWPs[i][2]); - for(uint8 i = 0; i < 16; ++i) - AddWaypoint(i+6, HordeOverrunWP[i][0]+irand(-10,10), HordeOverrunWP[i][1]+irand(-10,10), HordeOverrunWP[i][2]); - SetDespawnAtEnd(true); - LastOverronPos = 21; - Start(true, true); - } - } - } -} - -void hyjal_trashAI::JustDied(Unit *victim) -{ - if (!pInstance)return; - if (IsEvent && !m_creature->isWorldBoss()) - pInstance->SetData(DATA_TRASH, 0);//signal trash is dead - - if ((pInstance->GetData(DATA_RAIDDAMAGE) < MINRAIDDAMAGE && !m_creature->isWorldBoss()) || (damageTaken < m_creature->GetMaxHealth()/4 && m_creature->isWorldBoss())) - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE);//no loot -} - -struct mob_giant_infernalAI : public hyjal_trashAI -{ - mob_giant_infernalAI(Creature* c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - meteor = false;//call once! - CanMove = false; - Delay = rand()%30000; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetDisplayId(MODEL_INVIS); - pGo = false; - pos = 0; - Reset(); - } - - bool meteor; - bool CanMove; - bool WpEnabled; - bool pGo; - uint32 pos; - uint32 spawnTimer; - uint32 FlameBuffetTimer; - bool imol; - - void Reset() - { - spawnTimer = 2000; - FlameBuffetTimer= 2000; - imol = false; - } - - void EnterCombat(Unit* who) {} - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 0 && pInstance && !IsOverrun) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (DelayGetPosition(x,y,z); - Creature* trigger = m_creature->SummonCreature(NPC_TRIGGER,x+8,y+8,z+25+rand()%10,m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,1000); - if (trigger) - { - trigger->SetVisibility(VISIBILITY_OFF); - trigger->setFaction(m_creature->getFaction()); - trigger->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - trigger->CastSpell(m_creature,SPELL_METEOR,true); - } - m_creature->GetMotionMaster()->Clear(); - meteor = true; - }else if (!CanMove){ - if (spawnTimerRemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetDisplayId(m_creature->GetUInt32Value(UNIT_FIELD_NATIVEDISPLAYID)); - CanMove = true; - if (pInstance) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && !pInstance->GetData(DATA_HORDE_RETREAT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - }else if (pInstance->GetData(DATA_ALLIANCE_RETREAT) && pInstance->GetData(DATA_HORDE_RETREAT)){ - //do overrun - } - } - }else spawnTimer -= diff; - } - if (!CanMove)return; - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - npc_escortAI::UpdateAI(diff); - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - AddWaypoint(0, HordeWPs[7][0]+irand(-3,3), HordeWPs[7][1]+irand(-3,3), HordeWPs[7][2]);//HordeWPs[7] infront of thrall - Start(true, true); - SetDespawnAtEnd(false); - } - } - } - - if (!UpdateVictim()) - return; - if (!imol) - { - DoCast(m_creature,SPELL_IMMOLATION); - imol=true; - } - if (FlameBuffetTimergetVictim(),SPELL_FLAME_BUFFET,true); - FlameBuffetTimer = 7000; - }else FlameBuffetTimer -= diff; - DoMeleeAttackIfReady(); - } -}; - - -CreatureAI* GetAI_mob_giant_infernal(Creature* pCreature) -{ - return new mob_giant_infernalAI(pCreature); -} - -#define SPELL_DISEASE_CLOUD 31607 -#define SPELL_KNOCKDOWN 31610 - -struct mob_abominationAI : public hyjal_trashAI -{ - mob_abominationAI(Creature* c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - Reset(); - } - - bool pGo; - uint32 KnockDownTimer; - uint32 pos; - void Reset() - { - KnockDownTimer = 10000; - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance && !IsOverrun) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - }else{ - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - if (i == LastOverronPos && IsOverrun) - { - if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) - { - m_creature->setDeathState(DEAD); - m_creature->RemoveCorpse(); - } - } - } - - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - npc_escortAI::UpdateAI(diff); - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - }else//use alliance WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - } - if (!m_creature->HasAura(SPELL_DISEASE_CLOUD)) - DoCast(m_creature,SPELL_DISEASE_CLOUD); - if (!UpdateVictim()) - return; - if (KnockDownTimergetVictim(),SPELL_KNOCKDOWN); - KnockDownTimer = 15000+rand()%10000; - }else KnockDownTimer -= diff; - DoMeleeAttackIfReady(); - } -}; - - -CreatureAI* GetAI_mob_abomination(Creature* pCreature) -{ - return new mob_abominationAI(pCreature); -} - -#define SPELL_FRENZY 31540 - -struct mob_ghoulAI : public hyjal_trashAI -{ - mob_ghoulAI(Creature* c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - Reset(); - } - - bool pGo; - uint32 FrenzyTimer; - uint32 pos; - uint32 MoveTimer; - bool RandomMove; - void Reset() - { - FrenzyTimer = 5000+rand()%5000; - MoveTimer = 2000; - RandomMove = false; - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance && !IsOverrun) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - }else{ - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - if (i == LastOverronPos && IsOverrun) - { - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_ATTACKUNARMED); - if ((faction == 0 && LastOverronPos == 17) || (faction == 1 && LastOverronPos == 21)) - { - m_creature->setDeathState(DEAD); - m_creature->RemoveCorpse(); - } - - } - } - - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - npc_escortAI::UpdateAI(diff); - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - }else//use alliance WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - } - if (FrenzyTimerGetInstanceData(); - pGo = false; - pos = 0; - Reset(); - } - SummonList summons; - bool pGo; - uint32 ShadowBoltTimer; - uint32 pos; - void Reset() - { - ShadowBoltTimer = 1000+rand()%5000; - summons.DespawnAll(); - } - - void JustSummoned(Creature* summon) - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,30,true); - if (target && summon) - summon->Attack(target,false); - summons.Summon(summon); - } - void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance && !IsOverrun) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - }else{ - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - } - - void KilledUnit(Unit* victim) - { - switch (rand()%3) - { - case 0: - DoSpawnCreature(17902,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); - DoSpawnCreature(17902,-3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); - break; - case 1: - DoSpawnCreature(17903,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); - DoSpawnCreature(17903,-3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); - break; - case 2: - if (rand()%2) - DoSpawnCreature(17902,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); - else - DoSpawnCreature(17903,3,0,0,0,TEMPSUMMON_TIMED_DESPAWN, 60000); - break; - } - } - - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - npc_escortAI::UpdateAI(diff); - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - Start(true, true); - SetDespawnAtEnd(false); - }else//use alliance WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - Start(true, true); - SetDespawnAtEnd(false); - } - } - } - } - if (!UpdateVictim()) - return; - if (ShadowBoltTimergetVictim(),SPELL_SHADOW_BOLT); - ShadowBoltTimer = 20000+rand()%10000; - }else ShadowBoltTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - - -CreatureAI* GetAI_mob_necromancer(Creature* pCreature) -{ - return new mob_necromancerAI(pCreature); -} - -#define SPELL_BANSHEE_CURSE 31651 -#define SPELL_BANSHEE_WAIL 38183 -#define SPELL_ANTI_MAGIC_SHELL 31662 - -struct mob_bansheeAI : public hyjal_trashAI -{ - mob_bansheeAI(Creature* c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - Reset(); - } - - bool pGo; - uint32 CourseTimer; - uint32 WailTimer; - uint32 ShellTimer; - uint32 pos; - void Reset() - { - CourseTimer = 20000+rand()%5000; - WailTimer = 15000+rand()%5000; - ShellTimer = 50000+rand()%10000; - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance && !IsOverrun) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - }else{ - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - } - - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - npc_escortAI::UpdateAI(diff); - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - }else//use alliance WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - } - if (!UpdateVictim()) - return; - if (CourseTimergetVictim(),SPELL_BANSHEE_CURSE); - CourseTimer = 20000+rand()%5000; - }else CourseTimer -= diff; - if (WailTimergetVictim(),SPELL_BANSHEE_WAIL); - WailTimer = 15000+rand()%5000; - }else WailTimer -= diff; - if (ShellTimerGetInstanceData(); - pGo = false; - pos = 0; - Reset(); - } - - bool pGo; - uint32 WebTimer; - uint32 pos; - void Reset() - { - WebTimer = 20000+rand()%5000; - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance && !IsOverrun) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - }else{ - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - } - - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - npc_escortAI::UpdateAI(diff); - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - }else//use alliance WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - } - - } - } - } - if (!UpdateVictim()) - return; - if (WebTimergetVictim(),SPELL_WEB); - WebTimer = 20000+rand()%5000; - }else WebTimer -= diff; - DoMeleeAttackIfReady(); - } -}; - - -CreatureAI* GetAI_mob_crypt_fiend(Creature* pCreature) -{ - return new mob_crypt_fiendAI(pCreature); -} - -#define SPELL_MANA_BURN 31729 - -struct mob_fel_stalkerAI : public hyjal_trashAI -{ - mob_fel_stalkerAI(Creature* c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - Reset(); - } - - bool pGo; - uint32 ManaBurnTimer; - uint32 pos; - void Reset() - { - ManaBurnTimer = 9000+rand()%5000; - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 7 && pInstance && !IsOverrun) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, attack thrall - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - }else{ - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_JAINAPROUDMOORE)); - if (target && target->isAlive()) - m_creature->AddThreat(target,0.0); - } - } - } - - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - npc_escortAI::UpdateAI(diff); - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (pInstance->GetData(DATA_ALLIANCE_RETREAT))//2.alliance boss down, use horde WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, HordeWPs[i][0]+irand(-3,3), HordeWPs[i][1]+irand(-3,3), HordeWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - }else//use alliance WPs - { - for (uint8 i = 0; i < 8; ++i) - AddWaypoint(i, AllianceWPs[i][0]+irand(-3,3), AllianceWPs[i][1]+irand(-3,3), AllianceWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - } - - } - } - } - if (!UpdateVictim()) - return; - if (ManaBurnTimergetVictim(),SPELL_MANA_BURN); - ManaBurnTimer = 9000+rand()%5000; - }else ManaBurnTimer -= diff; - DoMeleeAttackIfReady(); - } -}; - - -CreatureAI* GetAI_mob_fel_stalker(Creature* pCreature) -{ - return new mob_fel_stalkerAI(pCreature); -} - -#define SPELL_FROST_BREATH 31688 - -struct mob_frost_wyrmAI : public hyjal_trashAI -{ - mob_frost_wyrmAI(Creature* c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - Reset(); - } - - bool pGo; - uint32 FrostBreathTimer; - uint32 pos; - uint32 MoveTimer; - - void Reset() - { - FrostBreathTimer = 5000; - MoveTimer = 0; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 2 && pInstance && !IsOverrun) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - { - m_creature->AddThreat(target,0.0); - DoCast(target,SPELL_FROST_BREATH,true); - } - } - } - - void JustDied(Unit *victim) - { - if (pInstance && IsEvent) - pInstance->SetData(DATA_TRASH, 0);//signal trash is dead - - float x,y,z; - m_creature->GetPosition(x,y,z); - z = m_creature->GetMap()->GetVmapHeight(x, y, z, true); - m_creature->GetMotionMaster()->MovePoint(0,x,y,z); - m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z,0); - } - - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - { - CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanMelee(false); - npc_escortAI::UpdateAI(diff); - } - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (!useFlyPath) - { - for (uint8 i = 0; i < 3; ++i) - AddWaypoint(i, FrostWyrmWPs[i][0], FrostWyrmWPs[i][1], FrostWyrmWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - }else{//fly path FlyPathWPs - for (uint8 i = 0; i < 3; ++i) - AddWaypoint(i, FlyPathWPs[i][0]+irand(-10,10), FlyPathWPs[i][1]+irand(-10,10), FlyPathWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - } - if (!UpdateVictim()) - return; - if (!m_creature->IsWithinDist(m_creature->getVictim(), 25)){ - if (MoveTimerGetMotionMaster()->MoveChase(m_creature->getVictim()); - MoveTimer = 2000; - }else MoveTimer-=diff; - } - - if (FrostBreathTimerIsWithinDist(m_creature->getVictim(), 25)) - { - DoCast(m_creature->getVictim(),SPELL_FROST_BREATH); - m_creature->StopMoving(); - m_creature->GetMotionMaster()->Clear(); - FrostBreathTimer = 4000; - } - }else FrostBreathTimer -= diff; - } -}; - - -CreatureAI* GetAI_mob_frost_wyrm(Creature* pCreature) -{ - return new mob_frost_wyrmAI(pCreature); -} - -#define SPELL_GARGOYLE_STRIKE 31664 - -struct mob_gargoyleAI : public hyjal_trashAI -{ - mob_gargoyleAI(Creature* c) : hyjal_trashAI(c) - { - pInstance = c->GetInstanceData(); - pGo = false; - pos = 0; - DummyTarget[0] = 0;DummyTarget[1] = 0;DummyTarget[2] = 0; - Reset(); - } - - bool pGo; - uint32 StrikeTimer; - uint32 pos; - uint32 MoveTimer; - float Zpos; - bool forcemove; - - void Reset() - { - forcemove = true; - Zpos = 10.0; - StrikeTimer = 2000+rand()%5000; - MoveTimer = 0; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - } - - void WaypointReached(uint32 i) - { - pos = i; - if (i == 2 && pInstance && !IsOverrun) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_THRALL)); - if (target && target->isAlive()) - { - m_creature->AddThreat(target,0.0); - DoCast(target,SPELL_GARGOYLE_STRIKE,true); - } - } - } - - void JustDied(Unit *victim) - { - float x,y,z; - m_creature->GetPosition(x,y,z); - z = m_creature->GetMap()->GetVmapHeight(x, y, z, true); - m_creature->GetMotionMaster()->MovePoint(0,x,y,z); - m_creature->GetMap()->CreatureRelocation(m_creature, x,y,z,0); - hyjal_trashAI::JustDied(victim); - } - - void UpdateAI(const uint32 diff) - { - hyjal_trashAI::UpdateAI(diff); - if (IsEvent || IsOverrun) - { - CAST_AI(hyjal_trashAI, m_creature->AI())->SetCanMelee(false); - npc_escortAI::UpdateAI(diff); - } - if (IsEvent) - { - if (!pGo) - { - pGo = true; - if (pInstance) - { - if (!useFlyPath) - { - for (uint8 i = 0; i < 3; ++i) - AddWaypoint(i, GargoyleWPs[i][0]+irand(-10,10), GargoyleWPs[i][1]+irand(-10,10), GargoyleWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - }else{//fly path FlyPathWPs - for (uint8 i = 0; i < 3; ++i) - AddWaypoint(i, FlyPathWPs[i][0]+irand(-10,10), FlyPathWPs[i][1]+irand(-10,10), FlyPathWPs[i][2]); - Start(false, true); - SetDespawnAtEnd(false); - } - } - } - } - if (IsOverrun && !UpdateVictim()) - { - if (faction == 0)//alliance - { - if (StrikeTimerCastSpell(DummyTarget[0],DummyTarget[1],DummyTarget[2],SPELL_GARGOYLE_STRIKE,false); - StrikeTimer = 2000+rand()%1000; - }else StrikeTimer -= diff; - } - } - if (!UpdateVictim()) - return; - if (!m_creature->IsWithinDist(m_creature->getVictim(), 20) || forcemove) - { - forcemove = false; - if (forcemove) - { - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - m_creature->Attack(target,false); - } - if (MoveTimergetVictim()->GetPosition(x,y,z); - m_creature->GetMotionMaster()->MovePoint(0,x,y,z+Zpos); - Zpos-=1.0; - if (Zpos<=0)Zpos=0; - MoveTimer = 2000; - }else MoveTimer-=diff; - } - if (StrikeTimerIsWithinDist(m_creature->getVictim(), 20)) - { - DoCast(m_creature->getVictim(),SPELL_GARGOYLE_STRIKE); - m_creature->StopMoving(); - m_creature->GetMotionMaster()->Clear(); - StrikeTimer = 2000+rand()%1000; - }else StrikeTimer=0; - }else StrikeTimer -= diff; - } -}; - - -CreatureAI* GetAI_mob_gargoyle(Creature* pCreature) -{ - return new mob_gargoyleAI(pCreature); -} - -#define SPELL_EXPLODING_SHOT 7896 - -struct TRINITY_DLL_DECL alliance_riflemanAI : public Scripted_NoMovementAI -{ - alliance_riflemanAI(Creature *c) : Scripted_NoMovementAI(c) - { - Reset(); - } - - uint32 ExplodeTimer; - - void JustDied(Unit* who) - { - } - - void Reset() - { - ExplodeTimer = 5000+rand()%5000; - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || m_creature->getVictim()) - return; - - if (who->isTargetableForAttack() && m_creature->IsHostileTo(who)) - { - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, 30)) - { - AttackStart(who); - } - } - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Check if we have a target - if (!UpdateVictim()) - return; - if (ExplodeTimer < diff) - { - if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 30)) - { - EnterEvadeMode(); - return; - } - int dmg = 500+rand()%700; - m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_EXPLODING_SHOT, &dmg, 0, 0, false); - ExplodeTimer = 5000+rand()%5000; - }else ExplodeTimer -= diff; - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_alliance_rifleman(Creature* pCreature) -{ - return new alliance_riflemanAI(pCreature); -} - -void AddSC_hyjal_trash() -{ - Script *newscript = new Script; - newscript->Name = "mob_giant_infernal"; - newscript->GetAI = &GetAI_mob_giant_infernal; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_abomination"; - newscript->GetAI = &GetAI_mob_abomination; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_ghoul"; - newscript->GetAI = &GetAI_mob_ghoul; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_necromancer"; - newscript->GetAI = &GetAI_mob_necromancer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_banshee"; - newscript->GetAI = &GetAI_mob_banshee; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_crypt_fiend"; - newscript->GetAI = &GetAI_mob_crypt_fiend; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_fel_stalker"; - newscript->GetAI = &GetAI_mob_fel_stalker; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_frost_wyrm"; - newscript->GetAI = &GetAI_mob_frost_wyrm; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_gargoyle"; - newscript->GetAI = &GetAI_mob_gargoyle; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "alliance_rifleman"; - newscript->GetAI = &GetAI_alliance_rifleman; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h deleted file mode 100644 index 9eeff8a03f4..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/hyjal_trash.h +++ /dev/null @@ -1,35 +0,0 @@ - -#ifndef SC_HYJAL_TRASH_AI_H -#define SC_HYJAL_TRASH_AI_H - -#include "def_hyjal.h" -#include "escortAI.h" - -#define MINRAIDDAMAGE 700000//minimal damage before trash can drop loot and reputation, resets if faction leader dies - -struct TRINITY_DLL_DECL hyjal_trashAI : public npc_escortAI -{ - hyjal_trashAI(Creature *c); - - void UpdateAI(const uint32 diff); - - void JustDied(Unit* killer); - - void DamageTaken(Unit *done_by, uint32 &damage); - - public: - ScriptedInstance* pInstance; - bool IsEvent; - uint32 Delay; - uint32 LastOverronPos; - bool IsOverrun; - bool SetupOverrun; - uint32 OverrunType; - uint8 faction; - bool useFlyPath; - uint32 damageTaken; - float DummyTarget[3]; - - //private: -}; -#endif \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp deleted file mode 100644 index 83fbbc67b73..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/hyjal/instance_hyjal.cpp +++ /dev/null @@ -1,322 +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_Mount_Hyjal -SD%Complete: 100 -SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Hyjal Scripts -SDCategory: Caverns of Time, Mount Hyjal -EndScriptData */ - -#include "precompiled.h" -#include "def_hyjal.h" -#include "hyjal_trash.h" - -enum -{ - MAX_ENCOUNTER = 5, - - GO_ANCIENT_GEM = 185557 -}; -/* Battle of Mount Hyjal encounters: -0 - Rage Winterchill event -1 - Anetheron event -2 - Kaz'rogal event -3 - Azgalor event -4 - Archimonde event -*/ - -struct TRINITY_DLL_DECL instance_mount_hyjal : public ScriptedInstance -{ - instance_mount_hyjal(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - std::list m_uiAncientGemGUID; - - uint64 RageWinterchill; - uint64 Anetheron; - uint64 Kazrogal; - uint64 Azgalor; - uint64 Archimonde; - uint64 JainaProudmoore; - uint64 Thrall; - uint64 TyrandeWhisperwind; - uint64 HordeGate; - uint64 ElfGate; - - uint32 Trash; - - - uint32 hordeRetreat; - uint32 allianceRetreat; - bool ArchiYell; - - uint32 RaidDamage; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiAncientGemGUID.clear(); - - RageWinterchill = 0; - Anetheron = 0; - Kazrogal = 0; - Azgalor = 0; - Archimonde = 0; - JainaProudmoore = 0; - Thrall = 0; - TyrandeWhisperwind = 0; - HordeGate = 0; - ElfGate = 0; - ArchiYell = false; - RaidDamage = 0; - - Trash = 0; - - hordeRetreat = 0; - allianceRetreat = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 182060: - HordeGate = pGo->GetGUID(); - if (allianceRetreat) - HandleGameObject(0, true, pGo); - else - HandleGameObject(0, false, pGo); - break; - case 182061: - ElfGate = pGo->GetGUID(); - if (hordeRetreat) - HandleGameObject(0, true, pGo); - else - HandleGameObject(0, false, pGo); - break; - case GO_ANCIENT_GEM: - m_uiAncientGemGUID.push_back(pGo->GetGUID()); - break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 17767: RageWinterchill = pCreature->GetGUID(); break; - case 17808: Anetheron = pCreature->GetGUID(); break; - case 17888: Kazrogal = pCreature->GetGUID(); break; - case 17842: Azgalor = pCreature->GetGUID(); break; - case 17968: Archimonde = pCreature->GetGUID(); break; - case 17772: JainaProudmoore = pCreature->GetGUID(); break; - case 17852: Thrall = pCreature->GetGUID(); break; - case 17948: TyrandeWhisperwind = pCreature->GetGUID(); break; - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_RAGEWINTERCHILL: return RageWinterchill; - case DATA_ANETHERON: return Anetheron; - case DATA_KAZROGAL: return Kazrogal; - case DATA_AZGALOR: return Azgalor; - case DATA_ARCHIMONDE: return Archimonde; - case DATA_JAINAPROUDMOORE: return JainaProudmoore; - case DATA_THRALL: return Thrall; - case DATA_TYRANDEWHISPERWIND: return TyrandeWhisperwind; - } - - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_RAGEWINTERCHILLEVENT: m_auiEncounter[0] = data; break; - case DATA_ANETHERONEVENT: - m_auiEncounter[1] = data; - break; - case DATA_KAZROGALEVENT: m_auiEncounter[2] = data; break; - case DATA_AZGALOREVENT: - { - m_auiEncounter[3] = data; - if (data==DONE) - { - if (ArchiYell)break; - ArchiYell = true; - - Creature* pCreature = instance->GetCreature(Azgalor); - if (pCreature) - { - Creature* pUnit = pCreature->SummonCreature(21987,pCreature->GetPositionX(),pCreature->GetPositionY(),pCreature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,10000); - - Map* pMap = pCreature->GetMap(); - if (pMap->IsDungeon() && pUnit) - { - pUnit->SetVisibility(VISIBILITY_OFF); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - if (PlayerList.isEmpty()) - return; - - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()) - { - WorldPacket data(SMSG_MESSAGECHAT, 200); - pUnit->BuildMonsterChat(&data,CHAT_MSG_MONSTER_YELL,"All of your efforts have been in vain, for the draining of the World Tree has already begun. Soon the heart of your world will beat no more.",0,"Archimonde",i->getSource()->GetGUID()); - i->getSource()->GetSession()->SendPacket(&data); - - WorldPacket data2(SMSG_PLAY_SOUND, 4); - data2 << 10986; - i->getSource()->GetSession()->SendPacket(&data2); - } - } - } - } - } - } - break; - case DATA_ARCHIMONDEEVENT: m_auiEncounter[4] = data; break; - case DATA_RESET_TRASH_COUNT: Trash = 0; break; - - case DATA_TRASH: - if (data) Trash = data; - else Trash--; - DoUpdateWorldState(WORLD_STATE_ENEMYCOUNT, Trash); - break; - case TYPE_RETREAT: - if (data == SPECIAL) - { - if (!m_uiAncientGemGUID.empty()) - { - for(std::list::iterator itr = m_uiAncientGemGUID.begin(); itr != m_uiAncientGemGUID.end(); ++itr) - { - //don't know how long it expected - DoRespawnGameObject(*itr,DAY); - } - } - } - break; - case DATA_ALLIANCE_RETREAT: - allianceRetreat = data; - HandleGameObject(HordeGate, true); - SaveToDB(); - break; - case DATA_HORDE_RETREAT: - hordeRetreat = data; - HandleGameObject(ElfGate, true); - SaveToDB(); - break; - case DATA_RAIDDAMAGE: - RaidDamage += data; - if (RaidDamage >= MINRAIDDAMAGE) - RaidDamage = MINRAIDDAMAGE; - break; - case DATA_RESET_RAIDDAMAGE: - RaidDamage = 0; - break; - } - - debug_log("TSCR: Instance Hyjal: Instance data updated for event %u (Data=%u)",type,data); - - if (data == DONE) - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " - << m_auiEncounter[3] << " " << m_auiEncounter[4] - << " " << allianceRetreat << " " << hordeRetreat - << " " << RaidDamage; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_RAGEWINTERCHILLEVENT: return m_auiEncounter[0]; - case DATA_ANETHERONEVENT: return m_auiEncounter[1]; - case DATA_KAZROGALEVENT: return m_auiEncounter[2]; - case DATA_AZGALOREVENT: return m_auiEncounter[3]; - case DATA_ARCHIMONDEEVENT: return m_auiEncounter[4]; - case DATA_TRASH: return Trash; - case DATA_ALLIANCE_RETREAT: return allianceRetreat; - case DATA_HORDE_RETREAT: return hordeRetreat; - case DATA_RAIDDAMAGE: return RaidDamage; - } - 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] >> allianceRetreat >> hordeRetreat >> RaidDamage; - 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_mount_hyjal(Map* pMap) -{ - return new instance_mount_hyjal(pMap); -} - -void AddSC_instance_mount_hyjal() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_hyjal"; - newscript->GetInstanceData = &GetInstanceData_instance_mount_hyjal; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp deleted file mode 100644 index 0c6c98d9758..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_captain_skarloc.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Captain_Skarloc -SD%Complete: 75 -SDComment: Missing adds, missing waypoints to move up to Thrall once spawned + speech before enter combat. -SDCategory: Caverns of Time, Old Hillsbrad Foothills -EndScriptData */ - -#include "precompiled.h" -#include "def_old_hillsbrad.h" - -#define SAY_ENTER -1560000 -#define SAY_TAUNT1 -1560001 -#define SAY_TAUNT2 -1560002 -#define SAY_SLAY1 -1560003 -#define SAY_SLAY2 -1560004 -#define SAY_DEATH -1560005 - -#define SPELL_HOLY_LIGHT 29427 -#define SPELL_CLEANSE 29380 -#define SPELL_HAMMER_OF_JUSTICE 13005 -#define SPELL_HOLY_SHIELD 31904 -#define SPELL_DEVOTION_AURA 8258 -#define SPELL_CONSECRATION 38385 - -struct TRINITY_DLL_DECL boss_captain_skarlocAI : public ScriptedAI -{ - boss_captain_skarlocAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 Holy_Light_Timer; - uint32 Cleanse_Timer; - uint32 HammerOfJustice_Timer; - uint32 HolyShield_Timer; - uint32 DevotionAura_Timer; - uint32 Consecration_Timer; - - void Reset() - { - Holy_Light_Timer = 20000 + rand()%10000; - Cleanse_Timer = 10000; - HammerOfJustice_Timer = 20000 + rand()%15000; - HolyShield_Timer = 240000; - DevotionAura_Timer = 3000; - Consecration_Timer = 8000; - } - - void EnterCombat(Unit *who) - { - //This is not correct. Should taunt Thrall before engage in combat - DoScriptText(SAY_TAUNT1, m_creature); - DoScriptText(SAY_TAUNT2, m_creature); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) - pInstance->SetData(TYPE_THRALL_PART1, DONE); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Holy_Light - if (Holy_Light_Timer < diff) - { - DoCast(m_creature, SPELL_HOLY_LIGHT); - Holy_Light_Timer = 30000; - }else Holy_Light_Timer -= diff; - - //Cleanse - if (Cleanse_Timer < diff) - { - DoCast(m_creature, SPELL_CLEANSE); - Cleanse_Timer = 10000; - } else Cleanse_Timer -= diff; - - //Hammer of Justice - if (HammerOfJustice_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); - HammerOfJustice_Timer = 60000; - }else HammerOfJustice_Timer -= diff; - - //Holy Shield - if (HolyShield_Timer < diff) - { - DoCast(m_creature, SPELL_HOLY_SHIELD); - HolyShield_Timer = 240000; - }else HolyShield_Timer -= diff; - - //Devotion_Aura - if (DevotionAura_Timer < diff) - { - DoCast(m_creature, SPELL_DEVOTION_AURA); - DevotionAura_Timer = 45000 + rand()%10000; - }else DevotionAura_Timer -= diff; - - //Consecration - if (Consecration_Timer < diff) - { - //DoCast(m_creature->getVictim(), SPELL_CONSECRATION); - Consecration_Timer = 5000 + rand()%5000; - }else Consecration_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_captain_skarloc(Creature* pCreature) -{ - return new boss_captain_skarlocAI (pCreature); -} - -void AddSC_boss_captain_skarloc() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_captain_skarloc"; - newscript->GetAI = &GetAI_boss_captain_skarloc; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp deleted file mode 100644 index 138a59cce93..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_epoch_hunter.cpp +++ /dev/null @@ -1,150 +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_Epoch_Hunter -SD%Complete: 60 -SDComment: Missing spawns pre-event, missing speech to be coordinated with rest of escort event. -SDCategory: Caverns of Time, Old Hillsbrad Foothills -EndScriptData */ - -#include "precompiled.h" -#include "def_old_hillsbrad.h" - -#define SAY_ENTER1 -1560013 -#define SAY_ENTER2 -1560014 -#define SAY_ENTER3 -1560015 -#define SAY_AGGRO1 -1560016 -#define SAY_AGGRO2 -1560017 -#define SAY_SLAY1 -1560018 -#define SAY_SLAY2 -1560019 -#define SAY_BREATH1 -1560020 -#define SAY_BREATH2 -1560021 -#define SAY_DEATH -1560022 - -#define SPELL_SAND_BREATH 31914 -#define SPELL_IMPENDING_DEATH 31916 -#define SPELL_MAGIC_DISRUPTION_AURA 33834 -#define SPELL_WING_BUFFET 31475 - -struct TRINITY_DLL_DECL boss_epoch_hunterAI : public ScriptedAI -{ - boss_epoch_hunterAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 SandBreath_Timer; - uint32 ImpendingDeath_Timer; - uint32 WingBuffet_Timer; - uint32 Mda_Timer; - - void Reset() - { - SandBreath_Timer = 8000 + rand()%8000; - ImpendingDeath_Timer = 25000 + rand()%5000; - WingBuffet_Timer = 35000; - Mda_Timer = 40000; - } - - void EnterCombat(Unit *who) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - } - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance && pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) - pInstance->SetData(TYPE_THRALL_PART4, DONE); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Sand Breath - if (SandBreath_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - DoCast(m_creature->getVictim(),SPELL_SAND_BREATH); - - switch(rand()%2) - { - case 0: DoScriptText(SAY_BREATH1, m_creature); break; - case 1: DoScriptText(SAY_BREATH2, m_creature); break; - } - - SandBreath_Timer = 10000 + rand()%10000; - }else SandBreath_Timer -= diff; - - if (ImpendingDeath_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_IMPENDING_DEATH); - ImpendingDeath_Timer = 25000+rand()%5000; - }else ImpendingDeath_Timer -= diff; - - if (WingBuffet_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_WING_BUFFET); - WingBuffet_Timer = 25000+rand()%10000; - }else WingBuffet_Timer -= diff; - - if (Mda_Timer < diff) - { - DoCast(m_creature,SPELL_MAGIC_DISRUPTION_AURA); - Mda_Timer = 15000; - }else Mda_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_epoch_hunter(Creature* pCreature) -{ - return new boss_epoch_hunterAI (pCreature); -} - -void AddSC_boss_epoch_hunter() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_epoch_hunter"; - newscript->GetAI = &GetAI_boss_epoch_hunter; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp deleted file mode 100644 index 266f61354c0..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp +++ /dev/null @@ -1,194 +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_Luetenant_Drake -SD%Complete: 70 -SDComment: Missing proper code for patrolling area after being spawned. Script for GO (barrels) quest 10283 -SDCategory: Caverns of Time, Old Hillsbrad Foothills -EndScriptData */ - -#include "precompiled.h" -#include "def_old_hillsbrad.h" -#include "escortAI.h" - -/*###### -## go_barrel_old_hillsbrad -######*/ - -bool GOHello_go_barrel_old_hillsbrad(Player* pPlayer, GameObject* pGO) -{ - if (ScriptedInstance* pInstance = pGO->GetInstanceData()) - { - if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE) - return false; - - pInstance->SetData(TYPE_BARREL_DIVERSION, IN_PROGRESS); - } - - return false; -} - -/*###### -## boss_lieutenant_drake -######*/ - -#define SAY_ENTER -1560006 -#define SAY_AGGRO -1560007 -#define SAY_SLAY1 -1560008 -#define SAY_SLAY2 -1560009 -#define SAY_MORTAL -1560010 -#define SAY_SHOUT -1560011 -#define SAY_DEATH -1560012 - -#define SPELL_WHIRLWIND 31909 -#define SPELL_HAMSTRING 9080 -#define SPELL_MORTAL_STRIKE 31911 -#define SPELL_FRIGHTENING_SHOUT 33789 - -struct Location -{ - uint32 wpId; - float x; - float y; - float z; -}; - -static Location DrakeWP[]= -{ - {0, 2125.84, 88.2535, 54.8830}, - {1, 2111.01, 93.8022, 52.6356}, - {2, 2106.70, 114.753, 53.1965}, - {3, 2107.76, 138.746, 52.5109}, - {4, 2114.83, 160.142, 52.4738}, - {5, 2125.24, 178.909, 52.7283}, - {6, 2151.02, 208.901, 53.1551}, - {7, 2177.00, 233.069, 52.4409}, - {8, 2190.71, 227.831, 53.2742}, - {9, 2178.14, 214.219, 53.0779}, - {10, 2154.99, 202.795, 52.6446}, - {11, 2132.00, 191.834, 52.5709}, - {12, 2117.59, 166.708, 52.7686}, - {13, 2093.61, 139.441, 52.7616}, - {14, 2086.29, 104.950, 52.9246}, - {15, 2094.23, 81.2788, 52.6946}, - {16, 2108.70, 85.3075, 53.3294}, - {17, 2125.50, 88.9481, 54.7953}, - {18, 2128.20, 70.9763, 64.4221} -}; - -struct TRINITY_DLL_DECL boss_lieutenant_drakeAI : public ScriptedAI -{ - boss_lieutenant_drakeAI(Creature *c) : ScriptedAI(c) {} - - bool CanPatrol; - uint32 wpId; - - uint32 Whirlwind_Timer; - uint32 Fear_Timer; - uint32 MortalStrike_Timer; - uint32 ExplodingShout_Timer; - - void Reset() - { - CanPatrol = true; - wpId = 0; - - Whirlwind_Timer = 20000; - Fear_Timer = 30000; - MortalStrike_Timer = 45000; - ExplodingShout_Timer = 25000; - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - //TODO: make this work - if (CanPatrol && wpId == 0) - { - m_creature->GetMotionMaster()->MovePoint(DrakeWP[0].wpId, DrakeWP[0].x, DrakeWP[0].y, DrakeWP[0].z); - wpId++; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Whirlwind - if (Whirlwind_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_WHIRLWIND); - Whirlwind_Timer = 20000+rand()%5000; - }else Whirlwind_Timer -= diff; - - //Fear - if (Fear_Timer < diff) - { - DoScriptText(SAY_SHOUT, m_creature); - DoCast(m_creature->getVictim(), SPELL_FRIGHTENING_SHOUT); - Fear_Timer = 25000+rand()%10000; - }else Fear_Timer -= diff; - - //Mortal Strike - if (MortalStrike_Timer < diff) - { - DoScriptText(SAY_MORTAL, m_creature); - DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); - MortalStrike_Timer = 20000+rand()%10000; - }else MortalStrike_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_lieutenant_drake(Creature* pCreature) -{ - return new boss_lieutenant_drakeAI (pCreature); -} - -void AddSC_boss_lieutenant_drake() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="go_barrel_old_hillsbrad"; - newscript->pGOHello = &GOHello_go_barrel_old_hillsbrad; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_lieutenant_drake"; - newscript->GetAI = &GetAI_boss_lieutenant_drake; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.h deleted file mode 100644 index 3253a384217..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/def_old_hillsbrad.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_OLD_HILLSBRAD_H -#define DEF_OLD_HILLSBRAD_H - -#define TYPE_BARREL_DIVERSION 1 -#define TYPE_THRALL_EVENT 2 -#define TYPE_THRALL_PART1 3 -#define TYPE_THRALL_PART2 4 -#define TYPE_THRALL_PART3 5 -#define TYPE_THRALL_PART4 6 -#define DATA_THRALL 7 -#define DATA_TARETHA 8 -#define DATA_EPOCH 9 -#define WORLD_STATE_OH 2436 -#endif - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp deleted file mode 100644 index b8ec8f2e111..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/instance_old_hillsbrad.cpp +++ /dev/null @@ -1,238 +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_Old_Hillsbrad -SD%Complete: 75 -SDComment: If thrall escort fail, all parts will reset. In future, save sub-parts and continue from last known. -SDCategory: Caverns of Time, Old Hillsbrad Foothills -EndScriptData */ - -#include "precompiled.h" -#include "def_old_hillsbrad.h" - -#define MAX_ENCOUNTER 6 - -#define THRALL_ENTRY 17876 -#define TARETHA_ENTRY 18887 -#define EPOCH_ENTRY 18096 - -#define DRAKE_ENTRY 17848 - -#define QUEST_ENTRY_DIVERSION 10283 -#define LODGE_QUEST_TRIGGER 20155 - -struct TRINITY_DLL_DECL instance_old_hillsbrad : public ScriptedInstance -{ - instance_old_hillsbrad(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint32 mBarrelCount; - uint32 mThrallEventCount; - - uint64 ThrallGUID; - uint64 TarethaGUID; - uint64 EpochGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - mBarrelCount = 0; - mThrallEventCount = 0; - ThrallGUID = 0; - TarethaGUID = 0; - EpochGUID = 0; - } - - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("TSCR: Instance Old Hillsbrad: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void UpdateQuestCredit() - { - 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()) - pPlayer->KilledMonsterCredit(LODGE_QUEST_TRIGGER,0); - } - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case THRALL_ENTRY: - ThrallGUID = pCreature->GetGUID(); - break; - case TARETHA_ENTRY: - TarethaGUID = pCreature->GetGUID(); - break; - case EPOCH_ENTRY: - EpochGUID = pCreature->GetGUID(); - break; - } - } - - void SetData(uint32 type, uint32 data) - { - Player* pPlayer = GetPlayerInMap(); - - if (!pPlayer) - { - debug_log("TSCR: Instance Old Hillsbrad: SetData (Type: %u Data %u) cannot find any player.", type, data); - return; - } - - switch(type) - { - case TYPE_BARREL_DIVERSION: - { - if (data == IN_PROGRESS) - { - if (mBarrelCount >= 5) - return; - - ++mBarrelCount; - DoUpdateWorldState(WORLD_STATE_OH, mBarrelCount); - - debug_log("TSCR: Instance Old Hillsbrad: go_barrel_old_hillsbrad count %u",mBarrelCount); - - m_auiEncounter[0] = IN_PROGRESS; - - if (mBarrelCount == 5) - { - UpdateQuestCredit(); - pPlayer->SummonCreature(DRAKE_ENTRY, 2128.43, 71.01, 64.42, 1.74, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 1800000); - m_auiEncounter[0] = DONE; - } - } - break; - } - case TYPE_THRALL_EVENT: - { - if (data == FAIL) - { - if (mThrallEventCount <= 20) - { - mThrallEventCount++; - m_auiEncounter[1] = NOT_STARTED; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); - m_auiEncounter[2] = NOT_STARTED; - m_auiEncounter[3] = NOT_STARTED; - m_auiEncounter[4] = NOT_STARTED; - m_auiEncounter[5] = NOT_STARTED; - } - else if (mThrallEventCount > 20) - { - m_auiEncounter[1] = data; - m_auiEncounter[2] = data; - m_auiEncounter[3] = data; - m_auiEncounter[4] = data; - m_auiEncounter[5] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event failed %u times. Resetting all sub-events.",mThrallEventCount); - } - } - else - m_auiEncounter[1] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall escort event adjusted to data %u.",data); - break; - } - case TYPE_THRALL_PART1: - m_auiEncounter[2] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event part I adjusted to data %u.",data); - break; - case TYPE_THRALL_PART2: - m_auiEncounter[3] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event part II adjusted to data %u.",data); - break; - case TYPE_THRALL_PART3: - m_auiEncounter[4] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event part III adjusted to data %u.",data); - break; - case TYPE_THRALL_PART4: - m_auiEncounter[5] = data; - debug_log("TSCR: Instance Old Hillsbrad: Thrall event part IV adjusted to data %u.",data); - break; - } - } - - uint32 GetData(uint32 data) - { - switch(data) - { - case TYPE_BARREL_DIVERSION: - return m_auiEncounter[0]; - case TYPE_THRALL_EVENT: - return m_auiEncounter[1]; - case TYPE_THRALL_PART1: - return m_auiEncounter[2]; - case TYPE_THRALL_PART2: - return m_auiEncounter[3]; - case TYPE_THRALL_PART3: - return m_auiEncounter[4]; - case TYPE_THRALL_PART4: - return m_auiEncounter[5]; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_THRALL: - return ThrallGUID; - case DATA_TARETHA: - return TarethaGUID; - case DATA_EPOCH: - return EpochGUID; - } - return 0; - } -}; -InstanceData* GetInstanceData_instance_old_hillsbrad(Map* pMap) -{ - return new instance_old_hillsbrad(pMap); -} - -void AddSC_instance_old_hillsbrad() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_old_hillsbrad"; - newscript->GetInstanceData = &GetInstanceData_instance_old_hillsbrad; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp deleted file mode 100644 index 5559989ef65..00000000000 --- a/src/bindings/scripts/scripts/zone/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp +++ /dev/null @@ -1,682 +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: Old_Hillsbrad -SD%Complete: 40 -SDComment: Quest support: 10283, 10284. All friendly NPC's. Thrall waypoints fairly complete, missing many details, but possible to complete escort. -SDCategory: Caverns of Time, Old Hillsbrad Foothills -EndScriptData */ - -/* ContentData -npc_erozion -npc_thrall_old_hillsbrad -npc_taretha -EndContentData */ - -#include "precompiled.h" -#include "escortAI.h" -#include "def_old_hillsbrad.h" - -#define QUEST_ENTRY_HILLSBRAD 10282 -#define QUEST_ENTRY_DIVERSION 10283 -#define QUEST_ENTRY_ESCAPE 10284 -#define QUEST_ENTRY_RETURN 10285 -#define ITEM_ENTRY_BOMBS 25853 - -/*###### -## npc_erozion -######*/ - -bool GossipHello_npc_erozion(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - ScriptedInstance* pInstance = (pCreature->GetInstanceData()); - if (pInstance && pInstance->GetData(TYPE_BARREL_DIVERSION) != DONE && !pPlayer->HasItemCount(ITEM_ENTRY_BOMBS,1)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I need a pack of Incendiary Bombs.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - - if (!pPlayer->GetQuestRewardStatus(QUEST_ENTRY_RETURN) && pPlayer->GetQuestStatus(QUEST_ENTRY_RETURN) == QUEST_STATUS_COMPLETE) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] Teleport please, i'm tired.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - - pPlayer->SEND_GOSSIP_MENU(9778, pCreature->GetGUID()); - - return true; -} - -bool GossipSelect_npc_erozion(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - ItemPosCountVec dest; - uint8 msg = pPlayer->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, ITEM_ENTRY_BOMBS, 1); - if (msg == EQUIP_ERR_OK) - { - pPlayer->StoreNewItem(dest, ITEM_ENTRY_BOMBS, true); - } - pPlayer->SEND_GOSSIP_MENU(9515, pCreature->GetGUID()); - } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) - { - pPlayer->CLOSE_GOSSIP_MENU(); - } - return true; -} - -/*###### -## npc_thrall_old_hillsbrad -######*/ - -//Thrall texts -#define SAY_TH_START_EVENT_PART1 -1560023 -#define SAY_TH_ARMORY -1560024 -#define SAY_TH_SKARLOC_MEET -1560025 -#define SAY_TH_SKARLOC_TAUNT -1560026 -#define SAY_TH_START_EVENT_PART2 -1560027 -#define SAY_TH_MOUNTS_UP -1560028 -#define SAY_TH_CHURCH_END -1560029 -#define SAY_TH_MEET_TARETHA -1560030 -#define SAY_TH_EPOCH_WONDER -1560031 -#define SAY_TH_EPOCH_KILL_TARETHA -1560032 -#define SAY_TH_EVENT_COMPLETE -1560033 - -#define SAY_TH_RANDOM_LOW_HP1 -1560034 -#define SAY_TH_RANDOM_LOW_HP2 -1560035 - -#define SAY_TH_RANDOM_DIE1 -1560036 -#define SAY_TH_RANDOM_DIE2 -1560037 - -#define SAY_TH_RANDOM_AGGRO1 -1560038 -#define SAY_TH_RANDOM_AGGRO2 -1560039 -#define SAY_TH_RANDOM_AGGRO3 -1560040 -#define SAY_TH_RANDOM_AGGRO4 -1560041 - -#define SAY_TH_RANDOM_KILL1 -1560042 -#define SAY_TH_RANDOM_KILL2 -1560043 -#define SAY_TH_RANDOM_KILL3 -1560044 - -#define SAY_TH_LEAVE_COMBAT1 -1560045 -#define SAY_TH_LEAVE_COMBAT2 -1560046 -#define SAY_TH_LEAVE_COMBAT3 -1560047 - -//Taretha texts -#define SAY_TA_FREE -1560048 -#define SAY_TA_ESCAPED -1560049 - -//Misc for Thrall -#define SPELL_STRIKE 14516 -#define SPELL_SHIELD_BLOCK 12169 -#define SPELL_SUMMON_EROZION_IMAGE 33954 //if thrall dies during escort? - -#define SPEED_WALK (0.5f) -#define SPEED_RUN (1.0f) -#define SPEED_MOUNT (1.6f) - -#define THRALL_WEAPON_MODEL 22106 -#define THRALL_WEAPON_INFO 218169346 -#define THRALL_SHIELD_MODEL 18662 -#define THRALL_SHIELD_INFO 234948100 -#define THRALL_MODEL_UNEQUIPPED 17292 -#define THRALL_MODEL_EQUIPPED 18165 - -//Misc Creature entries -#define ENTRY_ARMORER 18764 -#define ENTRY_SCARLOC 17862 - -#define MOB_ENTRY_RIFLE 17820 -#define MOB_ENTRY_WARDEN 17833 -#define MOB_ENTRY_VETERAN 17860 -#define MOB_ENTRY_WATCHMAN 17814 -#define MOB_ENTRY_SENTRY 17815 - -#define MOB_ENTRY_BARN_GUARDSMAN 18092 -#define MOB_ENTRY_BARN_PROTECTOR 18093 -#define MOB_ENTRY_BARN_LOOKOUT 18094 - -#define MOB_ENTRY_CHURCH_GUARDSMAN 23175 -#define MOB_ENTRY_CHURCH_PROTECTOR 23179 -#define MOB_ENTRY_CHURCH_LOOKOUT 23177 - -#define MOB_ENTRY_INN_GUARDSMAN 23176 -#define MOB_ENTRY_INN_PROTECTOR 23180 -#define MOB_ENTRY_INN_LOOKOUT 23178 - -#define SKARLOC_MOUNT 18798 -#define SKARLOC_MOUNT_MODEL 18223 -#define EROZION_ENTRY 18723 -#define ENTRY_EPOCH 18096 - -//gossip items -#define GOSSIP_ID_START 9568 -#define GOSSIP_ID_SKARLOC1 9614 //I'm glad Taretha is alive. We now must find a way to free her... -#define GOSSIP_ITEM_SKARLOC1 "Taretha cannot see you, Thrall." -#define GOSSIP_ID_SKARLOC2 9579 //What do you mean by this? Is Taretha in danger? -#define GOSSIP_ITEM_SKARLOC2 "The situation is rather complicated, Thrall. It would be best for you to head into the mountains now, before more of Blackmoore's men show up. We'll make sure Taretha is safe." -#define GOSSIP_ID_SKARLOC3 9580 - -#define GOSSIP_ID_TARREN 9597 //tarren mill is beyond these trees -#define GOSSIP_ITEM_TARREN "We're ready, Thrall." - -#define GOSSIP_ID_COMPLETE 9578 //Thank you friends, I owe my freedom to you. Where is Taretha? I hoped to see her - -struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI -{ - npc_thrall_old_hillsbradAI(Creature *c) : npc_escortAI(c) - { - pInstance = c->GetInstanceData(); - HadMount = false; - m_creature->setActive(true); - } - - ScriptedInstance *pInstance; - - uint64 TarethaGUID; - - bool LowHp; - bool HadMount; - - void WaypointReached(uint32 i) - { - if (!pInstance) - return; - - switch(i) - { - case 8: - SetRun(false); - m_creature->SummonCreature(18764,2181.87,112.46,89.45,0.26,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - break; - case 9: - DoScriptText(SAY_TH_ARMORY, m_creature); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, THRALL_WEAPON_MODEL); - //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO, THRALL_WEAPON_INFO); - //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+1, 781); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, THRALL_SHIELD_MODEL); - //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+2, THRALL_SHIELD_INFO); - //m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_INFO+3, 1038); - break; - case 10: - m_creature->SetDisplayId(THRALL_MODEL_EQUIPPED); - break; - case 11: - SetRun(); - break; - case 15: - m_creature->SummonCreature(MOB_ENTRY_RIFLE,2200.28,137.37,87.93,5.07,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_WARDEN,2197.44,131.83,87.93,0.78,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_VETERAN,2203.62,135.40,87.93,3.70,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_VETERAN,2200.75,130.13,87.93,1.48,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - break; - case 21: - m_creature->SummonCreature(MOB_ENTRY_RIFLE,2135.80,154.01,67.45,4.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_WARDEN,2144.36,151.87,67.74,4.46,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_VETERAN,2142.12,154.41,67.12,4.56,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_VETERAN,2138.08,155.38,67.24,4.60,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - break; - case 25: - m_creature->SummonCreature(MOB_ENTRY_RIFLE,2102.98,192.17,65.24,6.02,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_WARDEN,2108.48,198.75,65.18,5.15,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_VETERAN,2106.11,197.29,65.18,5.63,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_VETERAN,2104.18,194.82,65.18,5.75,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - break; - case 29: - DoScriptText(SAY_TH_SKARLOC_MEET, m_creature); - m_creature->SummonCreature(ENTRY_SCARLOC,2036.48,271.22,63.43,5.27,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - //temporary,skarloc should rather be triggered to walk up to thrall - break; - case 30: - IsOnHold = true; - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - SetRun(false); - break; - case 31: - DoScriptText(SAY_TH_MOUNTS_UP, m_creature); - DoMount(); - SetRun(); - break; - case 37: - //possibly regular patrollers? If so, remove this and let database handle them - m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2124.26,522.16,56.87,3.99,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_WATCHMAN,2121.69,525.37,57.11,4.01,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_SENTRY,2124.65,524.55,56.63,3.98,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - break; - case 59: - m_creature->SummonCreature(SKARLOC_MOUNT,2488.64,625.77,58.26,4.71,TEMPSUMMON_TIMED_DESPAWN,10000); - DoUnmount(); - HadMount = false; - SetRun(false); - break; - case 60: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION); - //make horsie run off - IsOnHold = true; - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - pInstance->SetData(TYPE_THRALL_PART2, DONE); - SetRun(); - break; - case 64: - SetRun(false); - break; - case 68: - m_creature->SummonCreature(MOB_ENTRY_BARN_PROTECTOR,2500.22,692.60,55.50,2.84,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_BARN_LOOKOUT,2500.13,696.55,55.51,3.38,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.55,693.64,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_BARN_GUARDSMAN,2500.94,695.81,55.50,3.14,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - break; - case 71: - SetRun(); - break; - case 81: - SetRun(false); - break; - case 83: - m_creature->SummonCreature(MOB_ENTRY_CHURCH_PROTECTOR,2627.33,646.82,56.03,4.28,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); - m_creature->SummonCreature(MOB_ENTRY_CHURCH_LOOKOUT,2624.14,648.03,56.03,4.50,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); - m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2625.32,649.60,56.03,4.38,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); - m_creature->SummonCreature(MOB_ENTRY_CHURCH_GUARDSMAN,2627.22,649.00,56.03,4.34,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,5000); - break; - case 84: - DoScriptText(SAY_TH_CHURCH_END, m_creature); - SetRun(); - break; - case 91: - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - SetRun(false); - break; - case 93: - m_creature->SummonCreature(MOB_ENTRY_INN_PROTECTOR,2652.71,660.31,61.93,1.67,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_INN_LOOKOUT,2648.96,662.59,61.93,0.79,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2657.36,662.34,61.93,2.68,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - m_creature->SummonCreature(MOB_ENTRY_INN_GUARDSMAN,2656.39,659.77,61.93,2.61,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,5000); - break; - case 94: - if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) - { - if (Unit* Taretha = Unit::GetUnit((*m_creature), TarethaGUID)) - DoScriptText(SAY_TA_ESCAPED, Taretha, m_creature); - } - break; - case 95: - DoScriptText(SAY_TH_MEET_TARETHA, m_creature); - pInstance->SetData(TYPE_THRALL_PART3,DONE); - IsOnHold = true; - break; - case 96: - DoScriptText(SAY_TH_EPOCH_WONDER, m_creature); - break; - case 97: - DoScriptText(SAY_TH_EPOCH_KILL_TARETHA, m_creature); - SetRun(); - break; - case 98: - //trigger epoch Yell("Thrall! Come outside and face your fate! ....") - //from here, thrall should not never be allowed to move to point 106 which he currently does. - break; - - case 106: - { - if (!PlayerGUID) - break; - - //trigger taretha to run down outside - if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) - { - if (Creature* Taretha = (Unit::GetCreature(*m_creature, TarethaGUID))) - CAST_AI(npc_escortAI, (Taretha->AI()))->Start(false, true, PlayerGUID); - } - - //kill credit Creature for quest - Map* pMap = m_creature->GetMap(); - Map::PlayerList const& players = pMap->GetPlayers(); - if (!players.isEmpty() && pMap->IsDungeon()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* pPlayer = itr->getSource()) - pPlayer->KilledMonsterCredit(20156,m_creature->GetGUID()); - } - } - - //alot will happen here, thrall and taretha talk, erozion appear at spot to explain - m_creature->SummonCreature(EROZION_ENTRY,2646.47,680.416,55.38,4.16,TEMPSUMMON_TIMED_DESPAWN,120000); - } - break; - case 108: - //last waypoint, just set Thrall invisible, respawn is turned off - m_creature->SetVisibility(VISIBILITY_OFF); - break; - } - } - - - void Reset() - { - LowHp = false; - - if (HadMount) - DoMount(); - - if (!IsBeingEscorted) - { - DoUnmount(); - HadMount = false; - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); - m_creature->SetDisplayId(THRALL_MODEL_UNEQUIPPED); - } - if (IsBeingEscorted) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_TH_LEAVE_COMBAT1, m_creature); break; - case 1: DoScriptText(SAY_TH_LEAVE_COMBAT2, m_creature); break; - case 2: DoScriptText(SAY_TH_LEAVE_COMBAT3, m_creature); break; - } - } - } - void StartWP() - { - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - IsOnHold = false; - } - void DoMount() - { - m_creature->Mount(SKARLOC_MOUNT_MODEL); - m_creature->SetSpeed(MOVE_RUN,SPEED_MOUNT); - } - void DoUnmount() - { - m_creature->Unmount(); - m_creature->SetSpeed(MOVE_RUN,SPEED_RUN); - } - void EnterCombat(Unit* who) - { - switch(rand()%4) - { - case 0: DoScriptText(SAY_TH_RANDOM_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_TH_RANDOM_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_TH_RANDOM_AGGRO3, m_creature); break; - case 3: DoScriptText(SAY_TH_RANDOM_AGGRO4, m_creature); break; - } - if (m_creature->IsMounted()) - { - DoUnmount(); - HadMount = true; - } - } - - void JustSummoned(Creature* summoned) - { - switch(summoned->GetEntry()) - { - //TODO: make Scarloc start into event instead, and not start attack directly - case MOB_ENTRY_BARN_GUARDSMAN: - case MOB_ENTRY_BARN_PROTECTOR: - case MOB_ENTRY_BARN_LOOKOUT: - case SKARLOC_MOUNT: - case EROZION_ENTRY: - break; - default: - summoned->AI()->AttackStart(m_creature); - break; - } - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_TH_RANDOM_KILL1, m_creature); break; - case 1: DoScriptText(SAY_TH_RANDOM_KILL2, m_creature); break; - case 2: DoScriptText(SAY_TH_RANDOM_KILL3, m_creature); break; - } - } - void JustDied(Unit *slayer) - { - if (pInstance) - pInstance->SetData(TYPE_THRALL_EVENT,FAIL); - - // Don't do a yell if he kills self (if player goes too far or at the end). - if (slayer == m_creature) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_TH_RANDOM_DIE1, m_creature); break; - case 1: DoScriptText(SAY_TH_RANDOM_DIE2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - //TODO: add his abilities'n-crap here - if (!LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_TH_RANDOM_LOW_HP1, m_creature); break; - case 1: DoScriptText(SAY_TH_RANDOM_LOW_HP2, m_creature); break; - } - LowHp = true; - } - } -}; - -CreatureAI* GetAI_npc_thrall_old_hillsbrad(Creature* pCreature) -{ - return new npc_thrall_old_hillsbradAI(pCreature); -} - -bool GossipHello_npc_thrall_old_hillsbrad(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - { - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - pPlayer->SendPreparedQuest(pCreature->GetGUID()); - } - - ScriptedInstance* pInstance = (pCreature->GetInstanceData()); - if (pInstance) - { - if (pInstance->GetData(TYPE_BARREL_DIVERSION) == DONE && !pInstance->GetData(TYPE_THRALL_EVENT)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "[PH] Start walking.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_START, pCreature->GetGUID()); - } - - if (pInstance->GetData(TYPE_THRALL_PART1) == DONE && !pInstance->GetData(TYPE_THRALL_PART2)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC1, pCreature->GetGUID()); - } - - if (pInstance->GetData(TYPE_THRALL_PART2) == DONE && !pInstance->GetData(TYPE_THRALL_PART3)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TARREN, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_TARREN, pCreature->GetGUID()); - } - } - return true; -} - -bool GossipSelect_npc_thrall_old_hillsbrad(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - ScriptedInstance* pInstance = (pCreature->GetInstanceData()); - switch(uiAction) - { - case GOSSIP_ACTION_INFO_DEF+1: - pPlayer->CLOSE_GOSSIP_MENU(); - if (pInstance) - { - pInstance->SetData(TYPE_THRALL_EVENT,IN_PROGRESS); - pInstance->SetData(TYPE_THRALL_PART1,IN_PROGRESS); - } - - DoScriptText(SAY_TH_START_EVENT_PART1, pCreature); - - if (npc_escortAI* pEscortAI = CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI())) - pEscortAI->Start(true, true, pPlayer->GetGUID()); - - CAST_AI(npc_escortAI, (pCreature->AI()))->SetMaxPlayerDistance(100.0f);//not really needed, because it will not despawn if player is too far - CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtEnd(false); - CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtFar(false); - break; - - case GOSSIP_ACTION_INFO_DEF+2: - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_SKARLOC2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+20); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC2, pCreature->GetGUID()); - break; - - case GOSSIP_ACTION_INFO_DEF+20: - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_SKARLOC3, pCreature->GetGUID()); - pCreature->SummonCreature(SKARLOC_MOUNT,2038.81,270.26,63.20,5.41,TEMPSUMMON_TIMED_DESPAWN,12000); - if (pInstance) - pInstance->SetData(TYPE_THRALL_PART2,IN_PROGRESS); - - DoScriptText(SAY_TH_START_EVENT_PART2, pCreature); - - CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI())->StartWP(); - break; - - case GOSSIP_ACTION_INFO_DEF+3: - pPlayer->CLOSE_GOSSIP_MENU(); - if (pInstance) - pInstance->SetData(TYPE_THRALL_PART3,IN_PROGRESS); - CAST_AI(npc_thrall_old_hillsbradAI, pCreature->AI())->StartWP(); - break; - } - return true; -} - -/*###### -## npc_taretha -######*/ - -#define GOSSIP_ID_EPOCH1 9610 //Thank you for helping Thrall escape, friends. Now I only hope -#define GOSSIP_ITEM_EPOCH1 "Strange wizard?" -#define GOSSIP_ID_EPOCH2 9613 //Yes, friends. This man was no wizard of -#define GOSSIP_ITEM_EPOCH2 "We'll get you out. Taretha. Don't worry. I doubt the wizard would wander too far away." - -struct TRINITY_DLL_DECL npc_tarethaAI : public npc_escortAI -{ - npc_tarethaAI(Creature *c) : npc_escortAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - void WaypointReached(uint32 i) - { - switch(i) - { - case 6: - DoScriptText(SAY_TA_FREE, m_creature); - break; - case 7: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_CHEER); - break; - } - } - void Reset() {} - void EnterCombat(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } -}; -CreatureAI* GetAI_npc_taretha(Creature* pCreature) -{ - return new npc_tarethaAI(pCreature); -} - -bool GossipHello_npc_taretha(Player* pPlayer, Creature* pCreature) -{ - ScriptedInstance* pInstance = (pCreature->GetInstanceData()); - if (pInstance && pInstance->GetData(TYPE_THRALL_PART3) == DONE && pInstance->GetData(TYPE_THRALL_PART4) == NOT_STARTED) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH1, pCreature->GetGUID()); - } - return true; -} - -bool GossipSelect_npc_taretha(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - ScriptedInstance* pInstance = (pCreature->GetInstanceData()); - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_EPOCH2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_EPOCH2, pCreature->GetGUID()); - } - if (uiAction == GOSSIP_ACTION_INFO_DEF+2) - { - pPlayer->CLOSE_GOSSIP_MENU(); - - if (pInstance->GetData(TYPE_THRALL_EVENT) == IN_PROGRESS) - { - if (pInstance) - pInstance->SetData(TYPE_THRALL_PART4,IN_PROGRESS); - if (pInstance->GetData64(DATA_EPOCH) == 0) - pCreature->SummonCreature(ENTRY_EPOCH,2639.13,698.55,65.43,4.59,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000); - - if (uint64 ThrallGUID = pInstance->GetData64(DATA_THRALL)) - { - Creature* Thrall = (Unit::GetCreature((*pCreature), ThrallGUID)); - if (Thrall) - CAST_AI(npc_thrall_old_hillsbradAI, Thrall->AI())->StartWP(); - } - } - } - return true; -} - -/*###### -## AddSC -######*/ - -void AddSC_old_hillsbrad() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_erozion"; - newscript->pGossipHello = &GossipHello_npc_erozion; - newscript->pGossipSelect = &GossipSelect_npc_erozion; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_thrall_old_hillsbrad"; - newscript->pGossipHello = &GossipHello_npc_thrall_old_hillsbrad; - newscript->pGossipSelect = &GossipSelect_npc_thrall_old_hillsbrad; - newscript->GetAI = &GetAI_npc_thrall_old_hillsbrad; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_taretha"; - newscript->pGossipHello = &GossipHello_npc_taretha; - newscript->pGossipSelect = &GossipSelect_npc_taretha; - newscript->GetAI = &GetAI_npc_taretha; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.cpp deleted file mode 100644 index f2ac8ff08e1..00000000000 --- a/src/bindings/scripts/scripts/zone/maraudon/boss_celebras_the_cursed.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_Celebras_the_Cursed -SD%Complete: 100 -SDComment: -SDCategory: Maraudon -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_WRATH 21807 -#define SPELL_ENTANGLINGROOTS 12747 -#define SPELL_CORRUPT_FORCES 21968 - -struct TRINITY_DLL_DECL celebras_the_cursedAI : public ScriptedAI -{ - celebras_the_cursedAI(Creature *c) : ScriptedAI(c) {} - - uint32 Wrath_Timer; - uint32 EntanglingRoots_Timer; - uint32 CorruptForces_Timer; - - void Reset() - { - Wrath_Timer = 8000; - EntanglingRoots_Timer = 2000; - CorruptForces_Timer = 30000; - } - - void EnterCombat(Unit *who) { } - - void JustDied(Unit* Killer) - { - m_creature->SummonCreature(13716, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 600000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Wrath - if (Wrath_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - DoCast(target,SPELL_WRATH); - Wrath_Timer = 8000; - }else Wrath_Timer -= diff; - - //EntanglingRoots - if (EntanglingRoots_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ENTANGLINGROOTS); - EntanglingRoots_Timer = 20000; - }else EntanglingRoots_Timer -= diff; - - //CorruptForces - if (CorruptForces_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_CORRUPT_FORCES); - CorruptForces_Timer = 20000; - }else CorruptForces_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_celebras_the_cursed(Creature* pCreature) -{ - return new celebras_the_cursedAI (pCreature); -} - -void AddSC_boss_celebras_the_cursed() -{ - Script *newscript; - newscript = new Script; - newscript->Name="celebras_the_cursed"; - newscript->GetAI = &GetAI_celebras_the_cursed; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.cpp deleted file mode 100644 index 353b9c1e3c0..00000000000 --- a/src/bindings/scripts/scripts/zone/maraudon/boss_landslide.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_Landslide -SD%Complete: 100 -SDComment: -SDCategory: Maraudon -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_KNOCKAWAY 18670 -#define SPELL_TRAMPLE 5568 -#define SPELL_LANDSLIDE 21808 - -struct TRINITY_DLL_DECL boss_landslideAI : public ScriptedAI -{ - boss_landslideAI(Creature *c) : ScriptedAI(c) {} - - uint32 KnockAway_Timer; - uint32 Trample_Timer; - uint32 Landslide_Timer; - - void Reset() - { - KnockAway_Timer = 8000; - Trample_Timer = 2000; - Landslide_Timer = 0; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //KnockAway_Timer - if (KnockAway_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KNOCKAWAY); - KnockAway_Timer = 15000; - }else KnockAway_Timer -= diff; - - //Trample_Timer - if (Trample_Timer < diff) - { - DoCast(m_creature,SPELL_TRAMPLE); - Trample_Timer = 8000; - }else Trample_Timer -= diff; - - //Landslide - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) - { - if (Landslide_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_LANDSLIDE); - Landslide_Timer = 60000; - } else Landslide_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_landslide(Creature* pCreature) -{ - return new boss_landslideAI (pCreature); -} - -void AddSC_boss_landslide() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_landslide"; - newscript->GetAI = &GetAI_boss_landslide; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp deleted file mode 100644 index 62190d4192a..00000000000 --- a/src/bindings/scripts/scripts/zone/maraudon/boss_noxxion.cpp +++ /dev/null @@ -1,150 +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_Noxxion -SD%Complete: 100 -SDComment: -SDCategory: Maraudon -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_TOXICVOLLEY 21687 -#define SPELL_UPPERCUT 22916 - -struct TRINITY_DLL_DECL boss_noxxionAI : public ScriptedAI -{ - boss_noxxionAI(Creature *c) : ScriptedAI(c) {} - - uint32 ToxicVolley_Timer; - uint32 Uppercut_Timer; - uint32 Adds_Timer; - uint32 Invisible_Timer; - bool Invisible; - int Rand; - int RandX; - int RandY; - Creature* Summoned; - - void Reset() - { - ToxicVolley_Timer = 7000; - Uppercut_Timer = 16000; - Adds_Timer = 19000; - Invisible_Timer = 15000; //Too much too low? - Invisible = false; - } - - void EnterCombat(Unit *who) - { - } - - void SummonAdds(Unit* victim) - { - Rand = rand()%8; - switch (rand()%2) - { - case 0: RandX = 0 - Rand; break; - case 1: RandX = 0 + Rand; break; - } - Rand = 0; - Rand = rand()%8; - switch (rand()%2) - { - case 0: RandY = 0 - Rand; break; - case 1: RandY = 0 + Rand; break; - } - Rand = 0; - Summoned = DoSpawnCreature(13456, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 90000); - if (Summoned) - (Summoned->AI())->AttackStart(victim); - } - - void UpdateAI(const uint32 diff) - { - if (Invisible && Invisible_Timer < diff) - { - //Become visible again - m_creature->setFaction(14); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //Noxxion model - m_creature->SetDisplayId(11172); - Invisible = false; - //m_creature->m_canMove = true; - } else if (Invisible) - { - Invisible_Timer -= diff; - //Do nothing while invisible - return; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //ToxicVolley_Timer - if (ToxicVolley_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_TOXICVOLLEY); - ToxicVolley_Timer = 9000; - }else ToxicVolley_Timer -= diff; - - //Uppercut_Timer - if (Uppercut_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_UPPERCUT); - Uppercut_Timer = 12000; - }else Uppercut_Timer -= diff; - - //Adds_Timer - if (!Invisible && Adds_Timer < diff) - { - //Inturrupt any spell casting - //m_creature->m_canMove = true; - m_creature->InterruptNonMeleeSpells(false); - m_creature->setFaction(35); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // Invisible Model - m_creature->SetDisplayId(11686); - SummonAdds(m_creature->getVictim()); - SummonAdds(m_creature->getVictim()); - SummonAdds(m_creature->getVictim()); - SummonAdds(m_creature->getVictim()); - SummonAdds(m_creature->getVictim()); - Invisible = true; - Invisible_Timer = 15000; - - Adds_Timer = 40000; - }else Adds_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_noxxion(Creature* pCreature) -{ - return new boss_noxxionAI (pCreature); -} - -void AddSC_boss_noxxion() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_noxxion"; - newscript->GetAI = &GetAI_boss_noxxion; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp b/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp deleted file mode 100644 index 7199c18cf75..00000000000 --- a/src/bindings/scripts/scripts/zone/maraudon/boss_princess_theradras.cpp +++ /dev/null @@ -1,109 +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_Princess_Theradras -SD%Complete: 100 -SDComment: -SDCategory: Maraudon -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_DUSTFIELD 21909 -#define SPELL_BOULDER 21832 -#define SPELL_THRASH 3391 -#define SPELL_REPULSIVEGAZE 21869 - -struct TRINITY_DLL_DECL boss_ptheradrasAI : public ScriptedAI -{ - boss_ptheradrasAI(Creature *c) : ScriptedAI(c) {} - - uint32 Dustfield_Timer; - uint32 Boulder_Timer; - uint32 Thrash_Timer; - uint32 RepulsiveGaze_Timer; - - void Reset() - { - Dustfield_Timer = 8000; - Boulder_Timer = 2000; - Thrash_Timer = 5000; - RepulsiveGaze_Timer = 23000; - } - - void EnterCombat(Unit *who) - { - } - - void JustDied(Unit* Killer) - { - m_creature->SummonCreature(12238,28.067,61.875,-123.405,4.67,TEMPSUMMON_TIMED_DESPAWN,600000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Dustfield_Timer - if (Dustfield_Timer < diff) - { - DoCast(m_creature,SPELL_DUSTFIELD); - Dustfield_Timer = 14000; - }else Dustfield_Timer -= diff; - - //Boulder_Timer - if (Boulder_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - DoCast(target,SPELL_BOULDER); - Boulder_Timer = 10000; - }else Boulder_Timer -= diff; - - //RepulsiveGaze_Timer - if (RepulsiveGaze_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_REPULSIVEGAZE); - RepulsiveGaze_Timer = 20000; - }else RepulsiveGaze_Timer -= diff; - - //Thrash_Timer - if (Thrash_Timer < diff) - { - DoCast(m_creature,SPELL_THRASH); - Thrash_Timer = 18000; - }else Thrash_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_ptheradras(Creature* pCreature) -{ - return new boss_ptheradrasAI (pCreature); -} - -void AddSC_boss_ptheradras() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_princess_theradras"; - newscript->GetAI = &GetAI_boss_ptheradras; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp b/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp deleted file mode 100644 index 35608557dad..00000000000 --- a/src/bindings/scripts/scripts/zone/onyxias_lair/boss_onyxia.cpp +++ /dev/null @@ -1,307 +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_Onyxia -SD%Complete: 90 -SDComment: Spell Heated Ground is wrong, flying animation, visual for area effect -SDCategory: Onyxia's Lair -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1249000 -#define SAY_KILL -1249001 -#define SAY_PHASE_2_TRANS -1249002 -#define SAY_PHASE_3_TRANS -1249003 -#define EMOTE_BREATH -1249004 - -#define SPELL_WINGBUFFET 18500 -#define SPELL_FLAMEBREATH 18435 -#define SPELL_CLEAVE 19983 -#define SPELL_TAILSWEEP 15847 -#define SPELL_KNOCK_AWAY 19633 - -#define SPELL_ENGULFINGFLAMES 20019 -#define SPELL_DEEPBREATH 23461 -#define SPELL_FIREBALL 18392 - -#define SPELL_BELLOWINGROAR 18431 -#define SPELL_HEATED_GROUND 22191 //Wrong Spell - -#define SPELL_SUMMONWHELP 17646 - -#define CREATURE_WHELP 11262 - -static float MovementLocations[4][3]= -{ - {-64.0523, -213.0619, -68.2985}, - {12.4636, -220.01490, -68.0548}, - {-38.8391, -182.3220, -68.9457}, - {-37.0390, -244.8760, -68.1278} -}; - -static float SpawnLocations[4][3]= -{ - {-30.127, -254.463, -89.440}, - {-30.817, -177.106, -89.258}, - {14.480, -241.560, -85.6300}, - {17.372, -190.840, -85.2810}, -}; - -struct TRINITY_DLL_DECL boss_onyxiaAI : public ScriptedAI -{ - boss_onyxiaAI(Creature* c) : ScriptedAI(c) {} - - uint32 Phase; - - uint32 FlameBreathTimer; - uint32 CleaveTimer; - uint32 TailSweepTimer; - uint32 MovementTimer; - uint32 EngulfingFlamesTimer; - uint32 SummonWhelpsTimer; - uint32 BellowingRoarTimer; - uint32 WingBuffetTimer; - uint32 KnockAwayTimer; - uint32 FireballTimer; - - bool InitialSpawn; - - void Reset() - { - Phase = 1; - - FlameBreathTimer = 20000; - TailSweepTimer = 2000; - CleaveTimer = 15000; - MovementTimer = 3000; - EngulfingFlamesTimer = 15000; - SummonWhelpsTimer = 45000; - BellowingRoarTimer = 30000; - WingBuffetTimer = 17000; - KnockAwayTimer = 15000; - FireballTimer = 18000; - - InitialSpawn = true; - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - } - - void JustDied(Unit* Killer) - { - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_KILL, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 60) && (Phase == 1)) - { - Phase = 2; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->SetHover(true); - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveIdle(); - DoScriptText(SAY_PHASE_2_TRANS, m_creature); - } - - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 40) && (Phase == 2)) - { - Phase = 3; - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->SetHover(false); - m_creature->GetMotionMaster()->MovePoint(0, -10.6155, -219.357, -87.7344); - DoStartMovement(m_creature->getVictim()); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - DoScriptText(SAY_PHASE_3_TRANS, m_creature); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - - if (Phase == 1 || Phase == 3) - { - if (FlameBreathTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH); - FlameBreathTimer = 15000; - }else FlameBreathTimer -= diff; - - if (TailSweepTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (target && !m_creature->HasInArc(M_PI, target)) - DoCast(target, SPELL_TAILSWEEP); - - TailSweepTimer = 10000; - }else TailSweepTimer -= diff; - - if (CleaveTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_CLEAVE); - CleaveTimer = 10000; - }else CleaveTimer -= diff; - - if (WingBuffetTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_WINGBUFFET); - WingBuffetTimer = 7000 + ((rand()%8)*1000); - }else WingBuffetTimer -= diff; - - if (KnockAwayTimer < diff) - { - if (rand() <= 30) - { - DoCast(m_creature->getVictim(), SPELL_KNOCK_AWAY); - } - KnockAwayTimer = 15000; - }else KnockAwayTimer -= diff; - - if (Phase == 3) - { - if (BellowingRoarTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR); - - BellowingRoarTimer = 30000; - }else BellowingRoarTimer -= diff; - - if (SummonWhelpsTimer < diff) - { - SummonWhelps(Phase); - - SummonWhelpsTimer = 45000; - }else SummonWhelpsTimer -= diff; - } - - DoMeleeAttackIfReady(); - } - - if (Phase == 2) - { - if (InitialSpawn) - { - InitialSpawn = false; - - for(uint32 i = 0; i < 10; ++i) - { - uint32 random = rand()%4; - Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Whelp) - Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - - if (EngulfingFlamesTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_ENGULFINGFLAMES); - m_creature->HandleEmoteCommand(ANIM_FLY); - - EngulfingFlamesTimer = 10000; - } - else EngulfingFlamesTimer -= diff; - - if (FireballTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); - - FireballTimer = 18000; - } - else FireballTimer -= diff; - - if (MovementTimer < diff) - { - if (rand()%100 < 30) - { - DoScriptText(EMOTE_BREATH, m_creature); - DoCast(m_creature->getVictim(), SPELL_DEEPBREATH); - } - else ChangePosition(); - - MovementTimer = 25000; - }else MovementTimer -= diff; - - if (SummonWhelpsTimer < diff) - { - SummonWhelps(Phase); - - SummonWhelpsTimer = 45000; - } - else SummonWhelpsTimer -= diff; - } - } - - void ChangePosition() - { - uint32 random = rand() % 4; - if (random<4){ - m_creature->GetMotionMaster()->MovePoint(0, MovementLocations[random][0], MovementLocations[random][1], MovementLocations[random][2]);} - } - - void SummonWhelps(uint32 Phase) - { - if (Phase == 2) - { - uint32 max = rand()%10; - for(uint32 i = 0; i < max; ++i) - { - uint32 random = rand()%3; - Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Whelp) - Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - - if (Phase == 3) - { - uint32 max = rand() % 10 +1; - if (max < 5) - { - for(uint32 i = 0; i < max; ++i) - { - uint32 random = rand()%4; - Creature* Whelp = m_creature->SummonCreature(CREATURE_WHELP, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Whelp) - Whelp->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - } - } -}; - -CreatureAI* GetAI_boss_onyxiaAI(Creature* pCreature) -{ - return new boss_onyxiaAI (pCreature); -} - -void AddSC_boss_onyxia() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_onyxia"; - newscript->GetAI = &GetAI_boss_onyxiaAI; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp b/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp deleted file mode 100644 index 2ecccaf2980..00000000000 --- a/src/bindings/scripts/scripts/zone/razorfen_downs/boss_amnennar_the_coldbringer.cpp +++ /dev/null @@ -1,130 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Amnennar_the_coldbringer -SD%Complete: 100 -SDComment: -SDCategory: Razorfen Downs -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1129000 -#define SAY_SUMMON60 -1129001 -#define SAY_SUMMON30 -1129002 -#define SAY_HP -1129003 -#define SAY_KILL -1129004 - -#define SPELL_AMNENNARSWRATH 13009 -#define SPELL_FROSTBOLT 15530 -#define SPELL_FROST_NOVA 15531 -#define SPELL_FROST_SPECTRES 12642 - -struct TRINITY_DLL_DECL boss_amnennar_the_coldbringerAI : public ScriptedAI -{ - boss_amnennar_the_coldbringerAI(Creature *c) : ScriptedAI(c) {} - - uint32 AmnenarsWrath_Timer; - uint32 FrostBolt_Timer; - uint32 FrostNova_Timer; - bool Spectrals60; - bool Spectrals30; - bool Hp; - - void Reset() - { - AmnenarsWrath_Timer = 8000; - FrostBolt_Timer = 1000; - FrostNova_Timer = 10000 + rand()%5000; - Spectrals30 = false; - Spectrals60 = false; - Hp = false; - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void KilledUnit() - { - DoScriptText(SAY_KILL, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //AmnenarsWrath_Timer - if (AmnenarsWrath_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_AMNENNARSWRATH); - AmnenarsWrath_Timer = 12000; - } else AmnenarsWrath_Timer -= diff; - - //FrostBolt_Timer - if (FrostBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); - FrostBolt_Timer = 8000; - } else FrostBolt_Timer -= diff; - - if (FrostNova_Timer < diff) - { - DoCast(m_creature,SPELL_FROST_NOVA); - FrostNova_Timer = 15000; - } else FrostNova_Timer -= diff; - - if (!Spectrals60 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 60) - { - DoScriptText(SAY_SUMMON60, m_creature); - DoCast(m_creature->getVictim(),SPELL_FROST_SPECTRES); - Spectrals60 = true; - } - - if (!Hp && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) - { - DoScriptText(SAY_HP, m_creature); - Hp = true; - } - - if (!Spectrals30 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 30) - { - DoScriptText(SAY_SUMMON30, m_creature); - DoCast(m_creature->getVictim(),SPELL_FROST_SPECTRES); - Spectrals30 = true; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_amnennar_the_coldbringer(Creature* pCreature) -{ - return new boss_amnennar_the_coldbringerAI (pCreature); -} - -void AddSC_boss_amnennar_the_coldbringer() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_amnennar_the_coldbringer"; - newscript->GetAI = &GetAI_boss_amnennar_the_coldbringer; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.cpp b/src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.cpp deleted file mode 100644 index 7515c5a9195..00000000000 --- a/src/bindings/scripts/scripts/zone/razorfen_downs/razorfen_downs.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: Razorfen_Downs -SD%Complete: 100 -SDComment: Support for Henry Stern(2 recipes) -SDCategory: Razorfen Downs -EndScriptData */ - -/* ContentData -npc_henry_stern -EndContentData */ - -#include "precompiled.h" - -/*### -# npc_henry_stern -####*/ - -enum -{ - SPELL_GOLDTHORN_TEA = 13028, - SPELL_TEACHING_GOLDTHORN_TEA = 13029, - SPELL_MIGHT_TROLLS_BLOOD_POTION = 3451, - SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION = 13030, - GOSSIP_TEXT_TEA_ANSWER = 2114, - GOSSIP_TEXT_POTION_ANSWER = 2115, -}; - -#define GOSSIP_ITEM_TEA "Teach me the cooking recipe" -#define GOSSIP_ITEM_POTION "Teach me the alchemy recipe" - -bool GossipHello_npc_henry_stern (Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->GetBaseSkillValue(SKILL_COOKING) >= 175 && !pPlayer->HasSpell(SPELL_GOLDTHORN_TEA)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - if (pPlayer->GetBaseSkillValue(SKILL_ALCHEMY) >= 180 && !pPlayer->HasSpell(SPELL_MIGHT_TROLLS_BLOOD_POTION)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_POTION, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_henry_stern (Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - { - pCreature->CastSpell(pPlayer, SPELL_TEACHING_GOLDTHORN_TEA, true); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_TEA_ANSWER, pCreature->GetGUID()); - } - - if (uiAction == GOSSIP_ACTION_INFO_DEF + 2) - { - pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXT_POTION_ANSWER, pCreature->GetGUID()); - pCreature->CastSpell(pPlayer, SPELL_TEACHING_MIGHTY_TROLLS_BLOOD_POTION, true); - } - - return true; -} - -void AddSC_razorfen_downs() -{ - Script* newscript; - - newscript = new Script; - newscript->Name = "npc_henry_stern"; - newscript->pGossipHello = &GossipHello_npc_henry_stern; - newscript->pGossipSelect = &GossipSelect_npc_henry_stern; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/def_razorfen_kraul.h b/src/bindings/scripts/scripts/zone/razorfen_kraul/def_razorfen_kraul.h deleted file mode 100644 index 96917fcd4bf..00000000000 --- a/src/bindings/scripts/scripts/zone/razorfen_kraul/def_razorfen_kraul.h +++ /dev/null @@ -1,21 +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 - */ - -#ifndef DEF_RAZORFEN_KRAUL_H -#define DEF_RAZORFEN_KRAUL_H - -#define TYPE_WARD_KEEPERS 1 -#endif \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/instance_razorfen_kraul.cpp b/src/bindings/scripts/scripts/zone/razorfen_kraul/instance_razorfen_kraul.cpp deleted file mode 100644 index 94b0943cf3d..00000000000 --- a/src/bindings/scripts/scripts/zone/razorfen_kraul/instance_razorfen_kraul.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: Instance_Razorfen_Kraul -SD%Complete: -SDComment: -SDCategory: Razorfen Kraul -EndScriptData */ - -#include "precompiled.h" -#include "def_razorfen_kraul.h" - - -#define WARD_KEEPERS_NR 2 - -struct TRINITY_DLL_DECL instance_razorfen_kraul : public ScriptedInstance -{ - instance_razorfen_kraul(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 DoorWardGUID; - uint32 WardCheck_Timer; - int WardKeeperAlive; - - void Initialize() - { - WardKeeperAlive = 1; - WardCheck_Timer = 4000; - DoorWardGUID = 0; - } - - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - debug_log("TSCR: Instance Razorfen Kraul: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void OnGameObjectCreate(GameObject* pGo, bool apply) - { - switch(pGo->GetEntry()) - { - case 21099: DoorWardGUID = pGo->GetGUID(); break; - } - } - - void Update(uint32 diff) - { - if (WardCheck_Timer < diff) - { - HandleGameObject(DoorWardGUID, WardKeeperAlive); - WardKeeperAlive = 0; - WardCheck_Timer = 4000; - }else - WardCheck_Timer -= diff; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_WARD_KEEPERS: - if (data == NOT_STARTED) - WardKeeperAlive = 1; - break; - } - } - -}; - -InstanceData* GetInstanceData_instance_razorfen_kraul(Map* pMap) -{ - return new instance_razorfen_kraul(pMap); -} - -void AddSC_instance_razorfen_kraul() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_razorfen_kraul"; - newscript->GetInstanceData = &GetInstanceData_instance_razorfen_kraul; - newscript->RegisterSelf(); -} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp deleted file mode 100644 index a6bd845b13e..00000000000 --- a/src/bindings/scripts/scripts/zone/razorfen_kraul/razorfen_kraul.cpp +++ /dev/null @@ -1,252 +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: Razorfen Kraul -SD%Complete: 100 -SDComment: Quest support: 1144 -SDCategory: Razorfen Kraul -EndScriptData */ - -/* ContentData -npc_willix -EndContentData */ - -#include "precompiled.h" -#include "escortAI.h" -#include "def_razorfen_kraul.h" - -#define SAY_READY -1047000 -#define SAY_POINT -10470001 -#define SAY_AGGRO1 -1047002 -#define SAY_BLUELEAF -1047003 -#define SAY_DANGER -1047004 -#define SAY_BAD -1047005 -#define SAY_THINK -1047006 -#define SAY_SOON -1047007 -#define SAY_FINALY -1047008 -#define SAY_WIN -1047009 -#define SAY_END -1047010 - -#define QUEST_WILLIX_THE_IMPORTER 1144 -#define ENTRY_BOAR 4514 -#define SPELL_QUILLBOAR_CHANNELING 7083 - -struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI -{ - npc_willixAI(Creature *c) : npc_escortAI(c) {} - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch (i) - { - case 3: - m_creature->HandleEmoteCommand(EMOTE_STATE_POINT); - DoScriptText(SAY_POINT, m_creature, pPlayer); - break; - case 4: - m_creature->SummonCreature(ENTRY_BOAR, 2137.66, 1843.98, 48.08, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 8: - DoScriptText(SAY_BLUELEAF, m_creature, pPlayer); - break; - case 9: - DoScriptText(SAY_DANGER, m_creature, pPlayer); - break; - case 13: - DoScriptText(SAY_BAD, m_creature, pPlayer); - break; - case 14: - m_creature->SummonCreature(ENTRY_BOAR, 2078.91, 1704.54, 56.77, 1.54, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 25: - DoScriptText(SAY_THINK, m_creature, pPlayer); - break; - case 31: - DoScriptText(SAY_SOON, m_creature, pPlayer); - break; - case 42: - DoScriptText(SAY_FINALY, m_creature, pPlayer); - break; - case 43: - m_creature->SummonCreature(ENTRY_BOAR, 1956.43, 1596.97, 81.75, 1.54,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - break; - case 45: - DoScriptText(SAY_WIN, m_creature, pPlayer); - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER,m_creature); - break; - case 46: - DoScriptText(SAY_END, m_creature, pPlayer); - break; - } - } - - void Reset() {} - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO1, m_creature, NULL); - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void JustDied(Unit* killer) - { - if (PlayerGUID) - { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - CAST_PLR(pPlayer)->FailQuest(QUEST_WILLIX_THE_IMPORTER); - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } -}; - -bool QuestAccept_npc_willix(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_WILLIX_THE_IMPORTER) - { - CAST_AI(npc_escortAI, (pCreature->AI()))->Start(true, false, pPlayer->GetGUID()); - DoScriptText(SAY_READY, pCreature, pPlayer); - pCreature->setFaction(113); - } - - return true; -} - -struct TRINITY_DLL_DECL npc_deaths_head_ward_keeperAI : public ScriptedAI -{ - npc_deaths_head_ward_keeperAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Reset(); - } - - ScriptedInstance *pInstance; - uint32 QuillboarChanneling_Timer; - - void Reset() - { - QuillboarChanneling_Timer = 1500; - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->isAlive()) - return; - - if (pInstance) - pInstance->SetData(TYPE_WARD_KEEPERS, NOT_STARTED); - - if (QuillboarChanneling_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - DoCast(m_creature, SPELL_QUILLBOAR_CHANNELING); - QuillboarChanneling_Timer = 1100; - }else QuillboarChanneling_Timer -= diff; - - } -}; - -CreatureAI* GetAI_npc_deaths_head_ward_keeper(Creature* pCreature) -{ - return new npc_deaths_head_ward_keeperAI(pCreature); -} - -CreatureAI* GetAI_npc_willix(Creature* pCreature) -{ - npc_willixAI* thisAI = new npc_willixAI(pCreature); - - thisAI->AddWaypoint(0, 2194.38, 1791.65, 65.48, 5000); - thisAI->AddWaypoint(1, 2188.56, 1805.87, 64.45); - thisAI->AddWaypoint(2, 2187, 1843.49, 59.33); - thisAI->AddWaypoint(3, 2163.27, 1851.67, 56.73, 5000); - thisAI->AddWaypoint(4, 2137.66, 1843.98, 48.08, 5000); - thisAI->AddWaypoint(5, 2140.22, 1845.02, 48.32); - thisAI->AddWaypoint(6, 2131.5, 1804.29, 46.85); - thisAI->AddWaypoint(7, 2096.18, 1789.03, 51.13); - thisAI->AddWaypoint(8, 2074.46, 1780.09, 55.64, 3000); - thisAI->AddWaypoint(9, 2055.12, 1768.67, 58.46, 5000); - thisAI->AddWaypoint(10, 2037.83, 1748.62, 60.27); - thisAI->AddWaypoint(11, 2037.51, 1728.94, 60.85); - thisAI->AddWaypoint(12, 2044.7, 1711.71, 59.71); - thisAI->AddWaypoint(13, 2067.66, 1701.84, 57.77, 3000); - thisAI->AddWaypoint(14, 2078.91, 1704.54, 56.77, 3000); - thisAI->AddWaypoint(15, 2097.65, 1715.24, 54.74); - thisAI->AddWaypoint(16, 2106.44, 1720.98, 54.41); - thisAI->AddWaypoint(17, 2123.96, 1732.56, 52.27); - thisAI->AddWaypoint(18, 2153.82, 1728.73, 51.92); - thisAI->AddWaypoint(19, 2163.49, 1706.33, 54.42); - thisAI->AddWaypoint(20, 2158.75, 1695.98, 55.70); - thisAI->AddWaypoint(21, 2142.6, 1680.72, 58.24); - thisAI->AddWaypoint(22, 2118.31, 1671.54, 59.21); - thisAI->AddWaypoint(23, 2086.02, 1672.04, 61.24); - thisAI->AddWaypoint(24, 2068.81, 1658.93, 61.24); - thisAI->AddWaypoint(25, 2062.82, 1633.31, 64.35, 3000); - thisAI->AddWaypoint(26, 2063.05, 1589.16, 63.26); - thisAI->AddWaypoint(27, 2063.67, 1577.22, 65.89); - thisAI->AddWaypoint(28, 2057.94, 1560.68, 68.40); - thisAI->AddWaypoint(29, 2052.56, 1548.05, 73.35); - thisAI->AddWaypoint(30, 2045.22, 1543.4, 76.65); - thisAI->AddWaypoint(31, 2034.35, 1543.01, 79.70); - thisAI->AddWaypoint(32, 2029.95, 1542.94, 80.79); - thisAI->AddWaypoint(33, 2021.34, 1538.67, 80.8); - thisAI->AddWaypoint(34, 2012.45, 1549.48, 79.93); - thisAI->AddWaypoint(35, 2008.05, 1554.92, 80.44); - thisAI->AddWaypoint(36, 2006.54, 1562.72, 81.11); - thisAI->AddWaypoint(37, 2003.8, 1576.43, 81.57); - thisAI->AddWaypoint(38, 2000.57, 1590.06, 80.62); - thisAI->AddWaypoint(39, 1998.96, 1596.87, 80.22); - thisAI->AddWaypoint(40, 1991.19, 1600.82, 79.39); - thisAI->AddWaypoint(41, 1980.71, 1601.44, 79.77, 3000); - thisAI->AddWaypoint(42, 1967.22, 1600.18, 80.62, 3000); - thisAI->AddWaypoint(43, 1956.43, 1596.97, 81.75, 3000); - thisAI->AddWaypoint(44, 1954.87, 1592.02, 82.18); - thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000); - thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000); - - return thisAI; -} - -void AddSC_razorfen_kraul() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_willix"; - newscript->GetAI = &GetAI_npc_willix; - newscript->pQuestAccept = &QuestAccept_npc_willix; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_deaths_head_ward_keeper"; - newscript->GetAI = &GetAI_npc_deaths_head_ward_keeper; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.cpp deleted file mode 100644 index eefedb2c0d5..00000000000 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ayamiss.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_Ayamiss -SD%Complete: 50 -SDComment: VERIFY SCRIPT -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -/* -To do: -make him fly from 70-100% -*/ - -#define SPELL_STINGERSPRAY 25749 -#define SPELL_POISONSTINGER 25748 //only used in phase1 -#define SPELL_SUMMONSWARMER 25844 //might be 25708 -// #define SPELL_PARALYZE 23414 doesnt work correct (core) - -struct TRINITY_DLL_DECL boss_ayamissAI : public ScriptedAI -{ - boss_ayamissAI(Creature *c) : ScriptedAI(c) {} - - Unit *pTarget; - uint32 STINGERSPRAY_Timer; - uint32 POISONSTINGER_Timer; - uint32 SUMMONSWARMER_Timer; - uint32 phase; - - void Reset() - { - pTarget = NULL; - STINGERSPRAY_Timer = 30000; - POISONSTINGER_Timer = 30000; - SUMMONSWARMER_Timer = 60000; - phase=1; - } - - void EnterCombat(Unit *who) - { - pTarget = who; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //If he is 70% start phase 2 - if (phase==1 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 70 && !m_creature->IsNonMeleeSpellCasted(false)) - { - phase=2; - } - - //STINGERSPRAY_Timer (only in phase2) - if (phase==2 && STINGERSPRAY_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_STINGERSPRAY); - STINGERSPRAY_Timer = 30000; - }else STINGERSPRAY_Timer -= diff; - - //POISONSTINGER_Timer (only in phase1) - if (phase==1 && POISONSTINGER_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_POISONSTINGER); - POISONSTINGER_Timer = 30000; - }else POISONSTINGER_Timer -= diff; - - //SUMMONSWARMER_Timer (only in phase1) - if (SUMMONSWARMER_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SUMMONSWARMER); - SUMMONSWARMER_Timer = 60000; - }else SUMMONSWARMER_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_ayamiss(Creature* pCreature) -{ - return new boss_ayamissAI (pCreature); -} - -void AddSC_boss_ayamiss() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_ayamiss"; - newscript->GetAI = &GetAI_boss_ayamiss; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp deleted file mode 100644 index 58c48540362..00000000000 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_buru.cpp +++ /dev/null @@ -1,27 +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_Buru -SD%Complete: 0 -SDComment: Place Holder -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - - #define EMOTE_TARGET -1509002 - diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp deleted file mode 100644 index e781c749d0d..00000000000 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_kurinnaxx.cpp +++ /dev/null @@ -1,94 +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_Kurinnaxx -SD%Complete: 100 -SDComment: VERIFY SCRIPT AND SQL -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_MORTALWOUND 25646 -#define SPELL_SANDTRAP 25656 -#define SPELL_ENRAGE 28798 - -struct TRINITY_DLL_DECL boss_kurinnaxxAI : public ScriptedAI -{ - boss_kurinnaxxAI(Creature *c) : ScriptedAI(c) {} - - Unit *pTarget; - uint32 MORTALWOUND_Timer; - uint32 SANDTRAP_Timer; - uint32 i; - - void Reset() - { - i=0; - pTarget = NULL; - MORTALWOUND_Timer = 30000; - SANDTRAP_Timer = 30000; - } - - void EnterCombat(Unit *who) - { - pTarget = who; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //If we are <30% cast enrage - if (i==0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 30 && !m_creature->IsNonMeleeSpellCasted(false)) - { - i=1; - DoCast(m_creature->getVictim(),SPELL_ENRAGE); - } - - //MORTALWOUND_Timer - if (MORTALWOUND_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MORTALWOUND); - MORTALWOUND_Timer = 30000; - }else MORTALWOUND_Timer -= diff; - - //SANDTRAP_Timer - if (SANDTRAP_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SANDTRAP); - SANDTRAP_Timer = 30000; - }else SANDTRAP_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_kurinnaxx(Creature* pCreature) -{ - return new boss_kurinnaxxAI (pCreature); -} - -void AddSC_boss_kurinnaxx() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_kurinnaxx"; - newscript->GetAI = &GetAI_boss_kurinnaxx; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.cpp deleted file mode 100644 index 4d62a923e16..00000000000 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_moam.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_Moam -SD%Complete: 100 -SDComment: VERIFY SCRIPT AND SQL -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define EMOTE_AGGRO -1509000 -#define EMOTE_MANA_FULL -1509001 - -#define SPELL_TRAMPLE 15550 -#define SPELL_DRAINMANA 27256 -#define SPELL_ARCANEERUPTION 25672 -#define SPELL_SUMMONMANA 25681 -#define SPELL_GRDRSLEEP 24360 //Greater Dreamless Sleep - -struct TRINITY_DLL_DECL boss_moamAI : public ScriptedAI -{ - boss_moamAI(Creature *c) : ScriptedAI(c) {} - - Unit *pTarget; - uint32 TRAMPLE_Timer; - uint32 DRAINMANA_Timer; - uint32 SUMMONMANA_Timer; - uint32 i; - uint32 j; - - void Reset() - { - i=0; - j=0; - pTarget = NULL; - TRAMPLE_Timer = 30000; - DRAINMANA_Timer = 30000; - } - - void EnterCombat(Unit *who) - { - DoScriptText(EMOTE_AGGRO, m_creature); - pTarget = who; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //If we are 100%MANA cast Arcane Erruption - //if (j==1 && m_creature->GetMana()*100 / m_creature->GetMaxMana() == 100 && !m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(m_creature->getVictim(),SPELL_ARCANEERUPTION); - DoScriptText(EMOTE_MANA_FULL, m_creature); - } - - //If we are <50%HP cast MANA FIEND (Summon Mana) and Sleep - //if (i==0 && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() <= 50 && !m_creature->IsNonMeleeSpellCasted(false)) - { - i=1; - DoCast(m_creature->getVictim(),SPELL_SUMMONMANA); - DoCast(m_creature->getVictim(),SPELL_GRDRSLEEP); - } - - //SUMMONMANA_Timer - if (i==1 && SUMMONMANA_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SUMMONMANA); - SUMMONMANA_Timer = 90000; - }else SUMMONMANA_Timer -= diff; - - //TRAMPLE_Timer - if (TRAMPLE_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_TRAMPLE); - j=1; - - TRAMPLE_Timer = 30000; - }else TRAMPLE_Timer -= diff; - - //DRAINMANA_Timer - if (DRAINMANA_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_DRAINMANA); - DRAINMANA_Timer = 30000; - }else DRAINMANA_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_moam(Creature* pCreature) -{ - return new boss_moamAI (pCreature); -} - -void AddSC_boss_moam() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_moam"; - newscript->GetAI = &GetAI_boss_moam; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp deleted file mode 100644 index 5652b706917..00000000000 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_ossirian.cpp +++ /dev/null @@ -1,38 +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_Ossirian -SD%Complete: 0 -SDComment: Place holder -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define SAY_SURPREME2 -1509019 -#define SAY_SURPREME3 -1509020 - -#define SAY_RAND_INTRO1 -1509021 -#define SAY_RAND_INTRO2 -1509022 -#define SAY_RAND_INTRO3 -1509023 -#define SAY_RAND_INTRO4 -1509024 //possibly old? - -#define SAY_AGGRO -1509025 - -#define SAY_SLAY -1509026 -#define SAY_DEATH -1509027 - diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp deleted file mode 100644 index fb2c92ff59f..00000000000 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/boss_rajaxx.cpp +++ /dev/null @@ -1,45 +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_Rajaxx -SD%Complete: 0 -SDComment: Place Holder -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define SAY_ANDOROV_INTRO -1509003 -#define SAY_ANDOROV_ATTACK -1509004 - -#define SAY_WAVE3 -1509005 -#define SAY_WAVE4 -1509006 -#define SAY_WAVE5 -1509007 -#define SAY_WAVE6 -1509008 -#define SAY_WAVE7 -1509009 -#define SAY_INTRO -1509010 - -#define SAY_UNK1 -1509011 -#define SAY_UNK2 -1509012 -#define SAY_UNK3 -1509013 -#define SAY_UNK4 -1509014 - -#define SAY_DEAGGRO -1509015 -#define SAY_KILLS_ANDOROV -1509016 - -#define SAY_COMPLETE_QUEST -1509017 //Yell when realm complete quest 8743 for world event - diff --git a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.cpp deleted file mode 100644 index b94e6f16a80..00000000000 --- a/src/bindings/scripts/scripts/zone/ruins_of_ahnqiraj/instance_ruins_of_ahnqiraj.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_Ruins_of_Ahnqiraj -SD%Complete: 0 -SDComment: Place holder -SDCategory: Ruins of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp deleted file mode 100644 index 042dd5d53f5..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_bug_trio.cpp +++ /dev/null @@ -1,346 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: boss_kri, boss_yauj, boss_vem : The Bug Trio -SD%Complete: 100 -SDComment: -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" -#include "def_temple_of_ahnqiraj.h" - -#define SPELL_CLEAVE 26350 -#define SPELL_TOXIC_VOLLEY 25812 -#define SPELL_POISON_CLOUD 38718 //Only Spell with right dmg. -#define SPELL_ENRAGE 34624 //Changed cause 25790 is casted on gamers too. Same prob with old explosion of twin emperors. - -#define SPELL_CHARGE 26561 -#define SPELL_KNOCKBACK 26027 - -#define SPELL_HEAL 25807 -#define SPELL_FEAR 19408 - -struct TRINITY_DLL_DECL boss_kriAI : public ScriptedAI -{ - boss_kriAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 Cleave_Timer; - uint32 ToxicVolley_Timer; - uint32 Check_Timer; - - bool VemDead; - bool Death; - - void Reset() - { - Cleave_Timer = 4000 + rand()%4000; - ToxicVolley_Timer = 6000 + rand()%6000; - Check_Timer = 2000; - - VemDead = false; - Death = false; - } - - void EnterCombat(Unit *who) - { - } - - void JustDied(Unit* killer) - { - if (pInstance) - { - if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) - // Unlootable if death - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - - pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); - } - } - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Cleave_Timer - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 5000 + rand()%7000; - }else Cleave_Timer -= diff; - - //ToxicVolley_Timer - if (ToxicVolley_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_TOXIC_VOLLEY); - ToxicVolley_Timer = 10000 + rand()%5000; - }else ToxicVolley_Timer -= diff; - - if (m_creature->GetHealth() <= m_creature->GetMaxHealth() * 0.05 && !Death) - { - DoCast(m_creature->getVictim(),SPELL_POISON_CLOUD); - Death = true; - } - - if (!VemDead) - { - //Checking if Vem is dead. If yes we will enrage. - if (Check_Timer < diff) - { - if (pInstance && pInstance->GetData(DATA_VEMISDEAD)) - { - DoCast(m_creature, SPELL_ENRAGE); - VemDead = true; - } - Check_Timer = 2000; - }else Check_Timer -=diff; - } - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_vemAI : public ScriptedAI -{ - boss_vemAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 Charge_Timer; - uint32 KnockBack_Timer; - uint32 Enrage_Timer; - - bool Enraged; - - void Reset() - { - Charge_Timer = 15000 + rand()%12000; - KnockBack_Timer = 8000 + rand()%12000; - Enrage_Timer = 120000; - - Enraged = false; - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - pInstance->SetData(DATA_VEM_DEATH, 0); - if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) - // Unlootable if death - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); - } - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Charge_Timer - if (Charge_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - { - DoCast(target, SPELL_CHARGE); - //m_creature->SendMonsterMove(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, true,1); - AttackStart(target); - } - - Charge_Timer = 8000 + rand()%8000; - }else Charge_Timer -= diff; - - //KnockBack_Timer - if (KnockBack_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KNOCKBACK); - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-80); - KnockBack_Timer = 15000 + rand()%10000; - }else KnockBack_Timer -= diff; - - //Enrage_Timer - if (!Enraged && Enrage_Timer < diff) - { - DoCast(m_creature,SPELL_ENRAGE); - Enraged = true; - }else Charge_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_yaujAI : public ScriptedAI -{ - boss_yaujAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 Heal_Timer; - uint32 Fear_Timer; - uint32 Check_Timer; - - bool VemDead; - - void Reset() - { - Heal_Timer = 25000 + rand()%15000; - Fear_Timer = 12000 + rand()%12000; - Check_Timer = 2000; - - VemDead = false; - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - if (pInstance->GetData(DATA_BUG_TRIO_DEATH) < 2) - // Unlootable if death - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - pInstance->SetData(DATA_BUG_TRIO_DEATH, 1); - } - - for(uint8 i = 0; i < 10; ++i) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - Creature* Summoned = m_creature->SummonCreature(15621,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,90000); - if (Summoned && target) - (Summoned->AI())->AttackStart(target); - } - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Fear_Timer - if (Fear_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FEAR); - DoResetThreat(); - Fear_Timer = 20000; - }else Fear_Timer -= diff; - - //Casting Heal to other twins or herself. - if (Heal_Timer < diff) - { - if (pInstance) - { - Unit *pKri = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KRI)); - Unit *pVem = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_VEM)); - - switch(rand()%3) - { - case 0: - if (pKri) - DoCast(pKri, SPELL_HEAL); - break; - case 1: - if (pVem) - DoCast(pVem, SPELL_HEAL); - break; - case 2: - DoCast(m_creature, SPELL_HEAL); - break; - } - } - - Heal_Timer = 15000+rand()%15000; - }else Heal_Timer -= diff; - - //Checking if Vem is dead. If yes we will enrage. - if (Check_Timer < diff) - { - if (!VemDead) - { - if (pInstance) - { - if (pInstance->GetData(DATA_VEMISDEAD)) - { - DoCast(m_creature, SPELL_ENRAGE); - VemDead = true; - } - } - } - Check_Timer = 2000; - }else Check_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_yauj(Creature* pCreature) -{ - return new boss_yaujAI (pCreature); -} - -CreatureAI* GetAI_boss_vem(Creature* pCreature) -{ - return new boss_vemAI (pCreature); -} - -CreatureAI* GetAI_boss_kri(Creature* pCreature) -{ - return new boss_kriAI (pCreature); -} - -void AddSC_bug_trio() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_kri"; - newscript->GetAI = &GetAI_boss_kri; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_vem"; - newscript->GetAI = &GetAI_boss_vem; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_yauj"; - newscript->GetAI = &GetAI_boss_yauj; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp deleted file mode 100644 index 905f46070f7..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_cthun.cpp +++ /dev/null @@ -1,1335 +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_Cthun -SD%Complete: 95 -SDComment: Darkglare tracking issue -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" -#include "def_temple_of_ahnqiraj.h" - -//Text emote -#define EMOTE_WEAKENED -1531011 - -#define PI 3.14 - -//****** Out of Combat ****** -//Random Wispers - No txt only sound -#define RANDOM_SOUND_WHISPER 8663 - -//***** Phase 1 ******** - -//Mobs -#define BOSS_EYE_OF_CTHUN 15589 -#define MOB_CLAW_TENTACLE 15725 -#define MOB_EYE_TENTACLE 15726 -#define MOB_SMALL_PORTAL 15904 - -//Eye Spells -#define SPELL_GREEN_BEAM 26134 -#define SPELL_DARK_GLARE 26029 -#define SPELL_RED_COLORATION 22518 //Probably not the right spell but looks similar - -//Eye Tentacles Spells -#define SPELL_MIND_FLAY 26143 - -//Claw Tentacles Spells -#define SPELL_GROUND_RUPTURE 26139 -#define SPELL_HAMSTRING 26141 - -#define MOB_ - -//*****Phase 2****** -//Body spells -//#define SPELL_CARAPACE_CTHUN 26156 //Was removed from client dbcs -#define SPELL_TRANSFORM 26232 - -//Eye Tentacles Spells -//SAME AS PHASE1 - -//Giant Claw Tentacles -#define SPELL_MASSIVE_GROUND_RUPTURE 26100 - -//Also casts Hamstring -#define SPELL_THRASH 3391 - -//Giant Eye Tentacles -//CHAIN CASTS "SPELL_GREEN_BEAM" - -//Stomach Spells -#define SPELL_MOUTH_TENTACLE 26332 -#define SPELL_EXIT_STOMACH_KNOCKBACK 25383 -#define SPELL_DIGESTIVE_ACID 26476 - -//Mobs -#define MOB_BODY_OF_CTHUN 15809 -#define MOB_GIANT_CLAW_TENTACLE 15728 -#define MOB_GIANT_EYE_TENTACLE 15334 -#define MOB_FLESH_TENTACLE 15802 -#define MOB_GIANT_PORTAL 15910 - -//Stomach Teleport positions -#define STOMACH_X -8562.0f -#define STOMACH_Y 2037.0f -#define STOMACH_Z -70.0f -#define STOMACH_O 5.05f - -//Flesh tentacle positions -#define TENTACLE_POS1_X -8571.0f -#define TENTACLE_POS1_Y 1990.0f -#define TENTACLE_POS1_Z -98.0f -#define TENTACLE_POS1_O 1.22f - -#define TENTACLE_POS2_X -8525.0f -#define TENTACLE_POS2_Y 1994.0f -#define TENTACLE_POS2_Z -98.0f -#define TENTACLE_POS2_O 2.12f - -//Kick out position -#define KICK_X -8545.0f -#define KICK_Y 1984.0f -#define KICK_Z -96.0f - -struct TRINITY_DLL_DECL flesh_tentacleAI : public ScriptedAI -{ - flesh_tentacleAI(Creature *c) : ScriptedAI(c), Parent(0) - { - SetCombatMovement(false); - } - - uint64 Parent; - uint32 CheckTimer; - - void SpawnedByCthun(uint64 p) - { - Parent = p; - } - - void Reset() - { - CheckTimer = 1000; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff); - - void JustDied(Unit* killer); -}; - -struct TRINITY_DLL_DECL eye_of_cthunAI : public Scripted_NoMovementAI -{ - eye_of_cthunAI(Creature *c) : Scripted_NoMovementAI(c) - { - pInst = c->GetInstanceData(); - if (!pInst) - error_log("TSCR: No Instance eye_of_cthunAI"); - } - - ScriptedInstance* pInst; - - //Global variables - uint32 PhaseTimer; - - //Eye beam phase - uint32 BeamTimer; - uint32 EyeTentacleTimer; - uint32 ClawTentacleTimer; - - //Dark Glare phase - uint32 DarkGlareTick; - uint32 DarkGlareTickTimer; - float DarkGlareAngle; - bool ClockWise; - - void Reset() - { - //Phase information - PhaseTimer = 50000; //First dark glare in 50 seconds - - //Eye beam phase 50 seconds - BeamTimer = 3000; - EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam - ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn durring Dark beam) - - //Dark Beam phase 35 seconds (each tick = 1 second, 35 ticks) - DarkGlareTick = 0; - DarkGlareTickTimer = 1000; - DarkGlareAngle = 0; - ClockWise = false; - - //Reset flags - m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - - //Reset Phase - if (pInst) - pInst->SetData(DATA_CTHUN_PHASE, 0); - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - } - - void SpawnEyeTentacle(float x, float y) - { - Creature* Spawned; - Spawned = me->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); - if (Spawned) - { - Unit* target; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (target) - Spawned->AI()->AttackStart(target); - } - } - - void UpdateAI(const uint32 diff) - { - //Check if we have a target - if (!UpdateVictim()) - return; - - //No instance - if (!pInst) - return; - - switch (pInst->GetData(DATA_CTHUN_PHASE)) - { - case 0: - { - //BeamTimer - if (BeamTimer < diff) - { - //SPELL_GREEN_BEAM - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(target,SPELL_GREEN_BEAM); - - //Correctly update our target - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID()); - } - - //Beam every 3 seconds - BeamTimer = 3000; - }else BeamTimer -= diff; - - //ClawTentacleTimer - if (ClawTentacleTimer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - { - Creature* Spawned = NULL; - - //Spawn claw tentacle on the random target - Spawned = me->SummonCreature(MOB_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); - - if (Spawned) - Spawned->AI()->AttackStart(target); - } - - //One claw tentacle every 12.5 seconds - ClawTentacleTimer = 12500; - }else ClawTentacleTimer -= diff; - - //EyeTentacleTimer - if (EyeTentacleTimer < diff) - { - //Spawn the 8 Eye Tentacles in the corret spots - SpawnEyeTentacle(0, 20); //south - SpawnEyeTentacle(10, 10); //south west - SpawnEyeTentacle(20, 0); //west - SpawnEyeTentacle(10, -10); //north west - - SpawnEyeTentacle(0, -20); //north - SpawnEyeTentacle(-10, -10); //north east - SpawnEyeTentacle(-20, 0); // east - SpawnEyeTentacle(-10, 10); // south east - - //No point actually putting a timer here since - //These shouldn't trigger agian until after phase shifts - EyeTentacleTimer = 45000; - }else EyeTentacleTimer -= diff; - - //PhaseTimer - if (PhaseTimer < diff) - { - //Switch to Dark Beam - pInst->SetData(DATA_CTHUN_PHASE, 1); - - m_creature->InterruptNonMeleeSpells(false); - - //Select random target for dark beam to start on - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (target) - { - //Correctly update our target - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, target->GetGUID()); - - //Face our target - DarkGlareAngle = m_creature->GetAngle(target); - DarkGlareTickTimer = 1000; - DarkGlareTick = 0; - ClockWise = rand()%2; - } - - //Add red coloration to C'thun - DoCast(m_creature,SPELL_RED_COLORATION); - - //Freeze animation - - //Darkbeam for 35 seconds - PhaseTimer = 35000; - }else PhaseTimer -= diff; - - } - break; - case 1: - { - //EyeTentacleTimer - if (DarkGlareTick < 35) - if (DarkGlareTickTimer < diff) - { - //Remove any target - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - - //Set angle and cast - if (ClockWise) - m_creature->SetOrientation(DarkGlareAngle + ((float)DarkGlareTick*PI/35)); - else m_creature->SetOrientation(DarkGlareAngle - ((float)DarkGlareTick*PI/35)); - - m_creature->StopMoving(); - - //Actual dark glare cast, maybe something missing here? - m_creature->CastSpell(m_creature, SPELL_DARK_GLARE, false); - - //Increase tick - DarkGlareTick++; - - //1 second per tick - DarkGlareTickTimer = 1000; - }else DarkGlareTickTimer -= diff; - - //PhaseTimer - if (PhaseTimer < diff) - { - //Switch to Eye Beam - pInst->SetData(DATA_CTHUN_PHASE, 0); - - BeamTimer = 3000; - EyeTentacleTimer = 45000; //Always spawns 5 seconds before Dark Beam - ClawTentacleTimer = 12500; //4 per Eye beam phase (unsure if they spawn durring Dark beam) - - m_creature->InterruptNonMeleeSpells(false); - - //Remove Red coloration from c'thun - m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); - - //Freeze animation - m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, 0); - - //Eye Beam for 50 seconds - PhaseTimer = 50000; - }else PhaseTimer -= diff; - }break; - - //Transition phase - case 2: - { - //Remove any target - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - m_creature->SetHealth(0); - } - - //Dead phase - case 5: - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - } - } - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - //No instance - if (!pInst) - return; - - switch (pInst->GetData(DATA_CTHUN_PHASE)) - { - case 0: - case 1: - { - //Only if it will kill - if (damage < m_creature->GetHealth()) - return; - - //Fake death in phase 0 or 1 (green beam or dark glare phase) - m_creature->InterruptNonMeleeSpells(false); - - //Remove Red coloration from c'thun - m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); - - //Reset to normal emote state and prevent select and attack - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - - //Remove Target field - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - - //Death animation/respawning; - pInst->SetData(DATA_CTHUN_PHASE, 2); - - m_creature->SetHealth(0); - damage = 0; - - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - } - break; - - case 5: - { - //Allow death here - return; - } - - default: - { - //Prevent death in this phase - damage = 0; - return; - } - break; - } - } -}; - -struct TRINITY_DLL_DECL cthunAI : public ScriptedAI -{ - cthunAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - - pInst = c->GetInstanceData(); - if (!pInst) - error_log("TSCR: No Instance eye_of_cthunAI"); - } - - ScriptedInstance* pInst; - - //Out of combat whisper timer - uint32 WisperTimer; - - //Global variables - uint32 PhaseTimer; - - //------------------- - - //Phase transition - uint64 HoldPlayer; - - //Body Phase - uint32 EyeTentacleTimer; - uint8 FleshTentaclesKilled; - uint32 GiantClawTentacleTimer; - uint32 GiantEyeTentacleTimer; - uint32 StomachAcidTimer; - uint32 StomachEnterTimer; - uint32 StomachEnterVisTimer; - uint64 StomachEnterTarget; - - //Stomach map, bool = true then in stomach - UNORDERED_MAP Stomach_Map; - - void Reset() - { - //One random wisper every 90 - 300 seconds - WisperTimer = 90000; - - //Phase information - PhaseTimer = 10000; //Emerge in 10 seconds - - //No hold player for transition - HoldPlayer = 0; - - //Body Phase - EyeTentacleTimer = 30000; - FleshTentaclesKilled = 0; - GiantClawTentacleTimer = 15000; //15 seconds into body phase (1 min repeat) - GiantEyeTentacleTimer = 45000; //15 seconds into body phase (1 min repeat) - StomachAcidTimer = 4000; //Every 4 seconds - StomachEnterTimer = 10000; //Every 10 seconds - StomachEnterVisTimer = 0; //Always 3.5 seconds after Stomach Enter Timer - StomachEnterTarget = 0; //Target to be teleported to stomach - - //Clear players in stomach and outside - Stomach_Map.clear(); - - //Reset flags - m_creature->RemoveAurasDueToSpell(SPELL_TRANSFORM); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - - if (pInst) - pInst->SetData(DATA_CTHUN_PHASE, 0); - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - } - - void SpawnEyeTentacle(float x, float y) - { - Creature* Spawned; - Spawned = me->SummonCreature(MOB_EYE_TENTACLE,m_creature->GetPositionX()+x,m_creature->GetPositionY()+y,m_creature->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); - if (Spawned) - { - Unit* target; - - target = SelectRandomNotStomach(); - - if (target) - Spawned->AI()->AttackStart(target); - } - } - - Unit* SelectRandomNotStomach() - { - if (Stomach_Map.empty()) - return NULL; - - UNORDERED_MAP::iterator i = Stomach_Map.begin(); - - std::list temp; - std::list::iterator j; - - //Get all players in map - while (i != Stomach_Map.end()) - { - //Check for valid player - Unit* pUnit = Unit::GetUnit(*m_creature, i->first); - - //Only units out of stomach - if (pUnit && i->second == false) - { - temp.push_back(pUnit); - } - ++i; - } - - if (temp.empty()) - return NULL; - - j = temp.begin(); - - //Get random but only if we have more than one unit on threat list - if (temp.size() > 1) - advance (i , rand() % (temp.size() - 1)); - - return (*j); - } - - void UpdateAI(const uint32 diff) - { - //Check if we have a target - if (!UpdateVictim()) - { - //No target so we'll use this section to do our random wispers instance wide - //WisperTimer - if (WisperTimer < diff) - { - Map* pMap = m_creature->GetMap(); - if (!pMap->IsDungeon()) return; - - //Play random sound to the zone - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - - if (!PlayerList.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = PlayerList.begin(); itr != PlayerList.end(); ++itr) - { - if (Player* pPlr = itr->getSource()) - pPlr->PlayDirectSound(RANDOM_SOUND_WHISPER,pPlr); - } - } - - //One random wisper every 90 - 300 seconds - WisperTimer = 90000 + (rand()% 210000); - }else WisperTimer -= diff; - - return; - } - - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - - //No instance - if (!pInst) - return; - - switch (pInst->GetData(DATA_CTHUN_PHASE)) - { - //Transition phase - case 2: - { - //PhaseTimer - if (PhaseTimer < diff) - { - //Switch - pInst->SetData(DATA_CTHUN_PHASE, 3); - - //Switch to c'thun model - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_TRANSFORM, false); - m_creature->SetHealth(m_creature->GetMaxHealth()); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_NON_ATTACKABLE); - - //Emerging phase - //AttackStart(Unit::GetUnit(*m_creature, HoldpPlayer)); - DoZoneInCombat(); - - //Place all units in threat list on outside of stomach - Stomach_Map.clear(); - - std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); - for (; i != m_creature->getThreatManager().getThreatList().end(); ++i) - { - //Outside stomach - Stomach_Map[(*i)->getUnitGuid()] = false; - } - - //Spawn 2 flesh tentacles - FleshTentaclesKilled = 0; - - Creature* Spawned; - - //Spawn flesh tentacle - Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (!Spawned) - FleshTentaclesKilled++; - else - CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); - - //Spawn flesh tentacle - Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (!Spawned) - FleshTentaclesKilled++; - else - CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); - - PhaseTimer = 0; - }else PhaseTimer -= diff; - - }break; - - //Body Phase - case 3: - { - //Remove Target field - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - - //Weaken - if (FleshTentaclesKilled > 1) - { - pInst->SetData(DATA_CTHUN_PHASE, 4); - - DoScriptText(EMOTE_WEAKENED, m_creature); - PhaseTimer = 45000; - - DoCast(m_creature, SPELL_RED_COLORATION, true); - - UNORDERED_MAP::iterator i = Stomach_Map.begin(); - - //Kick all players out of stomach - while (i != Stomach_Map.end()) - { - //Check for valid player - Unit* pUnit = Unit::GetUnit(*m_creature, i->first); - - //Only move units in stomach - if (pUnit && i->second == true) - { - //Teleport each player out - DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6); - - //Cast knockback on them - DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true); - - //Remove the acid debuff - pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); - - i->second = false; - } - ++i; - } - - return; - } - - //Stomach acid - if (StomachAcidTimer < diff) - { - //Apply aura to all players in stomach - UNORDERED_MAP::iterator i = Stomach_Map.begin(); - - while (i != Stomach_Map.end()) - { - //Check for valid player - Unit* pUnit = Unit::GetUnit(*m_creature, i->first); - - //Only apply to units in stomach - if (pUnit && i->second == true) - { - //Cast digestive acid on them - DoCast(pUnit, SPELL_DIGESTIVE_ACID, true); - - //Check if player should be kicked from stomach - if (pUnit->IsWithinDist3d(KICK_X, KICK_Y, KICK_Z, 15.0f)) - { - //Teleport each player out - DoTeleportPlayer(pUnit, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()+10, rand()%6); - - //Cast knockback on them - DoCast(pUnit, SPELL_EXIT_STOMACH_KNOCKBACK, true); - - //Remove the acid debuff - pUnit->RemoveAurasDueToSpell(SPELL_DIGESTIVE_ACID); - - i->second = false; - } - } - ++i; - } - - StomachAcidTimer = 4000; - }else StomachAcidTimer -= diff; - - //Stomach Enter Timer - if (StomachEnterTimer < diff) - { - Unit* target = NULL; - target = SelectRandomNotStomach(); - - if (target) - { - //Set target in stomach - Stomach_Map[target->GetGUID()] = true; - target->InterruptNonMeleeSpells(false); - target->CastSpell(target, SPELL_MOUTH_TENTACLE, true, NULL, NULL, m_creature->GetGUID()); - StomachEnterTarget = target->GetGUID(); - StomachEnterVisTimer = 3800; - } - - StomachEnterTimer = 13800; - }else StomachEnterTimer -= diff; - - if (StomachEnterVisTimer && StomachEnterTarget) - if (StomachEnterVisTimer <= diff) - { - //Check for valid player - Unit* pUnit = Unit::GetUnit(*m_creature, StomachEnterTarget); - - if (pUnit) - { - DoTeleportPlayer(pUnit, STOMACH_X, STOMACH_Y, STOMACH_Z, STOMACH_O); - } - - StomachEnterTarget = 0; - StomachEnterVisTimer = 0; - }else StomachEnterVisTimer -= diff; - - //GientClawTentacleTimer - if (GiantClawTentacleTimer < diff) - { - Unit* target = NULL; - target = SelectRandomNotStomach(); - if (target) - { - Creature* Spawned = NULL; - - //Spawn claw tentacle on the random target - Spawned = me->SummonCreature(MOB_GIANT_CLAW_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); - - if (Spawned) - Spawned->AI()->AttackStart(target); - } - - //One giant claw tentacle every minute - GiantClawTentacleTimer = 60000; - }else GiantClawTentacleTimer -= diff; - - //GiantEyeTentacleTimer - if (GiantEyeTentacleTimer < diff) - { - Unit* target = NULL; - target = SelectRandomNotStomach(); - if (target) - { - - Creature* Spawned = NULL; - - //Spawn claw tentacle on the random target - Spawned = me->SummonCreature(MOB_GIANT_EYE_TENTACLE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,500); - - if (Spawned) - Spawned->AI()->AttackStart(target); - } - - //One giant eye tentacle every minute - GiantEyeTentacleTimer = 60000; - }else GiantEyeTentacleTimer -= diff; - - //EyeTentacleTimer - if (EyeTentacleTimer < diff) - { - //Spawn the 8 Eye Tentacles in the corret spots - SpawnEyeTentacle(0, 25); //south - SpawnEyeTentacle(12, 12); //south west - SpawnEyeTentacle(25, 0); //west - SpawnEyeTentacle(12, -12); //north west - - SpawnEyeTentacle(0, -25); //north - SpawnEyeTentacle(-12, -12); //north east - SpawnEyeTentacle(-25, 0); // east - SpawnEyeTentacle(-12, 12); // south east - - //These spawn at every 30 seconds - EyeTentacleTimer = 30000; - }else EyeTentacleTimer -= diff; - - }break; - - //Weakened state - case 4: - { - //PhaseTimer - if (PhaseTimer < diff) - { - //Switch - pInst->SetData(DATA_CTHUN_PHASE, 3); - - //Remove red coloration - m_creature->RemoveAurasDueToSpell(SPELL_RED_COLORATION); - - //Spawn 2 flesh tentacles - FleshTentaclesKilled = 0; - - Creature* Spawned; - - //Spawn flesh tentacle - Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS1_X, TENTACLE_POS1_Y, TENTACLE_POS1_Z, TENTACLE_POS1_O, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (!Spawned) - FleshTentaclesKilled++; - else - CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); - - //Spawn flesh tentacle - Spawned = me->SummonCreature(MOB_FLESH_TENTACLE, TENTACLE_POS2_X, TENTACLE_POS2_Y, TENTACLE_POS2_Z, TENTACLE_POS2_O, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (!Spawned) - FleshTentaclesKilled++; - else - CAST_AI(flesh_tentacleAI, (Spawned->AI()))->SpawnedByCthun(m_creature->GetGUID()); - - PhaseTimer = 0; - }else PhaseTimer -= diff; - } - } - } - - void JustDied(Unit* pKiller) - { - //Switch - if (pInst) - pInst->SetData(DATA_CTHUN_PHASE, 5); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - //No instance - if (!pInst) - return; - - switch (pInst->GetData(DATA_CTHUN_PHASE)) - { - case 3: - { - //Not weakened so reduce damage by 99% - if (damage / 99 > 0) damage/= 99; - else damage = 1; - - //Prevent death in non-weakened state - if (damage >= m_creature->GetHealth()) - damage = 0; - - return; - } - break; - - case 4: - { - //Weakened - takes normal damage - return; - } - - default: - damage = 0; - break; - } - } - - void FleshTentcleKilled() - { - FleshTentaclesKilled++; - } -}; - -struct TRINITY_DLL_DECL eye_tentacleAI : public ScriptedAI -{ - eye_tentacleAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - - if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) - Portal = pPortal->GetGUID(); - } - - uint32 MindflayTimer; - uint32 KillSelfTimer; - uint64 Portal; - - void JustDied(Unit* who) - { - if (Unit* p = Unit::GetUnit(*m_creature, Portal)) - p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - } - - void Reset() - { - //Mind flay half a second after we spawn - MindflayTimer = 500; - - //This prevents eyes from overlapping - KillSelfTimer = 35000; - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - //Check if we have a target - if (!UpdateVictim()) - return; - - //KillSelfTimer - if (KillSelfTimer < diff) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - - return; - }else KillSelfTimer -= diff; - - //MindflayTimer - if (MindflayTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target && !target->HasAura(SPELL_DIGESTIVE_ACID)) - DoCast(target,SPELL_MIND_FLAY); - - //Mindflay every 10 seconds - MindflayTimer = 10100; - }else MindflayTimer -= diff; - } -}; - -struct TRINITY_DLL_DECL claw_tentacleAI : public ScriptedAI -{ - claw_tentacleAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - - if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) - Portal = pPortal->GetGUID(); - } - - uint32 GroundRuptureTimer; - uint32 HamstringTimer; - uint32 EvadeTimer; - uint64 Portal; - - void JustDied(Unit* who) - { - if (Unit* p = Unit::GetUnit(*m_creature, Portal)) - p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - } - - void Reset() - { - //First rupture should happen half a second after we spawn - GroundRuptureTimer = 500; - HamstringTimer = 2000; - EvadeTimer = 5000; - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - //Check if we have a target - if (!UpdateVictim()) - return; - - //EvadeTimer - if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) - if (EvadeTimer < diff) - { - if (Unit* p = Unit::GetUnit(*m_creature, Portal)) - p->DealDamage(p, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - - //Dissapear and reappear at new position - m_creature->SetVisibility(VISIBILITY_OFF); - - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (!target) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - return; - } - - if (!target->HasAura(SPELL_DIGESTIVE_ACID)) - { - m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); - if (Unit* pPortal = m_creature->SummonCreature(MOB_SMALL_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) - Portal = pPortal->GetGUID(); - - GroundRuptureTimer = 500; - HamstringTimer = 2000; - EvadeTimer = 5000; - AttackStart(target); - } - - m_creature->SetVisibility(VISIBILITY_ON); - - }else EvadeTimer -= diff; - - //GroundRuptureTimer - if (GroundRuptureTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_GROUND_RUPTURE); - GroundRuptureTimer = 30000; - }else GroundRuptureTimer -= diff; - - //HamstringTimer - if (HamstringTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_HAMSTRING); - HamstringTimer = 5000; - }else HamstringTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL giant_claw_tentacleAI : public ScriptedAI -{ - giant_claw_tentacleAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - - if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) - Portal = pPortal->GetGUID(); - } - - uint32 GroundRuptureTimer; - uint32 ThrashTimer; - uint32 HamstringTimer; - uint32 EvadeTimer; - uint64 Portal; - - void JustDied(Unit* who) - { - if (Unit* p = Unit::GetUnit(*m_creature, Portal)) - p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - } - - void Reset() - { - //First rupture should happen half a second after we spawn - GroundRuptureTimer = 500; - HamstringTimer = 2000; - ThrashTimer = 5000; - EvadeTimer = 5000; - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - //Check if we have a target - if (!UpdateVictim()) - return; - - //EvadeTimer - if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) - if (EvadeTimer < diff) - { - if (Unit* p = Unit::GetUnit(*m_creature, Portal)) - p->DealDamage(p, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - - //Dissapear and reappear at new position - m_creature->SetVisibility(VISIBILITY_OFF); - - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (!target) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - return; - } - - if (!target->HasAura(SPELL_DIGESTIVE_ACID)) - { - m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0); - if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) - Portal = pPortal->GetGUID(); - - GroundRuptureTimer = 500; - HamstringTimer = 2000; - ThrashTimer = 5000; - EvadeTimer = 5000; - AttackStart(target); - } - - m_creature->SetVisibility(VISIBILITY_ON); - - }else EvadeTimer -= diff; - - //GroundRuptureTimer - if (GroundRuptureTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_GROUND_RUPTURE); - GroundRuptureTimer = 30000; - }else GroundRuptureTimer -= diff; - - //ThrashTimer - if (ThrashTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_THRASH); - ThrashTimer = 10000; - }else ThrashTimer -= diff; - - //HamstringTimer - if (HamstringTimer < diff) - { - DoCast(m_creature->getVictim(),SPELL_HAMSTRING); - HamstringTimer = 10000; - }else HamstringTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL giant_eye_tentacleAI : public ScriptedAI -{ - giant_eye_tentacleAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - - if (Unit* pPortal = m_creature->SummonCreature(MOB_GIANT_PORTAL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_CORPSE_DESPAWN, 0)) - Portal = pPortal->GetGUID(); - } - - uint32 BeamTimer; - uint64 Portal; - - void JustDied(Unit* who) - { - if (Unit* p = Unit::GetUnit(*m_creature, Portal)) - p->DealDamage(p, p->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - } - - void Reset() - { - //Green Beam half a second after we spawn - BeamTimer = 500; - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - //Check if we have a target - if (!UpdateVictim()) - return; - - //BeamTimer - if (BeamTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target && !target->HasAura(SPELL_DIGESTIVE_ACID)) - DoCast(target,SPELL_GREEN_BEAM); - - //Beam every 2 seconds - BeamTimer = 2100; - }else BeamTimer -= diff; - } -}; - -//Flesh tentacle functions -void flesh_tentacleAI::UpdateAI(const uint32 diff) -{ - //Check if we have a target - if (!UpdateVictim()) - return; - - if (Parent) - if (CheckTimer < diff) - { - Unit* pUnit = Unit::GetUnit(*m_creature, Parent); - - if (!pUnit || !pUnit->isAlive() || !pUnit->isInCombat()) - { - Parent = 0; - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NONE, NULL, false); - return; - } - - CheckTimer = 1000; - }else CheckTimer -= diff; - - DoMeleeAttackIfReady(); -} - -void flesh_tentacleAI::JustDied(Unit* killer) -{ - if (!Parent) - { - error_log("TSCR: flesh_tentacle: No Parent variable"); - return; - } - - Creature* Cthun = Unit::GetCreature(*m_creature, Parent); - - if (Cthun) - CAST_AI(cthunAI, (Cthun->AI()))->FleshTentcleKilled(); - else error_log("TSCR: flesh_tentacle: No Cthun"); -} - -//GetAIs -CreatureAI* GetAI_eye_of_cthun(Creature* pCreature) -{ - return new eye_of_cthunAI (pCreature); -} - -CreatureAI* GetAI_cthun(Creature* pCreature) -{ - return new cthunAI (pCreature); -} - -CreatureAI* GetAI_eye_tentacle(Creature* pCreature) -{ - return new eye_tentacleAI (pCreature); -} - -CreatureAI* GetAI_claw_tentacle(Creature* pCreature) -{ - return new claw_tentacleAI (pCreature); -} - -CreatureAI* GetAI_giant_claw_tentacle(Creature* pCreature) -{ - return new giant_claw_tentacleAI (pCreature); -} - -CreatureAI* GetAI_giant_eye_tentacle(Creature* pCreature) -{ - return new giant_eye_tentacleAI (pCreature); -} - -CreatureAI* GetAI_flesh_tentacle(Creature* pCreature) -{ - return new flesh_tentacleAI (pCreature); -} - -void AddSC_boss_cthun() -{ - Script *newscript; - - //Eye - newscript = new Script; - newscript->Name="boss_eye_of_cthun"; - newscript->GetAI = &GetAI_eye_of_cthun; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_cthun"; - newscript->GetAI = &GetAI_cthun; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_eye_tentacle"; - newscript->GetAI = &GetAI_eye_tentacle; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_claw_tentacle"; - newscript->GetAI = &GetAI_claw_tentacle; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_giant_claw_tentacle"; - newscript->GetAI = &GetAI_giant_claw_tentacle; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_giant_eye_tentacle"; - newscript->GetAI = &GetAI_giant_eye_tentacle; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_giant_flesh_tentacle"; - newscript->GetAI = &GetAI_flesh_tentacle; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp deleted file mode 100644 index 6e5992556e3..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_fankriss.cpp +++ /dev/null @@ -1,206 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Fankriss -SD%Complete: 100 -SDComment: sound not implemented -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define SOUND_SENTENCE_YOU 8588 -#define SOUND_SERVE_TO 8589 -#define SOUND_LAWS 8590 -#define SOUND_TRESPASS 8591 -#define SOUND_WILL_BE 8592 - -#define SPELL_MORTAL_WOUND 28467 -#define SPELL_ROOT 28858 - -// Enrage for his spawns -#define SPELL_ENRAGE 28798 - -struct TRINITY_DLL_DECL boss_fankrissAI : public ScriptedAI -{ - boss_fankrissAI(Creature *c) : ScriptedAI(c) {} - - uint32 MortalWound_Timer; - uint32 SpawnHatchlings_Timer; - uint32 SpawnSpawns_Timer; - int Rand; - int RandX; - int RandY; - - Creature* Hatchling; - Creature* Spawn; - - void Reset() - { - MortalWound_Timer = 10000 + rand()%5000; - SpawnHatchlings_Timer = 6000 + rand()%6000; - SpawnSpawns_Timer = 15000 + rand()%30000; - } - - void SummonSpawn(Unit* victim) - { - if (!victim) - return; - - Rand = 10 + (rand()%10); - switch (rand()%2) - { - case 0: RandX = 0 - Rand; break; - case 1: RandX = 0 + Rand; break; - } - Rand = 0; - Rand = 10 + (rand()%10); - switch (rand()%2) - { - case 0: RandY = 0 - Rand; break; - case 1: RandY = 0 + Rand; break; - } - Rand = 0; - Spawn = DoSpawnCreature(15630, RandX, RandY, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); - if (Spawn) - (Spawn->AI())->AttackStart(victim); - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //MortalWound_Timer - if (MortalWound_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MORTAL_WOUND); - MortalWound_Timer = 10000 + rand()%10000; - }else MortalWound_Timer -= diff; - - //Summon 1-3 Spawns of Fankriss at random time. - if (SpawnSpawns_Timer < diff) - { - switch(rand()%3) - { - case 0: - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - break; - case 1: - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - break; - case 2: - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - SummonSpawn(SelectUnit(SELECT_TARGET_RANDOM,0)); - break; - } - SpawnSpawns_Timer = 30000 + rand()%30000; - }else SpawnSpawns_Timer -= diff; - - // Teleporting Random Target to one of the three tunnels and spawn 4 hatchlings near the gamer. - //We will only telport if fankriss has more than 3% of hp so teleported gamers can always loot. - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() > 3) - { - if (SpawnHatchlings_Timer< diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target && target->GetTypeId() == TYPEID_PLAYER) - { - DoCast(target, SPELL_ROOT); - - if (DoGetThreat(target)) - DoModifyThreatPercent(target, -100); - - switch(rand()%3) - { - case 0: - DoTeleportPlayer(target, -8106.0142,1289.2900,-74.419533,5.112); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - break; - case 1: - DoTeleportPlayer(target, -7990.135354,1155.1907,-78.849319,2.608); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - break; - case 2: - DoTeleportPlayer(target,-8159.7753,1127.9064,-76.868660,0.675); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()-3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-3, target->GetPositionY()+3, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()-5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - Hatchling = m_creature->SummonCreature(15962, target->GetPositionX()-5, target->GetPositionY()+5, target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - if (Hatchling) - (Hatchling->AI())->AttackStart(target); - break; - } - } - SpawnHatchlings_Timer = 45000 + rand()%15000; - }else SpawnHatchlings_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_fankriss(Creature* pCreature) -{ - return new boss_fankrissAI (pCreature); -} - -void AddSC_boss_fankriss() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_fankriss"; - newscript->GetAI = &GetAI_boss_fankriss; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp deleted file mode 100644 index 705e2275d33..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_huhuran.cpp +++ /dev/null @@ -1,148 +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_Huhuran -SD%Complete: 100 -SDComment: -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define EMOTE_GENERIC_FRENZY_KILL -1000001 -#define EMOTE_GENERIC_BERSERK -1000004 - -#define SPELL_FRENZY 26051 -#define SPELL_BERSERK 26068 -#define SPELL_POISONBOLT 26052 -#define SPELL_NOXIOUSPOISON 26053 -#define SPELL_WYVERNSTING 26180 -#define SPELL_ACIDSPIT 26050 - -struct TRINITY_DLL_DECL boss_huhuranAI : public ScriptedAI -{ - boss_huhuranAI(Creature *c) : ScriptedAI(c) {} - - uint32 Frenzy_Timer; - uint32 Wyvern_Timer; - uint32 Spit_Timer; - uint32 PoisonBolt_Timer; - uint32 NoxiousPoison_Timer; - uint32 FrenzyBack_Timer; - - bool Frenzy; - bool Berserk; - - void Reset() - { - Frenzy_Timer = 25000 + rand()%10000; - Wyvern_Timer = 18000 + rand()%10000; - Spit_Timer = 8000; - PoisonBolt_Timer = 4000; - NoxiousPoison_Timer = 10000 + rand()%10000; - FrenzyBack_Timer = 15000; - - Frenzy = false; - Berserk = false; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Frenzy_Timer - if (!Frenzy && Frenzy_Timer < diff) - { - DoCast(m_creature, SPELL_FRENZY); - DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); - Frenzy = true; - PoisonBolt_Timer = 3000; - Frenzy_Timer = 25000 + rand()%10000; - }else Frenzy_Timer -= diff; - - // Wyvern Timer - if (Wyvern_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_WYVERNSTING); - Wyvern_Timer = 15000 + rand()%17000; - }else Wyvern_Timer -= diff; - - //Spit Timer - if (Spit_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ACIDSPIT); - Spit_Timer = 5000 + rand()%5000; - }else Spit_Timer -= diff; - - //NoxiousPoison_Timer - if (NoxiousPoison_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_NOXIOUSPOISON); - NoxiousPoison_Timer = 12000 + rand()%12000; - }else NoxiousPoison_Timer -= diff; - - //PoisonBolt only if frenzy or berserk - if (Frenzy || Berserk) - { - if (PoisonBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_POISONBOLT); - PoisonBolt_Timer = 3000; - }else PoisonBolt_Timer -= diff; - } - - //FrenzyBack_Timer - if (Frenzy && FrenzyBack_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - Frenzy = false; - FrenzyBack_Timer = 15000; - }else FrenzyBack_Timer -= diff; - - if (!Berserk && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 31) - { - m_creature->InterruptNonMeleeSpells(false); - DoScriptText(EMOTE_GENERIC_BERSERK, m_creature); - DoCast(m_creature, SPELL_BERSERK); - Berserk = true; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_huhuran(Creature* pCreature) -{ - return new boss_huhuranAI (pCreature); -} - -void AddSC_boss_huhuran() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_huhuran"; - newscript->GetAI = &GetAI_boss_huhuran; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp deleted file mode 100644 index d7f6a186316..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_ouro.cpp +++ /dev/null @@ -1,140 +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_Ouro -SD%Complete: 85 -SDComment: No model for submerging. Currently just invisible. -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" -#include "def_temple_of_ahnqiraj.h" - -#define SPELL_SWEEP 26103 -#define SPELL_SANDBLAST 26102 -#define SPELL_GROUND_RUPTURE 26100 -#define SPELL_BIRTH 26262 //The Birth Animation - -#define SPELL_DIRTMOUND_PASSIVE 26092 - -struct TRINITY_DLL_DECL boss_ouroAI : public ScriptedAI -{ - boss_ouroAI(Creature *c) : ScriptedAI(c) {} - - uint32 Sweep_Timer; - uint32 SandBlast_Timer; - uint32 Submerge_Timer; - uint32 Back_Timer; - uint32 ChangeTarget_Timer; - uint32 Spawn_Timer; - - bool Enrage; - bool Submerged; - - void Reset() - { - Sweep_Timer = 5000 + rand()%5000; - SandBlast_Timer = 20000 + rand()%15000; - Submerge_Timer = 90000 + rand()%60000; - Back_Timer = 30000 + rand()%15000; - ChangeTarget_Timer = 5000 + rand()%3000; - Spawn_Timer = 10000 + rand()%10000; - - Enrage = false; - Submerged = false; - } - - void EnterCombat(Unit *who) - { - DoCast(m_creature->getVictim(), SPELL_BIRTH); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Sweep_Timer - if (!Submerged && Sweep_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SWEEP); - Sweep_Timer = 15000 + rand()%15000; - }else Sweep_Timer -= diff; - - //SandBlast_Timer - if (!Submerged && SandBlast_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SANDBLAST); - SandBlast_Timer = 20000 + rand()%15000; - }else SandBlast_Timer -= diff; - - //Submerge_Timer - if (!Submerged && Submerge_Timer < diff) - { - //Cast - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SUBMERGE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->setFaction(35); - DoCast(m_creature, SPELL_DIRTMOUND_PASSIVE); - - Submerged = true; - Back_Timer = 30000 + rand()%15000; - }else Submerge_Timer -= diff; - - //ChangeTarget_Timer - if (Submerged && ChangeTarget_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (target) - DoTeleportTo(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ()); - - ChangeTarget_Timer = 10000 + rand()%10000; - }else ChangeTarget_Timer -= diff; - - //Back_Timer - if (Submerged && Back_Timer < diff) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->setFaction(14); - - DoCast(m_creature->getVictim(), SPELL_GROUND_RUPTURE); - - Submerged = false; - Submerge_Timer = 60000 + rand()%60000; - }else Back_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_ouro(Creature* pCreature) -{ - return new boss_ouroAI (pCreature); -} - -void AddSC_boss_ouro() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_ouro"; - newscript->GetAI = &GetAI_boss_ouro; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp deleted file mode 100644 index dd5aa9bae87..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_sartura.cpp +++ /dev/null @@ -1,298 +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_Sartura -SD%Complete: 95 -SDComment: -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1531008 -#define SAY_SLAY -1531009 -#define SAY_DEATH -1531010 - -#define SPELL_WHIRLWIND 26083 -#define SPELL_ENRAGE 28747 //Not sure if right ID. -#define SPELL_ENRAGEHARD 28798 - -//Guard Spell -#define SPELL_WHIRLWINDADD 26038 -#define SPELL_KNOCKBACK 26027 - - -struct TRINITY_DLL_DECL boss_sarturaAI : public ScriptedAI -{ - boss_sarturaAI(Creature *c) : ScriptedAI(c) {} - - uint32 WhirlWind_Timer; - uint32 WhirlWindRandom_Timer; - uint32 WhirlWindEnd_Timer; - uint32 AggroReset_Timer; - uint32 AggroResetEnd_Timer; - uint32 EnrageHard_Timer; - - bool Enraged; - bool EnragedHard; - bool WhirlWind; - bool AggroReset; - - void Reset() - { - WhirlWind_Timer = 30000; - WhirlWindRandom_Timer = 3000 + rand()%4000; - WhirlWindEnd_Timer = 15000; - AggroReset_Timer = 45000 + rand()%10000; - AggroResetEnd_Timer = 5000; - EnrageHard_Timer = 10*60000; - - WhirlWind = false; - AggroReset = false; - Enraged = false; - EnragedHard = false; - - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_SLAY, m_creature); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (WhirlWind) - { - if (WhirlWindRandom_Timer < diff) - { - //Attack random Gamers - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target) - m_creature->AddThreat(target, 1.0f); - m_creature->TauntApply(target); - AttackStart(target); - - WhirlWindRandom_Timer = 3000 + rand()%4000; - }else WhirlWindRandom_Timer -= diff; - - if (WhirlWindEnd_Timer < diff) - { - WhirlWind = false; - WhirlWind_Timer = 25000 + rand()%15000; - }else WhirlWindEnd_Timer -= diff; - } - - if (!WhirlWind) - { - if (WhirlWind_Timer < diff) - { - DoCast(m_creature, SPELL_WHIRLWIND); - WhirlWind = true; - WhirlWindEnd_Timer = 15000; - }else WhirlWind_Timer -= diff; - - if (AggroReset_Timer < diff) - { - //Attack random Gamers - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target) - m_creature->AddThreat(target, 1.0f); - m_creature->TauntApply(target); - AttackStart(target); - - AggroReset = true; - AggroReset_Timer = 2000 + rand()%3000; - }else AggroReset_Timer -= diff; - - if (AggroReset) - { - if (AggroResetEnd_Timer GetHealth()*100 / m_creature->GetMaxHealth() <= 20 && !m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(m_creature, SPELL_ENRAGE); - Enraged = true; - } - } - - //After 10 minutes hard enrage - if (!EnragedHard) - { - if (EnrageHard_Timer < diff) - { - DoCast(m_creature, SPELL_ENRAGEHARD); - EnragedHard = true; - } else EnrageHard_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } - } -}; - -struct TRINITY_DLL_DECL mob_sartura_royal_guardAI : public ScriptedAI -{ - mob_sartura_royal_guardAI(Creature *c) : ScriptedAI(c) {} - - uint32 WhirlWind_Timer; - uint32 WhirlWindRandom_Timer; - uint32 WhirlWindEnd_Timer; - uint32 AggroReset_Timer; - uint32 AggroResetEnd_Timer; - uint32 KnockBack_Timer; - - bool WhirlWind; - bool AggroReset; - - void Reset() - { - WhirlWind_Timer = 30000; - WhirlWindRandom_Timer = 3000 + rand()%4000; - WhirlWindEnd_Timer = 15000; - AggroReset_Timer = 45000 + rand()%10000; - AggroResetEnd_Timer = 5000; - KnockBack_Timer = 10000; - - WhirlWind = false; - AggroReset = false; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (!WhirlWind && WhirlWind_Timer < diff) - { - DoCast(m_creature, SPELL_WHIRLWINDADD); - WhirlWind = true; - WhirlWind_Timer = 25000 + rand()%15000; - WhirlWindEnd_Timer = 15000; - }else WhirlWind_Timer -= diff; - - if (WhirlWind) - { - if (WhirlWindRandom_Timer < diff) - { - //Attack random Gamers - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target) - m_creature->AddThreat(target, 1.0f); - m_creature->TauntApply(target); - AttackStart(target); - - WhirlWindRandom_Timer = 3000 + rand()%4000; - }else WhirlWindRandom_Timer -= diff; - - if (WhirlWindEnd_Timer < diff) - { - WhirlWind = false; - }else WhirlWindEnd_Timer -= diff; - } - - if (!WhirlWind) - { - if (AggroReset_Timer < diff) - { - //Attack random Gamers - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target) - m_creature->AddThreat(target, 1.0f); - m_creature->TauntApply(target); - AttackStart(target); - - AggroReset = true; - AggroReset_Timer = 2000 + rand()%3000; - }else AggroReset_Timer -= diff; - - if (KnockBack_Timer < diff) - { - DoCast(m_creature, SPELL_WHIRLWINDADD); - KnockBack_Timer = 10000 + rand()%10000; - }else KnockBack_Timer -= diff; - } - - if (AggroReset) - { - if (AggroResetEnd_Timer Name="boss_sartura"; - newscript->GetAI = &GetAI_boss_sartura; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_sartura_royal_guard"; - newscript->GetAI = &GetAI_mob_sartura_royal_guard; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp deleted file mode 100644 index 780a0c28f22..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_skeram.cpp +++ /dev/null @@ -1,316 +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_Skeram -SD%Complete: 75 -SDComment: Mind Control buggy. -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" -#include "def_temple_of_ahnqiraj.h" -#include "Group.h" - -#define SAY_AGGRO1 -1531000 -#define SAY_AGGRO2 -1531001 -#define SAY_AGGRO3 -1531002 -#define SAY_SLAY1 -1531003 -#define SAY_SLAY2 -1531004 -#define SAY_SLAY3 -1531005 -#define SAY_SPLIT -1531006 -#define SAY_DEATH -1531007 - -#define SPELL_ARCANE_EXPLOSION 25679 -#define SPELL_EARTH_SHOCK 26194 -#define SPELL_TRUE_FULFILLMENT4 26526 -#define SPELL_BLINK 28391 - -class ov_mycoordinates -{ - public: - float x,y,z,r; - ov_mycoordinates(float cx, float cy, float cz, float cr) - { - x = cx; y = cy; z = cz; r = cr; - } -}; - -struct TRINITY_DLL_DECL boss_skeramAI : public ScriptedAI -{ - boss_skeramAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - IsImage = false; - } - - ScriptedInstance *pInstance; - - uint32 ArcaneExplosion_Timer; - uint32 EarthShock_Timer; - uint32 FullFillment_Timer; - uint32 Blink_Timer; - uint32 Invisible_Timer; - - Creature *Image1, *Image2; - - bool Images75; - bool Images50; - bool Images25; - bool IsImage; - bool Invisible; - - void Reset() - { - ArcaneExplosion_Timer = 6000 + rand()%6000; - EarthShock_Timer = 2000; - FullFillment_Timer = 15000; - Blink_Timer = 8000 + rand()%12000; - Invisible_Timer = 500; - - Images75 = false; - Images50 = false; - Images25 = false; - Invisible = false; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_ON); - - if (IsImage) - m_creature->setDeathState(JUST_DIED); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - if (!IsImage) - DoScriptText(SAY_DEATH, m_creature); - } - - void EnterCombat(Unit *who) - { - if (IsImage || Images75) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = 8000 + rand()%10000; - }else ArcaneExplosion_Timer -= diff; - - //If we are within range melee the target - if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - //Make sure our attack is ready and we arn't currently casting - if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) - { - m_creature->AttackerStateUpdate(m_creature->getVictim()); - m_creature->resetAttackTimer(); - } - }else - { - //EarthShock_Timer - if (EarthShock_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_EARTH_SHOCK); - EarthShock_Timer = 1000; - }else EarthShock_Timer -= diff; - } - - //Blink_Timer - if (Blink_Timer < diff) - { - //DoCast(m_creature, SPELL_BLINK); - switch(rand()%3) - { - case 0: - m_creature->GetMap()->CreatureRelocation(m_creature, -8340.782227,2083.814453,125.648788,0.0f); - DoResetThreat(); - break; - case 1: - m_creature->GetMap()->CreatureRelocation(m_creature, -8341.546875,2118.504639,133.058151,0.0f); - DoResetThreat(); - break; - case 2: - m_creature->GetMap()->CreatureRelocation(m_creature, -8318.822266,2058.231201,133.058151,0.0f); - DoResetThreat(); - break; - } - DoStopAttack(); - - Blink_Timer= 20000 + rand()%20000; - }else Blink_Timer -= diff; - - int procent = (int) (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() +0.5); - - //Summoning 2 Images and teleporting to a random position on 75% health - if ((!Images75 && !IsImage) && (procent <= 75 && procent > 70)) - DoSplit(75); - - //Summoning 2 Images and teleporting to a random position on 50% health - if ((!Images50 && !IsImage) && - (procent <= 50 && procent > 45)) - DoSplit(50); - - //Summoning 2 Images and teleporting to a random position on 25% health - if ((!Images25 && !IsImage) && (procent <= 25 && procent > 20)) - DoSplit(25); - - //Invisible_Timer - if (Invisible) - { - if (Invisible_Timer < diff) - { - //Making Skeram visible after telporting - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - Invisible_Timer = 2500; - Invisible = false; - }else Invisible_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } - - void DoSplit(int atPercent /* 75 50 25 */) - { - DoScriptText(SAY_SPLIT, m_creature); - - ov_mycoordinates *place1 = new ov_mycoordinates(-8340.782227,2083.814453,125.648788,0); - ov_mycoordinates *place2 = new ov_mycoordinates(-8341.546875,2118.504639,133.058151,0); - ov_mycoordinates *place3 = new ov_mycoordinates(-8318.822266,2058.231201,133.058151,0); - - ov_mycoordinates *bossc=place1, *i1=place2, *i2=place3; - - switch(rand()%3) - { - case 0: - bossc=place1; - i1=place2; - i2=place3; - break; - case 1: - bossc=place2; - i1=place1; - i2=place3; - break; - case 2: - bossc=place3; - i1=place1; - i2=place2; - break; - } - - for (int tryi = 0; tryi < 41; tryi ++) - { - Unit *targetpl = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (targetpl->GetTypeId() == TYPEID_PLAYER) - { - Group *grp = CAST_PLR(targetpl)->GetGroup(); - if (grp) - { - for (int ici = 0; ici < TARGETICONCOUNT; ++ici) - { - //if (grp ->m_targetIcons[ici] == m_creature->GetGUID()) -- private member:( - grp->SetTargetIcon(ici, 0); - } - } - break; - } - } - - m_creature->RemoveAllAuras(); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->GetMap()->CreatureRelocation(m_creature, bossc->x, bossc->y, bossc->z, bossc->r); - Invisible = true; - delete place1; - delete place2; - delete place3; - DoResetThreat(); - DoStopAttack(); - - switch (atPercent) - { - case 75: Images75 = true; break; - case 50: Images50 = true; break; - case 25: Images25 = true; break; - } - - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - - Image1 = m_creature->SummonCreature(15263, i1->x, i1->y, i1->z, i1->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - if (Image1) - { - Image1->SetMaxHealth(m_creature->GetMaxHealth() / 5); - Image1->SetHealth(m_creature->GetHealth() / 5); - if (target) - Image1->AI()->AttackStart(target); - CAST_AI(boss_skeramAI, Image1->AI())->IsImage = true; - } - - Image2 = m_creature->SummonCreature(15263,i2->x, i2->y, i2->z, i2->r, TEMPSUMMON_CORPSE_DESPAWN, 30000); - if (Image2) - { - Image2->SetMaxHealth(m_creature->GetMaxHealth() / 5); - Image2->SetHealth(m_creature->GetHealth() / 5); - if (target) - Image2->AI()->AttackStart(target); - CAST_AI(boss_skeramAI, Image2->AI())->IsImage = true; - } - Invisible = true; - } - -}; - -CreatureAI* GetAI_boss_skeram(Creature* pCreature) -{ - return new boss_skeramAI (pCreature); -} - -void AddSC_boss_skeram() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_skeram"; - newscript->GetAI = &GetAI_boss_skeram; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp deleted file mode 100644 index fdc1b6ae408..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_twinemperors.cpp +++ /dev/null @@ -1,618 +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_Twinemperors -SD%Complete: 95 -SDComment: -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" -#include "def_temple_of_ahnqiraj.h" -#include "WorldPacket.h" - -#include "Item.h" -#include "Spell.h" - -#define SPELL_HEAL_BROTHER 7393 -#define SPELL_TWIN_TELEPORT 800 // CTRA watches for this spell to start its teleport timer -#define SPELL_TWIN_TELEPORT_VISUAL 26638 // visual - -#define SPELL_EXPLODEBUG 804 -#define SPELL_MUTATE_BUG 802 - -#define SOUND_VN_DEATH 8660 //8660 - Death - Feel -#define SOUND_VN_AGGRO 8661 //8661 - Aggro - Let none -#define SOUND_VN_KILL 8662 //8661 - Kill - your fate - -#define SOUND_VL_AGGRO 8657 //8657 - Aggro - To Late -#define SOUND_VL_KILL 8658 //8658 - Kill - You will not -#define SOUND_VL_DEATH 8659 //8659 - Death - -#define PULL_RANGE 50 -#define ABUSE_BUG_RANGE 20 -#define SPELL_BERSERK 26662 -#define TELEPORTTIME 30000 - -#define SPELL_UPPERCUT 26007 -#define SPELL_UNBALANCING_STRIKE 26613 - -#define VEKLOR_DIST 20 // VL will not come to melee when attacking - -#define SPELL_SHADOWBOLT 26006 -#define SPELL_BLIZZARD 26607 -#define SPELL_ARCANEBURST 568 - -struct TRINITY_DLL_DECL boss_twinemperorsAI : public ScriptedAI -{ - ScriptedInstance *pInstance; - uint32 Heal_Timer; - uint32 Teleport_Timer; - bool AfterTeleport; - uint32 AfterTeleportTimer; - bool DontYellWhenDead; - uint32 Abuse_Bug_Timer, BugsTimer; - bool tspellcasted; - uint32 EnrageTimer; - - virtual bool IAmVeklor() = 0; - virtual void Reset() = 0; - virtual void CastSpellOnBug(Creature *target) = 0; - - boss_twinemperorsAI(Creature *c): ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - void TwinReset() - { - Heal_Timer = 0; // first heal immediately when they get close together - Teleport_Timer = TELEPORTTIME; - AfterTeleport = false; - tspellcasted = false; - AfterTeleportTimer = 0; - Abuse_Bug_Timer = 10000 + rand()%7000; - BugsTimer = 2000; - m_creature->clearUnitState(UNIT_STAT_STUNNED); - DontYellWhenDead = false; - EnrageTimer = 15*60000; - } - - Creature *GetOtherBoss() - { - if (pInstance) - { - return Unit::GetCreature(*m_creature, pInstance->GetData64(IAmVeklor() ? DATA_VEKNILASH : DATA_VEKLOR)); - } - else - { - return NULL; - } - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - Unit *pOtherBoss = GetOtherBoss(); - if (pOtherBoss) - { - float dPercent = ((float)damage) / ((float)m_creature->GetMaxHealth()); - int odmg = (int)(dPercent * ((float)pOtherBoss->GetMaxHealth())); - int ohealth = pOtherBoss->GetHealth()-odmg; - pOtherBoss->SetHealth(ohealth > 0 ? ohealth : 0); - if (ohealth <= 0) - { - pOtherBoss->setDeathState(JUST_DIED); - pOtherBoss->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - } - } - } - - void JustDied(Unit* Killer) - { - Creature *pOtherBoss = GetOtherBoss(); - if (pOtherBoss) - { - pOtherBoss->SetHealth(0); - pOtherBoss->setDeathState(JUST_DIED); - pOtherBoss->SetFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->DontYellWhenDead = true; - } - if (!DontYellWhenDead) // I hope AI is not threaded - DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_DEATH : SOUND_VN_DEATH); - } - - void KilledUnit(Unit* victim) - { - DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_KILL : SOUND_VN_KILL); - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - Creature *pOtherBoss = GetOtherBoss(); - if (pOtherBoss) - { - // TODO: we should activate the other boss location so he can start attackning even if nobody - // is near I dont know how to do that - ScriptedAI *otherAI = CAST_AI(ScriptedAI, pOtherBoss->AI()); - if (!pOtherBoss->isInCombat()) - { - DoPlaySoundToSet(m_creature, IAmVeklor() ? SOUND_VL_AGGRO : SOUND_VN_AGGRO); - otherAI->AttackStart(who); - otherAI->DoZoneInCombat(); - } - } - } - - void SpellHit(Unit *caster, const SpellEntry *entry) - { - if (caster == m_creature) - return; - - Creature *pOtherBoss = GetOtherBoss(); - if (entry->Id != SPELL_HEAL_BROTHER || !pOtherBoss) - return; - - // add health so we keep same percentage for both brothers - uint32 mytotal = m_creature->GetMaxHealth(), histotal = pOtherBoss->GetMaxHealth(); - float mult = ((float)mytotal) / ((float)histotal); - if (mult < 1) - mult = 1.0f/mult; - #define HEAL_BROTHER_AMOUNT 30000.0f - uint32 largerAmount = (uint32)((HEAL_BROTHER_AMOUNT * mult) - HEAL_BROTHER_AMOUNT); - - uint32 myh = m_creature->GetHealth(); - uint32 hish = pOtherBoss->GetHealth(); - if (mytotal > histotal) - { - uint32 h = m_creature->GetHealth()+largerAmount; - m_creature->SetHealth(std::min(mytotal, h)); - } - else - { - uint32 h = pOtherBoss->GetHealth()+largerAmount; - pOtherBoss->SetHealth(std::min(histotal, h)); - } - } - - void TryHealBrother(uint32 diff) - { - if (IAmVeklor()) // this spell heals caster and the other brother so let VN cast it - return; - - if (Heal_Timer < diff) - { - Unit *pOtherBoss = GetOtherBoss(); - if (pOtherBoss && pOtherBoss->IsWithinDist(m_creature,60)) - { - DoCast(pOtherBoss, SPELL_HEAL_BROTHER); - Heal_Timer = 1000; - } - } else Heal_Timer -= diff; - } - - void TeleportToMyBrother() - { - if (!pInstance) - return; - - Teleport_Timer = TELEPORTTIME; - - if (IAmVeklor()) - return; // mechanics handled by veknilash so they teleport exactly at the same time and to correct coordinates - - Creature *pOtherBoss = GetOtherBoss(); - if (pOtherBoss) - { - //m_creature->MonsterYell("Teleporting ...", LANG_UNIVERSAL, 0); - float other_x = pOtherBoss->GetPositionX(); - float other_y = pOtherBoss->GetPositionY(); - float other_z = pOtherBoss->GetPositionZ(); - float other_o = pOtherBoss->GetOrientation(); - - Map *thismap = m_creature->GetMap(); - thismap->CreatureRelocation(pOtherBoss, m_creature->GetPositionX(), - m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation()); - thismap->CreatureRelocation(m_creature, other_x, other_y, other_z, other_o); - - SetAfterTeleport(); - CAST_AI(boss_twinemperorsAI, pOtherBoss->AI())->SetAfterTeleport(); - } - } - - void SetAfterTeleport() - { - m_creature->InterruptNonMeleeSpells(false); - DoStopAttack(); - DoResetThreat(); - DoCast(m_creature, SPELL_TWIN_TELEPORT_VISUAL); - m_creature->addUnitState(UNIT_STAT_STUNNED); - AfterTeleport = true; - AfterTeleportTimer = 2000; - tspellcasted = false; - } - - bool TryActivateAfterTTelep(uint32 diff) - { - if (AfterTeleport) - { - if (!tspellcasted) - { - m_creature->clearUnitState(UNIT_STAT_STUNNED); - DoCast(m_creature, SPELL_TWIN_TELEPORT); - m_creature->addUnitState(UNIT_STAT_STUNNED); - } - - tspellcasted = true; - - if (AfterTeleportTimer < diff) - { - AfterTeleport = false; - m_creature->clearUnitState(UNIT_STAT_STUNNED); - Unit *nearu = m_creature->SelectNearestTarget(100); - //DoYell(nearu->GetName(), LANG_UNIVERSAL, 0); - if (nearu) - { - AttackStart(nearu); - m_creature->getThreatManager().addThreat(nearu, 10000); - } - return true; - } - else - { - AfterTeleportTimer -= diff; - // update important timers which would otherwise get skipped - if (EnrageTimer > diff) - EnrageTimer -= diff; - else - EnrageTimer = 0; - if (Teleport_Timer > diff) - Teleport_Timer -= diff; - else - Teleport_Timer = 0; - return false; - } - } - else - { - return true; - } - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || m_creature->getVictim()) - return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - float attackRadius = m_creature->GetAttackDistance(who); - if (attackRadius < PULL_RANGE) - attackRadius = PULL_RANGE; - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= /*CREATURE_Z_ATTACK_RANGE*/7 /*there are stairs*/) - { - //if (who->HasStealthAura()) - // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - } - } - - Creature *RespawnNearbyBugsAndGetOne() - { - std::list lUnitList; - m_creature->GetCreatureListWithEntryInGrid(lUnitList,15316,150.0f); - m_creature->GetCreatureListWithEntryInGrid(lUnitList,15317,150.0f); - - if (lUnitList.empty()) - return NULL; - - Creature *nearb = NULL; - - for(std::list::iterator iter = lUnitList.begin(); iter != lUnitList.end(); ++iter) - { - Creature *c = *iter; - if (c) - { - if (c->isDead()) - { - c->Respawn(); - c->setFaction(7); - c->RemoveAllAuras(); - } - if (c->IsWithinDistInMap(m_creature, ABUSE_BUG_RANGE)) - { - if (!nearb || (rand()%4) == 0) - nearb = c; - } - } - } - return nearb; - } - - void HandleBugs(uint32 diff) - { - if (BugsTimer < diff || Abuse_Bug_Timer < diff) - { - Creature *c = RespawnNearbyBugsAndGetOne(); - if (Abuse_Bug_Timer < diff) - { - if (c) - { - CastSpellOnBug(c); - Abuse_Bug_Timer = 10000 + rand()%7000; - } - else - { - Abuse_Bug_Timer = 1000; - } - } - else - { - Abuse_Bug_Timer -= diff; - } - BugsTimer = 2000; - } - else - { - BugsTimer -= diff; - Abuse_Bug_Timer -= diff; - } - } - - void CheckEnrage(uint32 diff) - { - if (EnrageTimer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(true)) - { - DoCast(m_creature, SPELL_BERSERK); - EnrageTimer = 60*60000; - } else EnrageTimer = 0; - } else EnrageTimer-=diff; - } -}; - -struct TRINITY_DLL_DECL boss_veknilashAI : public boss_twinemperorsAI -{ - bool IAmVeklor() {return false;} - boss_veknilashAI(Creature *c) : boss_twinemperorsAI(c) {} - - uint32 UpperCut_Timer; - uint32 UnbalancingStrike_Timer; - uint32 Scarabs_Timer; - int Rand; - int RandX; - int RandY; - - Creature* Summoned; - - void Reset() - { - TwinReset(); - UpperCut_Timer = 14000 + rand()%15000; - UnbalancingStrike_Timer = 8000 + rand()%10000; - Scarabs_Timer = 7000 + rand()%7000; - - //Added. Can be removed if its included in DB. - m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); - } - - void CastSpellOnBug(Creature *target) - { - target->setFaction(14); - (target->AI())->AttackStart(m_creature->getThreatManager().getHostilTarget()); - SpellEntry *spell = GET_SPELL(SPELL_MUTATE_BUG); - uint8 eff_mask=0; - for (int i=0; i<3; ++i) - { - if (!spell->Effect[i]) - continue; - eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, target, target)); - target->SetHealth(target->GetMaxHealth()); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (!TryActivateAfterTTelep(diff)) - return; - - //UnbalancingStrike_Timer - if (UnbalancingStrike_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_UNBALANCING_STRIKE); - UnbalancingStrike_Timer = 8000+rand()%12000; - }else UnbalancingStrike_Timer -= diff; - - if (UpperCut_Timer < diff) - { - Unit* randomMelee = SelectTarget(SELECT_TARGET_RANDOM, 0, NOMINAL_MELEE_RANGE, true); - if (randomMelee) - DoCast(randomMelee,SPELL_UPPERCUT); - UpperCut_Timer = 15000+rand()%15000; - }else UpperCut_Timer -= diff; - - HandleBugs(diff); - - //Heal brother when 60yrds close - TryHealBrother(diff); - - //Teleporting to brother - if (Teleport_Timer < diff) - { - TeleportToMyBrother(); - }else Teleport_Timer -= diff; - - CheckEnrage(diff); - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_veklorAI : public boss_twinemperorsAI -{ - bool IAmVeklor() {return true;} - boss_veklorAI(Creature *c) : boss_twinemperorsAI(c) {} - - uint32 ShadowBolt_Timer; - uint32 Blizzard_Timer; - uint32 ArcaneBurst_Timer; - uint32 Scorpions_Timer; - int Rand; - int RandX; - int RandY; - - Creature* Summoned; - - void Reset() - { - TwinReset(); - ShadowBolt_Timer = 0; - Blizzard_Timer = 15000 + rand()%5000;; - ArcaneBurst_Timer = 1000; - Scorpions_Timer = 7000 + rand()%7000; - - //Added. Can be removed if its included in DB. - m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MINDAMAGE, 0); - m_creature->SetBaseWeaponDamage(BASE_ATTACK, MAXDAMAGE, 0); - } - - void CastSpellOnBug(Creature *target) - { - target->setFaction(14); - SpellEntry *spell = GET_SPELL(SPELL_EXPLODEBUG); - uint8 eff_mask=0; - for (int i=0; i<3; ++i) - { - if (!spell->Effect[i]) - continue; - eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, target, target)); - target->SetHealth(target->GetMaxHealth()); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - // reset arcane burst after teleport - we need to do this because - // when VL jumps to VN's location there will be a warrior who will get only 2s to run away - // which is almost impossible - if (AfterTeleport) - ArcaneBurst_Timer = 5000; - if (!TryActivateAfterTTelep(diff)) - return; - - //ShadowBolt_Timer - if (ShadowBolt_Timer < diff) - { - if (!m_creature->IsWithinDist(m_creature->getVictim(), 45.0f)) - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), VEKLOR_DIST, 0); - else - DoCast(m_creature->getVictim(),SPELL_SHADOWBOLT); - ShadowBolt_Timer = 2000; - }else ShadowBolt_Timer -= diff; - - //Blizzard_Timer - if (Blizzard_Timer < diff) - { - Unit* target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45, true); - if (target) - DoCast(target,SPELL_BLIZZARD); - Blizzard_Timer = 15000+rand()%15000; - }else Blizzard_Timer -= diff; - - if (ArcaneBurst_Timer < diff) - { - Unit *mvic; - if ((mvic=SelectTarget(SELECT_TARGET_NEAREST, 0, NOMINAL_MELEE_RANGE, true))!=NULL) - { - DoCast(mvic,SPELL_ARCANEBURST); - ArcaneBurst_Timer = 5000; - } - }else ArcaneBurst_Timer -= diff; - - HandleBugs(diff); - - //Heal brother when 60yrds close - TryHealBrother(diff); - - //Teleporting to brother - if (Teleport_Timer < diff) - { - TeleportToMyBrother(); - }else Teleport_Timer -= diff; - - CheckEnrage(diff); - - //VL doesn't melee - //DoMeleeAttackIfReady(); - } - - void AttackStart(Unit* who) - { - if (!who) - return; - - if (who->isTargetableForAttack()) - { - // VL doesn't melee - if (m_creature->Attack(who, false)) - { - m_creature->GetMotionMaster()->MoveChase(who, VEKLOR_DIST, 0); - m_creature->AddThreat(who, 0.0f); - } - } - } -}; - -CreatureAI* GetAI_boss_veknilash(Creature* pCreature) -{ - return new boss_veknilashAI (pCreature); -} - -CreatureAI* GetAI_boss_veklor(Creature* pCreature) -{ - return new boss_veklorAI (pCreature); -} - -void AddSC_boss_twinemperors() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_veknilash"; - newscript->GetAI = &GetAI_boss_veknilash; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_veklor"; - newscript->GetAI = &GetAI_boss_veklor; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp deleted file mode 100644 index 2bb9f1bfb0b..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/boss_viscidus.cpp +++ /dev/null @@ -1,30 +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_Viscidus -SD%Complete: 0 -SDComment: place holder -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_POISON_SHOCK 25993 -#define SPELL_POISONBOLT_VOLLEY 25991 - -#define SPELL_TOXIN_CLOUD 25989 - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h deleted file mode 100644 index 5d545ed7c74..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/def_temple_of_ahnqiraj.h +++ /dev/null @@ -1,23 +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_TEMPLE_OF_AHNQIRAJ_H -#define DEF_TEMPLE_OF_AHNQIRAJ_H - -#define DATA_SKERAM 1 -#define DATA_KRI 2 -#define DATA_VEM 3 -#define DATA_VEMISDEAD 4 -#define DATA_VEM_DEATH 5 -#define DATA_VEKLOR 6 -#define DATA_VEKLORISDEAD 7 -#define DATA_VEKLOR_DEATH 8 -#define DATA_VEKNILASH 9 -#define DATA_VEKNILASHISDEAD 10 -#define DATA_VEKNILASH_DEATH 11 -#define DATA_BUG_TRIO_DEATH 14 - -#define DATA_CTHUN_PHASE 20 -#endif - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp deleted file mode 100644 index 489a415cf81..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/instance_temple_of_ahnqiraj.cpp +++ /dev/null @@ -1,166 +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_Temple_of_Ahnqiraj -SD%Complete: 80 -SDComment: -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" -#include "def_temple_of_ahnqiraj.h" - -struct TRINITY_DLL_DECL instance_temple_of_ahnqiraj : public ScriptedInstance -{ - instance_temple_of_ahnqiraj(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - //If Vem is dead... - bool IsBossDied[3]; - - //Storing Skeram, Vem and Kri. - uint64 SkeramGUID; - uint64 VemGUID; - uint64 KriGUID; - uint64 VeklorGUID; - uint64 VeknilashGUID; - - uint32 BugTrioDeathCount; - - uint32 CthunPhase; - - void Initialize() - { - IsBossDied[0] = false; - IsBossDied[1] = false; - IsBossDied[2] = false; - - SkeramGUID = 0; - VemGUID = 0; - KriGUID = 0; - VeklorGUID = 0; - VeknilashGUID = 0; - - BugTrioDeathCount = 0; - - CthunPhase = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch (pCreature->GetEntry()) - { - case 15263: SkeramGUID = pCreature->GetGUID(); break; - case 15544: VemGUID = pCreature->GetGUID(); break; - case 15511: KriGUID = pCreature->GetGUID(); break; - case 15276: VeklorGUID = pCreature->GetGUID(); break; - case 15275: VeknilashGUID = pCreature->GetGUID(); break; - } - } - - bool IsEncounterInProgress() const - { - //not active in AQ40 - return false; - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_VEMISDEAD: - if (IsBossDied[0]) - return 1; - break; - - case DATA_VEKLORISDEAD: - if (IsBossDied[1]) - return 1; - break; - - case DATA_VEKNILASHISDEAD: - if (IsBossDied[2]) - return 1; - break; - - case DATA_BUG_TRIO_DEATH: - return BugTrioDeathCount; - - case DATA_CTHUN_PHASE: - return CthunPhase; - } - return 0; - } - - uint64 GetData64 (uint32 identifier) - { - switch(identifier) - { - case DATA_SKERAM: - return SkeramGUID; - case DATA_VEM: - return VemGUID; - case DATA_KRI: - return KriGUID; - case DATA_VEKLOR: - return VeklorGUID; - case DATA_VEKNILASH: - return VeknilashGUID; - } - return 0; - } // end GetData64 - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_VEM_DEATH: - IsBossDied[0] = true; - break; - - case DATA_BUG_TRIO_DEATH: - BugTrioDeathCount++; - break; - - case DATA_VEKLOR_DEATH: - IsBossDied[1] = true; - break; - - case DATA_VEKNILASH_DEATH: - IsBossDied[2] = true; - break; - - case DATA_CTHUN_PHASE: - CthunPhase = data; - break; - } - } -}; - -InstanceData* GetInstanceData_instance_temple_of_ahnqiraj(Map* pMap) -{ - return new instance_temple_of_ahnqiraj(pMap); -} - -void AddSC_instance_temple_of_ahnqiraj() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_temple_of_ahnqiraj"; - newscript->GetInstanceData = &GetInstanceData_instance_temple_of_ahnqiraj; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp b/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp deleted file mode 100644 index 35882b86ac7..00000000000 --- a/src/bindings/scripts/scripts/zone/temple_of_ahnqiraj/mob_anubisath_sentinel.cpp +++ /dev/null @@ -1,318 +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: mob_anubisath_sentinel -SD%Complete: 95 -SDComment: Shadow storm is not properly implemented in core it should only target ppl outside of melee range. -SDCategory: Temple of Ahn'Qiraj -EndScriptData */ - -#include "precompiled.h" -#include "WorldPacket.h" - -#include "Item.h" -#include "Player.h" -#include "Spell.h" - -#include "Cell.h" -#include "CellImpl.h" -#include "GridNotifiers.h" -#include "GridNotifiersImpl.h" - -#define SPELL_MENDING_BUFF 2147 - -#define SPELL_KNOCK_BUFF 21737 -#define SPELL_KNOCK 25778 -#define SPELL_MANAB_BUFF 812 -#define SPELL_MANAB 25779 - -#define SPELL_REFLECTAF_BUFF 13022 -#define SPELL_REFLECTSFr_BUFF 19595 -#define SPELL_THORNS_BUFF 25777 - -#define SPELL_THUNDER_BUFF 2834 -#define SPELL_THUNDER 8732 - -#define SPELL_MSTRIKE_BUFF 9347 -#define SPELL_MSTRIKE 24573 - -#define SPELL_STORM_BUFF 2148 -#define SPELL_STORM 26546 - -struct TRINITY_DLL_DECL aqsentinelAI; -class TRINITY_DLL_DECL SentinelAbilityAura : public Aura -{ - public: - ~SentinelAbilityAura(); - Unit* GetTriggerTarget() const; - SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry *spell, uint32 ability, uint32 eff); - protected: - aqsentinelAI *aOwner; - int32 currentBasePoints; - uint32 abilityId; -}; - -struct TRINITY_DLL_DECL aqsentinelAI : public ScriptedAI -{ - uint32 ability; - int abselected; - - void selectAbility(int asel) - { - switch (asel) - { - case 0: ability = SPELL_MENDING_BUFF;break; - case 1: ability = SPELL_KNOCK_BUFF;break; - case 2: ability = SPELL_MANAB_BUFF;break; - case 3: ability = SPELL_REFLECTAF_BUFF;break; - case 4: ability = SPELL_REFLECTSFr_BUFF;break; - case 5: ability = SPELL_THORNS_BUFF;break; - case 6: ability = SPELL_THUNDER_BUFF;break; - case 7: ability = SPELL_MSTRIKE_BUFF;break; - case 8: ability = SPELL_STORM_BUFF;break; - } - } - - aqsentinelAI(Creature *c) : ScriptedAI(c) - { - ClearBudyList(); - abselected = 0; // just initialization of variable - } - - Creature *nearby[3]; - - void ClearBudyList() - { - nearby[0] = nearby[1] = nearby[2] = NULL; - } - - void AddBuddyToList(Creature *c) - { - if (c==m_creature) - return; - for (int i=0; i<3; ++i) - { - if (nearby[i] == c) - return; - if (!nearby[i]) - { - nearby[i] = c; - return; - } - } - } - - void GiveBuddyMyList(Creature *c) - { - aqsentinelAI *cai = CAST_AI(aqsentinelAI, (c)->AI()); - for (int i=0; i<3; ++i) - if (nearby[i] && nearby[i]!=c) - cai->AddBuddyToList(nearby[i]); - cai->AddBuddyToList(m_creature); - } - - void SendMyListToBuddies() - { - for (int i=0; i<3; ++i) - if (nearby[i]) - GiveBuddyMyList(nearby[i]); - } - - void CallBuddiesToAttack(Unit *who) - { - for (int i=0; i<3; ++i) - { - Creature *c = nearby[i]; - if (c) - { - if (!c->isInCombat()) - { - c->SetNoCallAssistance(true); - if (c->AI()) - c->AI()->AttackStart(who); - } - } - } - } - - void AddSentinelsNear(Unit *nears) - { - std::list assistList; - m_creature->GetCreatureListWithEntryInGrid(assistList,15264,70.0f); - - if (assistList.empty()) - return; - - for(std::list::iterator iter = assistList.begin(); iter != assistList.end(); ++iter) - AddBuddyToList((*iter)); - } - - int pickAbilityRandom(bool *chosenAbilities) - { - for (int t = 0; t < 2; ++t) - { - for (int i = !t ? (rand()%9) : 0; i < 9; ++i) - { - if (!chosenAbilities[i]) - { - chosenAbilities[i] = true; - return i; - } - } - } - return 0; // should never happen - } - - void GetOtherSentinels(Unit *who) - { - bool *chosenAbilities = new bool[9]; - memset(chosenAbilities, 0, 9*sizeof(bool)); - selectAbility(pickAbilityRandom(chosenAbilities)); - - ClearBudyList(); - AddSentinelsNear(m_creature); - int bli; - for (bli = 0; bli < 3; ++bli) - { - if (!nearby[bli]) - break; - AddSentinelsNear(nearby[bli]); - CAST_AI(aqsentinelAI, nearby[bli]->AI())->gatherOthersWhenAggro = false; - CAST_AI(aqsentinelAI, nearby[bli]->AI())->selectAbility(pickAbilityRandom(chosenAbilities)); - } - /*if (bli < 3) - DoYell("I dont have enough buddies.", LANG_NEUTRAL, 0);*/ - SendMyListToBuddies(); - CallBuddiesToAttack(who); - - delete[] chosenAbilities; - } - - bool gatherOthersWhenAggro; - - void Reset() - { - if (!m_creature->isDead()) - { - for (int i=0; i<3; ++i) - { - if (!nearby[i]) - continue; - if (nearby[i]->isDead()) - nearby[i]->Respawn(); - } - } - ClearBudyList(); - gatherOthersWhenAggro = true; - } - - void GainSentinelAbility(uint32 id) - { - const SpellEntry *spell = GetSpellStore()->LookupEntry(id); - uint8 eff_mask=0; - for (int i=0; i<3; ++i) - { - if (!spell->Effect[i]) - continue; - eff_mask=1<AddAura(a); - } - - void EnterCombat(Unit *who) - { - if (gatherOthersWhenAggro) - GetOtherSentinels(who); - - GainSentinelAbility(ability); - DoZoneInCombat(); - } - - void JustDied(Unit* who) - { - for (int ni=0; ni<3; ++ni) - { - Creature *sent = nearby[ni]; - if (!sent) - continue; - if (sent->isDead()) - continue; - int h = sent->GetHealth() + (sent->GetMaxHealth() / 2); - if (h > sent->GetMaxHealth()) - h = sent->GetMaxHealth(); - sent->SetHealth(h); - CAST_AI(aqsentinelAI, sent->AI())->GainSentinelAbility(ability); - } - } - - Unit *GetHatedManaUser() - { - std::list::iterator i; - for (i = m_creature->getThreatManager().getThreatList().begin();i != m_creature->getThreatManager().getThreatList().end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - if (pUnit->getPowerType()==POWER_MANA) - return pUnit; - } - return NULL; - } -}; -CreatureAI* GetAI_mob_anubisath_sentinelAI(Creature* pCreature) -{ - return new aqsentinelAI (pCreature); -} - -void AddSC_mob_anubisath_sentinel() -{ - Script *newscript; - newscript = new Script; - newscript->Name="mob_anubisath_sentinel"; - newscript->GetAI = &GetAI_mob_anubisath_sentinelAI; - newscript->RegisterSelf(); -} - -SentinelAbilityAura::~SentinelAbilityAura() {} -Unit* SentinelAbilityAura::GetTriggerTarget() const -{ - switch (abilityId) - { - case SPELL_KNOCK_BUFF: - case SPELL_THUNDER_BUFF: - case SPELL_MSTRIKE_BUFF: - case SPELL_STORM_BUFF: - return aOwner->m_creature->getVictim(); - - case SPELL_MANAB_BUFF: - return aOwner->GetHatedManaUser(); - - case SPELL_MENDING_BUFF: - case SPELL_REFLECTAF_BUFF: - case SPELL_REFLECTSFr_BUFF: - case SPELL_THORNS_BUFF: - default: - return aOwner->m_creature; - } -} - -SentinelAbilityAura::SentinelAbilityAura(aqsentinelAI *abilityOwner, SpellEntry *spell, uint32 ability, uint32 eff) -: Aura(spell, eff, NULL, abilityOwner->m_creature, abilityOwner->m_creature, NULL) -{ - aOwner = abilityOwner; - abilityId = ability; -} - diff --git a/src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp b/src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp deleted file mode 100644 index 426b7fa2217..00000000000 --- a/src/bindings/scripts/scripts/zone/ungoro_crater/ungoro_crater.cpp +++ /dev/null @@ -1,210 +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: Ungoro Crater -SD%Complete: 100 -SDComment: Support for Quest: 4245 -SDCategory: Ungoro Crater -EndScriptData */ - -/* ContentData -npc_a-me -EndContentData */ - -#include "precompiled.h" -#include "escortAI.h" - -#define SAY_READY -1000200 -#define SAY_AGGRO1 -1000201 -#define SAY_SEARCH -1000202 -#define SAY_AGGRO2 -1000203 -#define SAY_AGGRO3 -1000204 -#define SAY_FINISH -1000205 - -#define SPELL_DEMORALIZINGSHOUT 13730 - -#define QUEST_CHASING_AME 4245 -#define ENTRY_TARLORD 6519 -#define ENTRY_TARLORD1 6519 -#define ENTRY_STOMPER 6513 - - -struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI -{ - npc_ameAI(Creature *c) : npc_escortAI(c) {} - - uint32 DEMORALIZINGSHOUT_Timer; - - void WaypointReached(uint32 i) - { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - - if (!pPlayer) - return; - - switch (i) - { - - case 19: - m_creature->SummonCreature(ENTRY_STOMPER, -6391.69, -1730.49, -272.83, 4.96, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO1, m_creature, pPlayer); - break; - case 28: - DoScriptText(SAY_SEARCH, m_creature, pPlayer); - break; - case 38: - m_creature->SummonCreature(ENTRY_TARLORD, -6370.75, -1382.84, -270.51, 6.06, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO2, m_creature, pPlayer); - break; - case 49: - m_creature->SummonCreature(ENTRY_TARLORD1, -6324.44, -1181.05, -270.17, 4.34, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - DoScriptText(SAY_AGGRO3, m_creature, pPlayer); - break; - case 55: - DoScriptText(SAY_FINISH, m_creature, pPlayer); - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_CHASING_AME,m_creature); - break; - - } - } - - void Reset() - { - DEMORALIZINGSHOUT_Timer = 5000; - } - - void EnterCombat(Unit* who) - {} - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void JustDied(Unit* killer) - { - if (PlayerGUID) - { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - CAST_PLR(pPlayer)->FailQuest(QUEST_CHASING_AME); - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - if (!UpdateVictim()) - return; - - if (DEMORALIZINGSHOUT_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_DEMORALIZINGSHOUT); - DEMORALIZINGSHOUT_Timer = 70000; - }else DEMORALIZINGSHOUT_Timer -= diff; - - } -}; - -bool QuestAccept_npc_ame(Player* pPlayer, Creature* pCreature, Quest const* quest) -{ - if (quest->GetQuestId() == QUEST_CHASING_AME) - { - CAST_AI(npc_escortAI, (pCreature->AI()))->Start(false, false, pPlayer->GetGUID()); - DoScriptText(SAY_READY, pCreature, pPlayer); - pCreature->SetUInt32Value(UNIT_FIELD_BYTES_1,0); - // Change faction so mobs attack - pCreature->setFaction(113); - } - return true; -} - -CreatureAI* GetAI_npc_ame(Creature* pCreature) -{ - npc_ameAI* thisAI = new npc_ameAI(pCreature); - - thisAI->AddWaypoint(1, -6380.38, -1965.14, -258.292, 5000); - thisAI->AddWaypoint(2, -6383.06, -1962.9, -258.936); - thisAI->AddWaypoint(3, -6391.09, -1956.13, -260.291); - thisAI->AddWaypoint(4, -6395.29, -1933.58, -262.949); - thisAI->AddWaypoint(5, -6396.58, -1919.93, -263.838); - thisAI->AddWaypoint(6, -6389.01, -1912.64, -260.689); - thisAI->AddWaypoint(7, -6369.19, -1892.87, -255.924); - thisAI->AddWaypoint(8, -6373.77, -1879.36, -259.268); - thisAI->AddWaypoint(9, -6377.55, -1869.56, -260.503); - thisAI->AddWaypoint(10, -6376.58, -1860.79, -260.026); - thisAI->AddWaypoint(11, -6373.13, -1847.22, -259.249); - thisAI->AddWaypoint(12, -6370.54, -1837.04, -260.007); - thisAI->AddWaypoint(13, -6372.52, -1829.16, -260.071); - thisAI->AddWaypoint(14, -6377.13, -1815.94, -262.632); - thisAI->AddWaypoint(15, -6380.27, -1806.95, -265.53); - thisAI->AddWaypoint(16, -6386.04, -1790.43, -268.546); - thisAI->AddWaypoint(17, -6386.72, -1776.29, -269.851); - thisAI->AddWaypoint(18, -6385.92, -1762.31, -271.494); - thisAI->AddWaypoint(19, -6384.69, -1744.86, -272.196); - thisAI->AddWaypoint(20, -6383.8, -1732.66, -272.222); - thisAI->AddWaypoint(21, -6382.66, -1716.96, -272.235); - thisAI->AddWaypoint(22, -6381.5, -1703.01, -272.964); - thisAI->AddWaypoint(23, -6379.96, -1685.58, -272.842); - thisAI->AddWaypoint(24, -6379.34, -1678.61, -272.34); - thisAI->AddWaypoint(25, -6364.45, -1636.27, -271.065); - thisAI->AddWaypoint(26, -6371.85, -1626.36, -272.188); - thisAI->AddWaypoint(27, -6383.5, -1629.01, -272.206); - thisAI->AddWaypoint(28, -6388.09, -1635.37, -272.105, 5000); - thisAI->AddWaypoint(29, -6375.42, -1637.33, -272.193); - thisAI->AddWaypoint(30, -6365.46, -1617.25, -272.141); - thisAI->AddWaypoint(31, -6353.79, -1603.48, -271.932); - thisAI->AddWaypoint(32, -6340.24, -1592.41, -269.435); - thisAI->AddWaypoint(33, -6329.45, -1566.89, -269.895); - thisAI->AddWaypoint(34, -6312.2, -1499.06, -269.507); - thisAI->AddWaypoint(35, -6304.55, -1468.5, -269.431); - thisAI->AddWaypoint(36, -6310.36, -1440.94, -268.427); - thisAI->AddWaypoint(37, -6321, -1418.91, -266.525); - thisAI->AddWaypoint(38, -6358.76, -1389.97, -267.522); - thisAI->AddWaypoint(39, -6378.65, -1375.67, -271.749); - thisAI->AddWaypoint(40, -6387.22, -1360.95, -272.109); - thisAI->AddWaypoint(41, -6406.95, -1323.87, -271.586); - thisAI->AddWaypoint(42, -6405, -1311.92, -271.906); - thisAI->AddWaypoint(43, -6395.56, -1303.62, -271.902); - thisAI->AddWaypoint(44, -6375.97, -1296.08, -271.865); - thisAI->AddWaypoint(45, -6364.39, -1281.23, -269.012); - thisAI->AddWaypoint(46, -6353.71, -1263.19, -267.95); - thisAI->AddWaypoint(47, -6340.09, -1248.65, -267.441); - thisAI->AddWaypoint(48, -6338.21, -1237.11, -267.844); - thisAI->AddWaypoint(49, -6336.6, -1219.69, -269.196); - thisAI->AddWaypoint(50, -6334.44, -1202.33, -271.527); - thisAI->AddWaypoint(51, -6329.56, -1189.82, -270.947); - thisAI->AddWaypoint(52, -6324.66, -1179.46, -270.103); - thisAI->AddWaypoint(53, -6315.08, -1176.74, -269.735); - thisAI->AddWaypoint(54, -6308.49, -1179.12, -269.57); - thisAI->AddWaypoint(55, -6302.43, -1181.32, -269.328, 5000); - thisAI->AddWaypoint(56, -6298.87, -1185.79, -269.278); - - return thisAI; -} - -void AddSC_ungoro_crater() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_ame"; - newscript->GetAI = &GetAI_npc_ame; - newscript->pQuestAccept = &QuestAccept_npc_ame; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/wailing_caverns/def_wailing_caverns.h b/src/bindings/scripts/scripts/zone/wailing_caverns/def_wailing_caverns.h deleted file mode 100644 index ee03ade365e..00000000000 --- a/src/bindings/scripts/scripts/zone/wailing_caverns/def_wailing_caverns.h +++ /dev/null @@ -1,24 +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_WAILING_CAVERNS_H -#define DEF_WAILING_CAVERNS_H - -enum -{ - TYPE_LORD_COBRAHN = 1, - TYPE_LORD_PYTHAS = 2, - TYPE_LADY_ANACONDRA = 3, - TYPE_LORD_SERPENTIS = 4, - TYPE_NARALEX_EVENT = 5, - TYPE_NARALEX_PART1 = 6, - TYPE_NARALEX_PART2 = 7, - TYPE_NARALEX_PART3 = 8, - TYPE_MUTANUS_THE_DEVOURER = 9, - TYPE_NARALEX_YELLED = 10, - - DATA_NARALEX = 3679, -}; - -#endif \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp b/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp deleted file mode 100644 index e535a20a2c1..00000000000 --- a/src/bindings/scripts/scripts/zone/wailing_caverns/instance_wailing_caverns.cpp +++ /dev/null @@ -1,142 +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_Wailing_Caverns -SD%Complete: 99 -SDComment: Everything seems to work, still need some checking -SDCategory: Wailing Caverns -EndScriptData */ - -#include "precompiled.h" -#include "def_wailing_caverns.h" - -#define MAX_ENCOUNTER 9 - -struct TRINITY_DLL_DECL instance_wailing_caverns : public ScriptedInstance -{ - instance_wailing_caverns(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - bool yelled; - uint64 NaralexGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - yelled = false; - NaralexGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (pCreature->GetEntry() == DATA_NARALEX) - NaralexGUID = pCreature->GetGUID(); - } - - void SetData(uint32 type, uint32 data) - { - switch (type) - { - case TYPE_LORD_COBRAHN: m_auiEncounter[0] = data;break; - case TYPE_LORD_PYTHAS: m_auiEncounter[1] = data;break; - case TYPE_LADY_ANACONDRA: m_auiEncounter[2] = data;break; - case TYPE_LORD_SERPENTIS: m_auiEncounter[3] = data;break; - case TYPE_NARALEX_EVENT: m_auiEncounter[4] = data;break; - case TYPE_NARALEX_PART1: m_auiEncounter[5] = data;break; - case TYPE_NARALEX_PART2: m_auiEncounter[6] = data;break; - case TYPE_NARALEX_PART3: m_auiEncounter[7] = data;break; - case TYPE_MUTANUS_THE_DEVOURER: m_auiEncounter[8] = data;break; - case TYPE_NARALEX_YELLED: yelled = true; break; - } - if (data == DONE)SaveToDB(); - } - - uint32 GetData(uint32 type) - { - switch (type) - { - case TYPE_LORD_COBRAHN: return m_auiEncounter[0]; - case TYPE_LORD_PYTHAS: return m_auiEncounter[1]; - case TYPE_LADY_ANACONDRA: return m_auiEncounter[2]; - case TYPE_LORD_SERPENTIS: return m_auiEncounter[3]; - case TYPE_NARALEX_EVENT: return m_auiEncounter[4]; - case TYPE_NARALEX_PART1: return m_auiEncounter[5]; - case TYPE_NARALEX_PART2: return m_auiEncounter[6]; - case TYPE_NARALEX_PART3: return m_auiEncounter[7]; - case TYPE_MUTANUS_THE_DEVOURER: return m_auiEncounter[8]; - case TYPE_NARALEX_YELLED: return yelled; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - if (data == DATA_NARALEX)return NaralexGUID; - return 0; - } - - std::string GetSaveData() - { - 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]; - - 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 >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] - >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] >> m_auiEncounter[7] >> m_auiEncounter[8]; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] != DONE) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } - -}; - -InstanceData* GetInstanceData_instance_wailing_caverns(Map* pMap) -{ - return new instance_wailing_caverns(pMap); -} - -void AddSC_instance_wailing_caverns() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_wailing_caverns"; - newscript->GetInstanceData = &GetInstanceData_instance_wailing_caverns; - newscript->RegisterSelf(); -} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/wailing_caverns/wailing_caverns.cpp b/src/bindings/scripts/scripts/zone/wailing_caverns/wailing_caverns.cpp deleted file mode 100644 index 622800127db..00000000000 --- a/src/bindings/scripts/scripts/zone/wailing_caverns/wailing_caverns.cpp +++ /dev/null @@ -1,411 +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: Wailing Caverns -SD%Complete: 95 -SDComment: Need to add skill usage for Disciple of Naralex -SDCategory: Wailing Caverns -EndScriptData */ - -/* ContentData -EndContentData */ - -#include "precompiled.h" -#include "escortAI.h" -#include "def_wailing_caverns.h" - -/*###### -## npc_disciple_of_naralex -######*/ - -enum -{ - //say - SAY_MAKE_PREPARATIONS = -1043001, - SAY_TEMPLE_OF_PROMISE = -1043002, - SAY_MUST_CONTINUE = -1043003, - SAY_BANISH_THE_SPIRITS = -1043004, - SAY_CAVERNS_PURIFIED = -1043005, - SAY_BEYOND_THIS_CORRIDOR = -1043006, - SAY_EMERALD_DREAM = -1043007, - SAY_MUTANUS_THE_DEVOURER = -1043012, - SAY_NARALEX_AWAKES = -1043014, - SAY_THANK_YOU = -1043015, - SAY_FAREWELL = -1043016, - SAY_ATTACKED = -1043017, - //yell - SAY_AT_LAST = -1043000, - SAY_I_AM_AWAKE = -1043013, - //emote - EMOTE_AWAKENING_RITUAL = -1043008, - EMOTE_TROUBLED_SLEEP = -1043009, - EMOTE_WRITHE_IN_AGONY = -1043010, - EMOTE_HORRENDOUS_VISION = -1043011, - //spell - SPELL_MARK_OF_THE_WILD_RANK_2 = 5232, - SPELL_SERPENTINE_CLEANSING = 6270, - SPELL_NARALEXS_AWAKENING = 6271, - SPELL_FLIGHT_FORM = 33943, - //npc entry - NPC_DEVIATE_RAVAGER = 3636, - NPC_DEVIATE_VIPER = 5755, - NPC_DEVIATE_MOCCASIN = 5762, - NPC_NIGHTMARE_ECTOPLASM = 5763, - NPC_MUTANUS_THE_DEVOURER = 3654, -}; - -#define GOSSIP_ID_START_1 698 //Naralex sleeps again! -#define GOSSIP_ID_START_2 699 //The fanglords are dead! -#define GOSSIP_ITEM_NARALEX "Let the event begin!" -#define ACHIEVEMENT_WAILING_CAVERNS 630 - -struct TRINITY_DLL_DECL npc_disciple_of_naralexAI : public npc_escortAI -{ - npc_disciple_of_naralexAI(Creature *c) : npc_escortAI(c) - { - pInstance = c->GetInstanceData(); - eventTimer = 0; - currentEvent = 0; - eventProgress = 0; - m_creature->setActive(true); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - } - - uint32 eventTimer; - uint32 currentEvent; - uint32 eventProgress; - ScriptedInstance *pInstance; - - void WaypointReached(uint32 i) - { - if (!pInstance) - return; - - switch (i) - { - case 4: - eventProgress = 1; - currentEvent = TYPE_NARALEX_PART1; - pInstance->SetData(TYPE_NARALEX_PART1, IN_PROGRESS); - break; - case 5: - DoScriptText(SAY_MUST_CONTINUE, m_creature); - pInstance->SetData(TYPE_NARALEX_PART1, DONE); - break; - case 11: - eventProgress = 1; - currentEvent = TYPE_NARALEX_PART2; - pInstance->SetData(TYPE_NARALEX_PART2, IN_PROGRESS); - break; - case 19: - DoScriptText(SAY_BEYOND_THIS_CORRIDOR, m_creature); - break; - case 24: - eventProgress = 1; - currentEvent = TYPE_NARALEX_PART3; - pInstance->SetData(TYPE_NARALEX_PART3, IN_PROGRESS); - break; - } - } - - void Reset() - { - - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_ATTACKED, m_creature, who); - } - - void JustDied(Unit *slayer) - { - if (pInstance) - { - pInstance->SetData(TYPE_NARALEX_EVENT, FAIL); - pInstance->SetData(TYPE_NARALEX_PART1, FAIL); - pInstance->SetData(TYPE_NARALEX_PART2, FAIL); - pInstance->SetData(TYPE_NARALEX_PART3, FAIL); - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AI()->AttackStart(m_creature); - } - - void EnterEvadeMode() - { - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(false);//do not interrupt channeling - m_creature->SetLootRecipient(NULL); - if (GetIsBeingEscorted()) - { - SetReturning(true); - ReturnToLastPoint(); - debug_log("TSCR: EscortAI (EnterEvadeMode() Override) has left combat and is now returning to last point"); - } - else - m_creature->GetMotionMaster()->MoveTargetedHome(); - } - - void UpdateAI(const uint32 diff) - { - if (currentEvent != TYPE_NARALEX_PART3) - npc_escortAI::UpdateAI(diff); - - if (!pInstance) - return; - if (eventTimer <= diff) - { - eventTimer = 0; - if (pInstance->GetData(currentEvent) == IN_PROGRESS) - { - switch (currentEvent) - { - case TYPE_NARALEX_PART1: - if (eventProgress == 1) - { - eventProgress++; - DoScriptText(SAY_TEMPLE_OF_PROMISE, m_creature); - m_creature->SummonCreature(NPC_DEVIATE_RAVAGER, -82.1763, 227.874, -93.3233, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); - m_creature->SummonCreature(NPC_DEVIATE_RAVAGER, -72.9506, 216.645, -93.6756, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); - } - break; - case TYPE_NARALEX_PART2: - if (eventProgress == 1) - { - eventProgress++; - DoScriptText(SAY_BANISH_THE_SPIRITS, m_creature); - DoCast(m_creature, SPELL_SERPENTINE_CLEANSING); - //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(false); - eventTimer = 30000; - m_creature->SummonCreature(NPC_DEVIATE_VIPER, -61.5261, 273.676, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); - m_creature->SummonCreature(NPC_DEVIATE_VIPER, -58.4658, 280.799, -92.8393, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); - m_creature->SummonCreature(NPC_DEVIATE_VIPER, -50.002, 278.578, -92.8442, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); - } - else - if (eventProgress == 2) - { - //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(true); - DoScriptText(SAY_CAVERNS_PURIFIED, m_creature); - pInstance->SetData(TYPE_NARALEX_PART2, DONE); - if (m_creature->HasAura(SPELL_SERPENTINE_CLEANSING)) - m_creature->RemoveAura(SPELL_SERPENTINE_CLEANSING); - } - break; - case TYPE_NARALEX_PART3: - if (eventProgress == 1) - { - eventProgress++; - eventTimer = 4000; - m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); - DoScriptText(SAY_EMERALD_DREAM, m_creature); - } - else - if (eventProgress == 2) - { - eventProgress++; - eventTimer = 15000; - //CAST_AI(npc_escortAI, m_creature->AI())->SetCanDefend(false); - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - DoCast(naralex, SPELL_NARALEXS_AWAKENING, true); - DoScriptText(EMOTE_AWAKENING_RITUAL, m_creature); - } - else - if (eventProgress == 3) - { - eventProgress++; - eventTimer = 15000; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - DoScriptText(EMOTE_TROUBLED_SLEEP, naralex); - m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 135.943, 199.701, -103.529, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 151.08, 221.13, -103.609, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_DEVIATE_MOCCASIN, 128.007, 227.428, -97.421, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - } - else - if (eventProgress == 4) - { - eventProgress++; - eventTimer = 30000; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - DoScriptText(EMOTE_WRITHE_IN_AGONY, naralex); - m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 133.413, 207.188, -102.469, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 142.857, 218.645, -102.905, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 105.102, 227.211, -102.752, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 153.372, 235.149, -102.826, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 149.524, 251.113, -102.558, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 136.208, 266.466, -102.977, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - m_creature->SummonCreature(NPC_NIGHTMARE_ECTOPLASM, 126.167, 274.759, -102.962, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 15000); - } - else - if (eventProgress == 5) - { - eventProgress++; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - DoScriptText(EMOTE_HORRENDOUS_VISION, naralex); - m_creature->SummonCreature(NPC_MUTANUS_THE_DEVOURER, 150.872, 262.905, -103.503, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 300000); - DoScriptText(SAY_MUTANUS_THE_DEVOURER, m_creature); - pInstance->SetData(TYPE_MUTANUS_THE_DEVOURER, IN_PROGRESS); - } - else - if (eventProgress == 6 && pInstance->GetData(TYPE_MUTANUS_THE_DEVOURER) == DONE) - { - eventProgress++; - eventTimer = 3000; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - { - AchievementEntry const *AchievWC = GetAchievementStore()->LookupEntry(ACHIEVEMENT_WAILING_CAVERNS); - if (AchievWC) - { - Map* pMap = m_creature->GetMap(); - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &players = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - itr->getSource()->CompletedAchievement(AchievWC); - } - } - if (m_creature->HasAura(SPELL_NARALEXS_AWAKENING)) - m_creature->RemoveAura(SPELL_NARALEXS_AWAKENING); - naralex->SetStandState(UNIT_STAND_STATE_STAND); - DoScriptText(SAY_I_AM_AWAKE, naralex); - } - DoScriptText(SAY_NARALEX_AWAKES, m_creature); - } - else - if (eventProgress == 7) - { - eventProgress++; - eventTimer = 6000; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - DoScriptText(SAY_THANK_YOU, naralex); - } - else - if (eventProgress == 8) - { - eventProgress++; - eventTimer = 8000; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - { - DoScriptText(SAY_FAREWELL, naralex); - naralex->AddAura(SPELL_FLIGHT_FORM, naralex); - } - SetRun(); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->AddAura(SPELL_FLIGHT_FORM, m_creature); - } - else - if (eventProgress == 9) - { - eventProgress++; - eventTimer = 1500; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - naralex->GetMotionMaster()->MovePoint(25, naralex->GetPositionX(), naralex->GetPositionY(), naralex->GetPositionZ()); - } - else - if (eventProgress == 10) - { - eventProgress++; - eventTimer = 2500; - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - { - naralex->GetMotionMaster()->MovePoint(0, 117.095512, 247.107971, -96.167870); - naralex->GetMotionMaster()->MovePoint(1, 90.388809, 276.135406, -83.389801); - } - m_creature->GetMotionMaster()->MovePoint(26, 117.095512, 247.107971, -96.167870); - m_creature->GetMotionMaster()->MovePoint(27, 144.375443, 281.045837, -82.477135); - } - else - if (eventProgress == 11) - { - if (Creature* naralex = pInstance->instance->GetCreature(pInstance->GetData64(DATA_NARALEX))) - naralex->SetVisibility(VISIBILITY_OFF); - m_creature->SetVisibility(VISIBILITY_OFF); - pInstance->SetData(TYPE_NARALEX_PART3, DONE); - } - break; - } - } - }else eventTimer -= diff; - } -}; - -CreatureAI* GetAI_npc_disciple_of_naralex(Creature* pCreature) -{ - return new npc_disciple_of_naralexAI(pCreature); -} - -bool GossipHello_npc_disciple_of_naralex(Player* pPlayer, Creature* pCreature) -{ - ScriptedInstance *pInstance = (pCreature->GetInstanceData()); - - if (pInstance) - { - pCreature->CastSpell(pPlayer, SPELL_MARK_OF_THE_WILD_RANK_2, true); - if ((pInstance->GetData(TYPE_LORD_COBRAHN) == DONE) && (pInstance->GetData(TYPE_LORD_PYTHAS) == DONE) && - (pInstance->GetData(TYPE_LADY_ANACONDRA) == DONE) && (pInstance->GetData(TYPE_LORD_SERPENTIS) == DONE)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_NARALEX, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_START_2, pCreature->GetGUID()); - - if (!pInstance->GetData(TYPE_NARALEX_YELLED)) - { - DoScriptText(SAY_AT_LAST, pCreature); - pInstance->SetData(TYPE_NARALEX_YELLED, 1); - } - } - else - { - pPlayer->SEND_GOSSIP_MENU(GOSSIP_ID_START_1, pCreature->GetGUID()); - } - } - return true; -} - -bool GossipSelect_npc_disciple_of_naralex(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - ScriptedInstance *pInstance = (pCreature->GetInstanceData()); - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - if (pInstance)pInstance->SetData(TYPE_NARALEX_EVENT, IN_PROGRESS); - - DoScriptText(SAY_MAKE_PREPARATIONS, pCreature); - - pCreature->setFaction(250); - pCreature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - - CAST_AI(npc_escortAI, (pCreature->AI()))->Start(false, false, pPlayer->GetGUID()); - CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtFar(false); - CAST_AI(npc_escortAI, (pCreature->AI()))->SetDespawnAtEnd(false); - } - return true; -} - -void AddSC_wailing_caverns() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_disciple_of_naralex"; - newscript->pGossipHello = &GossipHello_npc_disciple_of_naralex; - newscript->pGossipSelect = &GossipSelect_npc_disciple_of_naralex; - newscript->GetAI = &GetAI_npc_disciple_of_naralex; - newscript->RegisterSelf(); -} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp b/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp deleted file mode 100644 index 4e630368db1..00000000000 --- a/src/bindings/scripts/scripts/zone/zulfarrak/zulfarrak.cpp +++ /dev/null @@ -1,223 +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: Zulfarrak -SD%Complete: 50 -SDComment: Consider it temporary, no instance script made for this instance yet. -SDCategory: Zul'Farrak -EndScriptData */ - -/* ContentData -npc_sergeant_bly -npc_weegli_blastfuse -EndContentData */ - -#include "precompiled.h" - -/*###### -## npc_sergeant_bly -######*/ - -#define FACTION_HOSTILE 14 -#define FACTION_FRIENDLY 35 - -#define SPELL_SHIELD_BASH 11972 -#define SPELL_REVENGE 12170 - -#define GOSSIP_BLY "[PH] In that case, i will take my reward!" - -struct TRINITY_DLL_DECL npc_sergeant_blyAI : public ScriptedAI -{ - npc_sergeant_blyAI(Creature *c) : ScriptedAI(c) - { - //pInstance = c->GetInstanceData(); - } - - //ScriptedInstance* pInstance; - - uint32 ShieldBash_Timer; - uint32 Revenge_Timer; //this is wrong, spell should never be used unless m_creature->getVictim() dodge, parry or block attack. Trinity support required. - - void Reset() - { - ShieldBash_Timer = 5000; - Revenge_Timer = 8000; - - m_creature->setFaction(FACTION_FRIENDLY); - - /*if (pInstance) - pInstance->SetData(0, NOT_STARTED);*/ - } - - void EnterCombat(Unit *who) - { - /*if (pInstance) - pInstance->SetData(0, IN_PROGRESS);*/ - } - - void JustDied(Unit *victim) - { - /*if (pInstance) - pInstance->SetData(0, DONE);*/ - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ShieldBash_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SHIELD_BASH); - ShieldBash_Timer = 15000; - }else ShieldBash_Timer -= diff; - - if (Revenge_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_REVENGE); - Revenge_Timer = 10000; - }else Revenge_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_npc_sergeant_bly(Creature* pCreature) -{ - return new npc_sergeant_blyAI (pCreature); -} - -bool GossipHello_npc_sergeant_bly(Player* pPlayer, Creature* pCreature) -{ - /*if (pInstance->GetData(0) == DONE) - {*/ - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_BLY, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(1517, pCreature->GetGUID()); - /*} - else if (pInstance->GetData(0) == IN_PROGRESS) - pPlayer->SEND_GOSSIP_MENU(1516, pCreature->GetGUID()); - else - pPlayer->SEND_GOSSIP_MENU(1515, pCreature->GetGUID());*/ - - return true; -} - -bool GossipSelect_npc_sergeant_bly(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - pCreature->setFaction(FACTION_HOSTILE); - CAST_AI(npc_sergeant_blyAI, pCreature->AI())->AttackStart(pPlayer); - } - return true; -} - -/*###### -## npc_weegli_blastfuse -######*/ - -#define SPELL_BOMB 8858 -#define SPELL_GOBLIN_LAND_MINE 21688 -#define SPELL_SHOOT 6660 -#define SPELL_WEEGLIS_BARREL 10772 - -#define GOSSIP_WEEGLI "[PH] Please blow up the door." - -struct TRINITY_DLL_DECL npc_weegli_blastfuseAI : public ScriptedAI -{ - npc_weegli_blastfuseAI(Creature *c) : ScriptedAI(c) - { - //pInstance = c->GetInstanceData(); - } - - //ScriptedInstance* pInstance; - - void Reset() - { - /*if (pInstance) - pInstance->SetData(0, NOT_STARTED);*/ - } - - void EnterCombat(Unit *who) - { - /*if (pInstance) - pInstance->SetData(0, IN_PROGRESS);*/ - } - - void JustDied(Unit *victim) - { - /*if (pInstance) - pInstance->SetData(0, DONE);*/ - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_npc_weegli_blastfuse(Creature* pCreature) -{ - return new npc_weegli_blastfuseAI (pCreature); -} - -bool GossipHello_npc_weegli_blastfuse(Player* pPlayer, Creature* pCreature) -{ - //event not implemented yet, this is only placeholder for future developement - /*if (pInstance->GetData(0) == DONE) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_WEEGLI, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->SEND_GOSSIP_MENU(1514, pCreature->GetGUID());//if event can proceed to end - } - else if (pInstance->GetData(0) == IN_PROGRESS) - pPlayer->SEND_GOSSIP_MENU(1513, pCreature->GetGUID());//if event are in progress - else*/ - pPlayer->SEND_GOSSIP_MENU(1511, pCreature->GetGUID()); //if event not started - return true; -} - -bool GossipSelect_npc_weegli_blastfuse(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF+1) - { - pPlayer->CLOSE_GOSSIP_MENU(); - //here we make him run to door, set the charge and run away off to nowhere - } - return true; -} - -void AddSC_zulfarrak() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_sergeant_bly"; - newscript->GetAI = &GetAI_npc_sergeant_bly; - newscript->pGossipHello = &GossipHello_npc_sergeant_bly; - newscript->pGossipSelect = &GossipSelect_npc_sergeant_bly; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_weegli_blastfuse"; - newscript->GetAI = &GetAI_npc_weegli_blastfuse; - newscript->pGossipHello = &GossipHello_npc_weegli_blastfuse; - newscript->pGossipSelect = &GossipSelect_npc_weegli_blastfuse; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 49d2aa8bb7e..6f49b54a515 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -164,6 +164,7 @@ extern void AddSC_boss_hazzarah(); extern void AddSC_boss_renataki(); extern void AddSC_boss_wushoolay(); extern void AddSC_instance_zulgurub(); + //extern void AddSC_alterac_mountains(); extern void AddSC_arathi_highlands(); extern void AddSC_blasted_lands(); @@ -189,6 +190,46 @@ extern void AddSC_western_plaguelands(); extern void AddSC_westfall(); //kalimdor +extern void AddSC_instance_blackfathom_deeps(); //Blackfathom Depths +extern void AddSC_hyjal(); //CoT Battle for Mt. Hyjal +extern void AddSC_boss_archimonde(); +extern void AddSC_instance_mount_hyjal(); +extern void AddSC_hyjal_trash(); +extern void AddSC_boss_rage_winterchill(); +extern void AddSC_boss_anetheron(); +extern void AddSC_boss_kazrogal(); +extern void AddSC_boss_azgalor(); +extern void AddSC_boss_captain_skarloc(); //CoT Old Hillsbrad +extern void AddSC_boss_epoch_hunter(); +extern void AddSC_boss_lieutenant_drake(); +extern void AddSC_instance_old_hillsbrad(); +extern void AddSC_old_hillsbrad(); +extern void AddSC_boss_aeonus(); //CoT The Dark Portal +extern void AddSC_boss_chrono_lord_deja(); +extern void AddSC_boss_temporus(); +extern void AddSC_dark_portal(); +extern void AddSC_instance_dark_portal(); +extern void AddSC_boss_celebras_the_cursed(); //Maraudon +extern void AddSC_boss_landslide(); +extern void AddSC_boss_noxxion(); +extern void AddSC_boss_ptheradras(); +extern void AddSC_boss_onyxia(); //Onyxia's Lair +extern void AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs +extern void AddSC_razorfen_downs(); +extern void AddSC_razorfen_kraul(); //Razorfen Kraul +extern void AddSC_boss_cthun(); //Temple of ahn'qiraj +extern void AddSC_boss_fankriss(); +extern void AddSC_boss_huhuran(); +extern void AddSC_bug_trio(); +extern void AddSC_boss_sartura(); +extern void AddSC_boss_skeram(); +extern void AddSC_boss_twinemperors(); +extern void AddSC_mob_anubisath_sentinel(); +extern void AddSC_instance_temple_of_ahnqiraj(); +extern void AddSC_wailing_caverns(); //Wailing caverns +extern void AddSC_instance_wailing_caverns(); +extern void AddSC_zulfarrak(); //Zul'Farrak + extern void AddSC_ashenvale(); extern void AddSC_azshara(); extern void AddSC_azuremyst_isle(); @@ -272,34 +313,6 @@ extern void AddSC_boss_najentus(); extern void AddSC_boss_illidari_council(); extern void AddSC_instance_black_temple(); -//Blackfathom Depths -extern void AddSC_instance_blackfathom_deeps(); - -//Caverns of Time -//--Battle for Mt. Hyjal -extern void AddSC_hyjal(); -extern void AddSC_boss_archimonde(); -extern void AddSC_instance_mount_hyjal(); -extern void AddSC_hyjal_trash(); -extern void AddSC_boss_rage_winterchill(); -extern void AddSC_boss_anetheron(); -extern void AddSC_boss_kazrogal(); -extern void AddSC_boss_azgalor(); - -//--Old Hillsbrad -extern void AddSC_boss_captain_skarloc(); -extern void AddSC_boss_epoch_hunter(); -extern void AddSC_boss_lieutenant_drake(); -extern void AddSC_instance_old_hillsbrad(); -extern void AddSC_old_hillsbrad(); - -//--The Dark Portal -extern void AddSC_boss_aeonus(); -extern void AddSC_boss_chrono_lord_deja(); -extern void AddSC_boss_temporus(); -extern void AddSC_dark_portal(); -extern void AddSC_instance_dark_portal(); - //Coilfang Resevoir //--Serpent Shrine Cavern extern void AddSC_boss_fathomlord_karathress(); @@ -350,12 +363,6 @@ extern void AddSC_boss_omor_the_unscarred(); extern void AddSC_boss_vazruden_the_herald(); extern void AddSC_instance_ramparts(); -//Maraudon -extern void AddSC_boss_celebras_the_cursed(); -extern void AddSC_boss_landslide(); -extern void AddSC_boss_noxxion(); -extern void AddSC_boss_ptheradras(); - //Naxxramas extern void AddSC_boss_anubrekhan(); extern void AddSC_boss_maexxna(); @@ -390,17 +397,6 @@ extern void AddSC_instance_nexus(); extern void AddSC_boss_sartharion(); extern void AddSC_instance_obsidian_sanctum(); -//Onyxia's Lair -extern void AddSC_boss_onyxia(); - -//Ragefire Chasm -//Razorfen Downs -extern void AddSC_boss_amnennar_the_coldbringer(); -extern void AddSC_razorfen_downs(); - -//Razorfen Kraul -extern void AddSC_razorfen_kraul(); - //Tempest Keep //--Arcatraz extern void AddSC_arcatraz(); @@ -426,16 +422,6 @@ extern void AddSC_boss_nethermancer_sepethrea(); extern void AddSC_boss_pathaleon_the_calculator(); extern void AddSC_instance_mechanar(); -//Temple of ahn'qiraj -extern void AddSC_boss_cthun(); -extern void AddSC_boss_fankriss(); -extern void AddSC_boss_huhuran(); -extern void AddSC_bug_trio(); -extern void AddSC_boss_sartura(); -extern void AddSC_boss_skeram(); -extern void AddSC_boss_twinemperors(); -extern void AddSC_mob_anubisath_sentinel(); -extern void AddSC_instance_temple_of_ahnqiraj(); //Ulduar extern void AddSC_boss_auriaya(); @@ -457,13 +443,6 @@ extern void AddSC_boss_ingvar_the_plunderer(); extern void AddSC_instance_utgarde_keep(); extern void AddSC_utgarde_keep(); -//Wailing caverns -extern void AddSC_wailing_caverns(); -extern void AddSC_instance_wailing_caverns(); - -//Zul'Farrak -extern void AddSC_zulfarrak(); - //Vault of Archavon extern void AddSC_boss_archavon(); extern void AddSC_boss_emalon(); @@ -639,6 +618,7 @@ void AddScripts() AddSC_boss_renataki(); AddSC_boss_wushoolay(); AddSC_instance_zulgurub(); + //AddSC_alterac_mountains(); AddSC_arathi_highlands(); AddSC_blasted_lands(); @@ -664,6 +644,46 @@ void AddScripts() AddSC_westfall(); //kalimdor + AddSC_instance_blackfathom_deeps(); //Blackfathom Depths + AddSC_hyjal(); //CoT Battle for Mt. Hyjal + AddSC_boss_archimonde(); + AddSC_instance_mount_hyjal(); + AddSC_hyjal_trash(); + AddSC_boss_rage_winterchill(); + AddSC_boss_anetheron(); + AddSC_boss_kazrogal(); + AddSC_boss_azgalor(); + AddSC_boss_captain_skarloc(); //CoT Old Hillsbrad + AddSC_boss_epoch_hunter(); + AddSC_boss_lieutenant_drake(); + AddSC_instance_old_hillsbrad(); + AddSC_old_hillsbrad(); + AddSC_boss_aeonus(); //CoT The Dark Portal + AddSC_boss_chrono_lord_deja(); + AddSC_boss_temporus(); + AddSC_dark_portal(); + AddSC_instance_dark_portal(); + AddSC_boss_celebras_the_cursed(); //Maraudon + AddSC_boss_landslide(); + AddSC_boss_noxxion(); + AddSC_boss_ptheradras(); + AddSC_boss_onyxia(); //Onyxia's Lair + AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs + AddSC_razorfen_downs(); + AddSC_razorfen_kraul(); //Razorfen Kraul + AddSC_boss_cthun(); //Temple of ahn'qiraj + AddSC_boss_fankriss(); + AddSC_boss_huhuran(); + AddSC_bug_trio(); + AddSC_boss_sartura(); + AddSC_boss_skeram(); + AddSC_boss_twinemperors(); + AddSC_mob_anubisath_sentinel(); + AddSC_instance_temple_of_ahnqiraj(); + AddSC_wailing_caverns(); //Wailing caverns + AddSC_instance_wailing_caverns(); + AddSC_zulfarrak(); //Zul'Farrak + AddSC_ashenvale(); AddSC_azshara(); AddSC_azuremyst_isle(); @@ -747,34 +767,6 @@ void AddScripts() AddSC_boss_illidari_council(); AddSC_instance_black_temple(); - //Blackfathom Depths - AddSC_instance_blackfathom_deeps(); - - //Caverns of Time - //--Battle for Mt. Hyjal - AddSC_hyjal(); - AddSC_boss_archimonde(); - AddSC_instance_mount_hyjal(); - AddSC_hyjal_trash(); - AddSC_boss_rage_winterchill(); - AddSC_boss_anetheron(); - AddSC_boss_kazrogal(); - AddSC_boss_azgalor(); - - //--Old Hillsbrad - AddSC_boss_captain_skarloc(); - AddSC_boss_epoch_hunter(); - AddSC_boss_lieutenant_drake(); - AddSC_instance_old_hillsbrad(); - AddSC_old_hillsbrad(); - - //--The Dark Portal - AddSC_boss_aeonus(); - AddSC_boss_chrono_lord_deja(); - AddSC_boss_temporus(); - AddSC_dark_portal(); - AddSC_instance_dark_portal(); - //Coilfang Resevoir //--Serpent Shrine Cavern AddSC_boss_fathomlord_karathress(); @@ -825,12 +817,6 @@ void AddScripts() AddSC_boss_vazruden_the_herald(); AddSC_instance_ramparts(); - //Maraudon - AddSC_boss_celebras_the_cursed(); - AddSC_boss_landslide(); - AddSC_boss_noxxion(); - AddSC_boss_ptheradras(); - //Naxxramas AddSC_boss_anubrekhan(); AddSC_boss_maexxna(); @@ -865,17 +851,6 @@ void AddScripts() AddSC_boss_sartharion(); AddSC_instance_obsidian_sanctum(); - //Onyxia's Lair - AddSC_boss_onyxia(); - - //Ragefire Chasm - //Razorfen Downs - AddSC_boss_amnennar_the_coldbringer(); - AddSC_razorfen_downs(); - - //Razorfen Kraul - AddSC_razorfen_kraul(); - //Tempest Keep //--Arcatraz AddSC_arcatraz(); @@ -901,16 +876,6 @@ void AddScripts() AddSC_boss_pathaleon_the_calculator(); AddSC_instance_mechanar(); - //Temple of ahn'qiraj - AddSC_boss_cthun(); - AddSC_boss_fankriss(); - AddSC_boss_huhuran(); - AddSC_bug_trio(); - AddSC_boss_sartura(); - AddSC_boss_skeram(); - AddSC_boss_twinemperors(); - AddSC_mob_anubisath_sentinel(); - AddSC_instance_temple_of_ahnqiraj(); //Ulduar AddSC_boss_auriaya(); @@ -932,13 +897,6 @@ void AddScripts() AddSC_instance_utgarde_keep(); AddSC_utgarde_keep(); - //Wailing caverns - AddSC_wailing_caverns(); - AddSC_instance_wailing_caverns(); - - //Zul'Farrak - AddSC_zulfarrak(); - //Vault of Archavon AddSC_boss_archavon(); AddSC_boss_emalon(); -- cgit v1.2.3 From 982dcc9eaa3fbddde8b02e0c242387dea1e6f912 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 17:22:17 +0200 Subject: Merge [SD2] r1305 Move source files to continent folder, part 3 --HG-- branch : trunk --- src/bindings/scripts/CMakeLists.txt | 396 +-- src/bindings/scripts/VC80/80ScriptDev2.vcproj | 1878 ++++++------ src/bindings/scripts/VC90/90ScriptDev2.vcproj | 3047 ++++++-------------- .../azjol_nerub/ahnkahet/boss_amanitar.cpp | 79 + .../azjol_nerub/ahnkahet/boss_elder_nadox.cpp | 274 ++ .../azjol_nerub/ahnkahet/boss_herald_volazj.cpp | 111 + .../ahnkahet/boss_jedoga_shadowseeker.cpp | 109 + .../azjol_nerub/ahnkahet/boss_prince_taldaram.cpp | 109 + .../northrend/azjol_nerub/ahnkahet/def_ahnkahet.h | 33 + .../azjol_nerub/ahnkahet/instance_ahnkahet.cpp | 194 ++ .../azjol_nerub/azjol_nerub/boss_anubarak.cpp | 112 + .../azjol_nerub/azjol_nerub/boss_hadronox.cpp | 114 + .../azjol_nerub/boss_krikthir_the_gatewatcher.cpp | 116 + .../azjol_nerub/azjol_nerub/def_azjol_nerub.h | 29 + .../azjol_nerub/instance_azjol_nerub.cpp | 178 ++ .../northrend/draktharon_keep/boss_dred.cpp | 56 + .../northrend/draktharon_keep/boss_novos.cpp | 75 + .../northrend/draktharon_keep/boss_tharon_ja.cpp | 88 + .../northrend/draktharon_keep/boss_trollgore.cpp | 75 + .../draktharon_keep/def_drak_tharon_keep.h | 4 + .../draktharon_keep/instance_drak_tharon_keep.cpp | 21 + .../northrend/gundrak/boss_drakkari_colossus.cpp | 55 + .../scripts/scripts/northrend/gundrak/boss_eck.cpp | 65 + .../scripts/northrend/gundrak/boss_gal_darah.cpp | 85 + .../scripts/northrend/gundrak/boss_moorabi.cpp | 88 + .../scripts/northrend/gundrak/boss_slad_ran.cpp | 95 + .../scripts/northrend/gundrak/def_gundrak.h | 4 + .../scripts/northrend/gundrak/instance_gundrak.cpp | 21 + .../northrend/naxxramas/boss_anubrekhan.cpp | 123 + .../scripts/northrend/naxxramas/boss_faerlina.cpp | 122 + .../northrend/naxxramas/boss_four_horsemen.cpp | 167 ++ .../scripts/northrend/naxxramas/boss_gluth.cpp | 160 + .../scripts/northrend/naxxramas/boss_gothik.cpp | 347 +++ .../scripts/northrend/naxxramas/boss_grobbulus.cpp | 103 + .../scripts/northrend/naxxramas/boss_heigan.cpp | 150 + .../northrend/naxxramas/boss_highlord_mograine.cpp | 179 ++ .../scripts/northrend/naxxramas/boss_kelthuzad.cpp | 294 ++ .../scripts/northrend/naxxramas/boss_loatheb.cpp | 93 + .../scripts/northrend/naxxramas/boss_maexxna.cpp | 140 + .../scripts/northrend/naxxramas/boss_noth.cpp | 210 ++ .../scripts/northrend/naxxramas/boss_patchwerk.cpp | 133 + .../scripts/northrend/naxxramas/boss_razuvious.cpp | 128 + .../scripts/northrend/naxxramas/boss_sapphiron.cpp | 350 +++ .../scripts/northrend/naxxramas/boss_thaddius.cpp | 143 + .../scripts/northrend/naxxramas/def_naxxramas.h | 52 + .../northrend/naxxramas/instance_naxxramas.cpp | 217 ++ .../nexus/eye_of_eternity/boss_malygos.cpp | 170 ++ .../nexus/eye_of_eternity/def_eye_of_eternity.h | 4 + .../eye_of_eternity/instance_eye_of_eternity.cpp | 21 + .../northrend/nexus/nexus/boss_anomalus.cpp | 302 ++ .../northrend/nexus/nexus/boss_keristrasza.cpp | 258 ++ .../northrend/nexus/nexus/boss_magus_telestra.cpp | 317 ++ .../scripts/northrend/nexus/nexus/boss_ormorok.cpp | 311 ++ .../northrend/nexus/nexus/commander_kolurg.cpp | 57 + .../northrend/nexus/nexus/commander_stoutbeard.cpp | 63 + .../scripts/northrend/nexus/nexus/def_nexus.h | 19 + .../northrend/nexus/nexus/instance_nexus.cpp | 258 ++ .../scripts/northrend/nexus/oculus/boss_drakos.cpp | 82 + .../scripts/northrend/nexus/oculus/boss_eregos.cpp | 104 + .../scripts/northrend/nexus/oculus/boss_urom.cpp | 87 + .../scripts/northrend/nexus/oculus/boss_varos.cpp | 85 + .../scripts/northrend/nexus/oculus/def_oculus.h | 4 + .../northrend/nexus/oculus/instance_oculus.cpp | 21 + .../northrend/obsidian_sanctum/boss_sartharion.cpp | 1153 ++++++++ .../obsidian_sanctum/def_obsidian_sanctum.h | 20 + .../obsidian_sanctum/instance_obsidian_sanctum.cpp | 97 + .../ulduar/halls_of_lightning/boss_bjarngrim.cpp | 440 +++ .../ulduar/halls_of_lightning/boss_ionar.cpp | 399 +++ .../ulduar/halls_of_lightning/boss_loken.cpp | 253 ++ .../ulduar/halls_of_lightning/boss_volkhan.cpp | 494 ++++ .../halls_of_lightning/def_halls_of_lightning.h | 34 + .../instance_halls_of_lightning.cpp | 194 ++ .../ulduar/halls_of_stone/boss_krystallus.cpp | 73 + .../ulduar/halls_of_stone/boss_maiden_of_grief.cpp | 81 + .../ulduar/halls_of_stone/boss_sjonnir.cpp | 83 + .../ulduar/halls_of_stone/def_halls_of_stone.h | 4 + .../halls_of_stone/instance_halls_of_stone.cpp | 21 + .../northrend/ulduar/ulduar/boss_algalon.cpp | 20 + .../ulduar/ulduar/boss_assembly_of_iron.cpp | 20 + .../northrend/ulduar/ulduar/boss_auriaya.cpp | 91 + .../ulduar/ulduar/boss_flame_leviathan.cpp | 306 ++ .../scripts/northrend/ulduar/ulduar/boss_freya.cpp | 20 + .../northrend/ulduar/ulduar/boss_general_vezax.cpp | 20 + .../scripts/northrend/ulduar/ulduar/boss_hodir.cpp | 20 + .../scripts/northrend/ulduar/ulduar/boss_ignis.cpp | 102 + .../northrend/ulduar/ulduar/boss_kologarn.cpp | 20 + .../northrend/ulduar/ulduar/boss_mimiron.cpp | 20 + .../northrend/ulduar/ulduar/boss_razorscale.cpp | 300 ++ .../northrend/ulduar/ulduar/boss_thorim.cpp | 20 + .../scripts/northrend/ulduar/ulduar/boss_xt002.cpp | 90 + .../northrend/ulduar/ulduar/boss_yoggsaron.cpp | 20 + .../scripts/northrend/ulduar/ulduar/def_ulduar.h | 41 + .../northrend/ulduar/ulduar/instance_ulduar.cpp | 20 + .../utgarde_keep/boss_ingvar_the_plunderer.cpp | 459 +++ .../utgarde_keep/utgarde_keep/boss_keleseth.cpp | 365 +++ .../utgarde_keep/boss_skarvald_dalronn.cpp | 397 +++ .../utgarde_keep/utgarde_keep/def_utgarde_keep.h | 35 + .../utgarde_keep/instance_utgarde_keep.cpp | 291 ++ .../utgarde_keep/utgarde_keep/utgarde_keep.cpp | 160 + .../utgarde_pinnacle/boss_palehoof.cpp | 78 + .../utgarde_keep/utgarde_pinnacle/boss_skadi.cpp | 89 + .../utgarde_keep/utgarde_pinnacle/boss_svala.cpp | 83 + .../utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp | 85 + .../utgarde_keep/utgarde_pinnacle/def_pinnacle.h | 4 + .../utgarde_pinnacle/instance_pinnacle.cpp | 21 + .../northrend/vault_of_archavon/boss_archavon.cpp | 199 ++ .../northrend/vault_of_archavon/boss_emalon.cpp | 275 ++ .../vault_of_archavon/def_vault_of_archavon.h | 8 + .../instance_vault_of_archavon.cpp | 124 + .../northrend/violet_hold/boss_cyanigosa.cpp | 82 + .../scripts/northrend/violet_hold/boss_erekem.cpp | 82 + .../scripts/northrend/violet_hold/boss_ichoron.cpp | 81 + .../northrend/violet_hold/boss_lavanthor.cpp | 52 + .../scripts/northrend/violet_hold/boss_moragg.cpp | 50 + .../scripts/northrend/violet_hold/boss_xevozz.cpp | 82 + .../scripts/northrend/violet_hold/boss_zuramat.cpp | 82 + .../northrend/violet_hold/def_violet_hold.h | 4 + .../northrend/violet_hold/instance_violet_hold.cpp | 21 + .../scripts/scripts/northrend/wintergrasp.cpp | 60 + .../auchenai_crypts/boss_exarch_maladaar.cpp | 358 +++ .../boss_shirrak_the_dead_watcher.cpp | 212 ++ .../mana_tombs/boss_nexusprince_shaffar.cpp | 369 +++ .../aunchindoun/mana_tombs/boss_pandemonius.cpp | 138 + .../sethekk_halls/boss_darkweaver_syth.cpp | 438 +++ .../sethekk_halls/boss_tailonking_ikiss.cpp | 221 ++ .../aunchindoun/sethekk_halls/def_sethekk_halls.h | 14 + .../sethekk_halls/instance_sethekk_halls.cpp | 91 + .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 217 ++ .../boss_blackheart_the_inciter.cpp | 177 ++ .../shadow_labyrinth/boss_grandmaster_vorpil.cpp | 321 +++ .../aunchindoun/shadow_labyrinth/boss_murmur.cpp | 207 ++ .../shadow_labyrinth/def_shadow_labyrinth.h | 15 + .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 227 ++ .../scripts/outland/black_temple/black_temple.cpp | 69 + .../outland/black_temple/boss_bloodboil.cpp | 344 +++ .../scripts/outland/black_temple/boss_illidan.cpp | 2208 ++++++++++++++ .../outland/black_temple/boss_mother_shahraz.cpp | 315 ++ .../black_temple/boss_reliquary_of_souls.cpp | 710 +++++ .../outland/black_temple/boss_shade_of_akama.cpp | 870 ++++++ .../scripts/outland/black_temple/boss_supremus.cpp | 296 ++ .../outland/black_temple/boss_teron_gorefiend.cpp | 520 ++++ .../outland/black_temple/boss_warlord_najentus.cpp | 226 ++ .../outland/black_temple/def_black_temple.h | 39 + .../outland/black_temple/illidari_council.cpp | 872 ++++++ .../outland/black_temple/instance_black_temple.cpp | 346 +++ .../serpent_shrine/boss_fathomlord_karathress.cpp | 759 +++++ .../serpent_shrine/boss_hydross_the_unstable.cpp | 386 +++ .../serpent_shrine/boss_lady_vashj.cpp | 1066 +++++++ .../serpent_shrine/boss_leotheras_the_blind.cpp | 808 ++++++ .../serpent_shrine/boss_lurker_below.cpp | 489 ++++ .../serpent_shrine/boss_morogrim_tidewalker.cpp | 372 +++ .../serpent_shrine/def_serpent_shrine.h | 32 + .../serpent_shrine/instance_serpent_shrine.cpp | 285 ++ .../steam_vault/boss_hydromancer_thespia.cpp | 197 ++ .../steam_vault/boss_mekgineer_steamrigger.cpp | 279 ++ .../steam_vault/boss_warlord_kalithresh.cpp | 213 ++ .../steam_vault/def_steam_vault.h | 17 + .../steam_vault/instance_steam_vault.cpp | 231 ++ .../coilfang_resevoir/underbog/boss_hungarfen.cpp | 156 + .../underbog/boss_the_black_stalker.cpp | 191 ++ .../scripts/outland/gruuls_lair/boss_gruul.cpp | 260 ++ .../outland/gruuls_lair/boss_high_king_maulgar.cpp | 793 +++++ .../scripts/outland/gruuls_lair/def_gruuls_lair.h | 21 + .../outland/gruuls_lair/instance_gruuls_lair.cpp | 193 ++ .../blood_furnace/boss_broggok.cpp | 131 + .../blood_furnace/boss_kelidan_the_breaker.cpp | 378 +++ .../blood_furnace/boss_the_maker.cpp | 162 ++ .../blood_furnace/def_blood_furnace.h | 29 + .../blood_furnace/instance_blood_furnace.cpp | 234 ++ .../hellfire_ramparts/boss_omor_the_unscarred.cpp | 214 ++ .../hellfire_ramparts/boss_vazruden_the_herald.cpp | 490 ++++ .../boss_watchkeeper_gargolmar.cpp | 168 ++ .../hellfire_ramparts/def_hellfire_ramparts.h | 16 + .../instance_hellfire_ramparts.cpp | 84 + .../magtheridons_lair/boss_magtheridon.cpp | 562 ++++ .../magtheridons_lair/def_magtheridons_lair.h | 14 + .../instance_magtheridons_lair.cpp | 249 ++ .../shattered_halls/boss_nethekurse.cpp | 412 +++ .../shattered_halls/boss_warbringer_omrogg.cpp | 408 +++ .../boss_warchief_kargath_bladefist.cpp | 303 ++ .../shattered_halls/def_shattered_halls.h | 14 + .../shattered_halls/instance_shattered_halls.cpp | 114 + .../outland/tempest_keep/arcatraz/arcatraz.cpp | 521 ++++ .../arcatraz/boss_harbinger_skyriss.cpp | 312 ++ .../outland/tempest_keep/arcatraz/def_arcatraz.h | 21 + .../tempest_keep/arcatraz/instance_arcatraz.cpp | 238 ++ .../botanica/boss_high_botanist_freywinn.cpp | 199 ++ .../outland/tempest_keep/botanica/boss_laj.cpp | 205 ++ .../tempest_keep/botanica/boss_warp_splinter.cpp | 226 ++ .../outland/tempest_keep/the_eye/boss_alar.cpp | 525 ++++ .../tempest_keep/the_eye/boss_astromancer.cpp | 474 +++ .../outland/tempest_keep/the_eye/boss_kaelthas.cpp | 1515 ++++++++++ .../tempest_keep/the_eye/boss_void_reaver.cpp | 185 ++ .../outland/tempest_keep/the_eye/def_the_eye.h | 20 + .../tempest_keep/the_eye/instance_the_eye.cpp | 176 ++ .../outland/tempest_keep/the_eye/the_eye.cpp | 99 + .../the_mechanar/boss_gatewatcher_gyrokill.cpp | 38 + .../the_mechanar/boss_gatewatcher_ironhand.cpp | 148 + .../the_mechanar/boss_nethermancer_sepethrea.cpp | 258 ++ .../the_mechanar/boss_pathaleon_the_calculator.cpp | 257 ++ .../tempest_keep/the_mechanar/def_mechanar.h | 6 + .../the_mechanar/instance_mechanar.cpp | 87 + .../auchenai_crypts/boss_exarch_maladaar.cpp | 358 --- .../boss_shirrak_the_dead_watcher.cpp | 212 -- .../mana_tombs/boss_nexusprince_shaffar.cpp | 369 --- .../aunchindoun/mana_tombs/boss_pandemonius.cpp | 138 - .../sethekk_halls/boss_darkweaver_syth.cpp | 438 --- .../sethekk_halls/boss_tailonking_ikiss.cpp | 221 -- .../aunchindoun/sethekk_halls/def_sethekk_halls.h | 14 - .../sethekk_halls/instance_sethekk_halls.cpp | 91 - .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 217 -- .../boss_blackheart_the_inciter.cpp | 177 -- .../shadow_labyrinth/boss_grandmaster_vorpil.cpp | 321 --- .../aunchindoun/shadow_labyrinth/boss_murmur.cpp | 207 -- .../shadow_labyrinth/def_shadow_labyrinth.h | 15 - .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 227 -- .../zone/azjol_nerub/ahnkahet/boss_amanitar.cpp | 79 - .../zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp | 274 -- .../azjol_nerub/ahnkahet/boss_herald_volazj.cpp | 111 - .../ahnkahet/boss_jedoga_shadowseeker.cpp | 109 - .../azjol_nerub/ahnkahet/boss_prince_taldaram.cpp | 109 - .../zone/azjol_nerub/ahnkahet/def_ahnkahet.h | 33 - .../azjol_nerub/ahnkahet/instance_ahnkahet.cpp | 194 -- .../zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp | 112 - .../zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp | 114 - .../azjol_nerub/boss_krikthir_the_gatewatcher.cpp | 116 - .../zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h | 29 - .../azjol_nerub/instance_azjol_nerub.cpp | 178 -- .../black_temple/.instance_black_temple.cpp-s8inyu | 347 --- .../scripts/zone/black_temple/black_temple.cpp | 69 - .../scripts/zone/black_temple/boss_bloodboil.cpp | 344 --- .../scripts/zone/black_temple/boss_illidan.cpp | 2208 -------------- .../zone/black_temple/boss_mother_shahraz.cpp | 315 -- .../zone/black_temple/boss_reliquary_of_souls.cpp | 710 ----- .../zone/black_temple/boss_shade_of_akama.cpp | 870 ------ .../scripts/zone/black_temple/boss_supremus.cpp | 296 -- .../zone/black_temple/boss_teron_gorefiend.cpp | 520 ---- .../zone/black_temple/boss_warlord_najentus.cpp | 226 -- .../scripts/zone/black_temple/def_black_temple.h | 39 - .../scripts/zone/black_temple/illidari_council.cpp | 872 ------ .../zone/black_temple/instance_black_temple.cpp | 346 --- .../serpent_shrine/boss_fathomlord_karathress.cpp | 759 ----- .../serpent_shrine/boss_hydross_the_unstable.cpp | 386 --- .../serpent_shrine/boss_lady_vashj.cpp | 1066 ------- .../serpent_shrine/boss_leotheras_the_blind.cpp | 808 ------ .../serpent_shrine/boss_lurker_below.cpp | 489 ---- .../serpent_shrine/boss_morogrim_tidewalker.cpp | 372 --- .../serpent_shrine/def_serpent_shrine.h | 32 - .../serpent_shrine/instance_serpent_shrine.cpp | 285 -- .../steam_vault/boss_hydromancer_thespia.cpp | 197 -- .../steam_vault/boss_mekgineer_steamrigger.cpp | 279 -- .../steam_vault/boss_warlord_kalithresh.cpp | 213 -- .../steam_vault/def_steam_vault.h | 17 - .../steam_vault/instance_steam_vault.cpp | 231 -- .../coilfang_resevoir/underbog/boss_hungarfen.cpp | 156 - .../underbog/boss_the_black_stalker.cpp | 191 -- .../scripts/zone/draktharon_keep/boss_dred.cpp | 56 - .../scripts/zone/draktharon_keep/boss_novos.cpp | 75 - .../zone/draktharon_keep/boss_tharon_ja.cpp | 88 - .../zone/draktharon_keep/boss_trollgore.cpp | 75 - .../zone/draktharon_keep/def_drak_tharon_keep.h | 4 - .../draktharon_keep/instance_drak_tharon_keep.cpp | 21 - .../scripts/zone/gruuls_lair/boss_gruul.cpp | 260 -- .../zone/gruuls_lair/boss_high_king_maulgar.cpp | 793 ----- .../scripts/zone/gruuls_lair/def_gruuls_lair.h | 21 - .../zone/gruuls_lair/instance_gruuls_lair.cpp | 193 -- .../zone/gundrak/boss_drakkari_colossus.cpp | 55 - .../scripts/scripts/zone/gundrak/boss_eck.cpp | 65 - .../scripts/zone/gundrak/boss_gal_darah.cpp | 85 - .../scripts/scripts/zone/gundrak/boss_moorabi.cpp | 88 - .../scripts/scripts/zone/gundrak/boss_slad_ran.cpp | 95 - .../scripts/scripts/zone/gundrak/def_gundrak.h | 4 - .../scripts/zone/gundrak/instance_gundrak.cpp | 21 - .../blood_furnace/boss_broggok.cpp | 131 - .../blood_furnace/boss_kelidan_the_breaker.cpp | 378 --- .../blood_furnace/boss_the_maker.cpp | 162 -- .../blood_furnace/def_blood_furnace.h | 29 - .../blood_furnace/instance_blood_furnace.cpp | 234 -- .../hellfire_ramparts/boss_omor_the_unscarred.cpp | 214 -- .../hellfire_ramparts/boss_vazruden_the_herald.cpp | 490 ---- .../boss_watchkeeper_gargolmar.cpp | 168 -- .../hellfire_ramparts/def_hellfire_ramparts.h | 16 - .../instance_hellfire_ramparts.cpp | 84 - .../magtheridons_lair/boss_magtheridon.cpp | 562 ---- .../magtheridons_lair/def_magtheridons_lair.h | 14 - .../instance_magtheridons_lair.cpp | 249 -- .../shattered_halls/boss_nethekurse.cpp | 412 --- .../shattered_halls/boss_warbringer_omrogg.cpp | 408 --- .../boss_warchief_kargath_bladefist.cpp | 303 -- .../shattered_halls/def_shattered_halls.h | 14 - .../shattered_halls/instance_shattered_halls.cpp | 114 - .../scripts/zone/naxxramas/boss_anubrekhan.cpp | 123 - .../scripts/zone/naxxramas/boss_faerlina.cpp | 122 - .../scripts/zone/naxxramas/boss_four_horsemen.cpp | 167 -- .../scripts/scripts/zone/naxxramas/boss_gluth.cpp | 160 - .../scripts/scripts/zone/naxxramas/boss_gothik.cpp | 347 --- .../scripts/zone/naxxramas/boss_grobbulus.cpp | 103 - .../scripts/scripts/zone/naxxramas/boss_heigan.cpp | 150 - .../zone/naxxramas/boss_highlord_mograine.cpp | 179 -- .../scripts/zone/naxxramas/boss_kelthuzad.cpp | 294 -- .../scripts/zone/naxxramas/boss_loatheb.cpp | 93 - .../scripts/zone/naxxramas/boss_maexxna.cpp | 140 - .../scripts/scripts/zone/naxxramas/boss_noth.cpp | 210 -- .../scripts/zone/naxxramas/boss_patchwerk.cpp | 133 - .../scripts/zone/naxxramas/boss_razuvious.cpp | 128 - .../scripts/zone/naxxramas/boss_sapphiron.cpp | 350 --- .../scripts/zone/naxxramas/boss_thaddius.cpp | 143 - .../scripts/scripts/zone/naxxramas/def_naxxramas.h | 52 - .../scripts/zone/naxxramas/instance_naxxramas.cpp | 217 -- .../zone/nexus/eye_of_eternity/boss_malygos.cpp | 170 -- .../nexus/eye_of_eternity/def_eye_of_eternity.h | 4 - .../eye_of_eternity/instance_eye_of_eternity.cpp | 21 - .../scripts/zone/nexus/nexus/boss_anomalus.cpp | 302 -- .../scripts/zone/nexus/nexus/boss_keristrasza.cpp | 258 -- .../zone/nexus/nexus/boss_magus_telestra.cpp | 317 -- .../scripts/zone/nexus/nexus/boss_ormorok.cpp | 311 -- .../scripts/zone/nexus/nexus/commander_kolurg.cpp | 57 - .../zone/nexus/nexus/commander_stoutbeard.cpp | 63 - .../scripts/scripts/zone/nexus/nexus/def_nexus.h | 19 - .../scripts/zone/nexus/nexus/instance_nexus.cpp | 258 -- .../scripts/zone/nexus/oculus/boss_drakos.cpp | 82 - .../scripts/zone/nexus/oculus/boss_eregos.cpp | 104 - .../scripts/zone/nexus/oculus/boss_urom.cpp | 87 - .../scripts/zone/nexus/oculus/boss_varos.cpp | 85 - .../scripts/scripts/zone/nexus/oculus/def_oculus.h | 4 - .../scripts/zone/nexus/oculus/instance_oculus.cpp | 21 - .../zone/obsidian_sanctum/boss_sartharion.cpp | 1153 -------- .../zone/obsidian_sanctum/def_obsidian_sanctum.h | 20 - .../obsidian_sanctum/instance_obsidian_sanctum.cpp | 97 - .../zone/tempest_keep/arcatraz/arcatraz.cpp | 521 ---- .../arcatraz/boss_harbinger_skyriss.cpp | 312 -- .../zone/tempest_keep/arcatraz/def_arcatraz.h | 21 - .../tempest_keep/arcatraz/instance_arcatraz.cpp | 238 -- .../botanica/boss_high_botanist_freywinn.cpp | 199 -- .../zone/tempest_keep/botanica/boss_laj.cpp | 205 -- .../tempest_keep/botanica/boss_warp_splinter.cpp | 226 -- .../zone/tempest_keep/the_eye/boss_alar.cpp | 525 ---- .../zone/tempest_keep/the_eye/boss_astromancer.cpp | 474 --- .../zone/tempest_keep/the_eye/boss_kaelthas.cpp | 1515 ---------- .../zone/tempest_keep/the_eye/boss_void_reaver.cpp | 185 -- .../zone/tempest_keep/the_eye/def_the_eye.h | 20 - .../zone/tempest_keep/the_eye/instance_the_eye.cpp | 176 -- .../scripts/zone/tempest_keep/the_eye/the_eye.cpp | 99 - .../the_mechanar/boss_gatewatcher_gyrokill.cpp | 38 - .../the_mechanar/boss_gatewatcher_ironhand.cpp | 148 - .../the_mechanar/boss_nethermancer_sepethrea.cpp | 258 -- .../the_mechanar/boss_pathaleon_the_calculator.cpp | 257 -- .../zone/tempest_keep/the_mechanar/def_mechanar.h | 6 - .../the_mechanar/instance_mechanar.cpp | 87 - .../ulduar/halls_of_lightning/boss_bjarngrim.cpp | 440 --- .../zone/ulduar/halls_of_lightning/boss_ionar.cpp | 399 --- .../zone/ulduar/halls_of_lightning/boss_loken.cpp | 253 -- .../ulduar/halls_of_lightning/boss_volkhan.cpp | 494 ---- .../halls_of_lightning/def_halls_of_lightning.h | 34 - .../instance_halls_of_lightning.cpp | 194 -- .../zone/ulduar/halls_of_stone/boss_krystallus.cpp | 73 - .../ulduar/halls_of_stone/boss_maiden_of_grief.cpp | 81 - .../zone/ulduar/halls_of_stone/boss_sjonnir.cpp | 83 - .../ulduar/halls_of_stone/def_halls_of_stone.h | 4 - .../halls_of_stone/instance_halls_of_stone.cpp | 21 - .../scripts/zone/ulduar/ulduar/boss_algalon.cpp | 20 - .../zone/ulduar/ulduar/boss_assembly_of_iron.cpp | 20 - .../scripts/zone/ulduar/ulduar/boss_auriaya.cpp | 91 - .../zone/ulduar/ulduar/boss_flame_leviathan.cpp | 306 -- .../scripts/zone/ulduar/ulduar/boss_freya.cpp | 20 - .../zone/ulduar/ulduar/boss_general_vezax.cpp | 20 - .../scripts/zone/ulduar/ulduar/boss_hodir.cpp | 20 - .../scripts/zone/ulduar/ulduar/boss_ignis.cpp | 102 - .../scripts/zone/ulduar/ulduar/boss_kologarn.cpp | 20 - .../scripts/zone/ulduar/ulduar/boss_mimiron.cpp | 20 - .../scripts/zone/ulduar/ulduar/boss_razorscale.cpp | 300 -- .../scripts/zone/ulduar/ulduar/boss_thorim.cpp | 20 - .../scripts/zone/ulduar/ulduar/boss_xt002.cpp | 90 - .../scripts/zone/ulduar/ulduar/boss_yoggsaron.cpp | 20 - .../scripts/zone/ulduar/ulduar/def_ulduar.h | 41 - .../scripts/zone/ulduar/ulduar/instance_ulduar.cpp | 20 - .../utgarde_keep/boss_ingvar_the_plunderer.cpp | 459 --- .../utgarde_keep/utgarde_keep/boss_keleseth.cpp | 365 --- .../utgarde_keep/boss_skarvald_dalronn.cpp | 397 --- .../utgarde_keep/utgarde_keep/def_utgarde_keep.h | 35 - .../utgarde_keep/instance_utgarde_keep.cpp | 291 -- .../utgarde_keep/utgarde_keep/utgarde_keep.cpp | 160 - .../utgarde_pinnacle/boss_palehoof.cpp | 78 - .../utgarde_keep/utgarde_pinnacle/boss_skadi.cpp | 89 - .../utgarde_keep/utgarde_pinnacle/boss_svala.cpp | 83 - .../utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp | 85 - .../utgarde_keep/utgarde_pinnacle/def_pinnacle.h | 4 - .../utgarde_pinnacle/instance_pinnacle.cpp | 21 - .../zone/vault_of_archavon/boss_archavon.cpp | 199 -- .../scripts/zone/vault_of_archavon/boss_emalon.cpp | 275 -- .../zone/vault_of_archavon/def_vault_of_archavon.h | 8 - .../instance_vault_of_archavon.cpp | 124 - .../scripts/zone/violet_hold/boss_cyanigosa.cpp | 82 - .../scripts/zone/violet_hold/boss_erekem.cpp | 82 - .../scripts/zone/violet_hold/boss_ichoron.cpp | 81 - .../scripts/zone/violet_hold/boss_lavanthor.cpp | 52 - .../scripts/zone/violet_hold/boss_moragg.cpp | 50 - .../scripts/zone/violet_hold/boss_xevozz.cpp | 82 - .../scripts/zone/violet_hold/boss_zuramat.cpp | 82 - .../scripts/zone/violet_hold/def_violet_hold.h | 4 - .../zone/violet_hold/instance_violet_hold.cpp | 21 - .../scripts/zone/wintergrasp/wintergrasp.cpp | 60 - src/bindings/scripts/system/ScriptLoader.cpp | 426 +-- 403 files changed, 43405 insertions(+), 45227 deletions(-) create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/def_ahnkahet.h create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/instance_ahnkahet.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/def_azjol_nerub.h create mode 100644 src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp create mode 100644 src/bindings/scripts/scripts/northrend/draktharon_keep/boss_dred.cpp create mode 100644 src/bindings/scripts/scripts/northrend/draktharon_keep/boss_novos.cpp create mode 100644 src/bindings/scripts/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp create mode 100644 src/bindings/scripts/scripts/northrend/draktharon_keep/boss_trollgore.cpp create mode 100644 src/bindings/scripts/scripts/northrend/draktharon_keep/def_drak_tharon_keep.h create mode 100644 src/bindings/scripts/scripts/northrend/draktharon_keep/instance_drak_tharon_keep.cpp create mode 100644 src/bindings/scripts/scripts/northrend/gundrak/boss_drakkari_colossus.cpp create mode 100644 src/bindings/scripts/scripts/northrend/gundrak/boss_eck.cpp create mode 100644 src/bindings/scripts/scripts/northrend/gundrak/boss_gal_darah.cpp create mode 100644 src/bindings/scripts/scripts/northrend/gundrak/boss_moorabi.cpp create mode 100644 src/bindings/scripts/scripts/northrend/gundrak/boss_slad_ran.cpp create mode 100644 src/bindings/scripts/scripts/northrend/gundrak/def_gundrak.h create mode 100644 src/bindings/scripts/scripts/northrend/gundrak/instance_gundrak.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_anubrekhan.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_faerlina.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_four_horsemen.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_gluth.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_gothik.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_grobbulus.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_heigan.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_highlord_mograine.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_kelthuzad.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_loatheb.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_maexxna.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_noth.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_patchwerk.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_razuvious.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_sapphiron.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/boss_thaddius.cpp create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/def_naxxramas.h create mode 100644 src/bindings/scripts/scripts/northrend/naxxramas/instance_naxxramas.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/def_eye_of_eternity.h create mode 100644 src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/instance_eye_of_eternity.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/boss_anomalus.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/boss_keristrasza.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/boss_ormorok.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/commander_kolurg.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/commander_stoutbeard.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/def_nexus.h create mode 100644 src/bindings/scripts/scripts/northrend/nexus/nexus/instance_nexus.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/oculus/boss_drakos.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/oculus/boss_eregos.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/oculus/boss_urom.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/oculus/boss_varos.cpp create mode 100644 src/bindings/scripts/scripts/northrend/nexus/oculus/def_oculus.h create mode 100644 src/bindings/scripts/scripts/northrend/nexus/oculus/instance_oculus.cpp create mode 100644 src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp create mode 100644 src/bindings/scripts/scripts/northrend/obsidian_sanctum/def_obsidian_sanctum.h create mode 100644 src/bindings/scripts/scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/def_halls_of_lightning.h create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/def_halls_of_stone.h create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_algalon.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_freya.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_hodir.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_ignis.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_thorim.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_xt002.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_yoggsaron.cpp create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/def_ulduar.h create mode 100644 src/bindings/scripts/scripts/northrend/ulduar/ulduar/instance_ulduar.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/def_utgarde_keep.h create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/def_pinnacle.h create mode 100644 src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp create mode 100644 src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_archavon.cpp create mode 100644 src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_emalon.cpp create mode 100644 src/bindings/scripts/scripts/northrend/vault_of_archavon/def_vault_of_archavon.h create mode 100644 src/bindings/scripts/scripts/northrend/vault_of_archavon/instance_vault_of_archavon.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/boss_cyanigosa.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/boss_erekem.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/boss_ichoron.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/boss_lavanthor.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/boss_moragg.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/boss_xevozz.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/boss_zuramat.cpp create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/def_violet_hold.h create mode 100644 src/bindings/scripts/scripts/northrend/violet_hold/instance_violet_hold.cpp create mode 100644 src/bindings/scripts/scripts/northrend/wintergrasp.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h create mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/black_temple.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_bloodboil.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_illidan.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_mother_shahraz.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_shade_of_akama.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_supremus.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_teron_gorefiend.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/boss_warlord_najentus.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/def_black_temple.h create mode 100644 src/bindings/scripts/scripts/outland/black_temple/illidari_council.cpp create mode 100644 src/bindings/scripts/scripts/outland/black_temple/instance_black_temple.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/def_steam_vault.h create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp create mode 100644 src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp create mode 100644 src/bindings/scripts/scripts/outland/gruuls_lair/boss_gruul.cpp create mode 100644 src/bindings/scripts/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp create mode 100644 src/bindings/scripts/scripts/outland/gruuls_lair/def_gruuls_lair.h create mode 100644 src/bindings/scripts/scripts/outland/gruuls_lair/instance_gruuls_lair.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/def_blood_furnace.h create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/def_shattered_halls.h create mode 100644 src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/def_arcatraz.h create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_laj.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_alar.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_eye/def_the_eye.h create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_eye/instance_the_eye.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_eye/the_eye.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/def_mechanar.h create mode 100644 src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/instance_mechanar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h delete mode 100644 src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h delete mode 100644 src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp delete mode 100644 src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp delete mode 100644 src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp delete mode 100644 src/bindings/scripts/scripts/zone/draktharon_keep/boss_dred.cpp delete mode 100644 src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp delete mode 100644 src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp delete mode 100644 src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp delete mode 100644 src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h delete mode 100644 src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h delete mode 100644 src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp delete mode 100644 src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h delete mode 100644 src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h delete mode 100644 src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_highlord_mograine.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/def_naxxramas.h delete mode 100644 src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h delete mode 100644 src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h delete mode 100644 src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp delete mode 100644 src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h delete mode 100644 src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp delete mode 100644 src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h delete mode 100644 src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/def_mechanar.h delete mode 100644 src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_algalon.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_assembly_of_iron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_auriaya.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_freya.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_general_vezax.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_hodir.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_ignis.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_kologarn.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_mimiron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_razorscale.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_thorim.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_xt002.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_yoggsaron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/def_ulduar.h delete mode 100644 src/bindings/scripts/scripts/zone/ulduar/ulduar/instance_ulduar.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h delete mode 100644 src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp delete mode 100644 src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp delete mode 100644 src/bindings/scripts/scripts/zone/vault_of_archavon/boss_emalon.cpp delete mode 100644 src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h delete mode 100644 src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h delete mode 100644 src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp delete mode 100644 src/bindings/scripts/scripts/zone/wintergrasp/wintergrasp.cpp (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index b83b2f09f58..0ea35a6b201 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -281,12 +281,210 @@ SET(trinityscript_LIB_SRCS scripts/kalimdor/thunder_bluff.cpp scripts/kalimdor/ungoro_crater.cpp scripts/kalimdor/winterspring.cpp + scripts/northrend/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp + scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp + scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp + scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp + scripts/northrend/azjol_nerub/azjol_nerub/def_azjol_nerub.h + scripts/northrend/azjol_nerub/ahnkahet/instance_ahnkahet.cpp + scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp + scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp + scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp + scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp + scripts/northrend/azjol_nerub/ahnkahet/boss_amanitar.cpp + scripts/northrend/azjol_nerub/ahnkahet/def_ahnkahet.h + scripts/northrend/draktharon_keep/instance_drak_tharon_keep.cpp + scripts/northrend/draktharon_keep/boss_trollgore.cpp + scripts/northrend/draktharon_keep/boss_novos.cpp + scripts/northrend/draktharon_keep/boss_dred.cpp + scripts/northrend/draktharon_keep/boss_tharon_ja.cpp + scripts/northrend/draktharon_keep/def_drak_tharon_keep.h + scripts/northrend/gundrak/instance_gundrak.cpp + scripts/northrend/gundrak/boss_slad_ran.cpp + scripts/northrend/gundrak/boss_moorabi.cpp + scripts/northrend/gundrak/boss_drakkari_colossus.cpp + scripts/northrend/gundrak/boss_gal_darah.cpp + scripts/northrend/gundrak/boss_eck.cpp + scripts/northrend/gundrak/def_gundrak.h + scripts/northrend/naxxramas/boss_anubrekhan.cpp + scripts/northrend/naxxramas/boss_faerlina.cpp + scripts/northrend/naxxramas/boss_gluth.cpp + scripts/northrend/naxxramas/boss_gothik.cpp + scripts/northrend/naxxramas/boss_grobbulus.cpp + scripts/northrend/naxxramas/boss_heigan.cpp + scripts/northrend/naxxramas/boss_kelthuzad.cpp + scripts/northrend/naxxramas/boss_four_horsemen.cpp + scripts/northrend/naxxramas/boss_loatheb.cpp + scripts/northrend/naxxramas/boss_maexxna.cpp + scripts/northrend/naxxramas/boss_noth.cpp + scripts/northrend/naxxramas/boss_patchwerk.cpp + scripts/northrend/naxxramas/boss_razuvious.cpp + scripts/northrend/naxxramas/boss_sapphiron.cpp + scripts/northrend/naxxramas/boss_thaddius.cpp + scripts/northrend/naxxramas/def_naxxramas.h + scripts/northrend/naxxramas/instance_naxxramas.cpp + scripts/northrend/nexus/eye_of_eternity/instance_eye_of_eternity.cpp + scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp + scripts/northrend/nexus/eye_of_eternity/def_eye_of_eternity.h + scripts/northrend/nexus/nexus/instance_nexus.cpp + scripts/northrend/nexus/nexus/boss_magus_telestra.cpp + scripts/northrend/nexus/nexus/boss_anomalus.cpp + scripts/northrend/nexus/nexus/boss_ormorok.cpp + scripts/northrend/nexus/nexus/boss_keristrasza.cpp + scripts/northrend/nexus/nexus/commander_stoutbeard.cpp + scripts/northrend/nexus/nexus/commander_kolurg.cpp + scripts/northrend/nexus/nexus/def_nexus.h + scripts/northrend/nexus/oculus/instance_oculus.cpp + scripts/northrend/nexus/oculus/boss_drakos.cpp + scripts/northrend/nexus/oculus/boss_urom.cpp + scripts/northrend/nexus/oculus/boss_varos.cpp + scripts/northrend/nexus/oculus/boss_eregos.cpp + scripts/northrend/nexus/oculus/def_oculus.h + scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp + scripts/northrend/obsidian_sanctum/boss_sartharion.cpp + scripts/northrend/obsidian_sanctum/def_obsidian_sanctum.h + scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp + scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp + scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp + scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp + scripts/northrend/ulduar/halls_of_stone/def_halls_of_stone.h + scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp + scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp + scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp + scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp + scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp + scripts/northrend/ulduar/halls_of_lightning/def_halls_of_lightning.h + scripts/northrend/ulduar/ulduar/boss_algalon.cpp + scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp + scripts/northrend/ulduar/ulduar/boss_auriaya.cpp + scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp + scripts/northrend/ulduar/ulduar/boss_freya.cpp + scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp + scripts/northrend/ulduar/ulduar/boss_hodir.cpp + scripts/northrend/ulduar/ulduar/boss_ignis.cpp + scripts/northrend/ulduar/ulduar/boss_kologarn.cpp + scripts/northrend/ulduar/ulduar/boss_mimiron.cpp + scripts/northrend/ulduar/ulduar/boss_razorscale.cpp + scripts/northrend/ulduar/ulduar/boss_thorim.cpp + scripts/northrend/ulduar/ulduar/boss_xt002.cpp + scripts/northrend/ulduar/ulduar/boss_yoggsaron.cpp + scripts/northrend/ulduar/ulduar/def_ulduar.h + scripts/northrend/ulduar/ulduar/instance_ulduar.cpp + scripts/northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp + scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp + scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp + scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp + scripts/northrend/utgarde_keep/utgarde_keep/def_utgarde_keep.h + scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp + scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp + scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp + scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp + scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp + scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp + scripts/northrend/utgarde_keep/utgarde_pinnacle/def_pinnacle.h + scripts/northrend/vault_of_archavon/instance_vault_of_archavon.cpp + scripts/northrend/vault_of_archavon/boss_archavon.cpp + scripts/northrend/vault_of_archavon/boss_emalon.cpp + scripts/northrend/vault_of_archavon/def_vault_of_archavon.h + scripts/northrend/violet_hold/instance_violet_hold.cpp + scripts/northrend/violet_hold/boss_cyanigosa.cpp + scripts/northrend/violet_hold/boss_erekem.cpp + scripts/northrend/violet_hold/boss_ichoron.cpp + scripts/northrend/violet_hold/boss_lavanthor.cpp + scripts/northrend/violet_hold/boss_moragg.cpp + scripts/northrend/violet_hold/boss_xevozz.cpp + scripts/northrend/violet_hold/boss_zuramat.cpp + scripts/northrend/violet_hold/def_violet_hold.h scripts/northrend/borean_tundra.cpp scripts/northrend/dragonblight.cpp scripts/northrend/grizzly_hills.cpp scripts/northrend/icecrown.cpp scripts/northrend/sholazar_basin.cpp + scripts/northrend/wintergrasp.cpp scripts/northrend/zuldrak.cpp + scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp + scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp + scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp + scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp + scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp + scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp + scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h + scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp + scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp + scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp + scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp + scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp + scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h + scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp + scripts/outland/black_temple/black_temple.cpp + scripts/outland/black_temple/boss_bloodboil.cpp + scripts/outland/black_temple/boss_illidan.cpp + scripts/outland/black_temple/boss_mother_shahraz.cpp + scripts/outland/black_temple/boss_reliquary_of_souls.cpp + scripts/outland/black_temple/boss_shade_of_akama.cpp + scripts/outland/black_temple/boss_supremus.cpp + scripts/outland/black_temple/boss_teron_gorefiend.cpp + scripts/outland/black_temple/boss_warlord_najentus.cpp + scripts/outland/black_temple/def_black_temple.h + scripts/outland/black_temple/illidari_council.cpp + scripts/outland/black_temple/instance_black_temple.cpp + scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp + scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp + scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp + scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp + scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp + scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp + scripts/outland/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h + scripts/outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp + scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp + scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp + scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp + scripts/outland/coilfang_resevoir/steam_vault/def_steam_vault.h + scripts/outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp + scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp + scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp + scripts/outland/gruuls_lair/boss_gruul.cpp + scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp + scripts/outland/gruuls_lair/def_gruuls_lair.h + scripts/outland/gruuls_lair/instance_gruuls_lair.cpp + scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp + scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp + scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp + scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp + scripts/outland/hellfire_citadel/blood_furnace/def_blood_furnace.h + scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp + scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp + scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp + scripts/outland/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h + scripts/outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp + scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp + scripts/outland/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h + scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp + scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp + scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp + scripts/outland/hellfire_citadel/shattered_halls/def_shattered_halls.h + scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp + scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp + scripts/outland/tempest_keep/arcatraz/arcatraz.cpp + scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp + scripts/outland/tempest_keep/arcatraz/def_arcatraz.h + scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp + scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp + scripts/outland/tempest_keep/botanica/boss_laj.cpp + scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp + scripts/outland/tempest_keep/the_eye/boss_alar.cpp + scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp + scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp + scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp + scripts/outland/tempest_keep/the_eye/def_the_eye.h + scripts/outland/tempest_keep/the_eye/instance_the_eye.cpp + scripts/outland/tempest_keep/the_eye/the_eye.cpp + scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp + scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp + scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp + scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp + scripts/outland/tempest_keep/the_mechanar/def_mechanar.h + scripts/outland/tempest_keep/the_mechanar/instance_mechanar.cpp scripts/outland/blades_edge_mountains.cpp scripts/outland/boss_doomlord_kazzak.cpp scripts/outland/boss_doomwalker.cpp @@ -297,204 +495,6 @@ SET(trinityscript_LIB_SRCS scripts/outland/shattrath_city.cpp scripts/outland/terokkar_forest.cpp scripts/outland/zangarmarsh.cpp - scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp - scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp - scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp - scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp - scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp - scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp - scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h - scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp - scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp - scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp - scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp - scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp - scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h - scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp - scripts/zone/black_temple/black_temple.cpp - scripts/zone/black_temple/boss_bloodboil.cpp - scripts/zone/black_temple/boss_illidan.cpp - scripts/zone/black_temple/boss_mother_shahraz.cpp - scripts/zone/black_temple/boss_reliquary_of_souls.cpp - scripts/zone/black_temple/boss_shade_of_akama.cpp - scripts/zone/black_temple/boss_supremus.cpp - scripts/zone/black_temple/boss_teron_gorefiend.cpp - scripts/zone/black_temple/boss_warlord_najentus.cpp - scripts/zone/black_temple/def_black_temple.h - scripts/zone/black_temple/illidari_council.cpp - scripts/zone/black_temple/instance_black_temple.cpp - scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp - scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp - scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp - scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp - scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp - scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp - scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h - scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp - scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp - scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp - scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp - scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h - scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp - scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp - scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp - scripts/zone/gruuls_lair/boss_gruul.cpp - scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp - scripts/zone/gruuls_lair/def_gruuls_lair.h - scripts/zone/gruuls_lair/instance_gruuls_lair.cpp - scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp - scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp - scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp - scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp - scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h - scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp - scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp - scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp - scripts/zone/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h - scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp - scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp - scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h - scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp - scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp - scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp - scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h - scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp - scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp - scripts/zone/naxxramas/boss_anubrekhan.cpp - scripts/zone/naxxramas/boss_faerlina.cpp - scripts/zone/naxxramas/boss_gluth.cpp - scripts/zone/naxxramas/boss_gothik.cpp - scripts/zone/naxxramas/boss_grobbulus.cpp - scripts/zone/naxxramas/boss_heigan.cpp - scripts/zone/naxxramas/boss_kelthuzad.cpp - scripts/zone/naxxramas/boss_four_horsemen.cpp - scripts/zone/naxxramas/boss_loatheb.cpp - scripts/zone/naxxramas/boss_maexxna.cpp - scripts/zone/naxxramas/boss_noth.cpp - scripts/zone/naxxramas/boss_patchwerk.cpp - scripts/zone/naxxramas/boss_razuvious.cpp - scripts/zone/naxxramas/boss_sapphiron.cpp - scripts/zone/naxxramas/boss_thaddius.cpp - scripts/zone/naxxramas/def_naxxramas.h - scripts/zone/naxxramas/instance_naxxramas.cpp - scripts/zone/tempest_keep/arcatraz/arcatraz.cpp - scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp - scripts/zone/tempest_keep/arcatraz/def_arcatraz.h - scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp - scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp - scripts/zone/tempest_keep/botanica/boss_laj.cpp - scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp - scripts/zone/tempest_keep/the_eye/boss_alar.cpp - scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp - scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp - scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp - scripts/zone/tempest_keep/the_eye/def_the_eye.h - scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp - scripts/zone/tempest_keep/the_eye/the_eye.cpp - scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp - scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp - scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp - scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp - scripts/zone/tempest_keep/the_mechanar/def_mechanar.h - scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp - scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp - scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp - scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp - scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp - scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h - scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp - scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp - scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp - scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp - scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp - scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp - scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h - scripts/zone/nexus/nexus/instance_nexus.cpp - scripts/zone/nexus/nexus/boss_magus_telestra.cpp - scripts/zone/nexus/nexus/boss_anomalus.cpp - scripts/zone/nexus/nexus/boss_ormorok.cpp - scripts/zone/nexus/nexus/boss_keristrasza.cpp - scripts/zone/nexus/nexus/commander_stoutbeard.cpp - scripts/zone/nexus/nexus/commander_kolurg.cpp - scripts/zone/nexus/nexus/def_nexus.h - scripts/zone/nexus/oculus/instance_oculus.cpp - scripts/zone/nexus/oculus/boss_drakos.cpp - scripts/zone/nexus/oculus/boss_urom.cpp - scripts/zone/nexus/oculus/boss_varos.cpp - scripts/zone/nexus/oculus/boss_eregos.cpp - scripts/zone/nexus/oculus/def_oculus.h - scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp - scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp - scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp - scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp - scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h - scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp - scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp - scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp - scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp - scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp - scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp - scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h - scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp - scripts/zone/draktharon_keep/boss_trollgore.cpp - scripts/zone/draktharon_keep/boss_novos.cpp - scripts/zone/draktharon_keep/boss_dred.cpp - scripts/zone/draktharon_keep/boss_tharon_ja.cpp - scripts/zone/draktharon_keep/def_drak_tharon_keep.h - scripts/zone/violet_hold/instance_violet_hold.cpp - scripts/zone/violet_hold/boss_cyanigosa.cpp - scripts/zone/violet_hold/boss_erekem.cpp - scripts/zone/violet_hold/boss_ichoron.cpp - scripts/zone/violet_hold/boss_lavanthor.cpp - scripts/zone/violet_hold/boss_moragg.cpp - scripts/zone/violet_hold/boss_xevozz.cpp - scripts/zone/violet_hold/boss_zuramat.cpp - scripts/zone/violet_hold/def_violet_hold.h - scripts/zone/gundrak/instance_gundrak.cpp - scripts/zone/gundrak/boss_slad_ran.cpp - scripts/zone/gundrak/boss_moorabi.cpp - scripts/zone/gundrak/boss_drakkari_colossus.cpp - scripts/zone/gundrak/boss_gal_darah.cpp - scripts/zone/gundrak/boss_eck.cpp - scripts/zone/gundrak/def_gundrak.h - scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp - scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp - scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp - scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp - scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h - scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp - scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp - scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp - scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp - scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp - scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h - scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp - scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp - scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h - scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp - scripts/zone/obsidian_sanctum/boss_sartharion.cpp - scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h - scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp - scripts/zone/vault_of_archavon/boss_archavon.cpp - scripts/zone/vault_of_archavon/boss_emalon.cpp - scripts/zone/vault_of_archavon/def_vault_of_archavon.h - scripts/zone/wintergrasp/wintergrasp.cpp - scripts/zone/ulduar/ulduar/boss_algalon.cpp - scripts/zone/ulduar/ulduar/boss_assembly_of_iron.cpp - scripts/zone/ulduar/ulduar/boss_auriaya.cpp - scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp - scripts/zone/ulduar/ulduar/boss_freya.cpp - scripts/zone/ulduar/ulduar/boss_general_vezax.cpp - scripts/zone/ulduar/ulduar/boss_hodir.cpp - scripts/zone/ulduar/ulduar/boss_ignis.cpp - scripts/zone/ulduar/ulduar/boss_kologarn.cpp - scripts/zone/ulduar/ulduar/boss_mimiron.cpp - scripts/zone/ulduar/ulduar/boss_razorscale.cpp - scripts/zone/ulduar/ulduar/boss_thorim.cpp - scripts/zone/ulduar/ulduar/boss_xt002.cpp - scripts/zone/ulduar/ulduar/boss_yoggsaron.cpp - scripts/zone/ulduar/ulduar/def_ulduar.h - scripts/zone/ulduar/ulduar/instance_ulduar.cpp scripts/world/areatrigger_scripts.cpp scripts/world/boss_emeriss.cpp scripts/world/boss_lethon.cpp diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 00b918bd22e..3136b5d6adc 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -1585,1070 +1585,1030 @@ - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Steam Vault" + > + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Underbog" + > + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Blood Furnace" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - + + + + + - - + - - + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="The Mechanar" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - - - - - - - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + - + + + + + + + + + + + - - + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + - + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -2859,6 +2138,10 @@ RelativePath="..\scripts\northrend\sholazar_basin.cpp" > + + @@ -2867,1042 +2150,462 @@ - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Steam Vault" + > + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Underbog" + > + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="Blood Furnace" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - + + + + + - - + - - + - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + Name="The Mechanar" + > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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: boss_amanitar +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: Only appears in heroic mode +SDCategory: Ahn'kahet +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_amanitar' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +#define SPELL_BASH 57094 +#define SPELL_ENTANGLING_ROOTS 57095 +#define SPELL_MINI 57055 +#define SPELL_VENOM_BOLT_VOLLEY 57088 + +struct TRINITY_DLL_DECL boss_amanitarAI : public ScriptedAI +{ + boss_amanitarAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) {} + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + } +}; + +CreatureAI* GetAI_boss_amanitar(Creature* pCreature) +{ + return new boss_amanitarAI (pCreature); +} + +void AddSC_boss_amanitar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_amanitar"; + newscript->GetAI = &GetAI_boss_amanitar; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp new file mode 100644 index 00000000000..129f7b34db6 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_elder_nadox.cpp @@ -0,0 +1,274 @@ +/* + * 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_elder_nadox +SD%Complete: 100 +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +bool DeadAhnkaharGuardian; // needed for achievement: Respect Your Elders(2038) + +#define ACHIEVEMENT_RESPECT_YOUR_ELDERS 2038 + +#define SAY_AGGRO -1619014 +#define SAY_SLAY_1 -1619015 +#define SAY_SLAY_2 -1619016 +#define SAY_SLAY_3 -1619017 +#define SAY_DEATH -1619018 +#define SAY_EGG_SAC_1 -1619019 +#define SAY_EGG_SAC_2 -1619020 + +#define SPELL_BROOD_PLAGUE 56130 +#define H_SPELL_BROOD_PLAGUE 59467 +#define H_SPELL_BROOD_RAGE 59465 +#define SPELL_ENRAGE 26662// Enraged if too far away from home + +#define MOB_AHNKAHAR_SWARMER 30178 +#define SPELL_SUMMON_SWARMERS 56119//2x 30178 -- 2x every 10secs + +#define MOB_AHNKAHAR_GUARDIAN_ENTRY 30176 +#define SPELL_SUMMON_SWARM_GUARD 56120//1x 30176 -- every 25secs +#define SPELL_GUARDIAN_AURA 56151 + +struct TRINITY_DLL_DECL boss_elder_nadoxAI : public ScriptedAI +{ + boss_elder_nadoxAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 plague_Timer; + uint32 rage_Timer; + + uint32 swarmer_spawn_Timer; + uint32 guard_spawn_Timer; + uint32 enrage_Timer; + + + ScriptedInstance *pInstance; + + void Reset() + { + plague_Timer = 13000; + rage_Timer = 20000; + + swarmer_spawn_Timer = 10000; + guard_spawn_Timer = 25000; + + enrage_Timer = 5000; + + DeadAhnkaharGuardian = false; + + if (pInstance) + pInstance->SetData(DATA_ELDER_NADOX_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_DEATH,m_creature); + + if (pInstance) + pInstance->SetData(DATA_ELDER_NADOX_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1,m_creature); break; + case 1: DoScriptText(SAY_SLAY_2,m_creature); break; + case 2: DoScriptText(SAY_SLAY_3,m_creature); break; + } + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_SLAY_3,m_creature); + + if (HeroicMode && !DeadAhnkaharGuardian) + { + AchievementEntry const *AchievRespectYourElders = GetAchievementStore()->LookupEntry(ACHIEVEMENT_RESPECT_YOUR_ELDERS); + if (AchievRespectYourElders) + { + Map* pMap = m_creature->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + itr->getSource()->CompletedAchievement(AchievRespectYourElders); + } + } + } + + if (pInstance) + pInstance->SetData(DATA_ELDER_NADOX_EVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (plague_Timer < diff) + { + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_BROOD_PLAGUE : SPELL_BROOD_PLAGUE); + plague_Timer = 15000; + }else plague_Timer -= diff; + + if (HeroicMode) + if (rage_Timer < diff) + { + Unit* Swarmer = m_creature->FindNearestCreature(MOB_AHNKAHAR_SWARMER, 35); + + if (Swarmer) + { + DoCast(Swarmer,H_SPELL_BROOD_RAGE,true); + rage_Timer = 15000; + } + }else rage_Timer -= diff; + + if (swarmer_spawn_Timer < diff) + { + DoCast(m_creature,SPELL_SUMMON_SWARMERS,true); + DoCast(m_creature,SPELL_SUMMON_SWARMERS); + if (rand()%3 == 0) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_EGG_SAC_1,m_creature); break; + case 1: DoScriptText(SAY_EGG_SAC_2,m_creature); break; + } + } + swarmer_spawn_Timer = 10000; + }else swarmer_spawn_Timer -= diff; + + if (guard_spawn_Timer < diff) + { + m_creature->MonsterTextEmote("An Ahn'kahar Guardian hatches!",m_creature->GetGUID(),true); + DoCast(m_creature,SPELL_SUMMON_SWARM_GUARD); + guard_spawn_Timer = 25000; + }else guard_spawn_Timer -= diff; + + if (enrage_Timer < diff) + { + if (m_creature->HasAura(SPELL_ENRAGE,0)) + return; + + float x, y, z, o; + m_creature->GetHomePosition(x, y, z, o); + if (z < 24) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(m_creature,SPELL_ENRAGE,true); + } + } + enrage_Timer = 5000; + }else enrage_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_elder_nadox(Creature* pCreature) +{ + return new boss_elder_nadoxAI(pCreature); +} + +#define SPELL_SPRINT 56354 + +struct TRINITY_DLL_DECL mob_ahnkahar_nerubianAI : public ScriptedAI +{ + mob_ahnkahar_nerubianAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + uint32 sprint_Timer; + + void Reset() + { + if (m_creature->GetEntry() == 30176) + DoCast(m_creature,SPELL_GUARDIAN_AURA,true); + sprint_Timer = 10000; + } + + void JustDied(Unit *killer) + { + if (m_creature->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY) + DeadAhnkaharGuardian = true; + } + + void EnterCombat(Unit *who){} + + void UpdateAI(const uint32 diff) + { + if (m_creature->GetEntry() == 30176) + m_creature->RemoveAurasDueToSpell(SPELL_GUARDIAN_AURA); + + if (pInstance) + { + if (pInstance->GetData(DATA_ELDER_NADOX_EVENT) != IN_PROGRESS) + { + m_creature->DealDamage(m_creature,m_creature->GetHealth()); + m_creature->RemoveCorpse(); + } + } + + if (!UpdateVictim()) + return; + + if (sprint_Timer < diff) + { + DoCast(m_creature,SPELL_SPRINT); + sprint_Timer = 25000; + }else sprint_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_ahnkahar_nerubian(Creature* pCreature) +{ + return new mob_ahnkahar_nerubianAI(pCreature); +} + +void AddSC_boss_elder_nadox() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_elder_nadox"; + newscript->GetAI = &GetAI_boss_elder_nadox; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ahnkahar_nerubian"; + newscript->GetAI = &GetAI_mob_ahnkahar_nerubian; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp new file mode 100644 index 00000000000..820c260801e --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_herald_volazj.cpp @@ -0,0 +1,111 @@ +/* + * 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_herald_volazj +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_volazj' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +//Spells +#define SPELL_INSANITY 57496 //Dummy +#define INSANITY_VISUAL 57561 +#define SPELL_MIND_FLAY_N 57941 +#define SPELL_MIND_FLAY_H 59974 +#define SPELL_SHADOW_BOLT_VOLLEY_1 57942 +#define SPELL_SHADOW_BOLT_VOLLEY_2 59975 +#define SPELL_SHIVER_N 57949 +#define SPELL_SHIVER_H 59978 + +//Yell +#define SAY_AGGRO -1619030 +#define SAY_SLAY_1 -1619031 +#define SAY_SLAY_2 -1619032 +#define SAY_SLAY_3 -1619033 +#define SAY_DEATH_1 -1619034 +#define SAY_DEATH_2 -1619035 +#define SAY_PHASE -1619036 + +struct TRINITY_DLL_DECL boss_volazjAI : public ScriptedAI +{ + boss_volazjAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + phase =1; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + if (phase == 1) + DoScriptText(SAY_DEATH_1, m_creature); + else + DoScriptText(SAY_DEATH_2, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_volazj(Creature* pCreature) +{ + return new boss_volazjAI (pCreature); +} + +void AddSC_boss_volazj() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_volazj"; + newscript->GetAI = &GetAI_boss_volazj; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp new file mode 100644 index 00000000000..47a7d79e87b --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp @@ -0,0 +1,109 @@ +/* + * 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_jedoga_shadowseeker +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_jedoga' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +#define SPELL_CYCLONE_STRIKE 56855 +#define H_SPELL_CYCLONE_STRIKE 60030//kein unterschied zu 56855 außer das 60030 1,5sec cast ist +#define SPELL_LIGHTNING_BOLT 56891 +#define H_SPELL_LIGHTNING_BOLT 60032 +#define SPELL_THUNDERSHOCK 56926//AOE works +#define H_SPELL_THUNDERSHOCK 60029//AOE works +#define SPELL_GIFT_OF_THE_HERALD 56219//triggert if sucessfull sacreficed + +#define SAY_AGGRO -1619000 +#define SAY_C_SACRIFICE_1 -1619001 +#define SAY_C_SACRIFICE_2 -1619002 +#define SAY_SACRIFICE_1 -1619003 +#define SAY_SACRIFICE_2 -1619004 +#define SAY_SLAY_1 -1619005 +#define SAY_SLAY_2 -1619006 +#define SAY_SLAY_3 -1619007 +#define SAY_DEATH -1619008 +#define SAY_PREACHING_1 -1619009 +#define SAY_PREACHING_2 -1619010 +#define SAY_PREACHING_3 -1619011 +#define SAY_PREACHING_4 -1619012 +#define SAY_PREACHING_5 -1619013 + +struct TRINITY_DLL_DECL boss_jedogaAI : public ScriptedAI +{ + boss_jedogaAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_jedoga(Creature* pCreature) +{ + return new boss_jedogaAI (pCreature); +} + +void AddSC_boss_jedoga() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_jedoga"; + newscript->GetAI = &GetAI_boss_jedoga; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp new file mode 100644 index 00000000000..cb34d8919d7 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp @@ -0,0 +1,109 @@ +/* + * 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_prince_taldaram +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: +SDCategory: Ahn'kahet +EndScriptData */ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +#define SPELL_BLOODTHIRST 55968 //Trigger Spell + add aura +#define SPELL_CONJURE_FLAME_SPHERE 55931 + +#define SPELL_FLAME_SPHERE_SUMMON_1 55895// 1x 30106 +#define H_SPELL_FLAME_SPHERE_SUMMON_1 59511// 1x 31686 +#define H_SPELL_FLAME_SPHERE_SUMMON_2 59512// 1x 31687 +#define SPELL_FLAME_SPHERE_SPAWN_EFFEKT 55891 +#define SPELL_FLAME_SPHERE_VISUAL 55928 +#define SPELL_FLAME_SPHERE_PERIODIC 55926 +#define H_SPELL_FLAME_SPHERE_PERIODIC 59508 +#define SPELL_FLAME_SPHERE_DEATH_EFFEKT 55947 + +#define SPELL_EMBRACE_OF_THE_VAMPYR 55959 +#define H_SPELL_EMBRACE_OF_THE_VAMPYR 59513 + +#define SPELL_VANISH 55964 + +//Yell +#define SAY_AGGRO -1619021 +#define SAY_SLAY_1 -1619022 +#define SAY_SLAY_2 -1619023 +#define SAY_SLAY_3 -1619024 +#define SAY_DEATH -1619025 +#define SAY_FEED_1 -1619026 +#define SAY_FEED_2 -1619027 +#define SAY_VANISH_1 -1619028 +#define SAY_VANISH_2 -1619029 + +struct TRINITY_DLL_DECL boss_taldaramAI : public ScriptedAI +{ + boss_taldaramAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_taldaram(Creature* pCreature) +{ + return new boss_taldaramAI (pCreature); +} + +void AddSC_boss_taldaram() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_taldaram"; + newscript->GetAI = &GetAI_boss_taldaram; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/def_ahnkahet.h b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/def_ahnkahet.h new file mode 100644 index 00000000000..97c0db55d72 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/def_ahnkahet.h @@ -0,0 +1,33 @@ +/* + * 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 + */ + +#ifndef DEF_AHNKAHET_H +#define DEF_AHNKAHET_H + +#define DATA_ELDER_NADOX 1 +#define DATA_PRINCE_TALDARAM 2 +#define DATA_JEDOGA_SHADOWSEEKER 3 +#define DATA_HERALD_VOLAZJ 4 +#define DATA_AMANITAR 5 + +#define DATA_ELDER_NADOX_EVENT 6 +#define DATA_PRINCE_TALDARAM_EVENT 7 +#define DATA_JEDOGA_SHADOWSEEKER_EVENT 8 +#define DATA_HERALD_VOLAZJ_EVENT 9 +#define DATA_AMANITAR_EVENT 10 +#endif diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/instance_ahnkahet.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/instance_ahnkahet.cpp new file mode 100644 index 00000000000..db9befd65cf --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/ahnkahet/instance_ahnkahet.cpp @@ -0,0 +1,194 @@ +/* + * 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: Instance_Azjol_Nerub +SD%Complete: 0 +SDComment: +SDCategory: Azjol Nerub +EndScriptData */ + +#include "precompiled.h" +#include "def_ahnkahet.h" + +#define MAX_ENCOUNTER 5 + +/* Ahn'kahet encounters: +0 - Elder Nadox +1 - Prince Taldaram +2 - Jedoga Shadowseeker +3 - Herald Volazj +4 - Amanitar (Heroic only) +*/ + +struct TRINITY_DLL_DECL instance_ahnkahet : public ScriptedInstance +{ + instance_ahnkahet(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 Elder_Nadox; + uint64 Prince_Taldaram; + uint64 Jedoga_Shadowseeker; + uint64 Herald_Volazj; + uint64 Amanitar; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + Elder_Nadox =0; + Prince_Taldaram =0; + Jedoga_Shadowseeker =0; + Herald_Volazj =0; + Amanitar =0; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + m_auiEncounter[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 29309: Elder_Nadox = pCreature->GetGUID(); break; + case 29308: Prince_Taldaram = pCreature->GetGUID(); break; + case 29310: Jedoga_Shadowseeker = pCreature->GetGUID(); break; + case 29311: Herald_Volazj = pCreature->GetGUID(); break; + case 30258: Amanitar = pCreature->GetGUID(); break; + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_ELDER_NADOX: return Elder_Nadox; + case DATA_PRINCE_TALDARAM: return Prince_Taldaram; + case DATA_JEDOGA_SHADOWSEEKER: return Jedoga_Shadowseeker; + case DATA_HERALD_VOLAZJ: return Herald_Volazj; + case DATA_AMANITAR: return Amanitar; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_ELDER_NADOX_EVENT: + m_auiEncounter[0] = data;break; + case DATA_PRINCE_TALDARAM_EVENT: + m_auiEncounter[1] = data; break; + case DATA_JEDOGA_SHADOWSEEKER_EVENT: + m_auiEncounter[2] = data; break; + case DATA_HERALD_VOLAZJ: + m_auiEncounter[3] = data; break; + case DATA_AMANITAR: + m_auiEncounter[4] = data; break; + } + + if (data == DONE) + { + SaveToDB(); + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_ELDER_NADOX_EVENT: return m_auiEncounter[0]; + case DATA_PRINCE_TALDARAM_EVENT: return m_auiEncounter[1]; + case DATA_JEDOGA_SHADOWSEEKER_EVENT: return m_auiEncounter[2]; + case DATA_HERALD_VOLAZJ: return m_auiEncounter[3]; + case DATA_AMANITAR: return m_auiEncounter[4]; + } + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::string str_data; + + std::ostringstream saveStream; + saveStream << "A K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2] << m_auiEncounter[3] << m_auiEncounter[4]; + + str_data = saveStream.str(); + + OUT_SAVE_INST_DATA_COMPLETE; + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + char dataHead1, dataHead2; + uint16 data0,data1,data2,data3,data4; + + std::istringstream loadStream(in); + loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4; + + if (dataHead1 == 'A' && dataHead2 == 'K') + { + m_auiEncounter[0] = data0; + m_auiEncounter[1] = data1; + m_auiEncounter[2] = data2; + m_auiEncounter[3] = data3; + m_auiEncounter[4] = data4; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + }else OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_ahnkahet(Map* pMap) +{ + return new instance_ahnkahet(pMap); +} + +void AddSC_instance_ahnkahet() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_ahnkahet"; + newscript->GetInstanceData = &GetInstanceData_instance_ahnkahet; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp new file mode 100644 index 00000000000..b4717824443 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_anubarak.cpp @@ -0,0 +1,112 @@ +/* + * 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_anubarak +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: +SDCategory: Azjol Nerub +EndScriptData */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_anub_arak' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_azjol_nerub.h" + +//Spells +#define SPELL_CARRION_BEETLES 53520 +#define SPELL_LOCUST_SWARM 53467 +#define SPELL_IMPALE 53454 +#define SPELL_POUND 53472 + +//Yell +#define SAY_INTRO -1601010 +#define SAY_AGGRO -1601000 +#define SAY_SLAY_1 -1601001 +#define SAY_SLAY_2 -1601002 +#define SAY_SLAY_3 -1601003 +#define SAY_LOCUST_1 -1601005 +#define SAY_LOCUST_2 -1601006 +#define SAY_LOCUST_3 -1601007 +#define SAY_SUBMERGE_1 -1601008 +#define SAY_SUBMERGE_2 -1601009 +#define SAY_DEATH -1601004 + +struct TRINITY_DLL_DECL boss_anub_arakAI : public ScriptedAI +{ + boss_anub_arakAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + phase =1; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 33) + phase = 2; + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 15) + phase = 3; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_anub_arak(Creature* pCreature) +{ + return new boss_anub_arakAI (pCreature); +} + +void AddSC_boss_anub_arak() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_anub_arak"; + newscript->GetAI = &GetAI_boss_anub_arak; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp new file mode 100644 index 00000000000..fa85563a2e7 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_hadronox.cpp @@ -0,0 +1,114 @@ +/* + * 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_hadronox +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Azjol Nerub +EndScriptData */ + +#include "precompiled.h" +#include "def_azjol_nerub.h" + +#define SPELL_WEB_FRONT_DOORS 53177//dummy + +#define SPELL_ACID_CLOUD 53400 +#define H_SPELL_ACID_CLOUD 59419 +#define SPELL_LEECH_POISON 53030 +#define H_SPELL_LEECH_POISON 59417 +#define SPELL_LEECH_POISON_DEADTRIGGER 53800//heal 10% heroic und normal +#define SPELL_PIECE_ARMOR 53418 +#define SPELL_WEB_GRAB 53406 +#define H_SPELL_WEB_GRAB 59420 + +/* Script Data Start +SDName: Boss hadronox +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_hadronox' where entry = ''; +*** SQL END ***/ + +//Spells +#define SPELL_LEECH_POISON 53030 +#define SPELL_ACID_CLOUD 53400 +#define SPELL_PIERCE_ARMOR 53418 //Source SUN++ +#define SPELL_WEB_GRAB 53406 + +//Phase 0 => Gauntlet Event described below +//Phase 1 => Boss Encounter + +/*When your group enters the main room (the one after the bridge), you will notice a group of 3 Nerubians. +When you engage them, 2 more groups like this one spawn behind the first one - it is important to pull the first group back, +so you don't aggro all 3. Hadronox will be under you, fighting Nerubians. + +This is the timed gauntlet - waves of non-elite spiders + will spawn from the 3 doors located a little above the main room, and will then head down to fight Hadronox. After clearing the + main room, it is recommended to just stay in it, kill the occasional non-elites that will attack you instead of the boss, and wait for + Hadronox to make his way to you. When Hadronox enters the main room, she will web the doors, and no more non-elites will spawn.*/ + +struct TRINITY_DLL_DECL boss_hadronoxAI : public ScriptedAI +{ + boss_hadronoxAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + phase =1; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + //when Hadronox kills any enemy (that includes a party member) she will regain 10% of her HP if the target had Leech Poison on + } +}; + +CreatureAI* GetAI_boss_hadronox(Creature* pCreature) +{ + return new boss_hadronoxAI (pCreature); +} + +void AddSC_boss_hadronox() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_hadronox"; + newscript->GetAI = &GetAI_boss_hadronox; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp new file mode 100644 index 00000000000..3e0d3e97a51 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp @@ -0,0 +1,116 @@ +/* + * 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_krikthir_the_gatewatcher +SDAuthor: LordVanMartin +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Azjol Nerub +EndScriptData */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_krik_thir' where entry = ''; +*** SQL END ***/ + +#include "precompiled.h" +#include "def_azjol_nerub.h" + +#define SPELL_MIND_FLAY 52586 +#define H_SPELL_MIND_FLAY 59367 +#define SPELL_CURSE_OF_FATIGUE 52592 +#define H_SPELL_CURSE_OF_FATIGUE 59368 +#define SPELL_FRENZY 28747 // maybe 53361 + +#define MOB_SKITTERING_SWARMER 28735 +#define MOB_SKITTERING_SWARMER_CONTROLLER 32593 + +#define SPELL_SUMMON_SKITTERING_SWARMER 52438//AOE Effekt 140, maybe 52439 +#define SPELL_SUMMON_SKITTERING_SWARMER 52439//Summon 3x 28735 + +//Yell +#define SAY_AGGRO -1601011 +#define SAY_SLAY_1 -1601012 +#define SAY_SLAY_2 -1601013 +#define SAY_SLAY_3 -1601014 +#define SAY_DEATH -1601015 +#define SAY_SEND_GROUP_1 -1601018 +#define SAY_SEND_GROUP_2 -1601019 +#define SAY_SEND_GROUP_3 -1601020 +#define SAY_SWARM_1 -1601016 +#define SAY_SWARM_2 -1601017 +#define SAY_PREFIGHT_1 -1601021 +#define SAY_PREFIGHT_2 -1601022 +#define SAY_PREFIGHT_3 -1601023 + +struct TRINITY_DLL_DECL boss_krik_thirAI : public ScriptedAI +{ + boss_krik_thirAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) >= 10) + { + //Frenzy + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_krik_thir(Creature* pCreature) +{ + return new boss_krik_thirAI (pCreature); +} + +void AddSC_boss_krik_thir() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_krik_thir"; + newscript->GetAI = &GetAI_boss_krik_thir; + newscript->RegisterSelf(); + +} diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/def_azjol_nerub.h b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/def_azjol_nerub.h new file mode 100644 index 00000000000..9e319e8fde0 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/def_azjol_nerub.h @@ -0,0 +1,29 @@ +/* + * 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 + */ + +#ifndef DEF_AZJOL_NERUB_H +#define DEF_AZJOL_NERUB_H + +#define DATA_KRIKTHIR_THE_GATEWATCHER 1 +#define DATA_HADRONOX 2 +#define DATA_ANUBARAK 3 + +#define DATA_KRIKTHIR_THE_GATEWATCHER_EVENT 4 +#define DATA_HADRONOX_EVENT 5 +#define DATA_ANUBARAK_EVENT 6 +#endif diff --git a/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp new file mode 100644 index 00000000000..bac772acc6f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp @@ -0,0 +1,178 @@ +/* + * 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: Instance_Azjol_Nerub +SD%Complete: 0 +SDComment: Placeholder +SDCategory: Azjol Nerub +EndScriptData */ + +#include "precompiled.h" +#include "def_azjol_nerub.h" + +#define MAX_ENCOUNTER 3 + +/* Azjol Nerub encounters: +0 - Krik'thir the Gatewatcher +1 - Hadronox +2 - Anub'arak +*/ + +struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance +{ + instance_azjol_nerub(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 m_uiKrikthir; + uint64 m_uiHadronox; + uint64 m_uiAnubarak; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiKrikthir = 0; + m_uiHadronox = 0; + m_uiAnubarak =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 28684: m_uiKrikthir = pCreature->GetGUID(); break; + case 28921: m_uiHadronox = pCreature->GetGUID(); break; + case 29120: m_uiAnubarak = pCreature->GetGUID(); break; + + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_KRIKTHIR_THE_GATEWATCHER: return m_uiKrikthir; + case DATA_HADRONOX: return m_uiHadronox; + case DATA_ANUBARAK: return m_uiAnubarak; + } + + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: + m_auiEncounter[0] = data;break; + case DATA_HADRONOX_EVENT: + m_auiEncounter[1] = data; break; + case DATA_ANUBARAK_EVENT: + m_auiEncounter[2] = data; break; + } + + if (data == DONE) + { + SaveToDB(); + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: return m_auiEncounter[0]; + case DATA_HADRONOX_EVENT: return m_auiEncounter[1]; + case DATA_ANUBARAK_EVENT: return m_auiEncounter[2]; + } + + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::string str_data; + + std::ostringstream saveStream; + saveStream << "A N " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2]; + + str_data = saveStream.str(); + + OUT_SAVE_INST_DATA_COMPLETE; + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + char dataHead1, dataHead2; + uint16 data0,data1,data2; + + std::istringstream loadStream(in); + loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2; + + if (dataHead1 == 'A' && dataHead2 == 'N') + { + m_auiEncounter[0] = data0; + m_auiEncounter[1] = data1; + m_auiEncounter[2] = data2; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + }else OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_azjol_nerub(Map* pMap) +{ + return new instance_azjol_nerub(pMap); +} + +void AddSC_instance_azjol_nerub() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_azjol_nerub"; + newscript->GetInstanceData = &GetInstanceData_instance_azjol_nerub; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_dred.cpp b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_dred.cpp new file mode 100644 index 00000000000..98425a29e1a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_dred.cpp @@ -0,0 +1,56 @@ +/* Script Data Start +SDName: Boss dred +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_BELLOWING_ROAR 44863 // fears the group, can be resisted/dispelled +#define SPELL_GRIEVOUS_BITE 48920 +#define SPELL_MANGLING_SLASH 48873 //casted on the current tank, adds debuf +#define SPELL_FEARSOME_ROAR_N 48849 +#define SPELL_FEARSOME_ROAR_H 48849 //Not stacking, debuff +#define SPELL_PIERCING_SLASH 48878 //debuff -->Armor reduced by 75% +#define SPELL_RAPTOR_CALL 59416 //dummy + + +struct TRINITY_DLL_DECL boss_dredAI : public ScriptedAI +{ + boss_dredAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_dred(Creature* pCreature) +{ + return new boss_dredAI (pCreature); +} + +void AddSC_boss_dred() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_dred"; + newscript->GetAI = &GetAI_boss_dred; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_novos.cpp b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_novos.cpp new file mode 100644 index 00000000000..2f1cc7d22fc --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_novos.cpp @@ -0,0 +1,75 @@ +/* Script Data Start +SDName: Boss novos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_novos' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_BLAST_N 49198 +#define SPELL_ARCANE_BLAST_H 59909 +#define SPELL_ARCANE_FIELD 47346 +#define SPELL_BLIZZARD_N 49034 +#define SPELL_BLIZZARD_H 59854 +#define SPELL_FROSTBOLT_N 49037 +#define SPELL_FROSTBOLT_H 59855 +#define SPELL_WRATH_OF_MISERY_N 50089 +#define SPELL_WRATH_OF_MISERY_H 59856 +#define SPELL_SUMMON_MINIONS 59910 //Summons an army of Fetid Troll Corpses to assist the caster. + +//Yell +#define SAY_AGGRO -1600000 +#define SAY_KILL -1600001 +#define SAY_DEATH -1600002 +#define SAY_NECRO_ADD -1600003 +#define SAY_REUBBLE_1 -1600004 +#define SAY_REUBBLE_2 -1600005 + +struct TRINITY_DLL_DECL boss_novosAI : public ScriptedAI +{ + boss_novosAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + DoScriptText(SAY_KILL, m_creature); + } +}; + +CreatureAI* GetAI_boss_novos(Creature* pCreature) +{ + return new boss_novosAI (pCreature); +} + +void AddSC_boss_novos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_novos"; + newscript->GetAI = &GetAI_boss_novos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp new file mode 100644 index 00000000000..62d724f4de4 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_tharon_ja.cpp @@ -0,0 +1,88 @@ +/* Script Data Start +SDName: Boss tharon_ja +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_tharon_ja' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_COURSE_OF_LIFE 49527 +#define SPELL_DECAY_FLESH 49356 //casted at end of pahase 1, starts phase 2 +#define SPELL_EYE_BEAM_N 49544 +#define SPELL_LIGHTNING_BREATH_N 49537 +#define SPELL_POISON_CLOUD_N 49548 +#define SPELL_RAIN_OF_FIRE_N 49518 +#define SPELL_RETURN_FLESH 53463 //Channeled spell ending phase two and returning to phase 1. This ability will stun the party for 6 seconds. +#define SPELL_SHADOW_VOLLEY_N 49528 + +//Spells Heroic +#define SPELL_COURSE_OF_LIFE_H 59972 +#define SPELL_EYE_BEAM_H 59965 +#define SPELL_LIGHTNING_BREATH_H 59963 +#define SPELL_POISON_CLOUD_H 59969 +#define SPELL_RAIN_OF_FIRE_H 59971 +#define SPELL_SHADOW_VOLLEY_H 59973 + +//Players skills durring Phase2 +#define PLAYER_PHASE2_SLAYING_STRIKE 50799 +#define PLAYER_PHASE2_TAUNT 49613 +#define PLAYER_PHASE2_BONE_ARMOR 49609 +#define PLAYER_PHASE2_TOUCH_OF_LIFE 49617 +//Phase 1 all abilities except Eye beam +//Phase 2 turns players to skeletons with new abilities, boss grows skin + +//Yell +#define SAY_AGGRO 1600011 +#define SAY_KILL_1 1600012 +#define SAY_KILL_2 1600013 +#define SAY_FLESH_1 1600014 +#define SAY_FLESH_2 1600015 +#define SAY_SKELETON_1 1600016 +#define SAY_SKELETON_2 1600017 +#define SAY_DEATH 1600018 + +struct TRINITY_DLL_DECL boss_tharon_jaAI : public ScriptedAI +{ + boss_tharon_jaAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH,m_creature); + } +}; + +CreatureAI* GetAI_boss_tharon_ja(Creature* pCreature) +{ + return new boss_tharon_jaAI (pCreature); +} + +void AddSC_boss_tharon_ja() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_tharon_ja"; + newscript->GetAI = &GetAI_boss_tharon_ja; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_trollgore.cpp b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_trollgore.cpp new file mode 100644 index 00000000000..59f68c37205 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/boss_trollgore.cpp @@ -0,0 +1,75 @@ +/* Script Data Start +SDName: Boss trollgore +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_trollgore' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spell +#define SPELL_INFECTED_WOUND 49637 +#define SPELL_CRUSH 49639 +#define SPELL_CORPSE_EXPLODE_N 49555 +#define SPELL_CONSUME_N 49380 + +//Spell Heroic +#define SPELL_CORPSE_EXPLODE_H 59807 +#define SPELL_CONSUME_H 59803 + +//Yell +#define SAY_AGGRO -1600006 +#define SAY_KILL -1600007 +#define SAY_CONSUME -1600008 +#define SAY_EXPLODE -1600009 +#define SAY_DEATH -1600010 + +struct TRINITY_DLL_DECL boss_trollgoreAI : public ScriptedAI +{ + boss_trollgoreAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + DoScriptText(SAY_KILL, m_creature); + } +}; + +CreatureAI* GetAI_boss_trollgore(Creature* pCreature) +{ + return new boss_trollgoreAI (pCreature); +} + +void AddSC_boss_trollgore() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_trollgore"; + newscript->GetAI = &GetAI_boss_trollgore; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/def_drak_tharon_keep.h b/src/bindings/scripts/scripts/northrend/draktharon_keep/def_drak_tharon_keep.h new file mode 100644 index 00000000000..321d77a9c27 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/def_drak_tharon_keep.h @@ -0,0 +1,4 @@ +#ifndef DEF_DRAK_THARON_H +#define DEF_DRAK_THARON_H + +#endif diff --git a/src/bindings/scripts/scripts/northrend/draktharon_keep/instance_drak_tharon_keep.cpp b/src/bindings/scripts/scripts/northrend/draktharon_keep/instance_drak_tharon_keep.cpp new file mode 100644 index 00000000000..795f36eca18 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/draktharon_keep/instance_drak_tharon_keep.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_drak_tharon_keep.h" + +struct TRINITY_DLL_DECL instance_drak_tharon : public ScriptedInstance +{ + instance_drak_tharon(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_drak_tharon(Map* pMap) +{ + return new instance_drak_tharon(pMap); +} + +void AddSC_instance_drak_tharon() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_drak_tharon"; + newscript->GetInstanceData = &GetInstanceData_instance_drak_tharon; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/gundrak/boss_drakkari_colossus.cpp b/src/bindings/scripts/scripts/northrend/gundrak/boss_drakkari_colossus.cpp new file mode 100644 index 00000000000..4d18ad6ba7c --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/gundrak/boss_drakkari_colossus.cpp @@ -0,0 +1,55 @@ +/* Script Data Start +SDName: Boss Drakkari Colossus +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_EMERGE 54850 //to phase2, Colossus unatackable, Elemental emerges +#define SPELL_EMERGE_2 54851 +#define SPELL_MIGHTY_BLOW 54719 + +struct TRINITY_DLL_DECL boss_drakkari_colossusAI : public ScriptedAI +{ + boss_drakkari_colossusAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + phase =1; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_drakkari_colossus(Creature* pCreature) +{ + return new boss_drakkari_colossusAI (pCreature); +} + +void AddSC_boss_drakkari_colossus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_drakkari_colossus"; + newscript->GetAI = &GetAI_boss_drakkari_colossus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/gundrak/boss_eck.cpp b/src/bindings/scripts/scripts/northrend/gundrak/boss_eck.cpp new file mode 100644 index 00000000000..8c72de6c9ad --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/gundrak/boss_eck.cpp @@ -0,0 +1,65 @@ +/* Script Data Start +SDName: Boss Eck the Ferocious +SDAuthor: LordVanMartin +SD%Complete: +SDComment: Only appears in Heroic mode +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +#define SPELL_ECK_BERSERK 55816 //Eck goes berserk, increasing his attack speed by 150% and all damage he deals by 500%. +#define SPELL_ECK_BITE 55813 //Eck bites down hard, inflicting 150% of his normal damage to an enemy. +#define SPELL_ECK_SPIT 55814 //Eck spits toxic bile at enemies in a cone in front of him, inflicting 2970 Nature damage and draining 220 mana every 1 sec for 3 sec. +#define SPELL_ECK_SPRING_1 55815 //Eck leaps at a distant target. --> Drops aggro and charges a random player. Tank can simply taunt him back. +#define SPELL_ECK_SPRING_2 55837 //Eck leaps at a distant target. + +struct TRINITY_DLL_DECL boss_eckAI : public ScriptedAI +{ + boss_eckAI(Creature *c) : ScriptedAI(c) {} + + uint32 berserk; + + void Reset() + { + //Source Deadly Boss Mod + berserk = 120000; //2min + } + + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (berserk < diff) + { + DoCast(m_creature,SPELL_ECK_BERSERK); + berserk = 120000; + }else berserk -= diff; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_eck(Creature* pCreature) +{ + return new boss_eckAI (pCreature); +} + +void AddSC_boss_eck() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_eck"; + newscript->GetAI = &GetAI_boss_eck; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/gundrak/boss_gal_darah.cpp b/src/bindings/scripts/scripts/northrend/gundrak/boss_gal_darah.cpp new file mode 100644 index 00000000000..65edd1b312e --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/gundrak/boss_gal_darah.cpp @@ -0,0 +1,85 @@ +/* Script Data Start +SDName: Boss gal_darah +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ENRAGE 55285 +#define SPELL_IMPALING_CHARGE 54956 +#define SPELL_STOMP 55292 + +#define SPELL_PUNCTURE 55276 +#define SPELL_STAMPEDE 55218 +#define SPELL_WHIRLING_SLASH 55285 + +//Yells +#define SAY_AGGRO -1604000 +#define SAY_SLAY_1 -1604001 +#define SAY_SLAY_2 -1604002 +#define SAY_SLAY_3 -1604003 +#define SAY_DEATH -1604004 +#define SAY_SUMMON_RHINO_1 -1604005 +#define SAY_SUMMON_RHINO_2 -1604006 +#define SAY_SUMMON_RHINO_3 -1604007 +#define SAY_TRANSFORM_1 -1604008 //Phase change +#define SAY_TRANSFORM_2 -1604009 + +struct TRINITY_DLL_DECL boss_gal_darahAI : public ScriptedAI +{ + boss_gal_darahAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_gal_darah(Creature* pCreature) +{ + return new boss_gal_darahAI (pCreature); +} + +void AddSC_boss_gal_darah() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_gal_darah"; + newscript->GetAI = &GetAI_boss_gal_darah; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/gundrak/boss_moorabi.cpp b/src/bindings/scripts/scripts/northrend/gundrak/boss_moorabi.cpp new file mode 100644 index 00000000000..7bdbe0eebc9 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/gundrak/boss_moorabi.cpp @@ -0,0 +1,88 @@ +/* Script Data Start +SDName: Boss moorabi +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_moorabi' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_DETERMINED_GORE 55102 +#define SPELL_DETERMINED_STAB_2 59444 +#define SPELL_DETERMINED_STAB_3 55104 + +#define SPELL_GROUND_TREMOR 55142 +#define SPELL_MOJO_FRENZY 55163 +#define SPELL_NUMBING_ROAR_1 55100 +#define SPELL_NUMBING_ROAR_2 55106 +#define SPELL_TRANSFORMATION 55098 //Periodic, The caster transforms into a powerful mammoth, increasing Physical damage done by 25% and granting immunity to Stun effects. +#define SPELL_QUAKE 55101 + +//Yell +#define SAY_AGGRO -1604010 +#define SAY_SLAY_1 -1604011 +#define SAY_SLAY_2 -1604012 +#define SAY_SLAY_3 -1604013 +#define SAY_DEATH -1604014 +#define SAY_TRANSFORM -1604015 +#define SAY_QUAKE -1604016 + +struct TRINITY_DLL_DECL boss_moorabiAI : public ScriptedAI +{ + boss_moorabiAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + phase =1; + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_moorabi(Creature* pCreature) +{ + return new boss_moorabiAI (pCreature); +} + +void AddSC_boss_moorabi() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_moorabi"; + newscript->GetAI = &GetAI_boss_moorabi; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/gundrak/boss_slad_ran.cpp b/src/bindings/scripts/scripts/northrend/gundrak/boss_slad_ran.cpp new file mode 100644 index 00000000000..559a0090e3b --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/gundrak/boss_slad_ran.cpp @@ -0,0 +1,95 @@ +/* Script Data Start +SDName: Boss slad_ran +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_slad_ran' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_POISON_NOVA 55081 +#define SPELL_POISON_NOVA_2 59842 +//-- +#define SPELL_POWERFUL_BITE 48287 +#define SPELL_POWERFUL_BITE_2 59840 +//-- +#define SPELL_VENOM_BOLT 54970 +#define SPELL_VENOM_BOLT_2 59839 +//At 30% HPStart summoning small serpents + +//Yell +#define SAY_AGGRO -1604017 +#define SAY_SLAY_1 -1604018 +#define SAY_SLAY_2 -1604019 +#define SAY_SLAY_3 -1604020 +#define SAY_DEATH -1604021 +#define SAY_SUMMON_SNAKES -1604022 //npc 29680 +#define SAY_SUMMON_CONSTRICTORS -1604023 //npc 29713, can cast Grip of Slad'ran (spell 55093) + +struct TRINITY_DLL_DECL boss_slad_ranAI : public ScriptedAI +{ + boss_slad_ranAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) + { + //Summon 3 snakes --> npc 29680 + DoScriptText(SAY_SUMMON_SNAKES,m_creature); + } + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) + { + //Summon 3 constrictors --> npc 29713 + DoScriptText(SAY_SUMMON_CONSTRICTORS,m_creature); + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%3) + { + case 0:DoScriptText(SAY_SLAY_1, m_creature);break; + case 1:DoScriptText(SAY_SLAY_2, m_creature);break; + case 2:DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_slad_ran(Creature* pCreature) +{ + return new boss_slad_ranAI (pCreature); +} + +void AddSC_boss_slad_ran() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_slad_ran"; + newscript->GetAI = &GetAI_boss_slad_ran; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/gundrak/def_gundrak.h b/src/bindings/scripts/scripts/northrend/gundrak/def_gundrak.h new file mode 100644 index 00000000000..5f015610312 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/gundrak/def_gundrak.h @@ -0,0 +1,4 @@ +#ifndef DEF_GUNDRAK_H +#define DEF_GUNDRAK_H + +#endif diff --git a/src/bindings/scripts/scripts/northrend/gundrak/instance_gundrak.cpp b/src/bindings/scripts/scripts/northrend/gundrak/instance_gundrak.cpp new file mode 100644 index 00000000000..0ed874d905f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/gundrak/instance_gundrak.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_gundrak.h" + +struct TRINITY_DLL_DECL instance_gundrak : public ScriptedInstance +{ + instance_gundrak(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_gundrak(Map* pMap) +{ + return new instance_gundrak(pMap); +} + +void AddSC_instance_gundrak() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_gundrak"; + newscript->GetInstanceData = &GetInstanceData_instance_gundrak; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_anubrekhan.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_anubrekhan.cpp new file mode 100644 index 00000000000..835a5bfa2da --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_anubrekhan.cpp @@ -0,0 +1,123 @@ +/* Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +#define SAY_GREET RAND(-1533000,-1533004,-1533005,-1533006,-1533007) +#define SAY_AGGRO RAND(-1533001,-1533002,-1533003) +#define SAY_SLAY -1533008 + +#define SPELL_IMPALE HEROIC(28783,56090) +#define SPELL_LOCUSTSWARM HEROIC(28785,54021) + +#define SPELL_SELF_SPAWN_5 29105 //This spawns 5 corpse scarabs ontop of us (most likely the player casts this on death) + +#define EVENT_IMPALE 1 +#define EVENT_LOCUST 2 + +#define MOB_CRYPT_GUARD 16573 + +struct TRINITY_DLL_DECL boss_anubrekhanAI : public BossAI +{ + boss_anubrekhanAI(Creature *c) : BossAI(c, BOSS_ANUBREKHAN) { HasTaunted = false; } + + bool HasTaunted; + + void Prepare() + { + HasTaunted = false; + DoSpawnCreature(MOB_CRYPT_GUARD, 0, 10, 0, me->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); + if (HeroicMode) + DoSpawnCreature(MOB_CRYPT_GUARD, 0, -10, 0, me->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); + } + + void InitializeAI() { Prepare(); } + void JustReachedHome() { Prepare(); _JustReachedHome(); } + + void KilledUnit(Unit* victim) + { + //Force the player to spawn corpse scarabs via spell + victim->CastSpell(victim, SPELL_SELF_SPAWN_5, true, NULL, NULL, me->GetGUID()); + + if (!(rand()%5)) + DoScriptText(SAY_SLAY, me); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + events.ScheduleEvent(EVENT_IMPALE, 15000, 1); + events.ScheduleEvent(EVENT_LOCUST, 80000 + rand()%40000, 1); + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && me->IsWithinDistInMap(who, 60.0f)) + { + DoScriptText(SAY_GREET, me); + HasTaunted = true; + } + ScriptedAI::MoveInLineOfSight(who); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() || !CheckInRoom()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_IMPALE: + //Cast Impale on a random target + //Do NOT cast it when we are afflicted by locust swarm + if (!me->HasAura(SPELL_LOCUSTSWARM)) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_IMPALE); + events.ScheduleEvent(EVENT_IMPALE, 15000, 1); + events.DelayEvents(1500, 1); + return; + case EVENT_LOCUST: + DoCast(m_creature, SPELL_LOCUSTSWARM); + DoSpawnCreature(MOB_CRYPT_GUARD, 5, 5, 0, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); + events.ScheduleEvent(EVENT_LOCUST, 90000, 1); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_anubrekhan(Creature* pCreature) +{ + return new boss_anubrekhanAI (pCreature); +} + +void AddSC_boss_anubrekhan() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_anubrekhan"; + newscript->GetAI = &GetAI_boss_anubrekhan; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_faerlina.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_faerlina.cpp new file mode 100644 index 00000000000..4be8f839e3d --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_faerlina.cpp @@ -0,0 +1,122 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +#define SAY_GREET -1533009 +#define SAY_AGGRO RAND(-1533010,-1533011,-1533012,-1533013) +#define SAY_SLAY RAND(-1533014,-1533015) +#define SAY_DEATH -1533016 + +//#define SOUND_RANDOM_AGGRO 8955 //soundId containing the 4 aggro sounds, we not using this + +#define SPELL_POSION_BOLT_VOLLEY HEROIC(28796,54098) +#define SPELL_RAIN_OF_FIRE HEROIC(28794,54099) +#define SPELL_FRENZY HEROIC(28798,54100) +#define SPELL_WIDOWS_EMBRACE HEROIC(28732,54097) + +enum Events +{ + EVENT_POSION = 1, + EVENT_FIRE, + EVENT_FRENZY, +}; + +struct TRINITY_DLL_DECL boss_faerlinaAI : public BossAI +{ + boss_faerlinaAI(Creature *c) : BossAI(c, BOSS_FAERLINA), greet(false) {} + + bool greet; + + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + events.ScheduleEvent(EVENT_POSION, 10000 + rand()%15000); + events.ScheduleEvent(EVENT_FIRE, 5000 + rand()%15000); + events.ScheduleEvent(EVENT_FRENZY, 60000 + rand()%20000); + } + + void MoveInLineOfSight(Unit *who) + { + if (!greet) + { + DoScriptText(SAY_GREET, me); + greet = true; + } + BossAI::MoveInLineOfSight(who); + } + + void KilledUnit(Unit* victim) + { + if (!(rand()%3)) + DoScriptText(SAY_SLAY, me); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_POSION: + if (!me->HasAura(SPELL_WIDOWS_EMBRACE)) + DoCastAOE(SPELL_POSION_BOLT_VOLLEY); + events.ScheduleEvent(EVENT_POSION, 10000 + rand()%15000); + return; + case EVENT_FIRE: + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_RAIN_OF_FIRE); + events.ScheduleEvent(EVENT_FIRE, 5000 + rand()%15000); + return; + case EVENT_FRENZY: + DoCast(me,SPELL_FRENZY); + events.ScheduleEvent(EVENT_FRENZY, 60000 + rand()%20000); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_faerlina(Creature* pCreature) +{ + return new boss_faerlinaAI (pCreature); +} + +void AddSC_boss_faerlina() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_faerlina"; + newscript->GetAI = &GetAI_boss_faerlina; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_four_horsemen.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_four_horsemen.cpp new file mode 100644 index 00000000000..467f5ef62e9 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_four_horsemen.cpp @@ -0,0 +1,167 @@ +/* Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +enum Horsemen +{ + HORSEMEN_THANE, + HORSEMEN_LADY, + HORSEMEN_BARON, + HORSEMEN_SIR, +}; + +enum Events +{ + EVENT_MARK = 1, + EVENT_CAST, + EVENT_BERSERK, +}; + +const uint32 MOB_HORSEMEN[] = {16064, 16065, 30549, 16063}; +const uint32 SPELL_MARK[] = {28832, 28833, 28834, 28835}; +#define SPELL_PRIMARY(i) HEROIC(SPELL_PRIMARY_N[i],SPELL_PRIMARY_H[i]) +const uint32 SPELL_PRIMARY_N[] = {28884, 28863, 28882, 28883}; +const uint32 SPELL_PRIMARY_H[] = {57467, 57463, 57369, 57466}; +#define SPELL_SECONDARY(i) HEROIC(SPELL_SECONDARY_N[i],SPELL_SECONDARY_H[i]) +const uint32 SPELL_SECONDARY_N[]= {0, 57374, 0, 57376}; +const uint32 SPELL_SECONDARY_H[]= {0, 57464, 0, 57465}; +const uint32 SPELL_PUNISH[] = {0, 57381, 0, 57377}; +#define SPELL_BERSERK 26662 + +const int32 SAY_AGGRO[] = {-1533051, -1533044, -1533065, -1533058}; +const int32 SAY_TAUNT[3][4] ={ {-1533052, -1533045, -1533071, -1533059}, + {-1533053, -1533046, -1533072, -1533060}, + {-1533054, -1533047, -1533073, -1533061},}; +const int32 SAY_SPECIAL[] = {-1533055, -1533048, -1533070, -1533062}; +const int32 SAY_SLAY[] = {-1533056, -1533049, -1533068, -1533063}; +const int32 SAY_DEATH[] = {-1533057, -1533050, -1533074, -1533064}; + +#define SAY_BARON_AGGRO RAND(-1533065,-1533066,-1533067) +#define SAY_BARON_SLAY RAND(-1533068,-1533069) + +struct TRINITY_DLL_DECL boss_four_horsemenAI : public BossAI +{ + boss_four_horsemenAI(Creature *c) : BossAI(c, BOSS_HORSEMEN) + { + id = Horsemen(0); + for(uint8 i = 1; i < 4; ++i) + if (me->GetEntry() == MOB_HORSEMEN[i]) + id = Horsemen(i); + caster = (id == HORSEMEN_LADY || id == HORSEMEN_SIR); + } + + Horsemen id; + bool caster; + + void MoveInLineOfSight(Unit *who) + { + BossAI::MoveInLineOfSight(who); + if (caster) + SelectNearestTarget(who); + } + + void AttackStart(Unit *who) + { + if (caster) + AttackStartCaster(who, 20); + else + BossAI::AttackStart(who); + } + + void KilledUnit(Unit* victim) + { + if (!(rand()%5)) + { + if (id == HORSEMEN_BARON) + DoScriptText(SAY_BARON_SLAY, me); + else + DoScriptText(SAY_SLAY[id], me); + } + } + + void JustDied(Unit* killer) + { + _JustDied(); + DoScriptText(SAY_DEATH[id], me); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + if (id == HORSEMEN_BARON) + DoScriptText(SAY_BARON_AGGRO, me); + else + DoScriptText(SAY_AGGRO[id], me); + events.ScheduleEvent(EVENT_MARK, 15000); + events.ScheduleEvent(EVENT_CAST, 20000+rand()%5000); + events.ScheduleEvent(EVENT_BERSERK, 15*100*1000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() || !CheckInRoom()) + return; + + events.Update(diff); + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_MARK: + if (!(rand()%5)) + DoScriptText(SAY_SPECIAL[id], me); + DoCastAOE(SPELL_MARK[id]); + events.ScheduleEvent(EVENT_MARK, 15000); + return; + case EVENT_CAST: + if (!(rand()%5)) + DoScriptText(SAY_TAUNT[rand()%3][id], me); + DoCast(SPELL_PRIMARY(id)); + events.ScheduleEvent(EVENT_CAST, 15000); + return; + case EVENT_BERSERK: + DoScriptText(SAY_SPECIAL[id], me); + DoCast(me, EVENT_BERSERK); + return; + } + } + + if (!caster) + DoMeleeAttackIfReady(); + else if (!DoSpellAttackIfReady(SPELL_SECONDARY(id))) + DoCastAOE(SPELL_PUNISH[id]); + } +}; + +CreatureAI* GetAI_four_horsemen(Creature* pCreature) +{ + return new boss_four_horsemenAI (pCreature); +} + +void AddSC_boss_four_horsemen() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_four_horsemen"; + newscript->GetAI = &GetAI_four_horsemen; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_gluth.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_gluth.cpp new file mode 100644 index 00000000000..a92c34a019c --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_gluth.cpp @@ -0,0 +1,160 @@ +/* Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +#define SPELL_MORTAL_WOUND 25646 +#define SPELL_ENRAGE HEROIC(28371,54427) +#define SPELL_DECIMATE HEROIC(28374,54426) +#define SPELL_BERSERK 26662 +#define SPELL_INFECTED_WOUND 29306 + +#define MOB_ZOMBIE 16360 + +const float PosSummon[3][4] = +{ + {3267.9, -3172.1, 297.42, 0.94}, + {3253.2, -3132.3, 297.42, 0}, + {3308.3, -3185.8, 297.42, 1.58}, +}; + +enum Events +{ + EVENT_WOUND = 1, + EVENT_ENRAGE, + EVENT_DECIMATE, + EVENT_BERSERK, + EVENT_SUMMON, +}; + +struct TRINITY_DLL_DECL boss_gluthAI : public BossAI +{ + boss_gluthAI(Creature *c) : BossAI(c, BOSS_GLUTH) + { + // Do not let Gluth be affected by zombies' debuff + me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_INFECTED_WOUND, true); + } + + std::vector triggers; + + void Reset() + { + triggers.clear(); + _Reset(); + } + + void MoveInLineOfSight(Unit *who) + { + if (who->GetEntry() == MOB_ZOMBIE && me->IsWithinDistInMap(who, 20)) + { + SetGazeOn(who); + me->MonsterTextEmote(" spots a nearby zombie to devour!", 0, true); + } + else + BossAI::MoveInLineOfSight(who); + } + + void EnterCombat(Unit *who) + { + for(uint32 i = 0; i < 3; ++i) + if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummon[i])) + triggers.push_back(trigger); + if (triggers.size() < 3) + { + error_log("Script Gluth: cannot summon triggers!"); + EnterEvadeMode(); + return; + } + + _EnterCombat(); + events.ScheduleEvent(EVENT_WOUND, 10000); + events.ScheduleEvent(EVENT_ENRAGE, 30000); + events.ScheduleEvent(EVENT_DECIMATE, 105000); + events.ScheduleEvent(EVENT_BERSERK, 8*60000); + events.ScheduleEvent(EVENT_SUMMON, 10000); + } + + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == WORLD_TRIGGER) + summon->setActive(true); + else if (summon->GetEntry() == MOB_ZOMBIE) + summon->AI()->AttackStart(me); + summons.Summon(summon); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictimWithGaze() || !CheckInRoom()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_WOUND: + DoCast(me->getVictim(), SPELL_MORTAL_WOUND); + events.ScheduleEvent(EVENT_WOUND, 10000); + return; + case EVENT_ENRAGE: + DoCast(me, SPELL_ENRAGE); + events.ScheduleEvent(EVENT_ENRAGE, 30000); + return; + case EVENT_DECIMATE: + DoCastAOE(SPELL_DECIMATE); + events.ScheduleEvent(EVENT_DECIMATE, 105000); + return; + case EVENT_BERSERK: + DoCast(me, SPELL_BERSERK); + return; + case EVENT_SUMMON: + for(uint32 i = 0; i < HEROIC(1,2); ++i) + DoSummon(MOB_ZOMBIE, triggers[rand()%3]); + events.ScheduleEvent(EVENT_SUMMON, 10000); + return; + } + } + + if (me->getVictim()->GetEntry() == MOB_ZOMBIE) + { + if (me->IsWithinMeleeRange(me->getVictim())) + { + me->Kill(me->getVictim()); + me->ModifyHealth(me->GetMaxHealth() * 0.05f); + } + } + else + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_gluth(Creature* pCreature) +{ + return new boss_gluthAI (pCreature); +} + +void AddSC_boss_gluth() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_gluth"; + newscript->GetAI = &GetAI_boss_gluth; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_gothik.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_gothik.cpp new file mode 100644 index 00000000000..f98e7667e6e --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_gothik.cpp @@ -0,0 +1,347 @@ +/* Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +#define SAY_SPEECH -1533040 +#define SAY_KILL -1533041 +#define SAY_DEATH -1533042 +#define SAY_TELEPORT -1533043 + +//Gothik +#define SPELL_HARVEST_SOUL 28679 +#define SPELL_SHADOW_BOLT HEROIC(29317,56405) + +#define SPELL_INFORM_LIVE_TRAINEE 27892 +#define SPELL_INFORM_LIVE_KNIGHT 27928 +#define SPELL_INFORM_LIVE_RIDER 27935 +#define SPELL_INFORM_DEAD_TRAINEE 27915 +#define SPELL_INFORM_DEAD_KNIGHT 27931 +#define SPELL_INFORM_DEAD_RIDER 27937 + +#define MOB_LIVE_TRAINEE 16124 +#define MOB_LIVE_KNIGHT 16125 +#define MOB_LIVE_RIDER 16126 +#define MOB_DEAD_TRAINEE 16127 +#define MOB_DEAD_KNIGHT 16148 +#define MOB_DEAD_RIDER 16150 +#define MOB_DEAD_HORSE 16149 + +const struct Waves { uint32 entry, number, time; } +waves[] = +{ + {MOB_LIVE_TRAINEE, 2, 20000}, + {MOB_LIVE_TRAINEE, 2, 20000}, + {MOB_LIVE_TRAINEE, 2, 10000}, + {MOB_LIVE_KNIGHT, 1, 10000}, + {MOB_LIVE_TRAINEE, 2, 15000}, + {MOB_LIVE_KNIGHT, 1, 10000}, + {MOB_LIVE_TRAINEE, 2, 15000}, + {MOB_LIVE_TRAINEE, 2, 0}, + {MOB_LIVE_KNIGHT, 1, 10000}, + {MOB_LIVE_RIDER, 1, 10000}, + {MOB_LIVE_TRAINEE, 2, 5000}, + {MOB_LIVE_KNIGHT, 1, 15000}, + {MOB_LIVE_TRAINEE, 2, 0}, + {MOB_LIVE_RIDER, 1, 10000}, + {MOB_LIVE_KNIGHT, 2, 10000}, + {MOB_LIVE_TRAINEE, 2, 10000}, + {MOB_LIVE_RIDER, 1, 5000}, + {MOB_LIVE_KNIGHT, 1, 5000}, + {MOB_LIVE_TRAINEE, 2, 20000}, + {MOB_LIVE_TRAINEE, 2, 0}, + {MOB_LIVE_KNIGHT, 1, 0}, + {MOB_LIVE_RIDER, 1, 15000}, + {MOB_LIVE_TRAINEE, 2, 29000}, + {0, 0, 0}, +}; + +#define POS_Y_GATE -3360.78f + +enum Events +{ + EVENT_SUMMON = 1, + EVENT_HARVEST, + EVENT_BOLT, +}; + +#define POS_LIVE 3 +#define POS_DEAD 5 + +const float PosSummonLive[POS_LIVE][4] = +{ + {2669.7, -3430.9, 268.56, 1.6}, + {2692.0, -3430.9, 268.56, 1.6}, + {2714.1, -3430.9, 268.56, 1.6}, +}; + +const float PosSummonDead[POS_DEAD][4] = +{ + {2725.1, -3310.0, 268.85, 3.4}, + {2699.3, -3322.8, 268.60, 3.3}, + {2733.1, -3348.5, 268.84, 3.1}, + {2682.8, -3304.2, 268.85, 3.9}, + {2664.8, -3340.7, 268.23, 3.7}, +}; + +const float PosGround[4] = {2691.2, -3362.7, 267.68, 1.7}; +const float PosPlatform[4] = {2640.5, -3360.6, 285.26, 0}; + +struct TRINITY_DLL_DECL boss_gothikAI : public BossAI +{ + boss_gothikAI(Creature *c) : BossAI(c, BOSS_GOTHIK) {} + + uint32 waveCount; + std::vector liveTrigger; + std::vector deadTrigger; + + void Reset() + { + liveTrigger.clear(); + deadTrigger.clear(); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + me->SetReactState(REACT_PASSIVE); + _Reset(); + } + + void EnterCombat(Unit *who) + { + for(uint32 i = 0; i < POS_LIVE; ++i) + if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummonLive[i])) + liveTrigger.push_back(trigger); + for(uint32 i = 0; i < POS_DEAD; ++i) + if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummonDead[i])) + deadTrigger.push_back(trigger); + + if (liveTrigger.size() < POS_LIVE || deadTrigger.size() < POS_DEAD) + { + error_log("Script Gothik: cannot summon triggers!"); + EnterEvadeMode(); + return; + } + + _EnterCombat(); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + waveCount = 0; + events.ScheduleEvent(EVENT_SUMMON, 30000); + DoTeleportTo(PosPlatform); + DoScriptText(SAY_SPEECH, me); + if (instance) + instance->SetData(DATA_GOTHIK_GATE, 1); + } + + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == WORLD_TRIGGER) + summon->setActive(true); + else + { + summon->AI()->DoAction(me->HasReactState(REACT_PASSIVE) ? 1 : 0); + summon->AI()->EnterEvadeMode(); + } + summons.Summon(summon); + } + + void KilledUnit(Unit* victim) + { + if (!(rand()%5)) + DoScriptText(SAY_KILL, me); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + uint32 spellId = 0; + switch(spell->Id) + { + case SPELL_INFORM_LIVE_TRAINEE: spellId = SPELL_INFORM_DEAD_TRAINEE; break; + case SPELL_INFORM_LIVE_KNIGHT: spellId = SPELL_INFORM_DEAD_KNIGHT; break; + case SPELL_INFORM_LIVE_RIDER: spellId = SPELL_INFORM_DEAD_RIDER; break; + } + if (spellId && me->isInCombat()) + { + me->HandleEmoteCommand(EMOTE_ONESHOT_SPELLCAST); + me->CastSpell(deadTrigger[rand()%POS_DEAD], spellId, true); + } + } + + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (!me->isInCombat()) + return; + + switch(spell->Id) + { + case SPELL_INFORM_DEAD_TRAINEE: DoSummon(MOB_DEAD_TRAINEE, target, 0); break; + case SPELL_INFORM_DEAD_KNIGHT: DoSummon(MOB_DEAD_KNIGHT, target, 0); break; + case SPELL_INFORM_DEAD_RIDER: DoSummon(MOB_DEAD_RIDER, target, 1.0f); + DoSummon(MOB_DEAD_HORSE, target, 1.0f); break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateCombatState() || !CheckInRoom()) + return; + + events.Update(diff); + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_SUMMON: + if (waves[waveCount].entry) + { + for(uint32 i = 0; i < waves[waveCount].number; ++i) + DoSummon(waves[waveCount].entry, liveTrigger[rand()%POS_LIVE], 1.0f); + events.ScheduleEvent(EVENT_SUMMON, waves[waveCount].time); + ++waveCount; + } + else + { + DoScriptText(SAY_TELEPORT, me); + DoTeleportTo(PosGround); + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + if (instance) + instance->SetData(DATA_GOTHIK_GATE, 0); + summons.DoAction(0, 0); + summons.DoZoneInCombat(); + events.ScheduleEvent(EVENT_BOLT, 1000); + events.ScheduleEvent(EVENT_HARVEST, 15000); + } + break; + case EVENT_BOLT: + DoCast(me->getVictim(), SPELL_SHADOW_BOLT); + events.ScheduleEvent(EVENT_BOLT, 1000); + return; + case EVENT_HARVEST: + DoCast(me->getVictim(), SPELL_HARVEST_SOUL); + events.ScheduleEvent(EVENT_HARVEST, 15000); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL mob_gothik_minionAI : public SpellAI +{ + mob_gothik_minionAI(Creature *c) : SpellAI(c) + { + liveSide = me->GetPositionY() < POS_Y_GATE; + } + + bool liveSide; + bool gateClose; + +#define SIDE_CHECK(who) (liveSide == (who->GetPositionY() < POS_Y_GATE)) + + void DoAction(const int32 param) + { + gateClose = param; + } + + void DamageTaken(Unit *attacker, uint32 &damage) + { + if (gateClose && !SIDE_CHECK(attacker)) + damage = 0; + } + + void JustDied(Unit *killer) + { + if (me->isSummon()) + { + if (Unit *owner = CAST_SUM(me)->GetSummoner()) + SpellAI::JustDied(owner); + } + } + + void EnterEvadeMode() + { + if (!gateClose) + { + SpellAI::EnterEvadeMode(); + return; + } + + if (!_EnterEvadeMode()) + return; + + Map* pMap = me->GetMap(); + if (pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive() && SIDE_CHECK(i->getSource())) + { + AttackStart(i->getSource()); + return; + } + } + } + + me->GetMotionMaster()->MoveIdle(); + Reset(); + } + + void UpdateAI(const uint32 diff) + { + if (gateClose && (!SIDE_CHECK(me) || me->getVictim() && !SIDE_CHECK(me->getVictim()))) + { + EnterEvadeMode(); + return; + } + + SpellAI::UpdateAI(diff); + } +}; + +CreatureAI* GetAI_boss_gothik(Creature* pCreature) +{ + return new boss_gothikAI (pCreature); +} + +CreatureAI* GetAI_mob_gothik_minion(Creature* pCreature) +{ + return new mob_gothik_minionAI (pCreature); +} + +void AddSC_boss_gothik() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_gothik"; + newscript->GetAI = &GetAI_boss_gothik; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_gothik_minion"; + newscript->GetAI = &GetAI_mob_gothik_minion; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_grobbulus.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_grobbulus.cpp new file mode 100644 index 00000000000..9195e0e7828 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_grobbulus.cpp @@ -0,0 +1,103 @@ +/* Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +#define SPELL_BOMBARD_SLIME 28280 + +#define SPELL_POISON_CLOUD 28240 +#define SPELL_MUTATING_INJECTION 28169 +#define SPELL_SLIME_SPRAY HEROIC(28157,54364) +#define SPELL_BERSERK 26662 + +#define EVENT_BERSERK 1 +#define EVENT_CLOUD 2 +#define EVENT_INJECT 3 +#define EVENT_SPRAY 4 + +#define MOB_FALLOUT_SLIME 16290 + +struct TRINITY_DLL_DECL boss_grobbulusAI : public BossAI +{ + boss_grobbulusAI(Creature *c) : BossAI(c, BOSS_GROBBULUS) {} + + void EnterCombat(Unit *who) + { + _EnterCombat(); + events.ScheduleEvent(EVENT_CLOUD, 15000); + events.ScheduleEvent(EVENT_INJECT, 20000); + events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); //not sure + events.ScheduleEvent(EVENT_BERSERK, 12*60000); + } + + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (spell->Id == SPELL_SLIME_SPRAY) + { + if (TempSummon *slime = me->SummonCreature(MOB_FALLOUT_SLIME, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0)) + DoZoneInCombat(slime); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_CLOUD: + DoCastAOE(SPELL_POISON_CLOUD); + events.ScheduleEvent(EVENT_CLOUD, 15000); + return; + case EVENT_BERSERK: + DoCastAOE(SPELL_BERSERK); + return; + case EVENT_SPRAY: + DoCastAOE(SPELL_SLIME_SPRAY); + events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); + return; + case EVENT_INJECT: + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (!target->HasAura(SPELL_MUTATING_INJECTION)) + DoCast(target, SPELL_MUTATING_INJECTION); + events.ScheduleEvent(EVENT_INJECT, 8000 + 12000 * ((float)me->GetHealth() / me->GetMaxHealth())); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_grobbulus(Creature* pCreature) +{ + return new boss_grobbulusAI (pCreature); +} + +void AddSC_boss_grobbulus() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_grobbulus"; + newscript->GetAI = &GetAI_boss_grobbulus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_heigan.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_heigan.cpp new file mode 100644 index 00000000000..8491ab95703 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_heigan.cpp @@ -0,0 +1,150 @@ +/* Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +#define SAY_AGGRO RAND(-1533109,-1533110,-1533111) +#define SAY_SLAY -1533112 +#define SAY_TAUNT RAND(-1533113,-1533114,-1533115,-1533116,-1533117) +#define SAY_DEATH -1533118 + +#define SPELL_SPELL_DISRUPTION 29310 +#define SPELL_DECREPIT_FEVER HEROIC(29998,55011) +#define SPELL_PLAGUE_CLOUD 29350 + +enum Events +{ + EVENT_DISRUPT = 1, + EVENT_FEVER, + EVENT_ERUPT, + EVENT_PHASE, +}; + +enum Phases +{ + PHASE_FIGHT = 1, + PHASE_DANCE, +}; + +//Spell by eye stalks +#define SPELL_MIND_FLAY 26143 + +struct TRINITY_DLL_DECL boss_heiganAI : public BossAI +{ + boss_heiganAI(Creature *c) : BossAI(c, BOSS_HEIGAN) {} + + uint32 eruptSection; + bool eruptDirection; + Phases phase; + + void KilledUnit(Unit* Victim) + { + if (!(rand()%5)) + DoScriptText(SAY_SLAY, me); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + EnterPhase(PHASE_FIGHT); + } + + void EnterPhase(Phases newPhase) + { + phase = newPhase; + events.Reset(); + eruptSection = 3; + if (phase == PHASE_FIGHT) + { + events.ScheduleEvent(EVENT_DISRUPT, 0); + events.ScheduleEvent(EVENT_FEVER, 20000); + events.ScheduleEvent(EVENT_PHASE, 85000); + events.ScheduleEvent(EVENT_ERUPT, 10000); + } + else + { + float x, y, z, o; + me->GetHomePosition(x, y, z, o); + me->NearTeleportTo(x, y, z, o); + DoCastAOE(SPELL_PLAGUE_CLOUD); + events.ScheduleEvent(EVENT_PHASE, 45000); + events.ScheduleEvent(EVENT_ERUPT, 5000); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() || !CheckInRoom()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_DISRUPT: + DoCastAOE(SPELL_SPELL_DISRUPTION); + events.ScheduleEvent(EVENT_DISRUPT, 5000); + return; + case EVENT_FEVER: + DoCastAOE(SPELL_DECREPIT_FEVER); + events.ScheduleEvent(EVENT_FEVER, 20000); + return; + case EVENT_PHASE: + EnterPhase(phase == PHASE_FIGHT ? PHASE_DANCE : PHASE_FIGHT); + return; + case EVENT_ERUPT: + instance->SetData(DATA_HEIGAN_ERUPT, eruptSection); + TeleportCheaters(); + + if (eruptSection == 0) + eruptDirection = true; + else if (eruptSection == 3) + eruptDirection = false; + + eruptDirection ? ++eruptSection : --eruptSection; + + events.ScheduleEvent(EVENT_ERUPT, phase == PHASE_FIGHT ? 10000 : 3000); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_heigan(Creature* pCreature) +{ + return new boss_heiganAI (pCreature); +} + +void AddSC_boss_heigan() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_heigan"; + newscript->GetAI = &GetAI_boss_heigan; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_highlord_mograine.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_highlord_mograine.cpp new file mode 100644 index 00000000000..9bef8ebd3f9 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_highlord_mograine.cpp @@ -0,0 +1,179 @@ +/* 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_Highlord_Mograine +SD%Complete: 100 +SDComment: SCRIPT OBSOLETE +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" + +//All horsemen +#define SPELL_SHIELDWALL 29061 +#define SPELL_BESERK 26662 + +// highlord mograine +#define SPELL_MARK_OF_MOGRAINE 28834 +#define SPELL_RIGHTEOUS_FIRE 28882 // Applied as a 25% chance on melee hit to proc. m_creature->GetVictim() + +#define SAY_TAUNT1 "Enough prattling. Let them come! We shall grind their bones to dust." +#define SAY_TAUNT2 "Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough." +#define SAY_TAUNT3 "Life is meaningless. It is in death that we are truly tested." +#define SAY_AGGRO1 "You seek death?" +#define SAY_AGGRO2 "None shall pass!" +#define SAY_AGGRO3 "Be still!" +#define SAY_SLAY1 "You will find no peace in death." +#define SAY_SLAY2 "The master's will is done." +#define SAY_SPECIAL "Bow to the might of the Highlord!" +#define SAY_DEATH "I... am... released! Perhaps it's not too late to - noo! I need... more time..." + +#define SOUND_TAUNT1 8842 +#define SOUND_TAUNT2 8843 +#define SOUND_TAUNT3 8844 +#define SOUND_AGGRO1 8835 +#define SOUND_AGGRO2 8836 +#define SOUND_AGGRO3 8837 +#define SOUND_SLAY1 8839 +#define SOUND_SLAY2 8840 +#define SOUND_SPECIAL 8841 +#define SOUND_DEATH 8838 + +#define SPIRIT_OF_MOGRAINE 16775 + +struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI +{ + boss_highlord_mograineAI(Creature *c) : ScriptedAI(c) {} + + uint32 Mark_Timer; + uint32 RighteousFire_Timer; + bool ShieldWall1; + bool ShieldWall2; + + void Reset() + { + Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec. + RighteousFire_Timer = 2000; // applied approx 1 out of 4 attacks + ShieldWall1 = true; + ShieldWall2 = true; + } + + void InitialYell() + { + if (!m_creature->isInCombat()) + { + switch(rand()%3) + { + case 0: + DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature,SOUND_AGGRO1); + break; + case 1: + DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature,SOUND_AGGRO2); + break; + case 2: + DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature,SOUND_AGGRO3); + break; + } + } + } + + void KilledUnit() + { + switch(rand()%2) + { + case 0: + DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature,SOUND_SLAY1); + break; + case 1: + DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature,SOUND_SLAY2); + break; + } + } + + void JustDied(Unit* Killer) + { + DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL); + DoPlaySoundToSet(m_creature, SOUND_DEATH); + } + + void Aggro(Unit *who) + { + InitialYell(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + // Mark of Mograine + if (Mark_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MARK_OF_MOGRAINE); + Mark_Timer = 12000; + }else Mark_Timer -= diff; + + // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds + if (ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) + { + if (ShieldWall1) + { + DoCast(m_creature,SPELL_SHIELDWALL); + ShieldWall1 = false; + } + } + if (ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) + { + if (ShieldWall2) + { + DoCast(m_creature,SPELL_SHIELDWALL); + ShieldWall2 = false; + } + } + + // Righteous Fire + if (RighteousFire_Timer < diff) + { + if (rand()%4 == 1) // 1/4 + { + DoCast(m_creature->getVictim(),SPELL_RIGHTEOUS_FIRE); + } + RighteousFire_Timer = 2000; + }else RighteousFire_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_highlord_mograine(Creature* pCreature) +{ + return new boss_highlord_mograineAI (pCreature); +} + +void AddSC_boss_highlord_mograine() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_highlord_mograine"; + newscript->GetAI = &GetAI_boss_highlord_mograine; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_kelthuzad.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_kelthuzad.cpp new file mode 100644 index 00000000000..a93ff572ab0 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_kelthuzad.cpp @@ -0,0 +1,294 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_KelThuzud +SD%Complete: 0 +SDComment: VERIFY SCRIPT +SDCategory: Naxxramas +EndScriptData */ + +#include "precompiled.h" +#include "def_naxxramas.h" + +//when shappiron dies. dialog between kel and lich king (in this order) +#define SAY_SAPP_DIALOG1 -1533084 +#define SAY_SAPP_DIALOG2_LICH -1533085 +#define SAY_SAPP_DIALOG3 -1533086 +#define SAY_SAPP_DIALOG4_LICH -1533087 +#define SAY_SAPP_DIALOG5 -1533088 + +//when cat dies +#define SAY_CAT_DIED -1533089 + +//when each of the 4 wing bosses dies +#define SAY_TAUNT1 -1533090 +#define SAY_TAUNT2 -1533091 +#define SAY_TAUNT3 -1533092 +#define SAY_TAUNT4 -1533093 + +#define SAY_SUMMON_MINIONS -1533105 //start of phase 1 + +#define SAY_AGGRO RAND(-1533094,-1533095,-1533096) //start of phase 2 +#define SAY_SLAY RAND(-1533097,-1533098) +#define SAY_DEATH -1533099 +#define SAY_CHAIN RAND(-1533100,-1533101) +#define SAY_FROST_BLAST -1533102 +#define SAY_SPECIAL RAND(-1533106,-1533107,-1533108) + +#define SAY_REQUEST_AID -1533103 //start of phase 3 +#define SAY_ANSWER_REQUEST -1533104 //lich king answer + +enum Event +{ + EVENT_BOLT = 1, + EVENT_NOVA, + EVENT_CHAIN, + EVENT_DETONATE, + EVENT_FISSURE, + EVENT_BLAST, + + EVENT_WASTE, + EVENT_ABOMIN, + EVENT_WEAVER, + EVENT_ICECROWN, + + EVENT_PHASE, +}; + +#define SPELL_FROST_BOLT HEROIC(28478,55802) +#define SPELL_FROST_BOLT_AOE HEROIC(28479,55807) +#define SPELL_SHADOW_FISURE 27810 +#define SPELL_VOID_BLAST 27812 +#define SPELL_MANA_DETONATION 27819 +#define SPELL_FROST_BLAST 27808 +#define SPELL_CHAINS_OF_KELTHUZAD 28410 //28408 script effect +#define SPELL_BERSERK 28498 + +#define MOB_WASTE 16427 // Soldiers of the Frozen Wastes +#define MOB_ABOMINATION 16428 // Unstoppable Abominations +#define MOB_WEAVER 16429 // Soul Weavers +#define MOB_ICECROWN 16441 // Guardians of Icecrown + +float Pos[12][4] = +{ + {3783.272705, -5062.697266, 143.711203,3.617599},//LEFT_FAR + {3730.291260, -5027.239258,143.956909,4.461900},//LEFT_MIDDLE + {3683.868652,-5057.281250,143.183884,5.237086},//LEFT_NEAR + {3759.355225,-5174.128418,143.802383,2.170104},//RIGHT_FAR + {3700.724365,-5185.123047,143.928024,1.309310},//RIGHT_MIDDLE + {3665.121094,-5138.679199,143.183212,0.604023},//RIGHT_NEAR + {3754.431396,-5080.727734,142.036316,3.736189},//LEFT_FAR + {3724.396484, -5061.330566,142.032700, 4.564785},//LEFT_MIDDLE + {3687.158424,-5076.834473,142.017319,5.237086},//LEFT_NEAR + {3687.571777,-5126.831055,142.017807,0.604023},//RIGHT_FAR + {3707.990733,-5151.450195,142.032562,1.376855},//RIGHT_MIDDLE + {3739.500000,-5141.883989,142.0141130, 2.121412}//RIGHT_NEAR +}; + +struct TRINITY_DLL_DECL boss_kelthuzadAI : public BossAI +{ + boss_kelthuzadAI(Creature* c) : BossAI(c, BOSS_KELTHUZAD) {} + + uint32 GuardiansOfIcecrown_Count; + + uint32 Phase; + uint32 GuardiansOfIcecrown_Timer; + + void Reset() + { + _Reset(); + me->SetReactState(REACT_AGGRESSIVE); + GuardiansOfIcecrown_Count = 0; + + GuardiansOfIcecrown_Timer = 5000; //5 seconds for summoning each Guardian of Icecrown in phase 3 + + Phase=0; + } + + void KilledUnit() + { + DoScriptText(SAY_SLAY, m_creature); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, m_creature); + } + + void EnterCombat(Unit* who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + Phase=1; + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_PASSIVE); + events.ScheduleEvent(EVENT_WASTE, 3000); + events.ScheduleEvent(EVENT_ABOMIN, 25000); + events.ScheduleEvent(EVENT_WEAVER, 20000); + events.ScheduleEvent(EVENT_PHASE, 228000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateCombatState()) + return; + + events.Update(diff); + + if (Phase == 1) + { + while(uint32 eventId = events.GetEvent()) + { + switch(eventId) + { + case EVENT_WASTE: + DoSummon(MOB_WASTE, Pos[RAND(0,3,6,9)]); + events.RepeatEvent(3000); + break; + case EVENT_ABOMIN: + DoSummon(MOB_ABOMINATION, Pos[RAND(1,4,7,10)]); + events.RepeatEvent(25000); + break; + case EVENT_WEAVER: + DoSummon(MOB_WEAVER, Pos[RAND(0,3,6,9)]); + events.RepeatEvent(20000); + break; + case EVENT_PHASE: + events.Reset(); + events.ScheduleEvent(EVENT_BOLT, 2000); + events.ScheduleEvent(EVENT_NOVA, 15000); + events.ScheduleEvent(EVENT_DETONATE, 20000); + events.ScheduleEvent(EVENT_FISSURE, 25000); + events.ScheduleEvent(EVENT_BLAST, (rand()%30+30)*1000); + if (HeroicMode) + events.ScheduleEvent(EVENT_CHAIN, (rand()%30+30)*1000); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_AGGRESSIVE); + Phase = 2; + return; + default: + events.PopEvent(); + break; + } + } + } + else + { + //start phase 3 when we are 40% health + if (Phase != 3) + { + if (HealthBelowPct(40)) + { + Phase = 3 ; + DoScriptText(SAY_REQUEST_AID, m_creature); + //here Lich King should respond to KelThuzad but I don't know which Creature to make talk + //so for now just make Kelthuzad says it. + DoScriptText(SAY_ANSWER_REQUEST, m_creature); + } + } + else if (GuardiansOfIcecrown_Count < HEROIC(2,5)) + { + if (GuardiansOfIcecrown_Timer < diff) + { + DoSummon(MOB_ICECROWN, Pos[RAND(2,5,8)]); + ++GuardiansOfIcecrown_Count; + GuardiansOfIcecrown_Timer = 5000; + } + else GuardiansOfIcecrown_Timer -= diff; + } + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + if (uint32 eventId = events.GetEvent()) + { + switch(eventId) + { + case EVENT_BOLT: + DoCast(m_creature->getVictim(),SPELL_FROST_BOLT); + events.RepeatEvent(2000); + return; + case EVENT_NOVA: + DoCastAOE(SPELL_FROST_BOLT_AOE); + events.RepeatEvent(15000); + return; + case EVENT_CHAIN: + if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) + DoCast(target, SPELL_CHAINS_OF_KELTHUZAD); + DoScriptText(SAY_CHAIN, me); + events.RepeatEvent((rand()%30+30)*1000); + return; + case EVENT_DETONATE: + { + std::vector unitList; + std::list *threatList = &me->getThreatManager().getThreatList(); + for(std::list::const_iterator itr = threatList->begin(); itr != threatList->end(); ++itr) + { + if ((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER + && (*itr)->getTarget()->getPowerType() == POWER_MANA + && (*itr)->getTarget()->GetPower(POWER_MANA)) + unitList.push_back((*itr)->getTarget()); + } + + if (!unitList.empty()) + { + std::vector::iterator itr = unitList.begin(); + advance(itr, rand()%unitList.size()); + DoCast(*itr, SPELL_MANA_DETONATION); + DoScriptText(SAY_SPECIAL, me); + } + + events.RepeatEvent(20000); + return; + } + case EVENT_FISSURE: + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_SHADOW_FISURE); + events.RepeatEvent(25000); + return; + case EVENT_BLAST: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) + DoCast(target, SPELL_FROST_BLAST); + if (rand()%2) + DoScriptText(SAY_FROST_BLAST, m_creature); + events.RepeatEvent((rand()%30+30)*1000); + return; + default: + events.PopEvent(); + return; + } + } + + DoMeleeAttackIfReady(); + } + } +}; + +CreatureAI* GetAI_boss_kelthuzadAI(Creature* pCreature) +{ + return new boss_kelthuzadAI (pCreature); +} + +void AddSC_boss_kelthuzad() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_kelthuzad"; + newscript->GetAI = &GetAI_boss_kelthuzadAI; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_loatheb.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_loatheb.cpp new file mode 100644 index 00000000000..eb53583752f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_loatheb.cpp @@ -0,0 +1,93 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +#define SPELL_NECROTIC_AURA 55593 +#define SPELL_SUMMON_SPORE 29234 +#define SPELL_DEATHBLOOM HEROIC(29865,55053) +#define SPELL_INEVITABLE_DOOM HEROIC(29204,55052) + +enum Events +{ + EVENT_AURA = 1, + EVENT_BLOOM, + EVENT_DOOM, +}; + +struct TRINITY_DLL_DECL boss_loathebAI : public BossAI +{ + boss_loathebAI(Creature *c) : BossAI(c, BOSS_LOATHEB) {} + + void EnterCombat(Unit *who) + { + _EnterCombat(); + events.ScheduleEvent(EVENT_AURA, 0); + events.ScheduleEvent(EVENT_BLOOM, 30000); + events.ScheduleEvent(EVENT_DOOM, 120000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_AURA: + DoCastAOE(SPELL_NECROTIC_AURA); + events.ScheduleEvent(EVENT_AURA, 20000); + return; + case EVENT_BLOOM: + DoCastAOE(SPELL_SUMMON_SPORE, true); + DoCastAOE(SPELL_DEATHBLOOM); + events.ScheduleEvent(EVENT_BLOOM, 30000); + return; + case EVENT_DOOM: + DoCastAOE(SPELL_INEVITABLE_DOOM); + events.ScheduleEvent(EVENT_DOOM, events.GetTimer() < 5*60000 ? 30000 : 15000); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_loatheb(Creature* pCreature) +{ + return new boss_loathebAI (pCreature); +} + +void AddSC_boss_loatheb() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_loatheb"; + newscript->GetAI = &GetAI_boss_loatheb; + newscript->RegisterSelf(); + + // Fungal Creep + GetAISpellInfo(29232)->condition = AICOND_DIE; +} + diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_maexxna.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_maexxna.cpp new file mode 100644 index 00000000000..63ffb995cd5 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_maexxna.cpp @@ -0,0 +1,140 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +#define SPELL_WEB_WRAP 28622 +#define SPELL_WEB_SPRAY HEROIC(29484,54125) +#define SPELL_POISON_SHOCK HEROIC(28741,54122) +#define SPELL_NECROTIC_POISON HEROIC(54121,28776) +#define SPELL_FRENZY HEROIC(54123,54124) + +#define MOB_WEB_WRAP 16486 +#define MOB_SPIDERLING 17055 + +#define MAX_POS_WRAP 3 +const float PosWrap[MAX_POS_WRAP][3] = +{ + {3546.796, -3869.082, 296.450+20}, + {3531.271, -3847.424, 299.450+20}, + {3497.067, -3843.384, 302.384+20}, +}; + +enum Events +{ + EVENT_SPRAY = 1, + EVENT_SHOCK, + EVENT_POISON, + EVENT_WRAP, + EVENT_SUMMON, +}; + +struct TRINITY_DLL_DECL boss_maexxnaAI : public BossAI +{ + boss_maexxnaAI(Creature *c) : BossAI(c, BOSS_MAEXXNA) {} + + bool enraged; + + void EnterCombat(Unit *who) + { + _EnterCombat(); + enraged = false; + events.ScheduleEvent(EVENT_WRAP, 20000); + events.ScheduleEvent(EVENT_SPRAY, 40000); + events.ScheduleEvent(EVENT_SHOCK, 10000); + events.ScheduleEvent(EVENT_POISON, 5000); + events.ScheduleEvent(EVENT_SUMMON, 40000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim() || !CheckInRoom()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_WRAP: + for(uint32 i = 0; i < HEROIC(1,2); ++i) + { + if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true, -SPELL_WEB_WRAP)) + { + target->RemoveAura(SPELL_WEB_SPRAY); + uint32 pos = rand()%MAX_POS_WRAP; + target->GetMotionMaster()->MoveJump(PosWrap[pos][0], PosWrap[pos][1], PosWrap[pos][2], 20, 20); + if (Creature *wrap = DoSummon(MOB_WEB_WRAP, target, 0, 60000)) + { + wrap->AI()->SetGUID(target->GetGUID()); + wrap->GetMotionMaster()->MoveJump(PosWrap[pos][0], PosWrap[pos][1], PosWrap[pos][2], 20, 20); + } + } + } + events.ScheduleEvent(EVENT_WRAP, 40000); + return; + case EVENT_SPRAY: + DoCastAOE(SPELL_WEB_SPRAY); + events.ScheduleEvent(EVENT_SPRAY, 40000); + return; + case EVENT_SHOCK: + DoCastAOE(SPELL_POISON_SHOCK); + events.ScheduleEvent(EVENT_SHOCK, 10000); + return; + case EVENT_POISON: + DoCast(me->getVictim(), SPELL_NECROTIC_POISON); + events.ScheduleEvent(EVENT_POISON, 30000); + return; + case EVENT_SUMMON: + { + uint32 amount = 8+rand()%2; + for(uint32 i = 0; i < amount; ++i) + DoSummon(MOB_SPIDERLING, me); + events.ScheduleEvent(EVENT_SUMMON, 40000); + break; + } + } + } + + if (!enraged && HealthBelowPct(30)) + { + DoCast(me, SPELL_FRENZY); + enraged = true; + } + else + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_maexxna(Creature* pCreature) +{ + return new boss_maexxnaAI (pCreature); +} + +void AddSC_boss_maexxna() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_maexxna"; + newscript->GetAI = &GetAI_boss_maexxna; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_noth.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_noth.cpp new file mode 100644 index 00000000000..87f9a96ad61 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_noth.cpp @@ -0,0 +1,210 @@ +/* Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +#define SAY_AGGRO RAND(-1533075,-1533076,-1533077) +#define SAY_SUMMON -1533078 +#define SAY_SLAY RAND(-1533079,-1533080) +#define SAY_DEATH -1533081 + +#define SOUND_DEATH 8848 + +#define SPELL_CURSE_PLAGUEBRINGER HEROIC(29213,54835) +#define SPELL_BLINK RAND(29208,29209,29210,29211) +#define SPELL_CRIPPLE HEROIC(29212,54814) +#define SPELL_TELEPORT 29216 + +#define MOB_WARRIOR 16984 +#define MOB_CHAMPION 16983 +#define MOB_GUARDIAN 16981 + +// Teleport position of Noth on his balcony +#define TELE_X 2631.370 +#define TELE_Y -3529.680 +#define TELE_Z 274.040 +#define TELE_O 6.277 + +#define MAX_SUMMON_POS 5 + +const float SummonPos[MAX_SUMMON_POS][4] = +{ + {2728.12, -3544.43, 261.91, 6.04}, + {2729.05, -3544.47, 261.91, 5.58}, + {2728.24, -3465.08, 264.20, 3.56}, + {2704.11, -3456.81, 265.53, 4.51}, + {2663.56, -3464.43, 262.66, 5.20}, +}; + +enum Events +{ + EVENT_BERSERK = 1, + EVENT_CURSE, + EVENT_BLINK, + EVENT_WARRIOR, + EVENT_BALCONY, + EVENT_WAVE, + EVENT_GROUND, +}; + +struct TRINITY_DLL_DECL boss_nothAI : public BossAI +{ + boss_nothAI(Creature *c) : BossAI(c, BOSS_NOTH) {} + + uint32 waveCount, balconyCount; + + void Reset() + { + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + _Reset(); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + balconyCount = 0; + EnterPhaseGround(); + } + + void EnterPhaseGround() + { + me->SetReactState(REACT_AGGRESSIVE); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoZoneInCombat(); + if (me->getThreatManager().isThreatListEmpty()) + EnterEvadeMode(); + else + { + events.ScheduleEvent(EVENT_BALCONY, 110000); + events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000); + events.ScheduleEvent(EVENT_WARRIOR, 30000); + if (HeroicMode) + events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000); + } + } + + void KilledUnit(Unit* victim) + { + if (!(rand()%5)) + DoScriptText(SAY_SLAY, me); + } + + void JustSummoned(Creature *summon) + { + summons.Summon(summon); + summon->setActive(true); + summon->AI()->DoZoneInCombat(); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } + + void SummonUndead(uint32 entry, uint32 num) + { + for(uint32 i = 0; i < num; ++i) + { + uint32 pos = rand()%MAX_SUMMON_POS; + me->SummonCreature(entry, SummonPos[pos][0], SummonPos[pos][1], SummonPos[pos][2], + SummonPos[pos][3], TEMPSUMMON_CORPSE_DESPAWN, 60000); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateCombatState() || !CheckInRoom()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_CURSE: + DoCastAOE(SPELL_CURSE_PLAGUEBRINGER); + events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000); + return; + case EVENT_WARRIOR: + DoScriptText(SAY_SUMMON, me); + SummonUndead(MOB_WARRIOR, HEROIC(2,3)); + events.ScheduleEvent(EVENT_WARRIOR, 30000); + return; + case EVENT_BLINK: + DoCastAOE(SPELL_CRIPPLE, true); + DoCastAOE(SPELL_BLINK); + DoResetThreat(); + events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000); + return; + case EVENT_BALCONY: + me->SetReactState(REACT_PASSIVE); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + me->AttackStop(); + me->RemoveAllAuras(); + me->NearTeleportTo(TELE_X, TELE_Y, TELE_Z, TELE_O); + events.Reset(); + events.ScheduleEvent(EVENT_WAVE, 2000); + waveCount = 0; + return; + case EVENT_WAVE: + DoScriptText(SAY_SUMMON, me); + switch(balconyCount) + { + case 0: SummonUndead(MOB_CHAMPION, HEROIC(2,4)); break; + case 1: SummonUndead(MOB_CHAMPION, HEROIC(1,2)); + SummonUndead(MOB_GUARDIAN, HEROIC(1,2)); break; + case 2: SummonUndead(MOB_GUARDIAN, HEROIC(2,4)); break; + default:SummonUndead(MOB_CHAMPION, HEROIC(5,10)); + SummonUndead(MOB_GUARDIAN, HEROIC(5,10));break; + } + ++waveCount; + events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, 34000); + return; + case EVENT_GROUND: + { + ++balconyCount; + float x, y, z, o; + me->GetHomePosition(x, y, z, o); + me->NearTeleportTo(x, y, z, o); + EnterPhaseGround(); + return; + } + } + } + + if (me->HasReactState(REACT_AGGRESSIVE)) + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_noth(Creature* pCreature) +{ + return new boss_nothAI (pCreature); +} + +void AddSC_boss_noth() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_noth"; + newscript->GetAI = &GetAI_boss_noth; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_patchwerk.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_patchwerk.cpp new file mode 100644 index 00000000000..d50c72d8fa6 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_patchwerk.cpp @@ -0,0 +1,133 @@ +/* Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +#define SAY_AGGRO RAND(-1533017,-1533018) +#define SAY_SLAY -1533019 +#define SAY_DEATH -1533020 + +#define EMOTE_BERSERK -1533021 +#define EMOTE_ENRAGE -1533022 + +#define SPELL_HATEFULSTRIKE HEROIC(41926,59192) +#define SPELL_FRENZY 28131 +#define SPELL_BERSERK 26662 +#define SPELL_SLIMEBOLT 32309 + +#define EVENT_BERSERK 1 +#define EVENT_HATEFUL 2 +#define EVENT_SLIME 3 + +struct TRINITY_DLL_DECL boss_patchwerkAI : public BossAI +{ + boss_patchwerkAI(Creature *c) : BossAI(c, BOSS_PATCHWERK) {} + + bool Enraged; + + void KilledUnit(Unit* Victim) + { + if (!(rand()%5)) + DoScriptText(SAY_SLAY, me); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + Enraged = false; + DoScriptText(SAY_AGGRO, me); + events.ScheduleEvent(EVENT_HATEFUL, 1200); + events.ScheduleEvent(EVENT_BERSERK, 360000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_HATEFUL: + { + //Cast Hateful strike on the player with the highest + //amount of HP within melee distance + uint32 MostHP = 0; + Unit* pMostHPTarget = NULL; + std::list::iterator i = me->getThreatManager().getThreatList().begin(); + for(; i != me->getThreatManager().getThreatList().end(); ++i) + { + Unit* target = (*i)->getTarget(); + if (target->isAlive() && target->GetHealth() > MostHP && me->IsWithinMeleeRange(target)) + { + MostHP = target->GetHealth(); + pMostHPTarget = target; + } + } + + if (pMostHPTarget) + DoCast(pMostHPTarget, SPELL_HATEFULSTRIKE, true); + + events.ScheduleEvent(EVENT_HATEFUL, 1200); + return; + } + case EVENT_BERSERK: + DoCast(m_creature, SPELL_BERSERK); + DoScriptText(EMOTE_BERSERK, m_creature); + events.ScheduleEvent(EVENT_SLIME, 2000); + return; + case EVENT_SLIME: + DoCast(m_creature->getVictim(), SPELL_SLIMEBOLT); + events.ScheduleEvent(EVENT_SLIME, 2000); + return; + } + } + + if (!Enraged && HealthBelowPct(5)) + { + DoCast(m_creature, SPELL_FRENZY); + DoScriptText(EMOTE_ENRAGE, NULL); + Enraged = true; + return; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_patchwerk(Creature* pCreature) +{ + return new boss_patchwerkAI (pCreature); +} + +void AddSC_boss_patchwerk() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_patchwerk"; + newscript->GetAI = &GetAI_boss_patchwerk; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_razuvious.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_razuvious.cpp new file mode 100644 index 00000000000..2ade34b6e6d --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_razuvious.cpp @@ -0,0 +1,128 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +//Razuvious - NO TEXT sound only +//8852 aggro01 - Hah hah, I'm just getting warmed up! +//8853 aggro02 Stand and fight! +//8854 aggro03 Show me what you've got! +//8861 slay1 - You should've stayed home! +//8863 slay2- +//8858 cmmnd3 - You disappoint me, students! +//8855 cmmnd1 - Do as I taught you! +//8856 cmmnd2 - Show them no mercy! +//8859 cmmnd4 - The time for practice is over! Show me what you've learned! +//8861 Sweep the leg! Do you have a problem with that? +//8860 death - An honorable... death... +//8947 - Aggro Mixed? - ? + +#define SOUND_AGGRO RAND(8852,8853,8854) +#define SOUND_SLAY RAND(8861,8863) +#define SOUND_COMMND RAND(8855,8856,8858,8859,8861) +#define SOUND_DEATH 8860 +#define SOUND_AGGROMIX 8847 + +#define SPELL_UNBALANCING_STRIKE 26613 +#define SPELL_DISRUPTING_SHOUT HEROIC(29107,55543) +#define SPELL_JAGGED_KNIFE 55550 +#define SPELL_HOPELESS 29125 + +enum Events +{ + EVENT_STRIKE, + EVENT_SHOUT, + EVENT_KNIFE, + EVENT_COMMAND, +}; + +struct TRINITY_DLL_DECL boss_razuviousAI : public BossAI +{ + boss_razuviousAI(Creature *c) : BossAI(c, BOSS_RAZUVIOUS) {} + + void KilledUnit(Unit* victim) + { + if (!(rand()%3)) + DoPlaySoundToSet(me, SOUND_SLAY); + } + + void JustDied(Unit* killer) + { + _JustDied(); + DoPlaySoundToSet(me, SOUND_DEATH); + me->CastSpell(me, SPELL_HOPELESS, true); // TODO: this may affect other creatures + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoPlaySoundToSet(m_creature, SOUND_AGGRO); + events.ScheduleEvent(EVENT_STRIKE, 30000); + events.ScheduleEvent(EVENT_SHOUT, 25000); + events.ScheduleEvent(EVENT_COMMAND, 40000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_STRIKE: + DoCast(me->getVictim(), SPELL_UNBALANCING_STRIKE); + events.ScheduleEvent(EVENT_STRIKE, 30000); + return; + case EVENT_SHOUT: + DoCastAOE(SPELL_DISRUPTING_SHOUT); + events.ScheduleEvent(EVENT_SHOUT, 25000); + return; + case EVENT_KNIFE: + if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45)) + DoCast(target, SPELL_JAGGED_KNIFE); + events.ScheduleEvent(EVENT_KNIFE, 25000); + return; + case EVENT_COMMAND: + DoPlaySoundToSet(me, SOUND_COMMND); + events.ScheduleEvent(EVENT_COMMAND, 40000); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_razuvious(Creature* pCreature) +{ + return new boss_razuviousAI (pCreature); +} + +void AddSC_boss_razuvious() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_razuvious"; + newscript->GetAI = &GetAI_boss_razuvious; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_sapphiron.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_sapphiron.cpp new file mode 100644 index 00000000000..f0dd9e735cb --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_sapphiron.cpp @@ -0,0 +1,350 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +#define EMOTE_BREATH -1533082 +#define EMOTE_ENRAGE -1533083 + +#define SPELL_FROST_AURA HEROIC(28531,55799) +#define SPELL_CLEAVE 19983 +#define SPELL_TAIL_SWEEP HEROIC(55697,55696) +#define SPELL_SUMMON_BLIZZARD 28560 +#define SPELL_LIFE_DRAIN HEROIC(28542,55665) +#define SPELL_ICEBOLT 28522 +#define SPELL_FROST_BREATH 29318 +#define SPELL_FROST_EXPLOSION 28524 +#define SPELL_FROST_MISSILE 30101 +#define SPELL_BERSERK 26662 +#define SPELL_DIES 29357 + +#define SPELL_CHILL HEROIC(28547,55699) + +#define MOB_BLIZZARD 16474 +#define GO_ICEBLOCK 181247 + +enum Phases +{ + PHASE_NULL = 0, + PHASE_BIRTH, + PHASE_GROUND, + PHASE_FLIGHT, +}; + +enum Events +{ + EVENT_BERSERK = 1, + EVENT_CLEAVE, + EVENT_TAIL, + EVENT_DRAIN, + EVENT_BLIZZARD, + EVENT_FLIGHT, + EVENT_LIFTOFF, + EVENT_ICEBOLT, + EVENT_BREATH, + EVENT_EXPLOSION, + EVENT_LAND, + EVENT_GROUND, + EVENT_BIRTH, +}; + +typedef std::map IceBlockMap; + +struct TRINITY_DLL_DECL boss_sapphironAI : public BossAI +{ + boss_sapphironAI(Creature* c) : BossAI(c, BOSS_SAPPHIRON) + , phase(PHASE_NULL) + {} + + Phases phase; + uint32 iceboltCount; + IceBlockMap iceblocks; + + void InitializeAI() + { + float x, y, z; + me->GetPosition(x, y, z); + me->SummonGameObject(GO_BIRTH, x, y, z, 0, 0, 0, 0, 0, 0); + me->SetVisibility(VISIBILITY_OFF); + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_PASSIVE); + + Reset(); + } + + void Reset() + { + _Reset(); + + if (phase = PHASE_FLIGHT) + ClearIceBlock(); + + phase = PHASE_NULL; + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + + me->CastSpell(me, SPELL_FROST_AURA, true); + + events.ScheduleEvent(EVENT_BERSERK, 15*60000); + EnterPhaseGround(); + } + + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (spell->Id == SPELL_ICEBOLT) + { + IceBlockMap::iterator itr = iceblocks.find(target->GetGUID()); + if (itr != iceblocks.end() && !itr->second) + { + if (GameObject *iceblock = me->SummonGameObject(GO_ICEBLOCK, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, 0, 0, 0, 0, 25000)) + itr->second = iceblock->GetGUID(); + } + } + } + + void JustDied(Unit* who) + { + _JustDied(); + me->CastSpell(me, SPELL_DIES, true); + } + + void MovementInform(uint32, uint32 id) + { + if (id == 1) + events.ScheduleEvent(EVENT_LIFTOFF, 0); + } + + void DoAction(const int32 param) + { + if (param == DATA_SAPPHIRON_BIRTH) + { + phase = PHASE_BIRTH; + events.ScheduleEvent(EVENT_BIRTH, 23000); + } + } + + void EnterPhaseGround() + { + phase = PHASE_GROUND; + me->SetReactState(REACT_AGGRESSIVE); + events.SetPhase(PHASE_GROUND); + events.ScheduleEvent(EVENT_CLEAVE, 5000+rand()%10000, 0, PHASE_GROUND); + events.ScheduleEvent(EVENT_TAIL, 5000+rand()%10000, 0, PHASE_GROUND); + events.ScheduleEvent(EVENT_DRAIN, 24000, 0, PHASE_GROUND); + events.ScheduleEvent(EVENT_BLIZZARD, 5000+rand()%5000, 0, PHASE_GROUND); + events.ScheduleEvent(EVENT_FLIGHT, 45000); + } + + void ClearIceBlock() + { + for(IceBlockMap::iterator itr = iceblocks.begin(); itr != iceblocks.end(); ++itr) + { + if (Player* pPlayer = Unit::GetPlayer(itr->first)) + pPlayer->RemoveAura(SPELL_ICEBOLT); + if (GameObject* pGo = GameObject::GetGameObject(*me, itr->second)) + pGo->DeleteObjectWithOwner(); + } + iceblocks.clear(); + } + + void UpdateAI(const uint32 diff) + { + if (!phase) + return; + + events.Update(diff); + + if (phase != PHASE_BIRTH && !UpdateCombatState() || !CheckInRoom()) + return; + + if (phase == PHASE_GROUND) + { + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_BERSERK: + DoScriptText(EMOTE_ENRAGE, m_creature); + DoCast(me, SPELL_BERSERK); + return; + case EVENT_CLEAVE: + DoCast(me->getVictim(), SPELL_CLEAVE); + events.ScheduleEvent(EVENT_CLEAVE, 5000+rand()%10000, 0, PHASE_GROUND); + return; + case EVENT_TAIL: + DoCastAOE(SPELL_TAIL_SWEEP); + events.ScheduleEvent(EVENT_TAIL, 5000+rand()%10000, 0, PHASE_GROUND); + return; + case EVENT_DRAIN: + DoCastAOE(SPELL_LIFE_DRAIN); + events.ScheduleEvent(EVENT_DRAIN, 24000, 0, PHASE_GROUND); + return; + case EVENT_BLIZZARD: + { + //DoCastAOE(SPELL_SUMMON_BLIZZARD); + float x, y, z; + me->GetGroundPointAroundUnit(x, y, z, rand_norm()*20, rand_norm()*2*M_PI); + if (Creature *summon = me->SummonCreature(MOB_BLIZZARD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 25000+rand()%5000)) + summon->GetMotionMaster()->MoveRandom(40); + events.ScheduleEvent(EVENT_BLIZZARD, HEROIC(20000,7000), 0, PHASE_GROUND); + break; + } + case EVENT_FLIGHT: + phase = PHASE_FLIGHT; + events.SetPhase(PHASE_FLIGHT); + me->SetReactState(REACT_PASSIVE); + me->AttackStop(); + float x, y, z, o; + me->GetHomePosition(x, y, z, o); + me->GetMotionMaster()->MovePoint(1, x, y, z); + return; + } + } + + DoMeleeAttackIfReady(); + } + else + { + if (uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_LIFTOFF: + me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SendMovementFlagUpdate(); + events.ScheduleEvent(EVENT_ICEBOLT, 1500); + iceboltCount = HEROIC(2,3); + return; + case EVENT_ICEBOLT: + { + std::vector targets; + std::list::iterator i = me->getThreatManager().getThreatList().begin(); + for(; i != me->getThreatManager().getThreatList().end(); ++i) + if ((*i)->getTarget()->GetTypeId() == TYPEID_PLAYER && !(*i)->getTarget()->HasAura(SPELL_ICEBOLT)) + targets.push_back((*i)->getTarget()); + + if (targets.empty()) + iceboltCount = 0; + else + { + std::vector::iterator itr = targets.begin(); + advance(itr, rand()%targets.size()); + iceblocks.insert(std::make_pair((*itr)->GetGUID(), 0)); + DoCast(*itr, SPELL_ICEBOLT); + --iceboltCount; + } + + if (iceboltCount) + events.ScheduleEvent(EVENT_ICEBOLT, 1000); + else + events.ScheduleEvent(EVENT_BREATH, 1000); + return; + } + case EVENT_BREATH: + { + DoScriptText(EMOTE_BREATH, me); + DoCastAOE(SPELL_FROST_MISSILE); + events.ScheduleEvent(EVENT_EXPLOSION, 8000); + return; + } + case EVENT_EXPLOSION: + CastExplosion(); + ClearIceBlock(); + events.ScheduleEvent(EVENT_LAND, 3000); + return; + case EVENT_LAND: + me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + me->SendMovementFlagUpdate(); + events.ScheduleEvent(EVENT_GROUND, 1500); + return; + case EVENT_GROUND: + EnterPhaseGround(); + return; + case EVENT_BIRTH: + me->SetVisibility(VISIBILITY_ON); + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + me->SetReactState(REACT_AGGRESSIVE); + return; + } + }//if (uint32 eventId = events.ExecuteEvent()) + }//if (phase == PHASE_GROUND) + } + + void CastExplosion() + { + DoZoneInCombat(); // make sure everyone is in threatlist + std::vector targets; + std::list::iterator i = me->getThreatManager().getThreatList().begin(); + for(; i != me->getThreatManager().getThreatList().end(); ++i) + { + Unit *target = (*i)->getTarget(); + if (target->GetTypeId() != TYPEID_PLAYER) + continue; + + if (target->HasAura(SPELL_ICEBOLT)) + { + target->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, true); + targets.push_back(target); + continue; + } + + for(IceBlockMap::iterator itr = iceblocks.begin(); itr != iceblocks.end(); ++itr) + { + if (GameObject* pGo = GameObject::GetGameObject(*me, itr->second)) + { + if (pGo->IsInBetween(me, target, 2.0f) + && me->GetExactDistance2d(target->GetPositionX(), target->GetPositionY()) - me->GetExactDistance2d(pGo->GetPositionX(), pGo->GetPositionY()) < 5.0f) + { + target->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, true); + targets.push_back(target); + break; + } + } + } + } + + me->CastSpell(me, SPELL_FROST_EXPLOSION, true); + + for(std::vector::iterator itr = targets.begin(); itr != targets.end(); ++itr) + (*itr)->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, false); + } +}; + +CreatureAI* GetAI_boss_sapphiron(Creature* pCreature) +{ + return new boss_sapphironAI (pCreature); +} + +void AddSC_boss_sapphiron() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_sapphiron"; + newscript->GetAI = &GetAI_boss_sapphiron; + newscript->RegisterSelf(); + + // Chill + GetAISpellInfo(28547)->cooldown = 1000; + GetAISpellInfo(55699)->cooldown = 1000; +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/boss_thaddius.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/boss_thaddius.cpp new file mode 100644 index 00000000000..b40b5aca876 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/boss_thaddius.cpp @@ -0,0 +1,143 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +//Stalagg +#define SAY_STAL_AGGRO -1533023 +#define SAY_STAL_SLAY -1533024 +#define SAY_STAL_DEATH -1533025 + +#define SPELL_POWERSURGE 28134 + +//Feugen +#define SAY_FEUG_AGGRO -1533026 +#define SAY_FEUG_SLAY -1533027 +#define SAY_FEUG_DEATH -1533028 + +#define SPELL_MANABURN 28135 + +//both +#define SPELL_WARSTOMP 28125 + + + //generic +#define C_TESLA_COIL 16218 //the coils (emotes "Tesla Coil overloads!") + + +//Thaddus +#define SAY_GREET -1533029 +#define SAY_AGGRO RAND(-1533030,-1533031,-1533032) +#define SAY_SLAY -1533033 +#define SAY_ELECT -1533034 +#define SAY_DEATH -1533035 +#define SAY_SCREAM1 -1533036 +#define SAY_SCREAM2 -1533037 +#define SAY_SCREAM3 -1533038 +#define SAY_SCREAM4 -1533039 + +#define SPELL_POLARITY_SHIFT 28089 +#define SPELL_BALL_LIGHTNING 28299 +#define SPELL_CHAIN_LIGHTNING HEROIC(28167,54531) +#define SPELL_BERSERK 27680 + +enum Events +{ + EVENT_SHIFT = 1, + EVENT_CHAIN, + EVENT_BERSERK, +}; + +struct TRINITY_DLL_DECL boss_thaddiusAI : public BossAI +{ + boss_thaddiusAI(Creature *c) : BossAI(c, BOSS_THADDIUS) + { + // temp + me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2 | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); + } + + void KilledUnit(Unit* victim) + { + if (!(rand()%5)) + DoScriptText(SAY_SLAY, me); + } + + void JustDied(Unit* Killer) + { + _JustDied(); + DoScriptText(SAY_DEATH, me); + } + + void EnterCombat(Unit *who) + { + _EnterCombat(); + DoScriptText(SAY_AGGRO, me); + events.ScheduleEvent(EVENT_SHIFT, 30000); + events.ScheduleEvent(EVENT_CHAIN, 10000+rand()%10000); + events.ScheduleEvent(EVENT_BERSERK, 6*60000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_SHIFT: + DoCastAOE(SPELL_POLARITY_SHIFT); + events.ScheduleEvent(EVENT_SHIFT, 30000); + return; + case EVENT_CHAIN: + DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); + events.ScheduleEvent(EVENT_CHAIN, 10000+rand()%10000); + return; + case EVENT_BERSERK: + DoCast(me, SPELL_BERSERK); + return; + } + } + + if (events.GetTimer() > 15000 && !me->IsWithinMeleeRange(me->getVictim())) + DoCast(me->getVictim(), SPELL_BALL_LIGHTNING); + else + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_thaddius(Creature* pCreature) +{ + return new boss_thaddiusAI (pCreature); +} + +void AddSC_boss_thaddius() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_thaddius"; + newscript->GetAI = &GetAI_boss_thaddius; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/def_naxxramas.h b/src/bindings/scripts/scripts/northrend/naxxramas/def_naxxramas.h new file mode 100644 index 00000000000..383200d4600 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/def_naxxramas.h @@ -0,0 +1,52 @@ +/* + * Copyright (C) 2008 - 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 + */ + +#ifndef DEF_NAXXRAMAS_H +#define DEF_NAXXRAMAS_H + +enum Encounter +{ + BOSS_ANUBREKHAN, + BOSS_FAERLINA, + BOSS_MAEXXNA, + BOSS_NOTH, + BOSS_HEIGAN, + BOSS_LOATHEB, + BOSS_PATCHWERK, + BOSS_GROBBULUS, + BOSS_GLUTH, + BOSS_THADDIUS, + BOSS_RAZUVIOUS, + BOSS_GOTHIK, + BOSS_HORSEMEN, + BOSS_SAPPHIRON, + BOSS_KELTHUZAD, + MAX_BOSS_NUMBER +}; + +enum Data +{ + DATA_HEIGAN_ERUPT, + DATA_GOTHIK_GATE, + DATA_SAPPHIRON_BIRTH, +}; + +#define GO_BIRTH 181356 + +#endif + diff --git a/src/bindings/scripts/scripts/northrend/naxxramas/instance_naxxramas.cpp b/src/bindings/scripts/scripts/northrend/naxxramas/instance_naxxramas.cpp new file mode 100644 index 00000000000..f6121c18ef5 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/naxxramas/instance_naxxramas.cpp @@ -0,0 +1,217 @@ +/* Copyright (C) 2008 - 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 "precompiled.h" +#include "def_naxxramas.h" + +const DoorData doorData[] = +{ + {181126, BOSS_ANUBREKHAN,DOOR_TYPE_ROOM, BOUNDARY_S}, + {181195, BOSS_ANUBREKHAN,DOOR_TYPE_PASSAGE, 0}, + {194022, BOSS_FAERLINA, DOOR_TYPE_PASSAGE, 0}, + {181209, BOSS_FAERLINA, DOOR_TYPE_PASSAGE, 0}, + {181209, BOSS_MAEXXNA, DOOR_TYPE_ROOM, BOUNDARY_SW}, + {181200, BOSS_NOTH, DOOR_TYPE_ROOM, BOUNDARY_N}, + {181201, BOSS_NOTH, DOOR_TYPE_PASSAGE, BOUNDARY_E}, + {181202, BOSS_NOTH, DOOR_TYPE_PASSAGE, 0}, + {181202, BOSS_HEIGAN, DOOR_TYPE_ROOM, BOUNDARY_N}, + {181203, BOSS_HEIGAN, DOOR_TYPE_PASSAGE, BOUNDARY_E}, + {181241, BOSS_HEIGAN, DOOR_TYPE_PASSAGE, 0}, + {181241, BOSS_LOATHEB, DOOR_TYPE_ROOM, BOUNDARY_W}, + {181123, BOSS_PATCHWERK, DOOR_TYPE_PASSAGE, 0}, + {181123, BOSS_GROBBULUS, DOOR_TYPE_ROOM, 0}, + {181120, BOSS_GLUTH, DOOR_TYPE_PASSAGE, BOUNDARY_NW}, + {181121, BOSS_GLUTH, DOOR_TYPE_PASSAGE, 0}, + {181121, BOSS_THADDIUS, DOOR_TYPE_ROOM, 0}, + {181124, BOSS_RAZUVIOUS, DOOR_TYPE_PASSAGE, 0}, + {181124, BOSS_GOTHIK, DOOR_TYPE_ROOM, BOUNDARY_N}, + {181125, BOSS_GOTHIK, DOOR_TYPE_PASSAGE, BOUNDARY_S}, + {181119, BOSS_GOTHIK, DOOR_TYPE_PASSAGE, 0}, + {181119, BOSS_HORSEMEN, DOOR_TYPE_ROOM, BOUNDARY_NE}, + {181225, BOSS_SAPPHIRON, DOOR_TYPE_PASSAGE, BOUNDARY_W}, + {0, 0, DOOR_TYPE_ROOM, 0}, // EOF +}; + +const MinionData minionData[] = +{ + //{16573, BOSS_ANUBREKHAN}, there is no spawn point in db, so we do not add them here + {16506, BOSS_FAERLINA}, + {16803, BOSS_RAZUVIOUS}, + {16063, BOSS_HORSEMEN}, + {16064, BOSS_HORSEMEN}, + {16065, BOSS_HORSEMEN}, + {30549, BOSS_HORSEMEN}, + {0, 0,} +}; + +enum +{ + GO_HORSEMEN_CHEST_HERO = 193426, + GO_HORSEMEN_CHEST = 181366, //four horsemen event, DoRespawnGameObject() when event == DONE + GO_GOTHIK_GATE = 181170, + + SPELL_ERUPTION = 29371 +}; + +const float HeiganPos[2] = {2796, -3707}; +const float HeiganEruptionSlope[3] = +{ + (-3685 - HeiganPos[1]) /(2724 - HeiganPos[0]), + (-3647 - HeiganPos[1]) /(2749 - HeiganPos[0]), + (-3637 - HeiganPos[1]) /(2771 - HeiganPos[0]), +}; + +// 0 H x +// 1 ^ +// 2 | +// 3 y<--o +inline uint32 GetEruptionSection(float x, float y) +{ + y -= HeiganPos[1]; + if (y < 1.0f) + return 0; + + x -= HeiganPos[0]; + if (x > -1.0f) + return 3; + + float slope = y/x; + for(uint32 i = 0; i < 3; ++i) + if (slope > HeiganEruptionSlope[i]) + return i; + return 3; +} + +struct TRINITY_DLL_DECL instance_naxxramas : public InstanceData +{ + instance_naxxramas(Map* pMap) : InstanceData(pMap) + , Sapphiron(NULL), pGothikGate(NULL), HorsemenChest(NULL), HorsemenNum(0) + { + SetBossNumber(MAX_BOSS_NUMBER); + LoadDoorData(doorData); + LoadMinionData(minionData); + } + + std::set HeiganEruption[4]; + GameObject* pGothikGate, *HorsemenChest; + Creature* Sapphiron; + uint32 HorsemenNum; + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 15989: Sapphiron = add ? pCreature : NULL; return; + } + + AddMinion(pCreature, add); + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + if (pGo->GetGOInfo()->displayId == 6785 || pGo->GetGOInfo()->displayId == 1287) + { + uint32 section = GetEruptionSection(pGo->GetPositionX(), pGo->GetPositionY()); + if (add) + HeiganEruption[section].insert(pGo); + else + HeiganEruption[section].erase(pGo); + return; + } + + switch(pGo->GetEntry()) + { + case GO_BIRTH: if (!add && Sapphiron) Sapphiron->AI()->DoAction(DATA_SAPPHIRON_BIRTH); return; + case GO_GOTHIK_GATE: pGothikGate = add ? pGo : NULL; break; + case GO_HORSEMEN_CHEST: HorsemenChest = add ? pGo : NULL; break; + } + + AddDoor(pGo, add); + } + + void SetData(uint32 id, uint32 value) + { + switch(id) + { + case DATA_HEIGAN_ERUPT: + HeiganErupt(value); + break; + case DATA_GOTHIK_GATE: + if (pGothikGate) + pGothikGate->SetGoState(GOState(value)); + break; + } + } + + bool SetBossState(uint32 id, EncounterState state) + { + if (!InstanceData::SetBossState(id, state)) + return false; + + if (id == BOSS_HORSEMEN && state == DONE && HorsemenChest) + HorsemenChest->SetRespawnTime(HorsemenChest->GetRespawnDelay()); + + return true; + } + + void HeiganErupt(uint32 section) + { + for(uint32 i = 0; i < 4; ++i) + { + if (i == section) + continue; + + for(std::set::iterator itr = HeiganEruption[i].begin(); itr != HeiganEruption[i].end(); ++itr) + { + (*itr)->SendCustomAnim(); + (*itr)->CastSpell(NULL, SPELL_ERUPTION); + } + } + } +}; + +bool AreaTrigger_at_naxxramas_frostwyrm_wing(Player* pPlayer, AreaTriggerEntry *at) +{ + if (pPlayer->isGameMaster()) + return false; + + InstanceData *data = pPlayer->GetInstanceData(); + if (data) + for(uint32 i = BOSS_ANUBREKHAN; i < BOSS_SAPPHIRON; ++i) + if (data->GetBossState(i) != DONE) + return true; + + return false; +} + +InstanceData* GetInstanceData_instance_naxxramas(Map* pMap) +{ + return new instance_naxxramas(pMap); +} + +void AddSC_instance_naxxramas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_naxxramas"; + newscript->GetInstanceData = &GetInstanceData_instance_naxxramas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "at_naxxramas_frostwyrm_wing"; + newscript->pAreaTrigger = &AreaTrigger_at_naxxramas_frostwyrm_wing; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp b/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp new file mode 100644 index 00000000000..b187fa10656 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/boss_malygos.cpp @@ -0,0 +1,170 @@ +/* Script Data Start +SDName: Boss malygos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_BREATH_N 56272 +#define SPELL_ARCANE_BREATH_H 60072 +#define SPELL_ARCANE_PULSE 57432 +#define SPELL_ARCANE_STORM_1 57459 +#define SPELL_ARCANE_STORM_2 61693 +#define SPELL_ARCANE_STORM_3 61694 +#define SPELL_STATIC_FIELD 57430 +#define SPELL_SURGE_OF_POWER_1 56505 +#define SPELL_SURGE_OF_POWER_2 57407 +#define SPELL_SURGE_OF_POWER_3 60936 +#define SPELL_VORTEX 56105 + +//Dragon "mounts" spells in Phase3 +//they use Rugelike energy +#define SPELL_DMOUNT_FLAME_SPIKE 56091 //maybe not accurate +#define SPELL_DMOUNT_ENGULF_IN_FLAMES 61621 +#define SPELL_DMOUNT_REVIVIFY 57090 +#define SPELL_DMOUNT_LIFE_BURST 57143 +#define SPELL_DMOUNT_FLAME_SHIELD 57108 +//#define SPELL_DMOUNT_UNKNOWN XYZ //Increases your drake's flight speed by 500%. + + +//Yell +//-->Other +#define SAY_ANTI_MAGIC_SHELL -1616000 +#define SAY_BREATH_ATTACK -1616001 +#define SAY_HIGH_DAMAGE_MODE -1616002 +#define SAY_MAGIC_BLAST -1616003 +//--> Generic Spells +#define SAY_GENERIC_SPELL_1 -1616004 +#define SAY_GENERIC_SPELL_2 -1616005 +#define SAY_GENERIC_SPELL_3 -1616006 +#define SAY_DEATH -1616007 +//--> Prefight +#define SAY_PREFIGHT_1 -1616008 +#define SAY_PREFIGHT_2 -1616009 +#define SAY_PREFIGHT_3 -1616010 +#define SAY_PREFIGHT_4 -1616011 +#define SAY_PREFIGHT_5 -1616012 +//--> Phase1 +#define SAY_PHASE1_AGGRO -1616013 +#define SAY_PHASE1_END -1616014 +#define SAY_PHASE1_SLAY_1 -1616015 +#define SAY_PHASE1_SLAY_2 -1616016 +#define SAY_PHASE1_SLAY_3 -1616017 + +//--> Phase2 at 50% HP, + +/*Malygos himself is not targetable during this phase, it will end when the adds he spawns are all killed. However, he does continue to play a part in the encounter. +During this phase he drops anti-magic zones onto the ground the raid MUST stand inside of, it reduces magical damage taken by 50%. They shrink over time, so it's important that your raid moves to each new one he drops. +Throughout the phase, he will deep breath doing ~4k damage per second, unless you are standing inside of the anti-magic zone. +The way the fight works during this phase is there are NPCs riding around on disks in the room. There are two types of mobs, Lords and Scions. +The Lords will move down onto the group, and need to be tanked (They will one-shot a non-tank). After they die, they drop a disk that a raid member can mount onto, which allows them to fly, to attack the Scions that do not come down to the ground. +It is recommended to let melee take the first disks, then ranged. As those mobs die, they also drop disks, which allows the rest of your dps to get onto them. +The Scions will continually cast Arcane Blast on random targets on the floor, which is mitigated by the anti-magic zones. While mounted on a disk, you will not take damage. +After all of the NPCs riding on the disks die, the players on the disks need to dismount as Phase 3 is about to begin.*/ + +#define SAY_PHASE2_AGGRO -1616018 +#define SAY_PHASE2_END -1616019 +#define SAY_PHASE2_SLAY_1 -1616020 +#define SAY_PHASE2_SLAY_2 -1616021 +#define SAY_PHASE2_SLAY_3 -1616022 +//--> Phase3 Malygos destroys the floor, encounter continues on dragon "mounts" +#define SAY_PHASE3_INTRO -1616023 +#define SAY_PHASE3_AGGRO -1616024 +#define SAY_PHASE3_SLAY_1 -1616025 +#define SAY_PHASE3_SLAY_2 -1616026 +#define SAY_PHASE3_SLAY_3 -1616027 +#define SAY_PHASE3_BIG_ATTACK -1616028 + +struct TRINITY_DLL_DECL boss_malygosAI : public ScriptedAI +{ + boss_malygosAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase, + enrage; + + void Reset() + { + //Source Deadly Boss Mod + enrage = 615000; //10 min + } + void EnterCombat(Unit* who) + { + if (phase == 1) + DoScriptText(SAY_PHASE1_AGGRO, m_creature); + if (phase == 2) + DoScriptText(SAY_PHASE1_AGGRO, m_creature); + if (phase == 3) + DoScriptText(SAY_PHASE1_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + phase =1; + //Return since we have no target + if (!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 50){ + phase = 2; + //spawn adds + //set malygos unatackable untill all adds spawned dead + //start phase3 + } + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + if (phase ==1) + switch(rand()%3) + { + case 0: DoScriptText(SAY_PHASE1_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_PHASE1_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_PHASE1_SLAY_3, m_creature);break; + } + if (phase ==2) + switch(rand()%3) + { + case 0: DoScriptText(SAY_PHASE2_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_PHASE2_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_PHASE2_SLAY_3, m_creature);break; + } + if (phase ==3) + switch(rand()%3) + { + case 0: DoScriptText(SAY_PHASE3_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_PHASE3_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_PHASE3_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_malygos(Creature* pCreature) +{ + return new boss_malygosAI (pCreature); +} + +void AddSC_boss_malygos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_malygos"; + newscript->GetAI = &GetAI_boss_malygos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/def_eye_of_eternity.h b/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/def_eye_of_eternity.h new file mode 100644 index 00000000000..caa82a92e95 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/def_eye_of_eternity.h @@ -0,0 +1,4 @@ +#ifndef DEF_EYE_OF_ETERNITY_H +#define DEF_EYE_OF_ETERNITY_H + +#endif diff --git a/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/instance_eye_of_eternity.cpp b/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/instance_eye_of_eternity.cpp new file mode 100644 index 00000000000..7c89a117d92 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/eye_of_eternity/instance_eye_of_eternity.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_eye_of_eternity.h" + +struct TRINITY_DLL_DECL instance_eye_of_eternity : public ScriptedInstance +{ + instance_eye_of_eternity(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_eye_of_eternity(Map* pMap) +{ + return new instance_eye_of_eternity(pMap); +} + +void AddSC_instance_eye_of_eternity() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_eye_of_eternity"; + newscript->GetInstanceData = &GetInstanceData_instance_eye_of_eternity; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_anomalus.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_anomalus.cpp new file mode 100644 index 00000000000..832dc9274e2 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_anomalus.cpp @@ -0,0 +1,302 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Anomalus +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + +#include "precompiled.h" +#include "def_nexus.h" + +bool DeadChaoticRift; // needed for achievement: Chaos Theory(2037) + +enum +{ + ACHIEVEMENT_CHAOS_THEORY = 2037, + + //Spells + SPELL_SPARK_N = 47751, + SPELL_SPARK_H = 57062, + SPELL_RIFT_SHIELD = 47748, + SPELL_CHARGE_RIFT = 47747, //Works wrong (affect players, not rifts) + SPELL_CREATE_RIFT = 47743, //Don't work, using WA + SPELL_ARCANE_ATTRACTION = 57063, //No idea, when it's used + + MOB_CRAZED_MANA_WRAITH = 26746, + MOB_CHAOTIC_RIFT = 26918, + SPELL_CHAOTIC_ENERGY_BURST = 47688, + SPELL_CHARGED_CHAOTIC_ENERGY_BURST = 47737, + SPELL_ARCANEFORM = 48019, //Chaotic Rift visual + + //Yell + SAY_AGGRO = -1576010, + SAY_DEATH = -1576011, + SAY_RIFT = -1576012, + SAY_SHIELD = -1576013 +}; + +float RiftLocation[6][3]= +{ + {652.64, -273.70, -8.75}, + {634.45, -265.94, -8.44}, + {620.73, -281.17, -9.02}, + {626.10, -304.67, -9.44}, + {639.87, -314.11, -9.49}, + {651.72, -297.44, -9.37} +}; + +struct TRINITY_DLL_DECL boss_anomalusAI : public ScriptedAI +{ + boss_anomalusAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint8 Phase; + uint32 SPELL_SPARK_Timer; + uint32 SPELL_CREATE_RIFT_Timer; + uint64 ChaoticRiftGUID; + + void Reset() + { + Phase = 0; + SPELL_SPARK_Timer = 5000; + SPELL_CREATE_RIFT_Timer = 25000; + ChaoticRiftGUID = 0; + + DeadChaoticRift = false; + + if (pInstance) + pInstance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_ANOMALUS_EVENT, IN_PROGRESS); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (HeroicMode && !DeadChaoticRift) + { + AchievementEntry const *AchievChaosTheory = GetAchievementStore()->LookupEntry(ACHIEVEMENT_CHAOS_THEORY); + if (AchievChaosTheory) + { + Map* pMap = m_creature->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + itr->getSource()->CompletedAchievement(AchievChaosTheory); + } + } + } + + if (pInstance) + pInstance->SetData(DATA_ANOMALUS_EVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (m_creature->HasAura(SPELL_RIFT_SHIELD)) + { + if (ChaoticRiftGUID) + { + Unit* Rift = Unit::GetUnit((*m_creature), ChaoticRiftGUID); + if (Rift && Rift->isDead()) + { + m_creature->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD); + ChaoticRiftGUID = 0; + } + return; + } + } else + ChaoticRiftGUID = 0; + + if ((Phase == 0) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.75)) + { + Phase = 1; + DoScriptText(SAY_SHIELD, m_creature); + DoCast(m_creature, SPELL_RIFT_SHIELD); + + int tmp = rand()%(2); + Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Rift) + { + //DoCast(Rift, SPELL_CHARGE_RIFT); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Rift->AI()->AttackStart(target); + ChaoticRiftGUID = Rift->GetGUID(); + DoScriptText(SAY_RIFT , m_creature); + } + } + + if ((Phase == 1) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.50)) + { + Phase = 2; + DoScriptText(SAY_SHIELD , m_creature); + DoCast(m_creature,SPELL_RIFT_SHIELD); + + int tmp = rand()%(2); + Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Rift) + { + //DoCast(Rift, SPELL_CHARGE_RIFT); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Rift->AI()->AttackStart(target); + ChaoticRiftGUID = Rift->GetGUID(); + DoScriptText(SAY_RIFT , m_creature); + } + } + + if ((Phase == 2) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) + { + Phase = 3; + DoScriptText(SAY_SHIELD , m_creature); + DoCast(m_creature,SPELL_RIFT_SHIELD); + + int tmp = rand()%(2); + Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Rift) + { + //DoCast(Rift, SPELL_CHARGE_RIFT); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Rift->AI()->AttackStart(target); + ChaoticRiftGUID = Rift->GetGUID(); + DoScriptText(SAY_RIFT , m_creature); + } + } + + if (SPELL_SPARK_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, HeroicMode ? SPELL_SPARK_H : SPELL_SPARK_N); + SPELL_SPARK_Timer = 5000; + }else SPELL_SPARK_Timer -=diff; + + if (SPELL_CREATE_RIFT_Timer < diff) + { + DoScriptText(SAY_RIFT , m_creature); + + int tmp = rand()%(2); + Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Rift) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Rift->AI()->AttackStart(target); + SPELL_CREATE_RIFT_Timer = 25000; + }else SPELL_CREATE_RIFT_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_anomalus(Creature* pCreature) +{ + return new boss_anomalusAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_chaotic_riftAI : public Scripted_NoMovementAI +{ + mob_chaotic_riftAI(Creature *c) : Scripted_NoMovementAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 SPELL_CHAOTIC_ENERGY_BURST_Timer; + uint32 SUMMON_CRAZED_MANA_WRAITH_Timer; + + void Reset() + { + SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000; + SUMMON_CRAZED_MANA_WRAITH_Timer = 5000; + m_creature->SetDisplayId(25206); //For some reason in DB models for ally and horde are different. + //Model for ally (1126) does not show auras. Horde model works perfect. + //Set model to horde number + DoCast(m_creature, SPELL_ARCANEFORM, false); + } + + void JustDied(Unit *killer) + { + DeadChaoticRift = true; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (SPELL_CHAOTIC_ENERGY_BURST_Timer < diff) + { + Unit* Anomalus = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANOMALUS)); + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD)) + DoCast(target, SPELL_CHARGED_CHAOTIC_ENERGY_BURST); + else + DoCast(target, SPELL_CHAOTIC_ENERGY_BURST); + SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000; + }else SPELL_CHAOTIC_ENERGY_BURST_Timer -=diff; + + if (SUMMON_CRAZED_MANA_WRAITH_Timer < diff) + { + Creature* Wraith = m_creature->SummonCreature(MOB_CRAZED_MANA_WRAITH, m_creature->GetPositionX()+1, m_creature->GetPositionY()+1, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Wraith) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Wraith->AI()->AttackStart(target); + Unit* Anomalus = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANOMALUS)); + if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD)) + SUMMON_CRAZED_MANA_WRAITH_Timer = 5000; + else + SUMMON_CRAZED_MANA_WRAITH_Timer = 10000; + }else SUMMON_CRAZED_MANA_WRAITH_Timer -=diff; + } +}; + +CreatureAI* GetAI_mob_chaotic_rift(Creature* pCreature) +{ + return new mob_chaotic_riftAI (pCreature); +} + +void AddSC_boss_anomalus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_anomalus"; + newscript->GetAI = &GetAI_boss_anomalus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_chaotic_rift"; + newscript->GetAI = &GetAI_mob_chaotic_rift; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_keristrasza.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_keristrasza.cpp new file mode 100644 index 00000000000..072e6db1a1f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_keristrasza.cpp @@ -0,0 +1,258 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Keristrasza +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + +#include "precompiled.h" +#include "def_nexus.h" + +enum +{ + CONTAINMENT_SPHERES = 3, + + ACHIEVEMENT_INTENSE_COLD = 2036, + + //Spells + SPELL_FROZEN_PRISON = 47854, + SPELL_TAIL_SWEEP = 50155, + SPELL_CRYSTAL_CHAINS = 50997, + SPELL_ENRAGE = 8599, + SPELL_CRYSTALFIRE_BREATH_N = 48096, + SPELL_CRYSTALFIRE_BREATH_H = 57091, + SPELL_CRYSTALIZE = 48179, + SPELL_INTENSE_COLD = 48094, + SPELL_INTENSE_COLD_TRIGGERED = 48095, + + //Yell + SAY_AGGRO = -1576040, + SAY_SLAY = -1576041, + SAY_ENRAGE = -1576042, + SAY_DEATH = -1576043, + SAY_CRYSTAL_NOVA = -1576044 +}; + +struct TRINITY_DLL_DECL boss_keristraszaAI : public ScriptedAI +{ + boss_keristraszaAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint32 CRYSTALFIRE_BREATH_Timer; + uint32 CRYSTAL_CHAINS_CRYSTALIZE_Timer; + uint32 TAIL_SWEEP_Timer; + bool Enrage; + + uint64 ContainmentSphereGUIDs[CONTAINMENT_SPHERES]; + + uint32 CheckIntenseColdTimer; + bool MoreThanTwoIntenseCold; // needed for achievement: Intense Cold(2036) + + void Reset() + { + CRYSTALFIRE_BREATH_Timer = 14000; + CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000; + TAIL_SWEEP_Timer = 5000; + Enrage = false; + + CheckIntenseColdTimer = 2000; + MoreThanTwoIntenseCold = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); + + RemovePrison(CheckContainmentSpheres()); + + if (pInstance) + pInstance->SetData(DATA_KERISTRASZA_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + DoCastAOE(SPELL_INTENSE_COLD); + + if (pInstance) + pInstance->SetData(DATA_KERISTRASZA_EVENT, IN_PROGRESS); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (HeroicMode && !MoreThanTwoIntenseCold) + { + AchievementEntry const *AchievIntenseCold = GetAchievementStore()->LookupEntry(ACHIEVEMENT_INTENSE_COLD); + if (AchievIntenseCold) + { + Map* pMap = m_creature->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + itr->getSource()->CompletedAchievement(AchievIntenseCold); + } + } + } + + if (pInstance) + pInstance->SetData(DATA_KERISTRASZA_EVENT, DONE); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + bool CheckContainmentSpheres(bool remove_prison = false) + { + ContainmentSphereGUIDs[0] = pInstance->GetData64(ANOMALUS_CONTAINMET_SPHERE); + ContainmentSphereGUIDs[1] = pInstance->GetData64(ORMOROKS_CONTAINMET_SPHERE); + ContainmentSphereGUIDs[2] = pInstance->GetData64(TELESTRAS_CONTAINMET_SPHERE); + + GameObject *ContainmentSpheres[CONTAINMENT_SPHERES]; + + for(uint8 i = 0; i < CONTAINMENT_SPHERES; ++i) + { + ContainmentSpheres[i] = pInstance->instance->GetGameObject(ContainmentSphereGUIDs[i]); + if (!ContainmentSpheres[i]) + return false; + if (ContainmentSpheres[i]->GetGoState() != GO_STATE_ACTIVE) + return false; + } + if (remove_prison) + RemovePrison(true); + return true; + } + + void RemovePrison(bool remove) + { + if (remove) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (m_creature->HasAura(SPELL_FROZEN_PRISON)) + m_creature->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON); + } + else + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->CastSpell(m_creature, SPELL_FROZEN_PRISON, false); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (CheckIntenseColdTimer < diff && !MoreThanTwoIntenseCold) + { + std::list ThreatList = m_creature->getThreatManager().getThreatList(); + for(std::list::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); itr++) + { + Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (!target || target->GetTypeId() != TYPEID_PLAYER) + continue; + + Aura *AuraIntenseCold = target->GetAura(SPELL_INTENSE_COLD_TRIGGERED); + if (AuraIntenseCold && AuraIntenseCold->GetStackAmount() > 2) + { + MoreThanTwoIntenseCold = true; + break; + } + } + CheckIntenseColdTimer = 2000; + }else CheckIntenseColdTimer -= diff; + + if (!Enrage && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) + { + DoScriptText(SAY_ENRAGE , m_creature); + DoCast(m_creature, SPELL_ENRAGE); + Enrage = true; + } + + if (CRYSTALFIRE_BREATH_Timer < diff) + { + DoCast(m_creature->getVictim(), HeroicMode ? SPELL_CRYSTALFIRE_BREATH_H : SPELL_CRYSTALFIRE_BREATH_N); + CRYSTALFIRE_BREATH_Timer = 14000; + }else CRYSTALFIRE_BREATH_Timer -=diff; + + if (TAIL_SWEEP_Timer < diff) + { + DoCast(m_creature, SPELL_TAIL_SWEEP); + TAIL_SWEEP_Timer = 5000; + }else TAIL_SWEEP_Timer -=diff; + + if (CRYSTAL_CHAINS_CRYSTALIZE_Timer < diff) + { + DoScriptText(SAY_CRYSTAL_NOVA , m_creature); + if (HeroicMode) + DoCast(m_creature, SPELL_CRYSTALIZE); + else + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_CRYSTAL_CHAINS); + CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000; + }else CRYSTAL_CHAINS_CRYSTALIZE_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_keristrasza(Creature* pCreature) +{ + return new boss_keristraszaAI (pCreature); +} + +bool GOHello_containment_sphere(Player *pPlayer, GameObject *pGO) +{ + ScriptedInstance *pInstance = pGO->GetInstanceData(); + + Creature *Keristrasza = Unit::GetCreature(*pGO, pInstance->GetData64(DATA_KERISTRASZA)); + if (Keristrasza && Keristrasza->isAlive()) + { + // maybe these are hacks :( + pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + pGO->SetGoState(GO_STATE_ACTIVE); + + CAST_AI(boss_keristraszaAI, Keristrasza->AI())->CheckContainmentSpheres(true); + } + return true; +} + +void AddSC_boss_keristrasza() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_keristrasza"; + newscript->GetAI = &GetAI_boss_keristrasza; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "containment_sphere"; + newscript->pGOHello = &GOHello_containment_sphere; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp new file mode 100644 index 00000000000..2fe856cea05 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_magus_telestra.cpp @@ -0,0 +1,317 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Magus_Telestra +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + +#include "precompiled.h" +#include "def_nexus.h" + +enum +{ +//Spells + SPELL_ICE_NOVA_N = 47772, + SPELL_ICE_NOVA_H = 56935, + SPELL_FIREBOMB_N = 47773, + SPELL_FIREBOMB_H = 56934, + SPELL_GRAVITY_WELL = 47756, + SPELL_TELESTRA_BACK = 47714, + +//At 50% HP - 3 clones, Frost, Fire, Arcane (and in 10% HP in Heroic) + MOB_FIRE_MAGUS = 26928, + MOB_FROST_MAGUS = 26930, + MOB_ARCANE_MAGUS = 26929, + + SPELL_FIRE_MAGUS_VISUAL = 47705, + SPELL_FROST_MAGUS_VISUAL = 47706, + SPELL_ARCANE_MAGUS_VISUAL = 47704, + +//Yell + SAY_AGGRO = -1576000, + SAY_KILL = -1576001, + SAY_DEATH = -1576002, + SAY_MERGE = -1576003, + SAY_SPLIT_1 = -1576004, + SAY_SPLIT_2 = -1576005 +}; + +float CenterOfRoom[1][4] = +{ + {504.80, 89.07, -16.12, 6.27} +}; + +struct TRINITY_DLL_DECL boss_magus_telestraAI : public ScriptedAI +{ + boss_magus_telestraAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint64 FireMagusGUID; + uint64 FrostMagusGUID; + uint64 ArcaneMagusGUID; + bool FireMagusDead; + bool FrostMagusDead; + bool ArcaneMagusDead; + + uint32 AppearDelay_Timer; + bool AppearDelay; + + uint8 Phase; + + uint32 SPELL_ICE_NOVA_Timer; + uint32 SPELL_FIREBOMB_Timer; + uint32 SPELL_GRAVITY_WELL_Timer; + uint32 Cooldown; + + void Reset() + { + Phase = 0; + //These times are probably wrong + SPELL_ICE_NOVA_Timer = 7000; + SPELL_FIREBOMB_Timer = 0; + SPELL_GRAVITY_WELL_Timer = 15000; + Cooldown = 0; + + FireMagusGUID = 0; + FrostMagusGUID = 0; + ArcaneMagusGUID = 0; + + AppearDelay = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + + if (pInstance) + pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, IN_PROGRESS); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, DONE); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + uint64 SplitPersonality(uint32 entry) + { + Creature* Summoned = m_creature->SummonCreature(entry, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Summoned) + { + switch (entry) + { + case MOB_FIRE_MAGUS: + { + Summoned->CastSpell(Summoned, SPELL_FIRE_MAGUS_VISUAL, false); + break; + } + case MOB_FROST_MAGUS: + { + Summoned->CastSpell(Summoned, SPELL_FROST_MAGUS_VISUAL, false); + break; + } + case MOB_ARCANE_MAGUS: + { + Summoned->CastSpell(Summoned, SPELL_ARCANE_MAGUS_VISUAL, false); + break; + } + } + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Summoned->AI()->AttackStart(target); + return Summoned->GetGUID(); + } + return 0; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + { + return; + } + + if (AppearDelay) + { + m_creature->StopMoving(); + m_creature->AttackStop(); + if (AppearDelay_Timer < diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + AppearDelay = false; + }else AppearDelay_Timer -= diff; + return; + } + + + if ((Phase == 1)||(Phase == 3)) + { + Unit* FireMagus; + Unit* FrostMagus; + Unit* ArcaneMagus; + if (FireMagusGUID) + FireMagus = Unit::GetUnit((*m_creature), FireMagusGUID); + if (FrostMagusGUID) + FrostMagus = Unit::GetUnit((*m_creature), FrostMagusGUID); + if (ArcaneMagusGUID) + ArcaneMagus = Unit::GetUnit((*m_creature), ArcaneMagusGUID); + if (FireMagus && FireMagus->isDead()) + FireMagusDead = true; + if (FrostMagus && FrostMagus->isDead()) + FrostMagusDead = true; + if (ArcaneMagus && ArcaneMagus->isDead()) + ArcaneMagusDead = true; + if (FireMagusDead && FrostMagusDead && ArcaneMagusDead) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMap()->CreatureRelocation(m_creature, CenterOfRoom[0][0], CenterOfRoom[0][1], CenterOfRoom[0][2], CenterOfRoom[0][3]); + DoCast(m_creature, SPELL_TELESTRA_BACK); + m_creature->SetVisibility(VISIBILITY_ON); + if (Phase == 1) + Phase = 2; + if (Phase == 3) + Phase = 4; + FireMagusGUID = 0; + FrostMagusGUID = 0; + ArcaneMagusGUID = 0; + AppearDelay = true; + AppearDelay_Timer = 4000; + DoScriptText(SAY_MERGE, m_creature); + }else + return; + } + + if ((Phase == 0) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.5))) + { + Phase = 1; + m_creature->CastStop(); + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS); + FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS); + ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS); + FireMagusDead = false; + FrostMagusDead = false; + ArcaneMagusDead = false; + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPLIT_1, m_creature); break; + case 1: DoScriptText(SAY_SPLIT_2, m_creature); break; + } + return; + } + + if (HeroicMode && (Phase == 2) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.1))) + { + Phase = 3; + m_creature->CastStop(); + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS); + FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS); + ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS); + FireMagusDead = false; + FrostMagusDead = false; + ArcaneMagusDead = false; + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPLIT_1, m_creature); break; + case 1: DoScriptText(SAY_SPLIT_2, m_creature); break; + } + return; + } + + if (Cooldown) + { + if (Cooldown < diff) + Cooldown = 0; + else + { + Cooldown -= diff; + return; + } + } + + if (SPELL_ICE_NOVA_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, HeroicMode ? SPELL_ICE_NOVA_H : SPELL_ICE_NOVA_N); + Cooldown = 1500; + } + SPELL_ICE_NOVA_Timer = 15000; + }else SPELL_ICE_NOVA_Timer -=diff; + + if (SPELL_GRAVITY_WELL_Timer < diff) + { + if (Unit* target = m_creature->getVictim()) + { + DoCast(target, SPELL_GRAVITY_WELL); + Cooldown = 6000; + } + SPELL_GRAVITY_WELL_Timer = 15000; + }else SPELL_GRAVITY_WELL_Timer -=diff; + + if (SPELL_FIREBOMB_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, HeroicMode ? SPELL_FIREBOMB_H : SPELL_FIREBOMB_N); + Cooldown = 2000; + } + SPELL_FIREBOMB_Timer = 2000; + }else SPELL_FIREBOMB_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_magus_telestra(Creature* pCreature) +{ + return new boss_magus_telestraAI (pCreature); +} + +void AddSC_boss_magus_telestra() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_magus_telestra"; + newscript->GetAI = &GetAI_boss_magus_telestra; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_ormorok.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_ormorok.cpp new file mode 100644 index 00000000000..d55e8514cc6 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/boss_ormorok.cpp @@ -0,0 +1,311 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Ormorok +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + +#include "precompiled.h" +#include "def_nexus.h" + +enum +{ +//Spells + SPELL_CRYSTAL_SPIKES_N = 47958, //Don't work, using walkaround + SPELL_CRYSTAL_SPIKES_H = 57082, //Don't work, using walkaround +//Walkaround for spells Crystal Spikes ----------------- + SPELL_CRYSTALL_SPIKE_DAMAGE_N = 47944, + SPELL_CRYSTALL_SPIKE_DAMAGE_H = 57067, + SPELL_CRYSTAL_SPIKE_PREVISUAL = 50442, + MOB_CRYSTAL_SPIKE = 27099, +//------------------------------------------------------ + SPELL_SPELL_REFLECTION = 47981, + SPELL_TRAMPLE_N = 48016, + SPELL_TRAMPLE_H = 57066, + SPELL_FRENZY = 48017, + SPELL_SUMMON_CRYSTALLINE_TANGLER = 61564, //summons npc 32665 + MOB_CRYSTALLINE_TANGLER = 32665, + SPELL_ROOTS = 28858, //proper spell id is unknown + +//Yell + SAY_AGGRO = -1576020, + SAY_DEATH = -1576021, + SAY_REFLECT = -1576022, + SAY_CRYSTAL_SPIKES = -1576023, + SAY_KILL = -1576024 +}; + +#define SPIKE_DISTANCE 5.0f + +struct TRINITY_DLL_DECL boss_ormorokAI : public ScriptedAI +{ + boss_ormorokAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + bool Frenzy; + bool CrystalSpikes; + uint8 CrystalSpikes_Count; + float BaseX; + float BaseY; + float BaseZ; + float BaseO; + float SpikeXY[4][2]; + + uint32 SPELL_CRYSTAL_SPIKES_Timer; + uint32 CRYSTAL_SPIKES_Timer; + uint32 SPELL_TRAMPLE_Timer; + uint32 SPELL_FRENZY_Timer; + uint32 SPELL_SPELL_REFLECTION_Timer; + uint32 SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer; + + void Reset() + { + SPELL_CRYSTAL_SPIKES_Timer = 12000; + SPELL_TRAMPLE_Timer = 10000; + SPELL_SPELL_REFLECTION_Timer = 30000; + SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000; + Frenzy = false; + CrystalSpikes = false; + + if (pInstance) + pInstance->SetData(DATA_ORMOROK_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_ORMOROK_EVENT, IN_PROGRESS); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_ORMOROK_EVENT, DONE); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + return; + } + if (CrystalSpikes) + if (CRYSTAL_SPIKES_Timer < diff) + { + SpikeXY[0][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO)); + SpikeXY[0][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO)); + SpikeXY[1][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO)); + SpikeXY[1][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO)); + SpikeXY[2][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2))); + SpikeXY[2][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2))); + SpikeXY[3][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2))); + SpikeXY[3][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2))); + for (uint8 i = 0; i < 4; ++i) + Creature* Spike = m_creature->SummonCreature(MOB_CRYSTAL_SPIKE, SpikeXY[i][0], SpikeXY[i][1], BaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7000); + if (++CrystalSpikes_Count >= 13) + CrystalSpikes = false; + CRYSTAL_SPIKES_Timer = 200; + }else CRYSTAL_SPIKES_Timer -= diff; + + if (!Frenzy && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) + { + DoCast(m_creature, SPELL_FRENZY); + Frenzy = true; + } + + if (SPELL_TRAMPLE_Timer < diff) + { + DoCast(m_creature, HeroicMode ? SPELL_TRAMPLE_H : SPELL_TRAMPLE_N); + SPELL_TRAMPLE_Timer = 10000; + }else SPELL_TRAMPLE_Timer -= diff; + + if (SPELL_SPELL_REFLECTION_Timer < diff) + { + DoScriptText(SAY_REFLECT, m_creature); + DoCast(m_creature, SPELL_SPELL_REFLECTION); + SPELL_SPELL_REFLECTION_Timer = 30000; + }else SPELL_SPELL_REFLECTION_Timer -= diff; + + if (SPELL_CRYSTAL_SPIKES_Timer < diff) + { + DoScriptText(SAY_CRYSTAL_SPIKES, m_creature); + CrystalSpikes = true; + CrystalSpikes_Count = 1; + CRYSTAL_SPIKES_Timer = 0; + BaseX = m_creature->GetPositionX(); + BaseY = m_creature->GetPositionY(); + BaseZ = m_creature->GetPositionZ(); + BaseO = m_creature->GetOrientation(); + SPELL_CRYSTAL_SPIKES_Timer = 20000; + }else SPELL_CRYSTAL_SPIKES_Timer -=diff; + + if (HeroicMode && (SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer < diff)) + { + Creature* Crystalline_Tangler = m_creature->SummonCreature(MOB_CRYSTALLINE_TANGLER, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); + if (Crystalline_Tangler) + { + Unit* target = NULL; + uint8 Healer = 0; + for (uint8 j = 1; j<=4; j++) + { + switch (j) + { + case 1: Healer = CLASS_PRIEST; break; + case 2: Healer = CLASS_PALADIN; break; + case 3: Healer = CLASS_DRUID; break; + case 4: Healer = CLASS_SHAMAN; break; + } + std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); + for (; i != m_creature->getThreatManager().getThreatList().end(); ++i) + { + Unit* pTemp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid()); + if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER && pTemp->getClass() == Healer) + { + target = pTemp; + break; + } + } + if (target) + break; + } + if (!target) + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + { + Crystalline_Tangler->AI()->AttackStart(target); + Crystalline_Tangler->getThreatManager().addThreat(target, 1000000000.0f); + } + } + SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000; + }else SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL mob_crystal_spikeAI : public Scripted_NoMovementAI +{ + mob_crystal_spikeAI(Creature *c) : Scripted_NoMovementAI(c) + { + HeroicMode = c->GetMap()->IsHeroic(); + } + + bool HeroicMode; + + uint32 SPELL_CRYSTALL_SPIKE_DAMAGE_Timer; + uint32 SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer; + + void Reset() + { + SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 3700; + SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 1000; + m_creature->SetLevel(80); // + m_creature->setFaction(16); //Walkaround to be independent from data in DB + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); // + } + + void UpdateAI(const uint32 diff) + { + if (SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer < diff) + { + DoCast(m_creature, SPELL_CRYSTAL_SPIKE_PREVISUAL); + SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 10000; + }else SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer -=diff; + + if (SPELL_CRYSTALL_SPIKE_DAMAGE_Timer < diff) + { + DoCast(m_creature, HeroicMode ? SPELL_CRYSTALL_SPIKE_DAMAGE_H : SPELL_CRYSTALL_SPIKE_DAMAGE_N); + SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 10000; + }else SPELL_CRYSTALL_SPIKE_DAMAGE_Timer -=diff; + } +}; + +struct TRINITY_DLL_DECL mob_crystalline_tanglerAI : public ScriptedAI +{ + mob_crystalline_tanglerAI(Creature *c) : ScriptedAI(c) {} + + uint32 SPELL_ROOTS_Timer; + + void Reset() + { + SPELL_ROOTS_Timer = 1000; + } + + void UpdateAI(const uint32 diff) + { + if (SPELL_ROOTS_Timer < diff) + { + if (m_creature->IsWithinDist(m_creature->getVictim(), 5.0f, false)) + { + DoCast(m_creature->getVictim(), SPELL_ROOTS); + SPELL_ROOTS_Timer = 15000; + } + }else SPELL_ROOTS_Timer -=diff; + } +}; + +CreatureAI* GetAI_mob_crystal_spike(Creature* pCreature) +{ + return new mob_crystal_spikeAI (pCreature); +} + +CreatureAI* GetAI_mob_crystalline_tangler(Creature* pCreature) +{ + return new mob_crystalline_tanglerAI (pCreature); +} + +CreatureAI* GetAI_boss_ormorok(Creature* pCreature) +{ + return new boss_ormorokAI (pCreature); +} + +void AddSC_boss_ormorok() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_ormorok"; + newscript->GetAI = &GetAI_boss_ormorok; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_crystal_spike"; + newscript->GetAI = &GetAI_mob_crystal_spike; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_crystalline_tangler"; + newscript->GetAI = &GetAI_mob_crystalline_tangler; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/commander_kolurg.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/commander_kolurg.cpp new file mode 100644 index 00000000000..a28deb89264 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/commander_kolurg.cpp @@ -0,0 +1,57 @@ +/* Script Data Start +SDName: Boss Commander Kolurg +SDAuthor: LordVanMartin +SD%Complete: +SDComment: Only Alliance Heroic +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_commander_kolurg' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +#define SPELL_BATTLE_SHOUT 31403 +#define SPELL_CHARGE 60067 +#define SPELL_FRIGHTENING_SHOUT 19134 +#define SPELL_WHIRLWIND_1 38619 +#define SPELL_WHIRLWIND_2 38618 + +//Yell +#define SAY_AGGRO 1576024 +#define SAY_KILL 1576025 +#define SAY_DEATH 1576026 + +struct TRINITY_DLL_DECL boss_commander_kolurgAI : public ScriptedAI +{ + boss_commander_kolurgAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_commander_kolurg(Creature* pCreature) +{ + return new boss_commander_kolurgAI (pCreature); +} + +void AddSC_boss_commander_kolurg() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_commander_kolurg"; + newscript->GetAI = &GetAI_boss_commander_kolurg; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/commander_stoutbeard.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/commander_stoutbeard.cpp new file mode 100644 index 00000000000..1bacd679e25 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/commander_stoutbeard.cpp @@ -0,0 +1,63 @@ +/* Script Data Start +SDName: Boss Commander Stoutbeard +SDAuthor: LordVanMartin +SD%Complete: +SDComment: Only Horde Heroic +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_commander_stoutbeard' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +#define SPELL_BATTLE_SHOUT 31403 +#define SPELL_CHARGE 60067 +#define SPELL_FRIGHTENING_SHOUT 19134 +#define SPELL_WHIRLWIND_1 38619 +#define SPELL_WHIRLWIND_2 38618 + +//Yell +#define SAY_AGGRO 1576021 +#define SAY_KILL 1576022 +#define SAY_DEATH 1576023 + +struct TRINITY_DLL_DECL boss_commander_stoutbeardAI : public ScriptedAI +{ + boss_commander_stoutbeardAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } +}; + +CreatureAI* GetAI_boss_commander_stoutbeard(Creature* pCreature) +{ + return new boss_commander_stoutbeardAI (pCreature); +} + +void AddSC_boss_commander_stoutbeard() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_commander_stoutbeard"; + newscript->GetAI = &GetAI_boss_commander_stoutbeard; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/def_nexus.h b/src/bindings/scripts/scripts/northrend/nexus/nexus/def_nexus.h new file mode 100644 index 00000000000..678e44e5bbe --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/def_nexus.h @@ -0,0 +1,19 @@ +#ifndef DEF_NEXUS_H +#define DEF_NEXUS_H + +enum +{ + DATA_MAGUS_TELESTRA_EVENT, + DATA_ANOMALUS_EVENT, + DATA_ORMOROK_EVENT, + DATA_KERISTRASZA_EVENT, + + DATA_ANOMALUS, + DATA_KERISTRASZA, + + ANOMALUS_CONTAINMET_SPHERE, + ORMOROKS_CONTAINMET_SPHERE, + TELESTRAS_CONTAINMET_SPHERE +}; + +#endif diff --git a/src/bindings/scripts/scripts/northrend/nexus/nexus/instance_nexus.cpp b/src/bindings/scripts/scripts/northrend/nexus/nexus/instance_nexus.cpp new file mode 100644 index 00000000000..169eda90d2a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/nexus/instance_nexus.cpp @@ -0,0 +1,258 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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_Nexus +SD%Complete: +SDComment: +SDCategory: The Nexus, The Nexus +EndScriptData */ + +#include "precompiled.h" +#include "def_nexus.h" + +#define NUMBER_OF_ENCOUNTERS 4 + +struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance +{ + instance_nexus(Map* pMap) : ScriptedInstance(pMap) { Initialize(); } + + uint32 m_auiEncounter[NUMBER_OF_ENCOUNTERS]; + + uint64 Anomalus; + uint64 Keristrasza; + + uint64 AnomalusContainmentSphere; + uint64 OrmoroksContainmentSphere; + uint64 TelestrasContainmentSphere; + + std::string strInstData; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + Anomalus = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + Map::PlayerList const& players = instance->GetPlayers(); + uint32 TeamInInstance = 0; + + if (!players.isEmpty()) + { + if (Player* pPlayer = players.begin()->getSource()) + { + TeamInInstance = pPlayer->GetTeam(); + } + } + switch(pCreature->GetEntry()) + { + case 26763: Anomalus = pCreature->GetGUID(); break; + case 26723: Keristrasza = pCreature->GetGUID(); break; + case 26800: + { + //26799 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24358); + break; + } + case 26802: + { + //26801 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24354); + break; + } + case 26805: + { + //26803 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24357); + break; + } + case 27949: + { + //27947 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24352); + break; + } + case 26796: + { + //26798 + pCreature->setFaction(16); + if (TeamInInstance == ALLIANCE) + pCreature->SetDisplayId(24352); + break; + } + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 188527: + { + AnomalusContainmentSphere = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + } + case 188528: + { + OrmoroksContainmentSphere = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + } + case 188526: + { + TelestrasContainmentSphere = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + break; + } + } + } + + uint32 GetData(uint32 identifier) + { + switch(identifier) + { + case DATA_MAGUS_TELESTRA_EVENT: return m_auiEncounter[0]; + case DATA_ANOMALUS_EVENT: return m_auiEncounter[1]; + case DATA_ORMOROK_EVENT: return m_auiEncounter[2]; + case DATA_KERISTRASZA_EVENT: return m_auiEncounter[3]; + } + return 0; + } + + void SetData(uint32 identifier, uint32 data) + { + switch(identifier) + { + case DATA_MAGUS_TELESTRA_EVENT: + { + if (data == DONE) + { + GameObject *Sphere = instance->GetGameObject(TelestrasContainmentSphere); + if (Sphere) + Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + } + m_auiEncounter[0] = data; + break; + } + case DATA_ANOMALUS_EVENT: + { + if (data == DONE) + { + GameObject *Sphere = instance->GetGameObject(AnomalusContainmentSphere); + if (Sphere) + Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + } + m_auiEncounter[1] = data; + break; + } + case DATA_ORMOROK_EVENT: + { + if (data == DONE) + { + GameObject *Sphere = instance->GetGameObject(OrmoroksContainmentSphere); + if (Sphere) + Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); + } + m_auiEncounter[2] = data; + break; + } + case DATA_KERISTRASZA_EVENT: 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]; + + strInstData = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint64 GetData64(uint32 uiIdentifier) + { + switch(uiIdentifier) + { + case DATA_ANOMALUS: return Anomalus; + case DATA_KERISTRASZA: return Keristrasza; + case ANOMALUS_CONTAINMET_SPHERE: return AnomalusContainmentSphere; + case ORMOROKS_CONTAINMET_SPHERE: return OrmoroksContainmentSphere; + case TELESTRAS_CONTAINMET_SPHERE: return TelestrasContainmentSphere; + } + return 0; + } + + std::string GetSaveData() + { + return strInstData; + } + + 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]; + + for(uint8 i = 1; i < NUMBER_OF_ENCOUNTERS; ++i) + { + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + } + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_nexus(Map* pMap) +{ + return new instance_nexus(pMap); +} + +void AddSC_instance_nexus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_nexus"; + newscript->GetInstanceData = &GetInstanceData_instance_nexus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_drakos.cpp b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_drakos.cpp new file mode 100644 index 00000000000..bde90bf021e --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_drakos.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss drakos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_MAGIC_PULL 51336 +#define SPELL_THUNDERING_STOMP 50774 +#define SPELL_THUNDERING_STOMP_2 59370 + +//Yell +#define SAY_AGGRO -1578000 +#define SAY_KILL_1 -1578001 +#define SAY_KILL_2 -1578002 +#define SAY_KILL_3 -1578003 +#define SAY_DEATH -1578004 +#define SAY_PULL_1 -1578005 +#define SAY_PULL_2 -1578006 +#define SAY_PULL_3 -1578007 +#define SAY_PULL_4 -1578008 +#define SAY_STOMP_1 -1578009 +#define SAY_STOMP_2 -1578010 +#define SAY_STOMP_3 -1578011 + +struct TRINITY_DLL_DECL boss_drakosAI : public ScriptedAI +{ + boss_drakosAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_KILL_1, m_creature);break; + case 1: DoScriptText(SAY_KILL_2, m_creature);break; + case 2: DoScriptText(SAY_KILL_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_drakos(Creature* pCreature) +{ + return new boss_drakosAI (pCreature); +} + +void AddSC_boss_drakos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_drakos"; + newscript->GetAI = &GetAI_boss_drakos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_eregos.cpp b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_eregos.cpp new file mode 100644 index 00000000000..cc3fa3b3043 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_eregos.cpp @@ -0,0 +1,104 @@ +/* Script Data Start +SDName: Boss eregos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: Encounter is done entirely on drake vehicles +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Types of drake mounts: Ruby(Tank), Amber(DPS), Emerald(Healer) +//Two Repeating phases + +//Spells +#define SPELL_ARCANE_BARRAGE 50804 +#define SPELL_ARCANE_VOLLEY 51153 +#define SPELL_ENRAGED_ASSAULT 51170 +#define SPELL_PLANAR_ANOMALIES 57959 +#define SPELL_PLANAR_SHIFT 51162 + +//Heroic +#define SPELL_ARCANE_BARRAGE_H 59381 +#define SPELL_ARCANE_VOLLEY_H 59382 + +/*Ruby Drake , +(npc 27756) (item 37860) +(summoned by spell Ruby Essence = 37860 ---> Call Amber Drake == 49462 ---> Summon 27756) +*/ +#define NPC_RUBY_DRAKE_VEHICLE 27756 +#define SPELL_RIDE_RUBY_DRAKE_QUE 49463 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49464 +#define SPELL_RUBY_DRAKE_SADDLE 49464 //Allows you to ride on the back of an Amber Drake. ---> Dummy + +#define SPELL_RUBY_SEARING_WRATH 50232 //(60 yds) - Instant - Breathes a stream of fire at an enemy dragon, dealing 6800 to 9200 Fire damage and then jumping to additional dragons within 30 yards. Each jump increases the damage by 50%. Affects up to 5 total targets +#define SPELL_RUBY_EVASIVE_AURA 50248 //Instant - Allows the Ruby Drake to generate Evasive Charges when hit by hostile attacks and spells. +#define SPELL_RUBY_EVASIVE_MANEUVERS 50240 //Instant - 5 sec. cooldown - Allows your drake to dodge all incoming attacks and spells. Requires Evasive Charges to use. Each attack or spell dodged while this ability is active burns one Evasive Charge. Lasts 30 sec. or until all charges are exhausted. +//you do not have acces to until you kill Mage-Lord Urom +#define SPELL_RUBY_MARTYR 50253 //Instant - 10 sec. cooldown - Redirect all harmful spells cast at friendly drakes to yourself for 10 sec. + +/*Amber Drake, +(npc 27755) (item 37859) +(summoned by spell Amber Essence = 37859 ---> Call Amber Drake == 49461 ---> Summon 27755) +*/ +#define NPC_AMBER_DRAKE_VEHICLE 27755 +#define SPELL_RIDE_AMBER_DRAKE_QUE 49459 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49460 +#define SPELL_AMBER_DRAKE_SADDLE 49460 //Allows you to ride on the back of an Amber Drake. ---> Dummy + +#define SPELL_AMBER_SHOCK_LANCE 49840 //(60 yds) - Instant - Deals 4822 to 5602 Arcane damage and detonates all Shock Charges on an enemy dragon. Damage is increased by 6525 for each detonated. +#define SPELL_AMBER_STOP_TIME //Instant - 1 min cooldown - Halts the passage of time, freezing all enemy dragons in place for 10 sec. This attack applies 5 Shock Charges to each affected target. +//you do not have access to until you kill the Mage-Lord Urom. +#define SPELL_AMBER_TEMPORAL_RIFT 49592 //(60 yds) - Channeled - Channels a temporal rift on an enemy dragon for 10 sec. While trapped in the rift, all damage done to the target is increased by 100%. In addition, for every 15,000 damage done to a target affected by Temporal Rift, 1 Shock Charge is generated. + +/*Emerald Drake, +(npc 27692) (item 37815), + (summoned by spell Emerald Essence = 37815 ---> Call Emerald Drake == 49345 ---> Summon 27692) +*/ +#define NPC_EMERALD_DRAKE_VEHICLE 27692 +#define SPELL_RIDE_EMERALD_DRAKE_QUE 49427 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49346 +#define SPELL_EMERALD_DRAKE_SADDLE 49346 //Allows you to ride on the back of an Amber Drake. ---> Dummy + +#define SPELL_EMERALD_LEECHING_POISON 50328 //(60 yds) - Instant - Poisons the enemy dragon, leeching 1300 to the caster every 2 sec. for 12 sec. Stacks up to 3 times. +#define SPELL_EMERALD_TOUCH_THE_NIGHTMARE 50341 //(60 yds) - Instant - Consumes 30% of the caster's max health to inflict 25,000 nature damage to an enemy dragon and reduce the damage it deals by 25% for 30 sec. +// you do not have access to until you kill the Mage-Lord Urom +#define SPELL_EMERALD_DREAM_FUNNEL 50344 //(60 yds) - Channeled - Transfers 5% of the caster's max health to a friendly drake every second for 10 seconds as long as the caster channels. + +struct TRINITY_DLL_DECL boss_eregosAI : public ScriptedAI +{ + boss_eregosAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + phase =1; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_eregos(Creature* pCreature) +{ + return new boss_eregosAI (pCreature); +} + +void AddSC_boss_eregos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_eregos"; + newscript->GetAI = &GetAI_boss_eregos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_urom.cpp b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_urom.cpp new file mode 100644 index 00000000000..1f34ecefbbd --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_urom.cpp @@ -0,0 +1,87 @@ +/* Script Data Start +SDName: Boss urom +SDAuthor: LordVanMartin +SD%Complete: 1% +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_SHIELD 53813 //Dummy --> Channeled, shields the caster from damage. +#define SPELL_EMPOWERED_ARCANE_EXPLOSION 51110 +#define SPELL_EMPOWERED_ARCANE_EXPLOSION_2 59377 +#define SPELL_FROSTBOMB 51103 //Urom throws a bomb, hitting its target with the highest aggro which inflict directly 650 frost damage and drops a frost zone on the ground. This zone deals 650 frost damage per second and reduce the movement speed by 35%. Lasts 1 minute. +#define SPELL_SUMMON_MENAGERIE 50476 //Summons an assortment of creatures and teleports the caster to safety. +#define SPELL_SUMMON_MENAGERIE_2 50495 +#define SPELL_SUMMON_MENAGERIE_3 50496 +#define SPELL_TELEPORT 51112 //Teleports to the center of Oculus +#define SPELL_TIME_BOMB 51121 //Deals arcane damage to a random player, and after 6 seconds, deals zone damage to nearby equal to the health missing of the target afflicted by the debuff. +#define SPELL_TIME_BOMB_2 59376 + +//Yell +#define SAY_AGGRO -1578012 +#define SAY_KILL_1 -1578013 +#define SAY_KILL_2 -1578014 +#define SAY_KILL_3 -1578015 +#define SAY_DEATH -1578016 +#define SAY_EXPLOSION_1 -1578017 +#define SAY_EXPLOSION_2 -1578018 +#define SAY_SUMMON_1 -1578019 +#define SAY_SUMMON_2 -1578020 +#define SAY_SUMMON_3 -1578021 + +struct TRINITY_DLL_DECL boss_uromAI : public ScriptedAI +{ + boss_uromAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_KILL_1, m_creature);break; + case 1: DoScriptText(SAY_KILL_2, m_creature);break; + case 2: DoScriptText(SAY_KILL_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_urom(Creature* pCreature) +{ + return new boss_uromAI (pCreature); +} + +void AddSC_boss_urom() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_urom"; + newscript->GetAI = &GetAI_boss_urom; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_varos.cpp b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_varos.cpp new file mode 100644 index 00000000000..299c54dd8dc --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/oculus/boss_varos.cpp @@ -0,0 +1,85 @@ +/* Script Data Start +SDName: Boss varos +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ENERGIZE_CORES 50785 //Damage 5938 to 6562, effec2 Triggers 54069, effect3 Triggers 56251 +#define SPELL_ENERGIZE_CORES_TRIGGER_1 54069 +#define SPELL_ENERGIZE_CORES_TRIGGER_2 56251 +#define SPELL_ENERGIZE_CORES_2 59372 //Damage 9025 to 9975, effect2 Triggers 54069, effect 56251 +#define SPELL_CALL_AZURE_RING_CAPTAIN 51002 //Effect Send Event (12229) +#define SPELL_CALL_AZURE_RING_CAPTAIN_2 51006 //Effect Send Event (10665) +#define SPELL_CALL_AZURE_RING_CAPTAIN_3 51007 //Effect Send Event (18454) +#define SPELL_CALL_AZURE_RING_CAPTAIN_4 51008 //Effect Send Event (18455) +#define SPELL_CALL_AMPLIFY_MAGIC 51054 +#define SPELL_CALL_AMPLIFY_MAGIC_2 59371 + +//Yell +#define SAY_AGGRO -1578022 +#define SAY_KILL_1 -1578023 +#define SAY_KILL_2 -1578024 +#define SAY_DEATH -1578025 +#define SAY_STRIKE_1 -1578026 +#define SAY_STRIKE_2 -1578027 +#define SAY_STRIKE_3 -1578028 +#define SAY_SPAWN -1578029 + + +struct TRINITY_DLL_DECL boss_varosAI : public ScriptedAI +{ + boss_varosAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature);break; + case 1: DoScriptText(SAY_KILL_2, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_varos(Creature* pCreature) +{ + return new boss_varosAI (pCreature); +} + +void AddSC_boss_varos() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_varos"; + newscript->GetAI = &GetAI_boss_varos; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/nexus/oculus/def_oculus.h b/src/bindings/scripts/scripts/northrend/nexus/oculus/def_oculus.h new file mode 100644 index 00000000000..0b63a52d866 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/oculus/def_oculus.h @@ -0,0 +1,4 @@ +#ifndef DEF_OCULUS_H +#define DEF_OCULUS_H + +#endif diff --git a/src/bindings/scripts/scripts/northrend/nexus/oculus/instance_oculus.cpp b/src/bindings/scripts/scripts/northrend/nexus/oculus/instance_oculus.cpp new file mode 100644 index 00000000000..b5ceee9e5ed --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/nexus/oculus/instance_oculus.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_oculus.h" + +struct TRINITY_DLL_DECL instance_oculus : public ScriptedInstance +{ + instance_oculus(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_oculus(Map* pMap) +{ + return new instance_oculus(pMap); +} + +void AddSC_instance_oculus() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_oculus"; + newscript->GetInstanceData = &GetInstanceData_instance_oculus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp new file mode 100644 index 00000000000..01ba351ff99 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/boss_sartharion.cpp @@ -0,0 +1,1153 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss Sartharion +SD%Complete: 70% +SDComment: Flame wave, achievement and portal events need to be implemented +SDCategory: Obsidian Sanctum +EndScriptData */ + +#include "precompiled.h" +#include "def_obsidian_sanctum.h" + +enum +{ + //Sartharion Yell + SAY_SARTHARION_AGGRO = -1615018, + SAY_SARTHARION_BERSERK = -1615019, + SAY_SARTHARION_BREATH = -1615020, + SAY_SARTHARION_CALL_SHADRON = -1615021, + SAY_SARTHARION_CALL_TENEBRON = -1615022, + SAY_SARTHARION_CALL_VESPERON = -1615023, + SAY_SARTHARION_DEATH = -1615024, + SAY_SARTHARION_SPECIAL_1 = -1615025, + SAY_SARTHARION_SPECIAL_2 = -1615026, + SAY_SARTHARION_SPECIAL_3 = -1615027, + SAY_SARTHARION_SPECIAL_4 = -1615028, + SAY_SARTHARION_SLAY_1 = -1615029, + SAY_SARTHARION_SLAY_2 = -1615030, + SAY_SARTHARION_SLAY_3 = -1615031, + + WHISPER_LAVA_CHURN = -1615032, + + WHISPER_SHADRON_DICIPLE = -1615008, + WHISPER_VESPERON_DICIPLE = -1615041, + WHISPER_HATCH_EGGS = -1615017, + WHISPER_OPEN_PORTAL = -1615042, // whisper, shared by two dragons + + //Sartharion Spells + SPELL_BERSERK = 61632, // Increases the caster's attack speed by 150% and all damage it deals by 500% for 5 min. + SPELL_CLEAVE = 56909, // Inflicts 35% weapon damage to an enemy and its nearest allies, affecting up to 10 targets. + SPELL_FLAME_BREATH = 56908, // Inflicts 8750 to 11250 Fire damage to enemies in a cone in front of the caster. + SPELL_FLAME_BREATH_H = 58956, // Inflicts 10938 to 14062 Fire damage to enemies in a cone in front of the caster. + SPELL_TAIL_LASH = 56910, // A sweeping tail strike hits all enemies behind the caster, inflicting 3063 to 3937 damage and stunning them for 2 sec. + SPELL_TAIL_LASH_H = 58957, // A sweeping tail strike hits all enemies behind the caster, inflicting 4375 to 5625 damage and stunning them for 2 sec. + SPELL_WILL_OF_SARTHARION = 61254, // Sartharion's presence bolsters the resolve of the Twilight Drakes, increasing their total health by 25%. This effect also increases Sartharion's health by 25%. + SPELL_LAVA_STRIKE = 57571, // (Real spell casted should be 57578) 57571 then trigger visual missile, then summon Lava Blaze on impact(spell 57572) + SPELL_TWILIGHT_REVENGE = 60639, + + SPELL_PYROBUFFET = 56916, // currently used for hard enrage after 15 minutes + SPELL_PYROBUFFET_RANGE = 58907, // possibly used when player get too far away from dummy creatures (2x Creature entry 30494) + + SPELL_TWILIGHT_SHIFT_ENTER = 57620, // enter phase. Player get this when click GO + SPELL_TWILIGHT_SHIFT_REMOVAL = 61187, // leave phase + SPELL_TWILIGHT_SHIFT_REMOVAL_ALL = 61190, // leave phase (probably version to make all leave) + + //Mini bosses common spells + SPELL_TWILIGHT_RESIDUE = 61885, // makes immune to shadow damage, applied when leave phase + + //Miniboses (Vesperon, Shadron, Tenebron) + SPELL_SHADOW_BREATH_H = 59126, // Inflicts 8788 to 10212 Fire damage to enemies in a cone in front of the caster. + SPELL_SHADOW_BREATH = 57570, // Inflicts 6938 to 8062 Fire damage to enemies in a cone in front of the caster. + + SPELL_SHADOW_FISSURE_H = 59127, // Deals 9488 to 13512 Shadow damage to any enemy within the Shadow fissure after 5 sec. + SPELL_SHADOW_FISSURE = 57579, // Deals 6188 to 8812 Shadow damage to any enemy within the Shadow fissure after 5 sec. + + //Vesperon + //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal open multiple times + NPC_ACOLYTE_OF_VESPERON = 31219, // Acolyte of Vesperon + SPELL_POWER_OF_VESPERON = 61251, // Vesperon's presence decreases the maximum health of all enemies by 25%. + SPELL_TWILIGHT_TORMENT_VESP = 57948, // (Shadow only) trigger 57935 then 57988 + SPELL_TWILIGHT_TORMENT_VESP_ACO = 58853, // (Fire and Shadow) trigger 58835 then 57988 + + //Shadron + //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal open multiple times + NPC_ACOLYTE_OF_SHADRON = 31218, // Acolyte of Shadron + SPELL_POWER_OF_SHADRON = 58105, // Shadron's presence increases Fire damage taken by all enemies by 100%. + SPELL_GIFT_OF_TWILIGTH_SHA = 57835, // TARGET_SCRIPT shadron + SPELL_GIFT_OF_TWILIGTH_SAR = 58766, // TARGET_SCRIPT sartharion + + //Tenebron + //in the portal spawns 6 eggs, if not killed in time (approx. 20s) they will hatch, whelps can cast 60708 + SPELL_POWER_OF_TENEBRON = 61248, // Tenebron's presence increases Shadow damage taken by all enemies by 100%. + //Tenebron, dummy spell + SPELL_SUMMON_TWILIGHT_WHELP = 58035, // doesn't work, will spawn NPC_TWILIGHT_WHELP + SPELL_SUMMON_SARTHARION_TWILIGHT_WHELP = 58826, // doesn't work, will spawn NPC_SHARTHARION_TWILIGHT_WHELP + + SPELL_HATCH_EGGS_H = 59189, + SPELL_HATCH_EGGS = 58542, + SPELL_HATCH_EGGS_EFFECT_H = 59190, + SPELL_HATCH_EGGS_EFFECT = 58685, + + //Whelps + NPC_TWILIGHT_WHELP = 30890, + NPC_SHARTHARION_TWILIGHT_WHELP = 31214, + SPELL_FADE_ARMOR = 60708, // Reduces the armor of an enemy by 1500 for 15s + + //flame tsunami + SPELL_FLAME_TSUNAMI = 57494, // the visual dummy + SPELL_FLAME_TSUNAMI_LEAP = 60241, // SPELL_EFFECT_138 some leap effect, causing caster to move in direction + SPELL_FLAME_TSUNAMI_DMG_AURA = 57492, // periodic damage, npc has this aura + + NPC_FLAME_TSUNAMI = 30616, // for the flame waves + NPC_LAVA_BLAZE = 30643, // adds spawning from flame strike + + //using these custom points for dragons start and end + POINT_ID_INIT = 100, + POINT_ID_LAND = 200 +}; + +struct Waypoint +{ + float m_fX, m_fY, m_fZ; +}; + +//each dragons special points. First where fly to before connect to connon, second where land point is. +Waypoint m_aTene[]= +{ + {3212.854, 575.597, 109.856}, //init + {3246.425, 565.367, 61.249} //end +}; + +Waypoint m_aShad[]= +{ + {3293.238, 472.223, 106.968}, + {3271.669, 526.907, 61.931} +}; + +Waypoint m_aVesp[]= +{ + {3193.310, 472.861, 102.697}, + {3227.268, 533.238, 59.995} +}; + +//points around raid "isle", counter clockwise. should probably be adjusted to be more alike +Waypoint m_aDragonCommon[]= +{ + {3214.012, 468.932, 98.652}, + {3244.950, 468.427, 98.652}, + {3283.520, 496.869, 98.652}, + {3287.316, 555.875, 98.652}, + {3250.479, 585.827, 98.652}, + {3209.969, 566.523, 98.652} +}; + +/*###### +## Boss Sartharion +######*/ + +struct TRINITY_DLL_DECL boss_sartharionAI : public ScriptedAI +{ + boss_sartharionAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsHeroic; + + bool m_bIsBerserk; + bool m_bIsSoftEnraged; + + uint32 m_uiEnrageTimer; + bool m_bIsHardEnraged; + + uint32 m_uiTenebronTimer; + uint32 m_uiShadronTimer; + uint32 m_uiVesperonTimer; + + uint32 m_uiFlameTsunamiTimer; + uint32 m_uiFlameBreathTimer; + uint32 m_uiTailSweepTimer; + uint32 m_uiCleaveTimer; + uint32 m_uiLavaStrikeTimer; + + bool m_bHasCalledTenebron; + bool m_bHasCalledShadron; + bool m_bHasCalledVesperon; + + void Reset() + { + m_bIsBerserk = false; + m_bIsSoftEnraged = false; + + m_uiEnrageTimer = MINUTE*15*IN_MILISECONDS; + m_bIsHardEnraged = false; + + m_uiTenebronTimer = 30000; + m_uiShadronTimer = 75000; + m_uiVesperonTimer = 120000; + + m_uiFlameTsunamiTimer = 30000; + m_uiFlameBreathTimer = 20000; + m_uiTailSweepTimer = 20000; + m_uiCleaveTimer = 7000; + m_uiLavaStrikeTimer = 5000; + + m_bHasCalledTenebron = false; + m_bHasCalledShadron = false; + m_bHasCalledVesperon = false; + + if (m_creature->HasAura(SPELL_TWILIGHT_REVENGE)) + m_creature->RemoveAurasDueToSpell(SPELL_TWILIGHT_REVENGE); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_SARTHARION_EVENT, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_SARTHARION_AGGRO,m_creature); + DoZoneInCombat(); + + if (m_pInstance) + { + m_pInstance->SetData(TYPE_SARTHARION_EVENT, IN_PROGRESS); + FetchDragons(); + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_SARTHARION_DEATH,m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_SARTHARION_EVENT, DONE); + } + + void KilledUnit(Unit* pVictim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SARTHARION_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SARTHARION_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SARTHARION_SLAY_3, m_creature); break; + } + } + + void FetchDragons() + { + Unit* pTene = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_TENEBRON)); + Unit* pShad = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_SHADRON)); + Unit* pVesp = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_VESPERON)); + + //if at least one of the dragons are alive and are being called + bool bCanUseWill = false; + + if (pTene && pTene->isAlive() && !pTene->getVictim()) + { + bCanUseWill = true; + pTene->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aTene[0].m_fX, m_aTene[0].m_fY, m_aTene[0].m_fZ); + + if (!pTene->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pTene->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + if (pShad && pShad->isAlive() && !pShad->getVictim()) + { + bCanUseWill = true; + pShad->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aShad[0].m_fX, m_aShad[0].m_fY, m_aShad[0].m_fZ); + + if (!pShad->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pShad->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + if (pVesp && pVesp->isAlive() && !pVesp->getVictim()) + { + bCanUseWill = true; + pVesp->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aVesp[0].m_fX, m_aVesp[0].m_fY, m_aVesp[0].m_fZ); + + if (!pVesp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pVesp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + if (bCanUseWill) + DoCast(m_creature, SPELL_WILL_OF_SARTHARION); + } + + void CallDragon(uint32 uiDataId) + { + if (m_pInstance) + { + Creature* pTemp = Unit::GetCreature((*m_creature),m_pInstance->GetData64(uiDataId)); + + if (pTemp && pTemp->isAlive() && !pTemp->getVictim()) + { + if (pTemp->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) + pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + + if (pTemp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + int32 iTextId = 0; + + switch(pTemp->GetEntry()) + { + case NPC_TENEBRON: + iTextId = SAY_SARTHARION_CALL_TENEBRON; + pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aTene[1].m_fX, m_aTene[1].m_fY, m_aTene[1].m_fZ); + break; + case NPC_SHADRON: + iTextId = SAY_SARTHARION_CALL_SHADRON; + pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aShad[1].m_fX, m_aShad[1].m_fY, m_aShad[1].m_fZ); + break; + case NPC_VESPERON: + iTextId = SAY_SARTHARION_CALL_VESPERON; + pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aVesp[1].m_fX, m_aVesp[1].m_fY, m_aVesp[1].m_fZ); + break; + } + + DoScriptText(iTextId, m_creature); + } + } + } + + void SendFlameTsunami() + { + Map* pMap = m_creature->GetMap(); + + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (!PlayerList.isEmpty()) + { + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive()) + DoScriptText(WHISPER_LAVA_CHURN,m_creature,i->getSource()); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //spell will target dragons, if they are still alive at 35% + if (!m_bIsBerserk && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 35) + { + DoScriptText(SAY_SARTHARION_BERSERK,m_creature); + DoCast(m_creature,SPELL_BERSERK); + m_bIsBerserk = true; + } + + //soft enrage + if (!m_bIsSoftEnraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 10) + { + // TODO + m_bIsSoftEnraged = true; + } + + // hard enrage + if (!m_bIsHardEnraged) + { + if (m_uiEnrageTimer < uiDiff) + { + DoCast(m_creature, SPELL_PYROBUFFET, true); + m_bIsHardEnraged = true; + } + else + m_uiEnrageTimer -= uiDiff; + } + + // flame tsunami + if (m_uiFlameTsunamiTimer < uiDiff) + { + SendFlameTsunami(); + m_uiFlameTsunamiTimer = 30000; + } + else + m_uiFlameTsunamiTimer -= uiDiff; + + // flame breath + if (m_uiFlameBreathTimer < uiDiff) + { + DoScriptText(SAY_SARTHARION_BREATH, m_creature); + DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_FLAME_BREATH_H : SPELL_FLAME_BREATH); + m_uiFlameBreathTimer = 25000 + rand()%10000; + } + else + m_uiFlameBreathTimer -= uiDiff; + + // Tail Sweep + if (m_uiTailSweepTimer < uiDiff) + { + DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_TAIL_LASH_H : SPELL_TAIL_LASH); + m_uiTailSweepTimer = 15000 + rand()%5000; + } + else + m_uiTailSweepTimer -= uiDiff; + + // Cleave + if (m_uiCleaveTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleaveTimer = 7000 + rand()%3000; + } + else + m_uiCleaveTimer -= uiDiff; + + // Lavas Strike + if (m_uiLavaStrikeTimer < uiDiff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(pTarget, SPELL_LAVA_STRIKE); + + switch(rand()%15) + { + case 0: DoScriptText(SAY_SARTHARION_SPECIAL_1, m_creature); break; + case 1: DoScriptText(SAY_SARTHARION_SPECIAL_2, m_creature); break; + case 2: DoScriptText(SAY_SARTHARION_SPECIAL_3, m_creature); break; + } + } + m_uiLavaStrikeTimer = 5000 + rand()%15000; + } + else + m_uiLavaStrikeTimer -= uiDiff; + + // call tenebron + if (!m_bHasCalledTenebron && m_uiTenebronTimer < uiDiff) + { + CallDragon(DATA_TENEBRON); + m_bHasCalledTenebron = true; + } + else + m_uiTenebronTimer -= uiDiff; + + // call shadron + if (!m_bHasCalledShadron && m_uiShadronTimer < uiDiff) + { + CallDragon(DATA_SHADRON); + m_bHasCalledShadron = true; + } + else + m_uiShadronTimer -= uiDiff; + + // call vesperon + if (!m_bHasCalledVesperon && m_uiVesperonTimer < uiDiff) + { + CallDragon(DATA_VESPERON); + m_bHasCalledVesperon = true; + } + else + m_uiVesperonTimer -= uiDiff; + + DoMeleeAttackIfReady(); + + EnterEvadeIfOutOfCombatArea(uiDiff); + } +}; + +CreatureAI* GetAI_boss_sartharion(Creature* pCreature) +{ + return new boss_sartharionAI(pCreature); +} + +enum TeneText +{ + SAY_TENEBRON_AGGRO = -1615009, + SAY_TENEBRON_SLAY_1 = -1615010, + SAY_TENEBRON_SLAY_2 = -1615011, + SAY_TENEBRON_DEATH = -1615012, + SAY_TENEBRON_BREATH = -1615013, + SAY_TENEBRON_RESPOND = -1615014, + SAY_TENEBRON_SPECIAL_1 = -1615015, + SAY_TENEBRON_SPECIAL_2 = -1615016 +}; + +enum ShadText +{ + SAY_SHADRON_AGGRO = -1615000, + SAY_SHADRON_SLAY_1 = -1615001, + SAY_SHADRON_SLAY_2 = -1615002, + SAY_SHADRON_DEATH = -1615003, + SAY_SHADRON_BREATH = -1615004, + SAY_SHADRON_RESPOND = -1615005, + SAY_SHADRON_SPECIAL_1 = -1615006, + SAY_SHADRON_SPECIAL_2 = -1615007 +}; + +enum VespText +{ + SAY_VESPERON_AGGRO = -1615033, + SAY_VESPERON_SLAY_1 = -1615034, + SAY_VESPERON_SLAY_2 = -1615035, + SAY_VESPERON_DEATH = -1615036, + SAY_VESPERON_BREATH = -1615037, + SAY_VESPERON_RESPOND = -1615038, + SAY_VESPERON_SPECIAL_1 = -1615039, + SAY_VESPERON_SPECIAL_2 = -1615040 +}; + +//to control each dragons common abilities +struct TRINITY_DLL_DECL dummy_dragonAI : public ScriptedAI +{ + dummy_dragonAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsHeroic; + + uint32 m_uiWaypointId; + uint32 m_uiMoveNextTimer; + int32 m_iPortalRespawnTime; + bool m_bCanMoveFree; + + void Reset() + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + m_uiWaypointId = 0; + m_uiMoveNextTimer = 500; + m_iPortalRespawnTime = 30000; + m_bCanMoveFree = false; + } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (!m_pInstance || uiType != POINT_MOTION_TYPE) + return; + + debug_log("dummy_dragonAI: %s reached point %u", m_creature->GetName(), uiPointId); + + //if healers messed up the raid and we was already initialized + if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) + { + EnterEvadeMode(); + return; + } + + //this is end, if we reach this, don't do much + if (uiPointId == POINT_ID_LAND) + { + m_creature->GetMotionMaster()->Clear(); + m_bCanMoveFree = false; + return; + } + + //get amount of common points + uint32 uiCommonWPCount = sizeof(m_aDragonCommon)/sizeof(Waypoint); + + //increase + m_uiWaypointId = uiPointId+1; + + //if we have reached a point bigger or equal to count, it mean we must reset to point 0 + if (m_uiWaypointId >= uiCommonWPCount) + { + if (!m_bCanMoveFree) + m_bCanMoveFree = true; + + m_uiWaypointId = 0; + } + + m_uiMoveNextTimer = 500; + } + + //used when open portal and spawn mobs in phase + void DoRaidWhisper(int32 iTextId) + { + Map* pMap = m_creature->GetMap(); + + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (!PlayerList.isEmpty()) + { + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + DoScriptText(iTextId, m_creature, i->getSource()); + } + } + } + + //"opens" the portal and does the "opening" whisper + void OpenPortal() + { + int32 iTextId = 0; + + //there are 4 portal spawn locations, each are expected to be spawned with negative spawntimesecs in database + + //using a grid search here seem to be more efficient than caching all four guids + //in instance script and calculate range to each. + GameObject* pPortal = m_creature->FindNearestGameObject(GO_TWILIGHT_PORTAL,50.0f); + + switch(m_creature->GetEntry()) + { + case NPC_TENEBRON: + iTextId = WHISPER_HATCH_EGGS; + break; + case NPC_SHADRON: + case NPC_VESPERON: + iTextId = WHISPER_OPEN_PORTAL; + break; + } + + DoRaidWhisper(iTextId); + + //By using SetRespawnTime() we will actually "spawn" the object with our defined time. + //Once time is up, portal will disappear again. + if (pPortal && !pPortal->isSpawned()) + pPortal->SetRespawnTime(m_iPortalRespawnTime); + + //Unclear what are expected to happen if one drake has a portal open already + //Refresh respawnTime so time again are set to 30secs? + } + + //Removes each drakes unique debuff from players + void RemoveDebuff(uint32 uiSpellId) + { + Map* pMap = m_creature->GetMap(); + + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (PlayerList.isEmpty()) + return; + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive() && i->getSource()->HasAura(uiSpellId)) + i->getSource()->RemoveAurasDueToSpell(uiSpellId); + } + } + } + + void JustDied(Unit* pKiller) + { + int32 iTextId = 0; + uint32 uiSpellId = 0; + + switch(m_creature->GetEntry()) + { + case NPC_TENEBRON: + iTextId = SAY_TENEBRON_DEATH; + uiSpellId = SPELL_POWER_OF_TENEBRON; + break; + case NPC_SHADRON: + iTextId = SAY_SHADRON_DEATH; + uiSpellId = SPELL_POWER_OF_SHADRON; + break; + case NPC_VESPERON: + iTextId = SAY_VESPERON_DEATH; + uiSpellId = SPELL_POWER_OF_VESPERON; + break; + } + + DoScriptText(iTextId, m_creature); + + RemoveDebuff(uiSpellId); + + if (m_pInstance) + { + // not if solo mini-boss fight + if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) + return; + + // Twilight Revenge to main boss + if (Unit* pSartharion = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_SARTHARION))) + { + if (pSartharion->isAlive()) + m_creature->CastSpell(pSartharion,SPELL_TWILIGHT_REVENGE,true); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (m_bCanMoveFree && m_uiMoveNextTimer) + { + if (m_uiMoveNextTimer < uiDiff) + { + m_creature->GetMotionMaster()->MovePoint(m_uiWaypointId, + m_aDragonCommon[m_uiWaypointId].m_fX, m_aDragonCommon[m_uiWaypointId].m_fY, m_aDragonCommon[m_uiWaypointId].m_fZ); + + debug_log("dummy_dragonAI: %s moving to point %u", m_creature->GetName(), m_uiWaypointId); + m_uiMoveNextTimer = 0; + } + else + m_uiMoveNextTimer -= uiDiff; + } + } +}; + +/*###### +## Mob Tenebron +######*/ + +struct TRINITY_DLL_DECL mob_tenebronAI : public dummy_dragonAI +{ + mob_tenebronAI(Creature* pCreature) : dummy_dragonAI(pCreature) { } + + uint32 m_uiShadowBreathTimer; + uint32 m_uiShadowFissureTimer; + uint32 m_uiHatchEggTimer; + + void Reset() + { + m_uiShadowBreathTimer = 20000; + m_uiShadowFissureTimer = 5000; + m_uiHatchEggTimer = 30000; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_TENEBRON_AGGRO, m_creature); + DoZoneInCombat(); + DoCast(m_creature, SPELL_POWER_OF_TENEBRON); + } + + void KilledUnit(Unit* pVictim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_TENEBRON_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_TENEBRON_SLAY_2, m_creature); break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + //if no target, update dummy and return + if (!UpdateVictim()) + { + dummy_dragonAI::UpdateAI(uiDiff); + return; + } + + // shadow fissure + if (m_uiShadowFissureTimer < uiDiff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, m_bIsHeroic ? SPELL_SHADOW_FISSURE_H : SPELL_SHADOW_FISSURE); + + m_uiShadowFissureTimer = 15000 + rand()%5000; + } + else + m_uiShadowFissureTimer -= uiDiff; + + // shadow breath + if (m_uiShadowBreathTimer < uiDiff) + { + DoScriptText(SAY_TENEBRON_BREATH, m_creature); + DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_SHADOW_BREATH_H : SPELL_SHADOW_BREATH); + m_uiShadowBreathTimer = 20000 + rand()%5000; + } + else + m_uiShadowBreathTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_tenebron(Creature* pCreature) +{ + return new mob_tenebronAI(pCreature); +} + +/*###### +## Mob Shadron +######*/ + +struct TRINITY_DLL_DECL mob_shadronAI : public dummy_dragonAI +{ + mob_shadronAI(Creature* pCreature) : dummy_dragonAI(pCreature) { } + + uint32 m_uiShadowBreathTimer; + uint32 m_uiShadowFissureTimer; + uint32 m_uiAcolyteShadronTimer; + + void Reset() + { + m_uiShadowBreathTimer = 20000; + m_uiShadowFissureTimer = 5000; + m_uiAcolyteShadronTimer = 60000; + + if (m_creature->HasAura(SPELL_TWILIGHT_TORMENT_VESP)) + m_creature->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP); + + if (m_creature->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) + m_creature->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_SHADRON_AGGRO,m_creature); + DoZoneInCombat(); + DoCast(m_creature, SPELL_POWER_OF_SHADRON); + } + + void KilledUnit(Unit* pVictim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SHADRON_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SHADRON_SLAY_2, m_creature); break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + //if no target, update dummy and return + if (!UpdateVictim()) + { + dummy_dragonAI::UpdateAI(uiDiff); + return; + } + + // shadow fissure + if (m_uiShadowFissureTimer < uiDiff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, m_bIsHeroic ? SPELL_SHADOW_FISSURE_H : SPELL_SHADOW_FISSURE); + + m_uiShadowFissureTimer = 15000 + rand()%5000; + } + else + m_uiShadowFissureTimer -= uiDiff; + + // shadow breath + if (m_uiShadowBreathTimer < uiDiff) + { + DoScriptText(SAY_SHADRON_BREATH, m_creature); + DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_SHADOW_BREATH_H : SPELL_SHADOW_BREATH); + m_uiShadowBreathTimer = 20000 + rand()%5000; + } + else + m_uiShadowBreathTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_shadron(Creature* pCreature) +{ + return new mob_shadronAI(pCreature); +} + +/*###### +## Mob Vesperon +######*/ + +struct TRINITY_DLL_DECL mob_vesperonAI : public dummy_dragonAI +{ + mob_vesperonAI(Creature* pCreature) : dummy_dragonAI(pCreature) { } + + uint32 m_uiShadowBreathTimer; + uint32 m_uiShadowFissureTimer; + uint32 m_uiAcolyteVesperonTimer; + + void Reset() + { + m_uiShadowBreathTimer = 20000; + m_uiShadowFissureTimer = 5000; + m_uiAcolyteVesperonTimer = 60000; + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_VESPERON_AGGRO,m_creature); + DoZoneInCombat(); + DoCast(m_creature, SPELL_POWER_OF_VESPERON); + } + + void KilledUnit(Unit* pVictim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_VESPERON_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_VESPERON_SLAY_2, m_creature); break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + //if no target, update dummy and return + if (!UpdateVictim()) + { + dummy_dragonAI::UpdateAI(uiDiff); + return; + } + + // shadow fissure + if (m_uiShadowFissureTimer < uiDiff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, m_bIsHeroic ? SPELL_SHADOW_FISSURE_H : SPELL_SHADOW_FISSURE); + + m_uiShadowFissureTimer = 15000 + rand()%5000; + } + else + m_uiShadowFissureTimer -= uiDiff; + + // shadow breath + if (m_uiShadowBreathTimer < uiDiff) + { + DoScriptText(SAY_VESPERON_BREATH, m_creature); + DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_SHADOW_BREATH_H : SPELL_SHADOW_BREATH); + m_uiShadowBreathTimer = 20000 + rand()%5000; + } + else + m_uiShadowBreathTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_vesperon(Creature* pCreature) +{ + return new mob_vesperonAI(pCreature); +} + +/*###### +## Mob Acolyte of Shadron +######*/ + +struct TRINITY_DLL_DECL mob_acolyte_of_shadronAI : public ScriptedAI +{ + mob_acolyte_of_shadronAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + } + + ScriptedInstance* m_pInstance; + + void Reset() + { + if (m_pInstance) + { + //if not solo figth, buff main boss, else place debuff on mini-boss. both spells TARGET_SCRIPT + if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) + DoCast(m_creature, SPELL_GIFT_OF_TWILIGTH_SAR); + else + DoCast(m_creature, SPELL_GIFT_OF_TWILIGTH_SHA); + } + } + + void JustDied(Unit* killer) + { + if (m_pInstance) + { + Creature* pDebuffTarget = NULL; + + if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) + { + //not solo fight, so main boss has deduff + pDebuffTarget = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SARTHARION)); + + if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SAR)) + pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SAR); + } + else + { + //event not in progress, then solo fight and must remove debuff mini-boss + pDebuffTarget = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SHADRON)); + + if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) + pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_acolyte_of_shadron(Creature* pCreature) +{ + return new mob_acolyte_of_shadronAI(pCreature); +} + +/*###### +## Mob Acolyte of Vesperon +######*/ + +struct TRINITY_DLL_DECL mob_acolyte_of_vesperonAI : public ScriptedAI +{ + mob_acolyte_of_vesperonAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + } + + ScriptedInstance* m_pInstance; + + void Reset() + { + DoCast(m_creature, SPELL_TWILIGHT_TORMENT_VESP_ACO); + } + + void JustDied(Unit* pKiller) + { + // remove twilight torment on Vesperon + if (m_pInstance) + { + Creature* pVesperon = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_VESPERON)); + + if (pVesperon && pVesperon->isAlive() && pVesperon->HasAura(SPELL_TWILIGHT_TORMENT_VESP)) + pVesperon->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP); + } + } + + void UpdateAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_acolyte_of_vesperon(Creature* pCreature) +{ + return new mob_acolyte_of_vesperonAI(pCreature); +} + +/*###### +## Mob Twilight Eggs +######*/ + +struct TRINITY_DLL_DECL mob_twilight_eggsAI : public ScriptedAI +{ + mob_twilight_eggsAI(Creature* pCreature) : ScriptedAI(pCreature) { } + + uint32 m_uiFadeArmorTimer; + + void Reset() + { + m_uiFadeArmorTimer = 1000; + } + + void AttackStart(Unit* pWho) { } + void MoveInLineOfSight(Unit* pWho) { } +}; + +CreatureAI* GetAI_mob_twilight_eggs(Creature* pCreature) +{ + return new mob_twilight_eggsAI(pCreature); +} + +/*###### +## Mob Twilight Whelps +######*/ + +struct TRINITY_DLL_DECL mob_twilight_whelpAI : public ScriptedAI +{ + mob_twilight_whelpAI(Creature* pCreature) : ScriptedAI(pCreature) { } + + uint32 m_uiFadeArmorTimer; + + void Reset() + { + m_uiFadeArmorTimer = 1000; + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + // twilight torment + if (m_uiFadeArmorTimer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_FADE_ARMOR); + m_uiFadeArmorTimer = 5000 + rand()%5000; + } + else + m_uiFadeArmorTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_twilight_whelp(Creature* pCreature) +{ + return new mob_twilight_whelpAI(pCreature); +} + +void AddSC_boss_sartharion() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_sartharion"; + newscript->GetAI = &GetAI_boss_sartharion; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_vesperon"; + newscript->GetAI = &GetAI_mob_vesperon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_shadron"; + newscript->GetAI = &GetAI_mob_shadron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_tenebron"; + newscript->GetAI = &GetAI_mob_tenebron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_acolyte_of_shadron"; + newscript->GetAI = &GetAI_mob_acolyte_of_shadron; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_acolyte_of_vesperon"; + newscript->GetAI = &GetAI_mob_acolyte_of_vesperon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_twilight_eggs"; + newscript->GetAI = &GetAI_mob_twilight_eggs; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_twilight_whelp"; + newscript->GetAI = &GetAI_mob_twilight_whelp; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/obsidian_sanctum/def_obsidian_sanctum.h b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/def_obsidian_sanctum.h new file mode 100644 index 00000000000..461834a2386 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/def_obsidian_sanctum.h @@ -0,0 +1,20 @@ +#ifndef DEF_OBSIDIAN_SANCTUM_H +#define DEF_OBSIDIAN_SANCTUM_H + +enum +{ + TYPE_SARTHARION_EVENT = 1, + + DATA_SARTHARION = 10, + DATA_TENEBRON = 11, + DATA_SHADRON = 12, + DATA_VESPERON = 13, + + NPC_SARTHARION = 28860, + NPC_TENEBRON = 30452, + NPC_SHADRON = 30451, + NPC_VESPERON = 30449, + GO_TWILIGHT_PORTAL = 193988 +}; + +#endif diff --git a/src/bindings/scripts/scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp new file mode 100644 index 00000000000..5dd3e06e585 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/obsidian_sanctum/instance_obsidian_sanctum.cpp @@ -0,0 +1,97 @@ +#include "precompiled.h" +#include "def_obsidian_sanctum.h" + +#define MAX_ENCOUNTER 1 + +/* Obsidian Sanctum encounters: +0 - Sartharion +*/ + +struct TRINITY_DLL_DECL instance_obsidian_sanctum : public ScriptedInstance +{ + instance_obsidian_sanctum(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint64 m_uiSartharionGUID; + uint64 m_uiTenebronGUID; + uint64 m_uiShadronGUID; + uint64 m_uiVesperonGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiSartharionGUID = 0; + m_uiTenebronGUID = 0; + m_uiShadronGUID = 0; + m_uiVesperonGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case NPC_SARTHARION: + m_uiSartharionGUID = pCreature->GetGUID(); + break; + //three dragons below set to active state once created. + //we must expect bigger raid to encounter main boss, and then three dragons must be active due to grid differences + case NPC_TENEBRON: + m_uiTenebronGUID = pCreature->GetGUID(); + pCreature->setActive(true); + break; + case NPC_SHADRON: + m_uiShadronGUID = pCreature->GetGUID(); + pCreature->setActive(true); + break; + case NPC_VESPERON: + m_uiVesperonGUID = pCreature->GetGUID(); + pCreature->setActive(true); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + if (uiType == TYPE_SARTHARION_EVENT) + m_auiEncounter[0] = uiData; + } + + uint32 GetData(uint32 uiType) + { + if (uiType == TYPE_SARTHARION_EVENT) + return m_auiEncounter[0]; + + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_SARTHARION: + return m_uiSartharionGUID; + case DATA_TENEBRON: + return m_uiTenebronGUID; + case DATA_SHADRON: + return m_uiShadronGUID; + case DATA_VESPERON: + return m_uiVesperonGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_obsidian_sanctum(Map* pMap) +{ + return new instance_obsidian_sanctum(pMap); +} + +void AddSC_instance_obsidian_sanctum() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_obsidian_sanctum"; + newscript->GetInstanceData = &GetInstanceData_instance_obsidian_sanctum; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp new file mode 100644 index 00000000000..5b6301019a5 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp @@ -0,0 +1,440 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with 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 Bjarngrim +SD%Complete: 70% +SDComment: Waypoint needed, we expect boss to always have 2x Stormforged Lieutenant following +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "def_halls_of_lightning.h" + +enum +{ + //Yell + SAY_AGGRO = -1602000, + SAY_SLAY_1 = -1602001, + SAY_SLAY_2 = -1602002, + SAY_SLAY_3 = -1602003, + SAY_DEATH = -1602004, + SAY_BATTLE_STANCE = -1602005, + EMOTE_BATTLE_STANCE = -1602006, + SAY_BERSEKER_STANCE = -1602007, + EMOTE_BERSEKER_STANCE = -1602008, + SAY_DEFENSIVE_STANCE = -1602009, + EMOTE_DEFENSIVE_STANCE = -1602010, + + SPELL_DEFENSIVE_STANCE = 53790, + //SPELL_DEFENSIVE_AURA = 41105, + SPELL_SPELL_REFLECTION = 36096, + SPELL_PUMMEL = 12555, + SPELL_KNOCK_AWAY = 52029, + SPELL_IRONFORM = 52022, + + SPELL_BERSEKER_STANCE = 53791, + //SPELL_BERSEKER_AURA = 41107, + SPELL_INTERCEPT = 58769, + SPELL_WHIRLWIND = 52027, + SPELL_CLEAVE = 15284, + + SPELL_BATTLE_STANCE = 53792, + //SPELL_BATTLE_AURA = 41106, + SPELL_MORTAL_STRIKE = 16856, + SPELL_SLAM = 52026, + + //OTHER SPELLS + //SPELL_CHARGE_UP = 52098, // only used when starting walk from one platform to the other + //SPELL_TEMPORARY_ELECTRICAL_CHARGE = 52092, // triggered part of above + + NPC_STORMFORGED_LIEUTENANT = 29240, + SPELL_ARC_WELD = 59085, + SPELL_RENEW_STEEL_N = 52774, + SPELL_RENEW_STEEL_H = 59160, + + EQUIP_SWORD = 37871, + EQUIP_SHIELD = 35642, + EQUIP_MACE = 43623, + + STANCE_DEFENSIVE = 0, + STANCE_BERSERKER = 1, + STANCE_BATTLE = 2 +}; + +/*###### +## boss_bjarngrim +######*/ + +struct TRINITY_DLL_DECL boss_bjarngrimAI : public ScriptedAI +{ + boss_bjarngrimAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + m_uiStance = STANCE_DEFENSIVE; + } + + ScriptedInstance* m_pInstance; + + bool m_bIsHeroic; + bool m_bIsChangingStance; + + uint8 m_uiChargingStatus; + uint8 m_uiStance; + + uint32 m_uiCharge_Timer; + uint32 m_uiChangeStance_Timer; + + uint32 m_uiReflection_Timer; + uint32 m_uiKnockAway_Timer; + uint32 m_uiPummel_Timer; + uint32 m_uiIronform_Timer; + + uint32 m_uiIntercept_Timer; + uint32 m_uiWhirlwind_Timer; + uint32 m_uiCleave_Timer; + + uint32 m_uiMortalStrike_Timer; + uint32 m_uiSlam_Timer; + + uint64 m_uiStormforgedLieutenantGUID[2]; + + void Reset() + { + m_bIsChangingStance = false; + + m_uiChargingStatus = 0; + m_uiCharge_Timer = 1000; + + m_uiChangeStance_Timer = 20000 + rand()%5000; + + m_uiReflection_Timer = 8000; + m_uiKnockAway_Timer = 20000; + m_uiPummel_Timer = 10000; + m_uiIronform_Timer = 25000; + + m_uiIntercept_Timer = 5000; + m_uiWhirlwind_Timer = 10000; + m_uiCleave_Timer = 8000; + + m_uiMortalStrike_Timer = 8000; + m_uiSlam_Timer = 10000; + + for(uint8 i = 0; i < 2; ++i) + { + if (Creature* pStormforgedLieutenant = (Unit::GetCreature((*m_creature), m_uiStormforgedLieutenantGUID[i]))) + { + if (!pStormforgedLieutenant->isAlive()) + pStormforgedLieutenant->Respawn(); + } + } + + if (m_uiStance != STANCE_DEFENSIVE) + { + DoRemoveStanceAura(m_uiStance); + DoCast(m_creature, SPELL_DEFENSIVE_STANCE); + m_uiStance = STANCE_DEFENSIVE; + } + + SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BJARNGRIM, NOT_STARTED); + } + + void EnterCombat(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + //must get both lieutenants here and make sure they are with him + m_creature->CallForHelp(30.0f); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BJARNGRIM, IN_PROGRESS); + } + + void KilledUnit(Unit* pVictim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_BJARNGRIM, DONE); + } + + //TODO: remove when removal is done by mangos + void DoRemoveStanceAura(uint8 uiStance) + { + switch(uiStance) + { + case STANCE_DEFENSIVE: + m_creature->RemoveAurasDueToSpell(SPELL_DEFENSIVE_STANCE); + break; + case STANCE_BERSERKER: + m_creature->RemoveAurasDueToSpell(SPELL_BERSEKER_STANCE); + break; + case STANCE_BATTLE: + m_creature->RemoveAurasDueToSpell(SPELL_BATTLE_STANCE); + break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + // Change stance + if (m_uiChangeStance_Timer < uiDiff) + { + //wait for current spell to finish before change stance + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + DoRemoveStanceAura(m_uiStance); + + int uiTempStance = rand()%(3-1); + + if (uiTempStance >= m_uiStance) + ++uiTempStance; + + m_uiStance = uiTempStance; + + switch(m_uiStance) + { + case STANCE_DEFENSIVE: + DoScriptText(SAY_DEFENSIVE_STANCE, m_creature); + DoScriptText(EMOTE_DEFENSIVE_STANCE, m_creature); + DoCast(m_creature, SPELL_DEFENSIVE_STANCE); + SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE); + break; + case STANCE_BERSERKER: + DoScriptText(SAY_BERSEKER_STANCE, m_creature); + DoScriptText(EMOTE_BERSEKER_STANCE, m_creature); + DoCast(m_creature, SPELL_BERSEKER_STANCE); + SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE); + break; + case STANCE_BATTLE: + DoScriptText(SAY_BATTLE_STANCE, m_creature); + DoScriptText(EMOTE_BATTLE_STANCE, m_creature); + DoCast(m_creature, SPELL_BATTLE_STANCE); + SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + break; + } + + m_uiChangeStance_Timer = 20000 + rand()%5000; + return; + } + else + m_uiChangeStance_Timer -= uiDiff; + + switch(m_uiStance) + { + case STANCE_DEFENSIVE: + { + if (m_uiReflection_Timer < uiDiff) + { + DoCast(m_creature, SPELL_SPELL_REFLECTION); + m_uiReflection_Timer = 8000 + rand()%1000; + } + else + m_uiReflection_Timer -= uiDiff; + + if (m_uiKnockAway_Timer < uiDiff) + { + DoCast(m_creature, SPELL_KNOCK_AWAY); + m_uiKnockAway_Timer = 20000 + rand()%1000; + } + else + m_uiKnockAway_Timer -= uiDiff; + + if (m_uiPummel_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_PUMMEL); + m_uiPummel_Timer = 10000 + rand()%1000; + } + else + m_uiPummel_Timer -= uiDiff; + + if (m_uiIronform_Timer < uiDiff) + { + DoCast(m_creature, SPELL_IRONFORM); + m_uiIronform_Timer = 25000 + rand()%1000; + } + else + m_uiIronform_Timer -= uiDiff; + + break; + } + case STANCE_BERSERKER: + { + if (m_uiIntercept_Timer < uiDiff) + { + //not much point is this, better random target and more often? + DoCast(m_creature->getVictim(), SPELL_INTERCEPT); + m_uiIntercept_Timer = 45000 + rand()%1000; + } + else + m_uiIntercept_Timer -= uiDiff; + + if (m_uiWhirlwind_Timer < uiDiff) + { + DoCast(m_creature, SPELL_WHIRLWIND); + m_uiWhirlwind_Timer = 10000 + rand()%1000; + } + else + m_uiWhirlwind_Timer -= uiDiff; + + if (m_uiCleave_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_CLEAVE); + m_uiCleave_Timer = 8000 + rand()%1000; + } + else + m_uiCleave_Timer -= uiDiff; + + break; + } + case STANCE_BATTLE: + { + if (m_uiMortalStrike_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + m_uiMortalStrike_Timer = 20000 + rand()%1000; + } + else + m_uiMortalStrike_Timer -= uiDiff; + + if (m_uiSlam_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_SLAM); + m_uiSlam_Timer = 15000 + rand()%1000; + } + else + m_uiSlam_Timer -= uiDiff; + + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +/*###### +## mob_stormforged_lieutenant +######*/ + +struct TRINITY_DLL_DECL mob_stormforged_lieutenantAI : public ScriptedAI +{ + mob_stormforged_lieutenantAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + } + + ScriptedInstance* m_pInstance; + bool m_bIsHeroic; + + uint32 m_uiArcWeld_Timer; + uint32 m_uiRenewSteel_Timer; + + void Reset() + { + m_uiArcWeld_Timer = 20000 + rand()%1000; + m_uiRenewSteel_Timer = 10000 + rand()%1000; + } + + void EnterCombat(Unit* pWho) + { + if (m_pInstance) + { + if (Creature* pBjarngrim = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_BJARNGRIM))) + { + if (pBjarngrim->isAlive() && !pBjarngrim->getVictim()) + pBjarngrim->AI()->AttackStart(pWho); + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (m_uiArcWeld_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_ARC_WELD); + m_uiArcWeld_Timer = 20000 + rand()%1000; + } + else + m_uiArcWeld_Timer -= uiDiff; + + if (m_uiRenewSteel_Timer < uiDiff) + { + if (m_pInstance) + { + if (Creature* pBjarngrim = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_BJARNGRIM))) + { + if (pBjarngrim->isAlive()) + DoCast(pBjarngrim, m_bIsHeroic ? SPELL_RENEW_STEEL_H : SPELL_RENEW_STEEL_N); + } + } + m_uiRenewSteel_Timer = 10000 + rand()%4000; + } + else + m_uiRenewSteel_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_bjarngrim(Creature* pCreature) +{ + return new boss_bjarngrimAI(pCreature); +} + +CreatureAI* GetAI_mob_stormforged_lieutenant(Creature* pCreature) +{ + return new mob_stormforged_lieutenantAI(pCreature); +} + +void AddSC_boss_bjarngrim() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_bjarngrim"; + newscript->GetAI = &GetAI_boss_bjarngrim; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_stormforged_lieutenant"; + newscript->GetAI = &GetAI_mob_stormforged_lieutenant; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp new file mode 100644 index 00000000000..227d23b154a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_ionar.cpp @@ -0,0 +1,399 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss Ionar +SD%Complete: 80% +SDComment: Timer check +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "def_halls_of_lightning.h" + +enum +{ + SAY_AGGRO = -1602011, + SAY_SLAY_1 = -1602012, + SAY_SLAY_2 = -1602013, + SAY_SLAY_3 = -1602014, + SAY_DEATH = -1602015, + SAY_SPLIT_1 = -1602016, + SAY_SPLIT_2 = -1602017, + + SPELL_BALL_LIGHTNING_N = 52780, + SPELL_BALL_LIGHTNING_H = 59800, + SPELL_STATIC_OVERLOAD_N = 52658, + SPELL_STATIC_OVERLOAD_H = 59795, + + SPELL_DISPERSE = 52770, + SPELL_SUMMON_SPARK = 52746, + SPELL_SPARK_DESPAWN = 52776, + + //Spark of Ionar + SPELL_SPARK_VISUAL_TRIGGER_N = 52667, + SPELL_SPARK_VISUAL_TRIGGER_H = 59833, + + NPC_SPARK_OF_IONAR = 28926, + + MAX_SPARKS = 5, + POINT_CALLBACK = 0 +}; + +/*###### +## Boss Ionar +######*/ + +struct TRINITY_DLL_DECL boss_ionarAI : public ScriptedAI +{ + boss_ionarAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + std::list m_lSparkGUIDList; + + bool m_bIsHeroic; + + bool m_bIsSplitPhase; + uint32 m_uiSplit_Timer; + uint32 m_uiSparkAtHomeCount; + + uint32 m_uiStaticOverload_Timer; + uint32 m_uiBallLightning_Timer; + + uint32 m_uiHealthAmountModifier; + + void Reset() + { + m_lSparkGUIDList.clear(); + + m_bIsSplitPhase = true; + m_uiSplit_Timer = 25000; + m_uiSparkAtHomeCount = 0; + + m_uiStaticOverload_Timer = 5000 + rand()%1000; + m_uiBallLightning_Timer = 10000 + rand()%1000; + + m_uiHealthAmountModifier = 1; + + if (m_creature->GetVisibility() == VISIBILITY_OFF) + m_creature->SetVisibility(VISIBILITY_ON); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->GetVisibility() == VISIBILITY_OFF) + return; + + AttackStart(pAttacker); + } + + void Aggro(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_IONAR, IN_PROGRESS); + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_IONAR, NOT_STARTED); + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho, 0.0f); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (m_creature->GetVisibility() != VISIBILITY_OFF) + m_creature->GetMotionMaster()->MoveChase(pWho); + } + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + DespawnSpark(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_IONAR, DONE); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void DespawnSpark() + { + if (m_lSparkGUIDList.empty()) + return; + + for(std::list::iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr) + { + if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr)) + { + if (pTemp->isAlive()) + pTemp->ForcedDespawn(); + } + } + + m_lSparkGUIDList.clear(); + } + + //make sparks come back + void CallBackSparks() + { + //should never be empty here, but check + if (m_lSparkGUIDList.empty()) + return; + + for(std::list::iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr) + { + if (Creature* pSpark = Unit::GetCreature(*m_creature, *itr)) + { + if (pSpark->isAlive()) + { + if (pSpark->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + pSpark->GetMotionMaster()->MovementExpired(); + + pSpark->SetSpeed(MOVE_RUN, pSpark->GetCreatureInfo()->speed * 2); + pSpark->GetMotionMaster()->MovePoint(POINT_CALLBACK, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + } + } + } + } + + void RegisterSparkAtHome() + { + ++m_uiSparkAtHomeCount; + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_SPARK_OF_IONAR) + { + pSummoned->CastSpell(pSummoned, m_bIsHeroic ? SPELL_SPARK_VISUAL_TRIGGER_H : SPELL_SPARK_VISUAL_TRIGGER_N, true); + + Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (m_creature->getVictim()) + pSummoned->AI()->AttackStart(pTarget ? pTarget : m_creature->getVictim()); + + m_lSparkGUIDList.push_back(pSummoned->GetGUID()); + } + } + + void UpdateAI(const uint32 uiDiff) + { + // Splitted + if (m_creature->GetVisibility() == VISIBILITY_OFF) + { + if (!m_creature->getVictim()) + { + Reset(); + return; + } + + if (m_uiSplit_Timer < uiDiff) + { + m_uiSplit_Timer = 2500; + + // Return sparks to where Ionar splitted + if (m_bIsSplitPhase) + { + CallBackSparks(); + m_bIsSplitPhase = false; + } + // Lightning effect and restore Ionar + else if (m_uiSparkAtHomeCount == MAX_SPARKS) + { + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->CastSpell(m_creature, SPELL_SPARK_DESPAWN, false); + + DespawnSpark(); + + m_uiSparkAtHomeCount = 0; + m_uiSplit_Timer = 25000; + m_bIsSplitPhase = true; + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) + { + if (m_creature->getVictim()) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + } + } + else + m_uiSplit_Timer -= uiDiff; + + return; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (m_uiStaticOverload_Timer < uiDiff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, m_bIsHeroic ? SPELL_STATIC_OVERLOAD_H : SPELL_STATIC_OVERLOAD_N); + + m_uiStaticOverload_Timer = 5000 + rand()%1000; + } + else + m_uiStaticOverload_Timer -= uiDiff; + + if (m_uiBallLightning_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_BALL_LIGHTNING_H : SPELL_BALL_LIGHTNING_N); + m_uiBallLightning_Timer = 10000 + rand()%1000; + } + else + m_uiBallLightning_Timer -= uiDiff; + + // Health check + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(20*m_uiHealthAmountModifier))) + { + ++m_uiHealthAmountModifier; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPLIT_1, m_creature); break; + case 1: DoScriptText(SAY_SPLIT_2, m_creature); break; + } + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCast(m_creature, SPELL_DISPERSE); + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ionar(Creature* pCreature) +{ + return new boss_ionarAI(pCreature); +} + +bool EffectDummyCreature_boss_ionar(Unit* pCaster, uint32 uiSpellId, uint32 uiEffIndex, Creature* pCreatureTarget) +{ + //always check spellid and effectindex + if (uiSpellId == SPELL_DISPERSE && uiEffIndex == 0) + { + if (pCreatureTarget->GetEntry() != NPC_IONAR) + return true; + + for(uint8 i = 0; i < MAX_SPARKS; ++i) + { + pCreatureTarget->CastSpell(pCreatureTarget, SPELL_SUMMON_SPARK, true); + + //TODO: remove this line of hack when summon implemented + pCreatureTarget->SummonCreature(NPC_SPARK_OF_IONAR, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + } + + pCreatureTarget->AttackStop(); + pCreatureTarget->SetVisibility(VISIBILITY_OFF); + + if (pCreatureTarget->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + pCreatureTarget->GetMotionMaster()->MovementExpired(); + + //always return true when we are handling this spell and effect + return true; + } + return false; +} + +/*###### +## mob_spark_of_ionar +######*/ + +struct TRINITY_DLL_DECL mob_spark_of_ionarAI : public ScriptedAI +{ + mob_spark_of_ionarAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + void Reset() { } + + void MovementInform(uint32 uiType, uint32 uiPointId) + { + if (uiType != POINT_MOTION_TYPE || !m_pInstance) + return; + + if (uiPointId == POINT_CALLBACK) + { + if (Creature* pIonar = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_IONAR))) + { + if (!pIonar->isAlive()) + { + m_creature->ForcedDespawn(); + return; + } + + if (boss_ionarAI* pIonarAI = dynamic_cast(pIonar->AI())) + pIonarAI->RegisterSparkAtHome(); + } + else + m_creature->ForcedDespawn(); + } + } +}; + +CreatureAI* GetAI_mob_spark_of_ionar(Creature* pCreature) +{ + return new mob_spark_of_ionarAI(pCreature); +} + +void AddSC_boss_ionar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_ionar"; + newscript->GetAI = &GetAI_boss_ionar; + newscript->pEffectDummyCreature = &EffectDummyCreature_boss_ionar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_spark_of_ionar"; + newscript->GetAI = &GetAI_mob_spark_of_ionar; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp new file mode 100644 index 00000000000..164b393b6d9 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_loken.cpp @@ -0,0 +1,253 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss Loken +SD%Complete: 60% +SDComment: Missing intro. Remove hack of Pulsing Shockwave when core supports. Aura is not working (59414) +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "def_halls_of_lightning.h" + +enum +{ + ACHIEVEMENT_TIMELY_DEATH = 1867, + + SAY_AGGRO = -1602018, + SAY_INTRO_1 = -1602019, + SAY_INTRO_2 = -1602020, + SAY_SLAY_1 = -1602021, + SAY_SLAY_2 = -1602022, + SAY_SLAY_3 = -1602023, + SAY_DEATH = -1602024, + SAY_NOVA_1 = -1602025, + SAY_NOVA_2 = -1602026, + SAY_NOVA_3 = -1602027, + SAY_75HEALTH = -1602028, + SAY_50HEALTH = -1602029, + SAY_25HEALTH = -1602030, + EMOTE_NOVA = -1602031, + + SPELL_ARC_LIGHTNING = 52921, + SPELL_LIGHTNING_NOVA_N = 52960, + SPELL_LIGHTNING_NOVA_H = 59835, + + SPELL_PULSING_SHOCKWAVE_N = 52961, + SPELL_PULSING_SHOCKWAVE_H = 59836, + SPELL_PULSING_SHOCKWAVE_AURA = 59414 +}; + +/*###### +## Boss Loken +######*/ + +struct TRINITY_DLL_DECL boss_lokenAI : public ScriptedAI +{ + boss_lokenAI(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + } + + ScriptedInstance* m_pInstance; + + bool m_bIsHeroic; + bool m_bIsAura; + + uint32 m_uiArcLightning_Timer; + uint32 m_uiLightningNova_Timer; + uint32 m_uiPulsingShockwave_Timer; + uint32 m_uiResumePulsingShockwave_Timer; + + uint32 m_uiHealthAmountModifier; + + uint32 EncounterTimer; + + void Reset() + { + m_bIsAura = false; + + m_uiArcLightning_Timer = 15000; + m_uiLightningNova_Timer = 20000; + m_uiPulsingShockwave_Timer = 2000; + m_uiResumePulsingShockwave_Timer = 15000; + + m_uiHealthAmountModifier = 1; + + EncounterTimer = 0; + + if (m_pInstance) + m_pInstance->SetData(TYPE_LOKEN, NOT_STARTED); + } + + void EnterCombat(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + EncounterTimer = 1; + + if (m_pInstance) + m_pInstance->SetData(TYPE_LOKEN, IN_PROGRESS); + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_bIsHeroic && EncounterTimer <= 120000) + { + AchievementEntry const *AchievTimelyDeath = GetAchievementStore()->LookupEntry(ACHIEVEMENT_TIMELY_DEATH); + if (AchievTimelyDeath) + { + Map* pMap = m_creature->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + itr->getSource()->CompletedAchievement(AchievTimelyDeath); + } + } + } + + if (m_pInstance) + m_pInstance->SetData(TYPE_LOKEN, DONE); + } + + void KilledUnit(Unit* pVictim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (EncounterTimer) + EncounterTimer += uiDiff; + + if (m_bIsAura) + { + // workaround for PULSING_SHOCKWAVE + if (m_uiPulsingShockwave_Timer < uiDiff) + { + Map* pMap = m_creature->GetMap(); + if (pMap->IsDungeon()) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (PlayerList.isEmpty()) + return; + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (i->getSource()->isAlive() && i->getSource()->isTargetableForAttack()) + { + int32 dmg; + float m_fDist = m_creature->GetDistance(i->getSource()); + + if (m_fDist <= 1.0f) // Less than 1 yard + dmg = (m_bIsHeroic ? 850 : 800); // need to correct damage + else // Further from 1 yard + dmg = ((m_bIsHeroic ? 250 : 200) * m_fDist) + (m_bIsHeroic ? 850 : 800); // need to correct damage + + m_creature->CastCustomSpell(i->getSource(), (m_bIsHeroic ? 59837 : 52942), &dmg, 0, 0, false); + } + } + m_uiPulsingShockwave_Timer = 2000; + }else m_uiPulsingShockwave_Timer -= uiDiff; + } + else + { + if (m_uiResumePulsingShockwave_Timer < uiDiff) + { + //breaks at movement, can we assume when it's time, this spell is casted and also must stop movement? + m_creature->CastSpell(m_creature, SPELL_PULSING_SHOCKWAVE_AURA, true); + + DoCast(m_creature, m_bIsHeroic ? SPELL_PULSING_SHOCKWAVE_H : SPELL_PULSING_SHOCKWAVE_N); // need core support + m_bIsAura = true; + m_uiResumePulsingShockwave_Timer = 0; + } + else + m_uiResumePulsingShockwave_Timer -= uiDiff; + } + + if (m_uiArcLightning_Timer < uiDiff) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pTarget, SPELL_ARC_LIGHTNING); + + m_uiArcLightning_Timer = 15000 + rand()%1000; + } + else + m_uiArcLightning_Timer -= uiDiff; + + if (m_uiLightningNova_Timer < uiDiff) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_NOVA_1, m_creature);break; + case 1: DoScriptText(SAY_NOVA_2, m_creature);break; + case 2: DoScriptText(SAY_NOVA_3, m_creature);break; + } + + DoCast(m_creature, m_bIsHeroic ? SPELL_LIGHTNING_NOVA_H : SPELL_LIGHTNING_NOVA_N); + + m_bIsAura = false; + m_uiResumePulsingShockwave_Timer = (m_bIsHeroic ? 4000 : 5000); // Pause Pulsing Shockwave aura + m_uiLightningNova_Timer = 20000 + rand()%1000; + } + else + m_uiLightningNova_Timer -= uiDiff; + + // Health check + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(25*m_uiHealthAmountModifier))) + { + switch(m_uiHealthAmountModifier) + { + case 1: DoScriptText(SAY_75HEALTH, m_creature); break; + case 2: DoScriptText(SAY_50HEALTH, m_creature); break; + case 3: DoScriptText(SAY_25HEALTH, m_creature); break; + } + + ++m_uiHealthAmountModifier; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_loken(Creature* pCreature) +{ + return new boss_lokenAI(pCreature); +} + +void AddSC_boss_loken() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_loken"; + newscript->GetAI = &GetAI_boss_loken; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp new file mode 100644 index 00000000000..35eadb9783e --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_volkhan.cpp @@ -0,0 +1,494 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss Volkhan +SD%Complete: 60% +SDComment: Not considered complete. Some events may fail and need further development +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "def_halls_of_lightning.h" + +enum +{ + SAY_AGGRO = -1602032, + SAY_SLAY_1 = -1602033, + SAY_SLAY_2 = -1602034, + SAY_SLAY_3 = -1602035, + SAY_DEATH = -1602036, + SAY_STOMP_1 = -1602037, + SAY_STOMP_2 = -1602038, + SAY_FORGE_1 = -1602039, + SAY_FORGE_2 = -1602040, + EMOTE_TO_ANVIL = -1602041, + EMOTE_SHATTER = -1602042, + + SPELL_HEAT_N = 52387, + SPELL_HEAT_H = 59528, + SPELL_SHATTERING_STOMP_N = 52237, + SPELL_SHATTERING_STOMP_H = 59529, + + //unclear how "directions" of spells must be. Last, summoning GO, what is it for? Script depend on: + SPELL_TEMPER = 52238, //TARGET_SCRIPT boss->anvil + SPELL_TEMPER_DUMMY = 52654, //TARGET_SCRIPT anvil->boss + + //SPELL_TEMPER_VISUAL = 52661, //summons GO + + SPELL_SUMMON_MOLTEN_GOLEM = 52405, + + //Molten Golem + SPELL_BLAST_WAVE = 23113, + SPELL_IMMOLATION_STRIKE_N = 52433, + SPELL_IMMOLATION_STRIKE_H = 59530, + SPELL_SHATTER_N = 52429, + SPELL_SHATTER_H = 59527, + + NPC_VOLKHAN_ANVIL = 28823, + NPC_MOLTEN_GOLEM = 28695, + NPC_BRITTLE_GOLEM = 28681, + + POINT_ID_ANVIL = 0, + MAX_GOLEM = 2 +}; + +/*###### +## Boss Volkhan +######*/ + +struct TRINITY_DLL_DECL boss_volkhanAI : public ScriptedAI +{ + boss_volkhanAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + std::list m_lGolemGUIDList; + + bool m_bIsHeroic; + bool m_bHasTemper; + bool m_bIsStriking; + bool m_bCanShatterGolem; + + uint32 m_uiPause_Timer; + uint32 m_uiShatteringStomp_Timer; + uint32 m_uiShatter_Timer; + + uint32 m_uiHealthAmountModifier; + + void Reset() + { + m_bIsStriking = false; + m_bHasTemper = false; + m_bCanShatterGolem = false; + + m_uiPause_Timer = 3500; + m_uiShatteringStomp_Timer = 0; + m_uiShatter_Timer = 5000; + + m_uiHealthAmountModifier = 1; + + DespawnGolem(); + m_lGolemGUIDList.clear(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VOLKHAN, NOT_STARTED); + } + + void Aggro(Unit* pWho) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VOLKHAN, IN_PROGRESS); + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho, 0.0f); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (!m_bHasTemper) + m_creature->GetMotionMaster()->MoveChase(pWho); + } + } + + void JustDied(Unit* pKiller) + { + DoScriptText(SAY_DEATH, m_creature); + DespawnGolem(); + + if (m_pInstance) + m_pInstance->SetData(TYPE_VOLKHAN, DONE); + } + + void KilledUnit(Unit* pVictim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void DespawnGolem() + { + if (m_lGolemGUIDList.empty()) + return; + + for(std::list::iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr) + { + if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr)) + { + if (pTemp->isAlive()) + pTemp->ForcedDespawn(); + } + } + + m_lGolemGUIDList.clear(); + } + + void ShatterGolem() + { + if (m_lGolemGUIDList.empty()) + return; + + for(std::list::iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr) + { + if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr)) + { + // only shatter brittle golems + if (pTemp->isAlive() && pTemp->GetEntry() == NPC_BRITTLE_GOLEM) + pTemp->CastSpell(pTemp, m_bIsHeroic ? SPELL_SHATTER_H : SPELL_SHATTER_N, false); + } + } + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + if (pSpell->Id == SPELL_TEMPER_DUMMY) + m_bIsStriking = true; + } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_MOLTEN_GOLEM) + { + m_lGolemGUIDList.push_back(pSummoned->GetGUID()); + + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + + //why healing when just summoned? + pSummoned->CastSpell(pSummoned, m_bIsHeroic ? SPELL_HEAT_H : SPELL_HEAT_N, false, NULL, NULL, m_creature->GetGUID()); + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (m_bIsStriking) + { + if (m_uiPause_Timer < uiDiff) + { + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) + { + if (m_creature->getVictim()) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + + m_bHasTemper = false; + m_bIsStriking = false; + m_uiPause_Timer = 3500; + } + else + m_uiPause_Timer -= uiDiff; + + return; + } + + // When to start shatter? After 60, 40 or 20% hp? + if (!m_bHasTemper && m_uiHealthAmountModifier >= 3) + { + if (m_uiShatteringStomp_Timer < uiDiff) + { + //should he stomp even if he has no brittle golem to shatter? + + switch(rand()%2) + { + case 0: DoScriptText(SAY_STOMP_1, m_creature); break; + case 1: DoScriptText(SAY_STOMP_2, m_creature); break; + } + + DoCast(m_creature, m_bIsHeroic ? SPELL_SHATTERING_STOMP_H : SPELL_SHATTERING_STOMP_N); + + DoScriptText(EMOTE_SHATTER, m_creature); + + m_uiShatteringStomp_Timer = 30000; + m_bCanShatterGolem = true; + } + else + m_uiShatteringStomp_Timer -= uiDiff; + } + + // Shatter Golems 3 seconds after Shattering Stomp + if (m_bCanShatterGolem) + { + if (m_uiShatter_Timer < uiDiff) + { + ShatterGolem(); + m_uiShatter_Timer = 3000; + m_bCanShatterGolem = false; + } + else + m_uiShatter_Timer -= uiDiff; + } + + // Health check + if (!m_bCanShatterGolem && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(20*m_uiHealthAmountModifier))) + { + ++m_uiHealthAmountModifier; + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + switch(rand()%2) + { + case 0: DoScriptText(SAY_FORGE_1, m_creature); break; + case 1: DoScriptText(SAY_FORGE_2, m_creature); break; + } + + m_bHasTemper = true; + + m_creature->CastSpell(m_creature, SPELL_TEMPER, false); + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_volkhan(Creature* pCreature) +{ + return new boss_volkhanAI(pCreature); +} + +bool EffectDummyCreature_boss_volkhan(Unit* pCaster, uint32 uiSpellId, uint32 uiEffIndex, Creature* pCreatureTarget) +{ + //always check spellid and effectindex + if (uiSpellId == SPELL_TEMPER_DUMMY && uiEffIndex == 0) + { + if (pCaster->GetEntry() != NPC_VOLKHAN_ANVIL || pCreatureTarget->GetEntry() != NPC_VOLKHAN) + return true; + + for(uint8 i = 0; i < MAX_GOLEM; ++i) + { + pCreatureTarget->CastSpell(pCaster, SPELL_SUMMON_MOLTEN_GOLEM, true); + + //TODO: remove this line of hack when summon effect implemented + pCreatureTarget->SummonCreature(NPC_MOLTEN_GOLEM, + pCaster->GetPositionX(), pCaster->GetPositionY(), pCaster->GetPositionZ(), 0.0f, + TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + } + + //always return true when we are handling this spell and effect + return true; + } + + return false; +} + +/*###### +## npc_volkhan_anvil +######*/ + +bool EffectDummyCreature_npc_volkhan_anvil(Unit* pCaster, uint32 uiSpellId, uint32 uiEffIndex, Creature* pCreatureTarget) +{ + //always check spellid and effectindex + if (uiSpellId == SPELL_TEMPER && uiEffIndex == 0) + { + if (pCaster->GetEntry() != NPC_VOLKHAN || pCreatureTarget->GetEntry() != NPC_VOLKHAN_ANVIL) + return true; + + Creature *cre = CAST_CRE(pCaster); + + DoScriptText(EMOTE_TO_ANVIL, pCaster); + + float fX, fY, fZ; + pCreatureTarget->GetContactPoint(pCaster, fX, fY, fZ, INTERACTION_DISTANCE); + + pCaster->AttackStop(); + + if (pCaster->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + pCaster->GetMotionMaster()->MovementExpired(); + + cre->GetMap()->CreatureRelocation(cre, fX, fY, fZ, pCreatureTarget->GetOrientation()); + cre->SendMonsterMove(fX, fY, fZ, 0, cre->GetUnitMovementFlags(), 1); + + pCreatureTarget->CastSpell(pCaster, SPELL_TEMPER_DUMMY, false); + + //always return true when we are handling this spell and effect + return true; + } + + return false; +} + +/*###### +## mob_molten_golem +######*/ + +struct TRINITY_DLL_DECL mob_molten_golemAI : public ScriptedAI +{ + mob_molten_golemAI(Creature *pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bIsHeroic = pCreature->GetMap()->IsHeroic(); + Reset(); + } + + ScriptedInstance* m_pInstance; + + bool m_bIsHeroic; + bool m_bIsFrozen; + + uint32 m_uiBlast_Timer; + uint32 m_uiDeathDelay_Timer; + uint32 m_uiImmolation_Timer; + + void Reset() + { + m_bIsFrozen = false; + + m_uiBlast_Timer = 20000; + m_uiDeathDelay_Timer = 0; + m_uiImmolation_Timer = 5000; + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho, 0.0f); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (!m_bIsFrozen) + m_creature->GetMotionMaster()->MoveChase(pWho); + } + } + + void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) + { + if (m_bIsFrozen) + { + //workaround for now, brittled should be immune to any kind of attacks + uiDamage = 0; + return; + } + + if (uiDamage > m_creature->GetHealth()) + { + m_bIsFrozen = true; + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + m_creature->RemoveAllAuras(); + m_creature->AttackStop(); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + uiDamage = m_creature->GetHealth()-1; + + m_creature->UpdateEntry(NPC_BRITTLE_GOLEM); + m_creature->SetHealth(1); + } + } + + void SpellHit(Unit* pCaster, const SpellEntry* pSpell) + { + //this is the dummy effect of the spells + if (pSpell->Id == SPELL_SHATTER_N || pSpell->Id == SPELL_SHATTER_H) + { + if (m_creature->GetEntry() == NPC_BRITTLE_GOLEM) + m_creature->ForcedDespawn(); + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target or if we are frozen + if (!UpdateVictim() || m_bIsFrozen) + return; + + if (m_uiBlast_Timer < uiDiff) + { + DoCast(m_creature, SPELL_BLAST_WAVE); + m_uiBlast_Timer = 20000; + } + else + m_uiBlast_Timer -= uiDiff; + + if (m_uiImmolation_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_IMMOLATION_STRIKE_H : SPELL_IMMOLATION_STRIKE_N); + m_uiImmolation_Timer = 5000; + } + else + m_uiImmolation_Timer -= uiDiff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_molten_golem(Creature* pCreature) +{ + return new mob_molten_golemAI(pCreature); +} + +void AddSC_boss_volkhan() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_volkhan"; + newscript->GetAI = &GetAI_boss_volkhan; + newscript->pEffectDummyCreature = &EffectDummyCreature_boss_volkhan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_volkhan_anvil"; + newscript->pEffectDummyCreature = &EffectDummyCreature_npc_volkhan_anvil; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_molten_golem"; + newscript->GetAI = &GetAI_mob_molten_golem; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/def_halls_of_lightning.h b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/def_halls_of_lightning.h new file mode 100644 index 00000000000..8790274e599 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/def_halls_of_lightning.h @@ -0,0 +1,34 @@ +/* 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_HALLS_OF_LIGHTNING_H +#define DEF_HALLS_OF_LIGHTNING_H + +enum +{ + MAX_ENCOUNTER = 4, + + DATA_BJARNGRIM = 1, + DATA_IONAR = 2, + DATA_LOKEN = 3, + DATA_VOLKHAN = 4, + + TYPE_BJARNGRIM = 10, + TYPE_IONAR = 11, + TYPE_LOKEN = 12, + TYPE_VOLKHAN = 13, + + NPC_BJARNGRIM = 28586, + NPC_VOLKHAN = 28587, + NPC_IONAR = 28546, + NPC_LOKEN = 28923, + + GO_BJARNGRIM_DOOR = 191416, //_doors10 + GO_VOLKHAN_DOOR = 191325, //_doors07 + GO_IONAR_DOOR = 191326, //_doors05 + GO_LOKEN_DOOR = 191324, //_doors02 + GO_LOKEN_THRONE = 192654 +}; + +#endif diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp new file mode 100644 index 00000000000..e9d75fb8b6f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp @@ -0,0 +1,194 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along 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_Halls_of_Lightning +SD%Complete: 90% +SDComment: All ready. +SDCategory: Halls of Lightning +EndScriptData */ + +#include "precompiled.h" +#include "def_halls_of_lightning.h" + +/* Halls of Lightning encounters: +0 - General Bjarngrim +1 - Volkhan +2 - Ionar +3 - Loken +*/ + +struct TRINITY_DLL_DECL instance_halls_of_lightning : public ScriptedInstance +{ + instance_halls_of_lightning(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 m_uiGeneralBjarngrimGUID; + uint64 m_uiIonarGUID; + uint64 m_uiLokenGUID; + uint64 m_uiVolkhanGUID; + + uint64 m_uiBjarngrimDoorGUID; + uint64 m_uiVolkhanDoorGUID; + uint64 m_uiIonarDoorGUID; + uint64 m_uiLokenDoorGUID; + uint64 m_uiLokenGlobeGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiGeneralBjarngrimGUID = 0; + m_uiVolkhanGUID = 0; + m_uiIonarGUID = 0; + m_uiLokenGUID = 0; + + m_uiBjarngrimDoorGUID = 0; + m_uiVolkhanDoorGUID = 0; + m_uiIonarDoorGUID = 0; + m_uiLokenDoorGUID = 0; + m_uiLokenGlobeGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case NPC_BJARNGRIM: + m_uiGeneralBjarngrimGUID = pCreature->GetGUID(); + break; + case NPC_VOLKHAN: + m_uiVolkhanGUID = pCreature->GetGUID(); + break; + case NPC_IONAR: + m_uiIonarGUID = pCreature->GetGUID(); + break; + case NPC_LOKEN: + m_uiLokenGUID = pCreature->GetGUID(); + break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case GO_BJARNGRIM_DOOR: + m_uiBjarngrimDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_VOLKHAN_DOOR: + m_uiVolkhanDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[1] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_IONAR_DOOR: + m_uiIonarDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_LOKEN_DOOR: + m_uiLokenDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case GO_LOKEN_THRONE: + m_uiLokenGlobeGUID = pGo->GetGUID(); + break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + switch(uiType) + { + case TYPE_BJARNGRIM: + if (uiData == DONE) + DoUseDoorOrButton(m_uiBjarngrimDoorGUID); + m_auiEncounter[0] = uiData; + break; + case TYPE_VOLKHAN: + if (uiData == DONE) + DoUseDoorOrButton(m_uiVolkhanDoorGUID); + m_auiEncounter[1] = uiData; + break; + case TYPE_IONAR: + if (uiData == DONE) + DoUseDoorOrButton(m_uiIonarDoorGUID); + m_auiEncounter[2] = uiData; + break; + case TYPE_LOKEN: + if (uiData == DONE) + { + DoUseDoorOrButton(m_uiLokenDoorGUID); + + //Appears to be type 5 GO with animation. Need to figure out how this work, code below only placeholder + if (GameObject* pGlobe = instance->GetGameObject(m_uiLokenGlobeGUID)) + pGlobe->SetGoState(GO_STATE_ACTIVE); + } + m_auiEncounter[3] = uiData; + break; + } + } + + uint32 GetData(uint32 uiType) + { + switch(uiType) + { + case TYPE_BJARNGRIM: + return m_auiEncounter[0]; + case TYPE_VOLKHAN: + return m_auiEncounter[1]; + case TYPE_IONAR: + return m_auiEncounter[2]; + case TYPE_LOKEN: + return m_auiEncounter[3]; + } + return 0; + } + + uint64 GetData64(uint32 uiData) + { + switch(uiData) + { + case DATA_BJARNGRIM: + return m_uiGeneralBjarngrimGUID; + case DATA_VOLKHAN: + return m_uiVolkhanGUID; + case DATA_IONAR: + return m_uiIonarGUID; + case DATA_LOKEN: + return m_uiLokenGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_halls_of_lightning(Map* pMap) +{ + return new instance_halls_of_lightning(pMap); +} + +void AddSC_instance_halls_of_lightning() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_halls_of_lightning"; + newscript->GetInstanceData = &GetInstanceData_instance_halls_of_lightning; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp new file mode 100644 index 00000000000..e7ec03124de --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_krystallus.cpp @@ -0,0 +1,73 @@ +/* Script Data Start +SDName: Boss krystallus +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_krystallus' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_BOULDER_TOSS 50843 +#define SPELL_BOULDER_TOSS_2 59742 +#define SPELL_GROUND_SPIKE 59750 +#define SPELL_SHATTER 50810 +#define SPELL_SHATTER_2 61546 +#define SPELL_STOMP 48131 +#define SPELL_STOMP_2 59744 + +//Yell +#define SAY_AGGRO -1599000 +#define SAY_KILL -1599001 +#define SAY_DEATH -1599002 +#define SAY_SHATTER -1599003 + +struct TRINITY_DLL_DECL boss_krystallusAI : public ScriptedAI +{ + boss_krystallusAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + DoScriptText(SAY_KILL, m_creature); + } +}; + +CreatureAI* GetAI_boss_krystallus(Creature* pCreature) +{ + return new boss_krystallusAI (pCreature); +} + +void AddSC_boss_krystallus() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_krystallus"; + newscript->GetAI = &GetAI_boss_krystallus; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp new file mode 100644 index 00000000000..51e8f26f6a9 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_maiden_of_grief.cpp @@ -0,0 +1,81 @@ +/* Script Data Start +SDName: Boss maiden_of_grief +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_maiden_of_grief' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spell +#define SPELL_PARTING_SORROW 59723 +#define SPELL_STORM_OF_GRIEF 50752 +#define SPELL_STORM_OF_GRIEF_2 59772 +#define SPELL_SHOCK_OF_SORROW 50760 +#define SPELL_SHOCK_OF_SORROW_2 59726 +#define SPELL_PILLAR_OF_WOE 50761 +#define SPELL_PILLAR_OF_WOE_2 59727 + +//Yell +#define SAY_AGGRO -1599004 +#define SAY_SLAY_1 -1599005 +#define SAY_SLAY_2 -1599006 +#define SAY_SLAY_3 -1599007 +#define SAY_SLAY_4 -1599008 +#define SAY_DEATH -1599009 +#define SAY_STUN -1599010 + +struct TRINITY_DLL_DECL boss_maiden_of_griefAI : public ScriptedAI +{ + boss_maiden_of_griefAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_maiden_of_grief(Creature* pCreature) +{ + return new boss_maiden_of_griefAI (pCreature); +} + +void AddSC_boss_maiden_of_grief() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_maiden_of_grief"; + newscript->GetAI = &GetAI_boss_maiden_of_grief; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp new file mode 100644 index 00000000000..d0b0889ea63 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/boss_sjonnir.cpp @@ -0,0 +1,83 @@ +/* Script Data Start +SDName: Boss sjonnir +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_sjonnir' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_LIGHTING_RING_1 50840 //Periodic Trigger (interval 2s) spell = 50841 +#define SPELL_LIGHTING_RING_2 51849 //Periodic Trigger (interval 2s) spell = 50841 +#define SPELL_LIGHTING_RING_2 59848 //Periodic Trigger (interval 2s) spell = 59849 +#define SPELL_LIGHTING_RING_3 59861 //Periodic Trigger (interval 2s) spell = 59849 +#define SPELL_STATIC_CHARGE_1 50834 //Periodic Trigger 2s interval, spell =50835 +#define SPELL_STATIC_CHARGE_2 59846 //Periodic Trigger 2s interval, spell =50847 +#define SPELL_CHAIN_LIGHTING_1 50830 +#define SPELL_CHAIN_LIGHTING_2 59844 +#define SPELL_LIGHTING_SHIELD_1 50831 +#define SPELL_LIGHTING_SHIELD_2 59845 +#define SPELL_FRENZY 28747 + +//Yell +#define SAY_AGGRO -1599011 +#define SAY_SLAY_1 -1599012 +#define SAY_SLAY_2 -1599013 +#define SAY_SLAY_3 -1599014 +#define SAY_DEATH -1599015 + +struct TRINITY_DLL_DECL boss_sjonnirAI : public ScriptedAI +{ + boss_sjonnirAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_sjonnir(Creature* pCreature) +{ + return new boss_sjonnirAI (pCreature); +} + +void AddSC_boss_sjonnir() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_sjonnir"; + newscript->GetAI = &GetAI_boss_sjonnir; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/def_halls_of_stone.h b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/def_halls_of_stone.h new file mode 100644 index 00000000000..ade934ad921 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/def_halls_of_stone.h @@ -0,0 +1,4 @@ +#ifndef DEF_HALLS_OF_STONE_H +#define DEF_HALLS_OF_STONE_H + +#endif diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp new file mode 100644 index 00000000000..fa2dd83637f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_stone/instance_halls_of_stone.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_halls_of_stone.h" + +struct TRINITY_DLL_DECL instance_halls_of_stone : public ScriptedInstance +{ + instance_halls_of_stone(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_halls_of_stone(Map* pMap) +{ + return new instance_halls_of_stone(pMap); +} + +void AddSC_instance_halls_of_stone() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_halls_of_stone"; + newscript->GetInstanceData = &GetInstanceData_instance_halls_of_stone; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_algalon.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_algalon.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_algalon.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_assembly_of_iron.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp new file mode 100644 index 00000000000..685e2b506c0 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_auriaya.cpp @@ -0,0 +1,91 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_ulduar.h" + +//boss_auriaya +#define SPELL_TERRIFYING_SCREECH 64386 +#define SPELL_SONIC_BOOM 38897 +#define SAY_AGGRO -2615016 +#define SAY_SLAY_1 -2615017 + +struct TRINITY_DLL_DECL boss_auriaya_AI : public ScriptedAI +{ + boss_auriaya_AI(Creature *c) : ScriptedAI(c) {} + + uint32 TERRIFYING_SCREECH_Timer; + uint32 SONIC_BOOM_Timer; + + void Reset() + { + TERRIFYING_SCREECH_Timer = 0; + SONIC_BOOM_Timer = 2000; + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO,m_creature); + } + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_SLAY_1, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_SLAY_1, m_creature); + } + + void MoveInLineOfSight(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (TERRIFYING_SCREECH_Timer < diff) + { + DoCast(m_creature,SPELL_TERRIFYING_SCREECH); + DoScriptText(SAY_SLAY_1, m_creature); + TERRIFYING_SCREECH_Timer = 360000; + } else TERRIFYING_SCREECH_Timer -= diff; + + if (SONIC_BOOM_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SONIC_BOOM); + SONIC_BOOM_Timer = 20000; + } else SONIC_BOOM_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_auriaya(Creature* pCreature) +{ + return new boss_auriaya_AI (pCreature); +} +void AddSC_boss_auriaya() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_auriaya"; + newscript->GetAI = &GetAI_boss_auriaya; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp new file mode 100644 index 00000000000..20ad85351a9 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_flame_leviathan.cpp @@ -0,0 +1,306 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_ulduar.h" +#include "Vehicle.h" + +#define SPELL_PURSUED 62374 +#define SPELL_GATHERING_SPEED 62375 +#define SPELL_BATTERING_RAM 62376 +#define SPELL_FLAME_VENTS 62396 +#define SPELL_MISSILE_BARRAGE 62400 +#define SPELL_SYSTEMS_SHUTDOWN 62475 + +#define SPELL_CANNON 62397 + +#define SPELL_OVERLOAD_CIRCUIT 62399 + +#define SPELL_SEARING_FLAME 62402 + +enum Events +{ + EVENT_PURSUE = 1, + EVENT_MISSILE, + EVENT_VENT, +}; + +struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI +{ + boss_flame_leviathanAI(Creature *c) : BossAI(c, BOSS_LEVIATHAN) + { + assert(c->isVehicle()); + } + + void MoveInLineOfSight(Unit* who) {} + + void EnterCombat(Unit *who) + { + _EnterCombat(); + events.ScheduleEvent(EVENT_PURSUE, 0); + events.ScheduleEvent(EVENT_MISSILE, 1500); + events.ScheduleEvent(EVENT_VENT, 20000); + if (Creature *turret = CAST_CRE(CAST_VEH(me)->GetPassenger(7))) + turret->AI()->DoZoneInCombat(); + } + + // TODO: effect 0 and effect 1 may be on different target + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (spell->Id == SPELL_PURSUED) + AttackStart(target); + } + + void UpdateAI(const uint32 diff) + { + if (!me->isInCombat()) + return; + + if (me->getThreatManager().isThreatListEmpty()) + { + EnterEvadeMode(); + return; + } + + events.Update(diff); + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + uint32 eventId = events.GetEvent(); + if (!me->getVictim()) + eventId = EVENT_PURSUE; + + switch(eventId) + { + case 0: + return; + case EVENT_PURSUE: + DoCastAOE(SPELL_PURSUED); + events.RepeatEvent(35000); + return; + case EVENT_MISSILE: + //TODO: without unittarget no visual effect + //DoCastAOE(SPELL_MISSILE_BARRAGE); + DoCast(me->getVictim(), SPELL_MISSILE_BARRAGE); + events.RepeatEvent(1500); + return; + case EVENT_VENT: + DoCastAOE(SPELL_FLAME_VENTS); + events.RepeatEvent(20000); + return; + default: + events.PopEvent(); + break; + } + + DoSpellAttackIfReady(SPELL_BATTERING_RAM); + } +}; + + +struct TRINITY_DLL_DECL boss_flame_leviathan_turretAI : public ScriptedAI +{ + boss_flame_leviathan_turretAI(Creature *c) : ScriptedAI(c) + { + me->SetReactState(REACT_PASSIVE); + } + + void Reset() + { + events.Reset(); + } + + EventMap events; + + void EnterCombat(Unit *who) + { + events.ScheduleEvent(1, 5000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateCombatState()) + return; + + events.Update(diff); + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + if (uint32 eventId = events.GetEvent()) + { + switch(eventId) + { + case 1: + DoCast(SelectTarget(SELECT_TARGET_RANDOM), SPELL_CANNON); + events.RepeatEvent(10000); + return; + default: + events.PopEvent(); + break; + } + } + } +}; + + +struct TRINITY_DLL_DECL boss_flame_leviathan_seatAI : public ScriptedAI +{ + boss_flame_leviathan_seatAI(Creature *c) : ScriptedAI(c) + { + assert(c->isVehicle()); + if (const CreatureInfo *cInfo = me->GetCreatureInfo()) + me->SetDisplayId(cInfo->DisplayID_A[0]); // 0 invisible, 1 visible + } + + void Reset() + { + me->SetReactState(REACT_AGGRESSIVE); + } + + void MoveInLineOfSight(Unit *who) // for test + { + if (who->GetTypeId() == TYPEID_PLAYER && !who->m_Vehicle + && !CAST_VEH(me)->GetPassenger(0) && CAST_VEH(me)->GetPassenger(2)) + who->EnterVehicle(CAST_VEH(me), 0); + } + + void UpdateAI(const uint32 diff) + { + if (!CAST_VEH(me)->GetPassenger(2)) + if (Unit *who = CAST_VEH(me)->GetPassenger(0)) + who->ExitVehicle(); + } +}; + +struct TRINITY_DLL_DECL boss_flame_leviathan_defense_turretAI : public ScriptedAI +{ + boss_flame_leviathan_defense_turretAI(Creature *c) : ScriptedAI(c) + { + } + + void Reset() + { + } + + void DamageTaken(Unit *who, uint32 &damage) + { + if (!who->m_Vehicle || who->m_Vehicle->GetEntry() != 33114) + damage = 0; + } + + void MoveInLineOfSight(Unit *who) + { + if (me->getVictim()) + return; + + if (who->GetTypeId() != TYPEID_PLAYER || !who->m_Vehicle || who->m_Vehicle->GetEntry() != 33114) + return; + + AttackStart(who); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + DoCast(me->getVictim(), SPELL_SEARING_FLAME); + } +}; + +struct TRINITY_DLL_DECL boss_flame_leviathan_overload_deviceAI : public ScriptedAI +{ + boss_flame_leviathan_overload_deviceAI(Creature *c) : ScriptedAI(c) + { + if (const CreatureInfo *cInfo = me->GetCreatureInfo()) + me->SetDisplayId(cInfo->DisplayID_H[0]); // A0 gm, H0 device + } + + void Reset() + { + } + + void DamageTaken(Unit *who, uint32 &damage) + { + if (damage >= me->GetHealth()) + { + damage = 0; + if (!me->hasUnitState(UNIT_STAT_CASTING)) + DoCastAOE(SPELL_OVERLOAD_CIRCUIT); + } + } +}; + +CreatureAI* GetAI_boss_flame_leviathan(Creature* pCreature) +{ + return new boss_flame_leviathanAI (pCreature); +} + +CreatureAI* GetAI_boss_flame_leviathan_turret(Creature* pCreature) +{ + return new boss_flame_leviathan_turretAI (pCreature); +} + +CreatureAI* GetAI_boss_flame_leviathan_seat(Creature* pCreature) +{ + return new boss_flame_leviathan_seatAI (pCreature); +} + +CreatureAI* GetAI_boss_flame_leviathan_defense_turret(Creature* pCreature) +{ + return new boss_flame_leviathan_defense_turretAI (pCreature); +} + +CreatureAI* GetAI_boss_flame_leviathan_overload_device(Creature* pCreature) +{ + return new boss_flame_leviathan_overload_deviceAI (pCreature); +} + +void AddSC_boss_flame_leviathan() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_flame_leviathan"; + newscript->GetAI = &GetAI_boss_flame_leviathan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_flame_leviathan_turret"; + newscript->GetAI = &GetAI_boss_flame_leviathan_turret; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_flame_leviathan_seat"; + newscript->GetAI = &GetAI_boss_flame_leviathan_seat; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_flame_leviathan_defense_turret"; + newscript->GetAI = &GetAI_boss_flame_leviathan_defense_turret; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_flame_leviathan_overload_device"; + newscript->GetAI = &GetAI_boss_flame_leviathan_overload_device; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_freya.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_freya.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_freya.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_general_vezax.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_hodir.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_hodir.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_hodir.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_ignis.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_ignis.cpp new file mode 100644 index 00000000000..56405eb13e1 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_ignis.cpp @@ -0,0 +1,102 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_ulduar.h" + +#define SPELL_FLAME_JETS 62680 +#define SPELL_SCORCH 62546 +#define SPELL_SLAG_POT 62717 + +#define SAY_AGGRO -10000002 +#define SAY_SLAY -1000003 + +struct TRINITY_DLL_DECL boss_ignis_AI : public ScriptedAI +{ + boss_ignis_AI(Creature *c) : ScriptedAI(c) {} + + uint32 FLAME_JETS_Timer; + uint32 SCORCH_Timer; + uint32 SLAG_POT_Timer; + + void Reset() + { + FLAME_JETS_Timer = 32000; + SCORCH_Timer = 100; + SLAG_POT_Timer = 100; + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO,m_creature); + } + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void MoveInLineOfSight(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (FLAME_JETS_Timer < diff) + { + DoCast(m_creature,SPELL_FLAME_JETS); + DoScriptText(SAY_SLAY, m_creature); + FLAME_JETS_Timer = 25000; + } else FLAME_JETS_Timer -= diff; + + if (SCORCH_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SCORCH); + SCORCH_Timer = 20000; + } else SCORCH_Timer -= diff; + + if (SLAG_POT_Timer < diff) + { + DoCast(m_creature,SPELL_SLAG_POT); + DoScriptText(SAY_SLAY, m_creature); + SLAG_POT_Timer = 30000; + } else SLAG_POT_Timer -= diff; + + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ignis(Creature* pCreature) +{ + return new boss_ignis_AI (pCreature); +} +void AddSC_boss_ignis() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_ignis"; + newscript->GetAI = &GetAI_boss_ignis; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_kologarn.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_mimiron.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp new file mode 100644 index 00000000000..59a7b8e6a9a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_razorscale.cpp @@ -0,0 +1,300 @@ +/* + * Copyright (C) 2008 - 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 +Name: razorscale +%Complete: 90 +Comment: Made by Epsik from WoW Arthas wow.dsl.net.pk +Category: +EndScriptData */ + +#include "precompiled.h" +#include "def_ulduar.h" + +#define SAY_AGGRO -2000000 +#define SAY_KILL -2000001 +#define SAY_PHASE_2_TRANS -2000002 +#define SAY_PHASE_3_TRANS -2000003 +#define EMOTE_BREATH -2000004 + +#define SPELL_FLAMEBUFFET 64016 +#define SPELL_FIREBALL 62796 + +#define SPELL_WINGBUFFET 62666 +#define SPELL_FLAMEBREATH 63317 +#define SPELL_FUSEARMOR 64771 +#define SPELL_DEVOURINGFLAME 63014 +#define SPELL_KNOCK_AWAY 19633 + +#define SPELL_BELLOWINGROAR 18431 +#define SPELL_HEATED_GROUND 22191 + +#define SPELL_SUMMONADDS 17646 + +#define CREATURE_ADDS 33846 + +static float MovementLocations[4][3]= +{ + {607.7, -281.9, 408.6}, + {602.0, -245.5, 424.7}, + {612.3, -230.8, 409.1}, + {624.1, -251.8, 426.1} +}; + +static float SpawnLocations[4][3]= +{ + {602.0, -248.1, 391.2}, + {624.4, -232-4, 391.1}, + {643.3, -256.4, 391.4}, + {626.6, -271.5, 391.4}, +}; + +struct TRINITY_DLL_DECL boss_razorscaleAI : public ScriptedAI +{ + boss_razorscaleAI(Creature* c) : ScriptedAI(c) {} + + uint32 Phase; + + uint32 FlameBreathTimer; + uint32 FUSEARMORTimer; + uint32 DEVOURINGFLAMETimer; + uint32 MovementTimer; + uint32 SummonAddsTimer; + uint32 BellowingRoarTimer; + uint32 WingBuffetTimer; + uint32 KnockAwayTimer; + uint32 FireballTimer; + + bool InitialSpawn; + + void Reset() + { + Phase = 1; + + FlameBreathTimer = 20000; + DEVOURINGFLAMETimer = 2000; + FUSEARMORTimer = 15000; + MovementTimer = 3000; + SummonAddsTimer = 45000; + BellowingRoarTimer = 30000; + WingBuffetTimer = 17000; + KnockAwayTimer = 15000; + FireballTimer = 18000; + + InitialSpawn = true; + + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + } + + void JustDied(Unit* Killer) + { + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_KILL, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 99) && (Phase == 1)) + { + Phase = 2; + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->SetHover(true); + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + DoScriptText(SAY_PHASE_2_TRANS, m_creature); + } + + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) && (Phase == 2)) + { + Phase = 3; + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->SetHover(false); + m_creature->GetMotionMaster()->MovePoint(0, 619.6, -261.1, 391.471832); + DoStartMovement(m_creature->getVictim()); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + DoScriptText(SAY_PHASE_3_TRANS, m_creature); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + + if (Phase == 1 || Phase == 3) + { + if (FlameBreathTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH); + FlameBreathTimer = 15000; + } else FlameBreathTimer -= diff; + + if (DEVOURINGFLAMETimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (target && !m_creature->HasInArc(M_PI, target)) + DoCast(target, SPELL_DEVOURINGFLAME); + + DEVOURINGFLAMETimer = 10000; + } else DEVOURINGFLAMETimer -= diff; + + if (FUSEARMORTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FUSEARMOR); + FUSEARMORTimer = 10000; + } else FUSEARMORTimer -= diff; + + if (WingBuffetTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WINGBUFFET); + WingBuffetTimer = 7000 + ((rand()%8)*1000); + } else WingBuffetTimer -= diff; + + if (KnockAwayTimer < diff) + { + if (rand()%100 <= 30) + { + DoCast(m_creature->getVictim(), SPELL_KNOCK_AWAY); + } + KnockAwayTimer = 15000; + } else KnockAwayTimer -= diff; + + if (Phase == 3) + { + if (BellowingRoarTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR); + + BellowingRoarTimer = 30000; + } else BellowingRoarTimer -= diff; + + if (SummonAddsTimer < diff) + { + SummonAdds(Phase); + + SummonAddsTimer = 45000; + } else SummonAddsTimer -= diff; + } + + DoMeleeAttackIfReady(); + } + + if (Phase == 2) + { + if (InitialSpawn) + { + InitialSpawn = false; + + for(uint32 i = 0; i < 4; ++i) + { + uint32 random = rand()%4; + Creature* Add = m_creature->SummonCreature(CREATURE_ADDS, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Add) + Add->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + + + if (FireballTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); + + FireballTimer = 18000; + } else FireballTimer -= diff; + + if (MovementTimer < diff) + { + if (rand()%100 <= 30) + { + DoScriptText(EMOTE_BREATH, m_creature); + DoCast(m_creature->getVictim(), SPELL_FLAMEBUFFET); + } + else ChangePosition(); + + MovementTimer = 25000; + } else MovementTimer -= diff; + + if (SummonAddsTimer < diff) + { + SummonAdds(Phase); + + SummonAddsTimer = 45000; + } else SummonAddsTimer -= diff; + } + } + + void ChangePosition() + { + /* Malfunctioning, Razorscale is flying around randomly, attacking players from hundreds of yards away. + uint32 random = rand() % 4; + if (random<4){ + m_creature->GetMotionMaster()->MovePoint(0, MovementLocations[random][0], MovementLocations[random][1], MovementLocations[random][2]);} */ + } + + void SummonAdds(uint32 Phase) + { + if (Phase == 2) + { + uint32 max = rand()%10; + for(uint32 i = 0; i < 4; ++i) + { + uint32 random = rand()%3; + Creature* Add = m_creature->SummonCreature(CREATURE_ADDS, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Add) + Add->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + + if (Phase == 3) + { + uint32 max = rand() % 10 +1; + if (max < 1) + { + for(uint32 i = 0; i < max; ++i) + { + uint32 random = rand()%4; + Creature* Add = m_creature->SummonCreature(CREATURE_ADDS, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); + if (Add) + Add->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + } + } + } +}; + +CreatureAI* GetAI_boss_razorscale(Creature* pCreature) +{ + return new boss_razorscaleAI (pCreature); +} + +void AddSC_boss_razorscale() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_razorscale"; + newscript->GetAI = &GetAI_boss_razorscale; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_thorim.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_thorim.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_thorim.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_xt002.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_xt002.cpp new file mode 100644 index 00000000000..a0d265f6224 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_xt002.cpp @@ -0,0 +1,90 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_ulduar.h" + +#define SPELL_SEARING_LIGHT 63018 +#define SPELL_SONIC_BOOM 38897 + +#define SAY_AGGRO -1000000 +#define SAY_SLAY -1000001 +struct TRINITY_DLL_DECL boss_xt002_AI : public ScriptedAI +{ + boss_xt002_AI(Creature *c) : ScriptedAI(c) {} + + uint32 SEARING_LIGHT_Timer; + uint32 SONIC_BOOM_Timer; + + void Reset() + { + SEARING_LIGHT_Timer = 100; + SONIC_BOOM_Timer = 20; + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO,m_creature); + } + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_SLAY, m_creature); + } + + void MoveInLineOfSight(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (SEARING_LIGHT_Timer < diff) + { + DoCast(m_creature,SPELL_SEARING_LIGHT); + DoScriptText(SAY_SLAY, m_creature); + SEARING_LIGHT_Timer = 50000; + } else SEARING_LIGHT_Timer -= diff; + + if (SONIC_BOOM_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SONIC_BOOM); + SONIC_BOOM_Timer = 20000; + } else SONIC_BOOM_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_xt002(Creature* pCreature) +{ + return new boss_xt002_AI (pCreature); +} +void AddSC_boss_xt002() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "boss_xt002"; + newscript->GetAI = &GetAI_boss_xt002; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_yoggsaron.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_yoggsaron.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/boss_yoggsaron.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/def_ulduar.h b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/def_ulduar.h new file mode 100644 index 00000000000..d73e6324fc8 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/def_ulduar.h @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2008 - 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 + */ + +#ifndef DEF_ULDUAR_H +#define DEF_ULDUAR_H + +enum Encounter +{ + BOSS_LEVIATHAN, + BOSS_IGNIS, + BOSS_RAZORSCALE, + BOSS_XT002, + BOSS_ASSEMBLY, + BOSS_KOLOGARN, + BOSS_AURIAYA, + BOSS_MIMIRON, + BOSS_HODIR, + BOSS_THORIM, + BOSS_FREYA, + BOSS_VEZAX, + BOSS_YOGGSARON, + BOSS_ALGALON, + MAX_BOSS_NUMBER +}; + +#endif diff --git a/src/bindings/scripts/scripts/northrend/ulduar/ulduar/instance_ulduar.cpp b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/instance_ulduar.cpp new file mode 100644 index 00000000000..a736b2db12a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/ulduar/ulduar/instance_ulduar.cpp @@ -0,0 +1,20 @@ +/* + * Copyright (C) 2008 - 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 "precompiled.h" +#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp new file mode 100644 index 00000000000..a2445a97229 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp @@ -0,0 +1,459 @@ +/* + * 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_Ingvar_The_Plunderer +SD%Complete: 95 +SDComment: Some Problems with Annhylde Movement, Blizzlike Timers +SDCategory: Udgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "def_utgarde_keep.h" + +enum +{ + //Yells Ingvar + YELL_AGGRO_1 = -1574005, + YELL_AGGRO_2 = -1574006, + + YELL_DEAD_1 = -1574007, + YELL_DEAD_2 = -1574008, + + YELL_KILL_1 = -1574009, + YELL_KILL_2 = -1574010, + +//Ingvar Spells human form + MOB_INGVAR_HUMAN = 23954, + SPELL_CLEAVE = 42724, + SPELL_SMASH = 42669, + H_SPELL_SMASH = 59706, + SPELL_STAGGERING_ROAR = 42708, + H_SPELL_STAGGERING_ROAR = 59708, + SPELL_ENRAGE = 42705, + H_SPELL_ENRAGE = 59707, + + MOB_ANNHYLDE_THE_CALLER = 24068, + SPELL_INGVAR_FEIGN_DEATH = 42795, + SPELL_SUMMON_BANSHEE = 42912, + SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN = 42863, //Spawn resurrecteffekt around Ingvar + + MODEL_INGVAR_UNDEAD = 26351, + MODEL_INGVAR_HUMAN = 21953, + +//Ingvar Spells undead form + MOB_INGVAR_UNDEAD = 23980, + SPELL_DARK_SMASH = 42723, + SPELL_DREADFUL_ROAR = 42729, + H_SPELL_DREADFUL_ROAR = 59734, + SPELL_WOE_STRIKE = 42730, + H_SPELL_WOE_STRIKE = 59735, + + ENTRY_THROW_TARGET = 23996, + SPELL_SHADOW_AXE_SUMMON = 42749 +}; + +struct TRINITY_DLL_DECL boss_ingvar_the_plundererAI : public ScriptedAI +{ + boss_ingvar_the_plundererAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + + bool HeroicMode; + bool undead; + bool event_inProgress; + + uint32 Cleave_Timer; + uint32 Smash_Timer; + uint32 Enrage_Timer; + uint32 Roar_Timer; + uint32 SpawnResTimer; + uint32 wait_Timer; + + void Reset() + { + if (undead) // Visual Hack + m_creature->SetDisplayId(MODEL_INGVAR_HUMAN); + + undead = false; + event_inProgress = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + Cleave_Timer = 2000; + Smash_Timer = 5000; + Enrage_Timer = 10000; + Roar_Timer = 15000; + + SpawnResTimer = 3000; + + wait_Timer = 0; + + if (pInstance) + pInstance->SetData(DATA_INGVAR_EVENT, NOT_STARTED); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= m_creature->GetHealth() && !undead) + { + //DoCast(m_creature,SPELL_INGVAR_FEIGN_DEATH,true); // Dont work ??? + // visuel hack + m_creature->SetHealth(0); + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->GetMotionMaster()->MovementExpired(false); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + // visuel hack end + + event_inProgress = true; + undead = true; + + DoScriptText(YELL_DEAD_1,m_creature); + } + + if (event_inProgress) + { + damage = 0; + } + } + + void StartZombiePhase() + { + undead = true; + event_inProgress = false; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + m_creature->AI()->AttackStart(m_creature->getVictim()); + + DoScriptText(YELL_AGGRO_2,m_creature); + } + + void EnterCombat(Unit *who) + { + DoScriptText(YELL_AGGRO_1,m_creature); + + if (pInstance) + pInstance->SetData(DATA_INGVAR_EVENT, IN_PROGRESS); + } + + void JustDied(Unit* killer) + { + DoScriptText(YELL_DEAD_2,m_creature); + + if (pInstance) + pInstance->SetData(DATA_INGVAR_EVENT, DONE); + } + + void KilledUnit(Unit *victim) + { + if (undead) { DoScriptText(YELL_KILL_1,m_creature); } + else { DoScriptText(YELL_KILL_2,m_creature); } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (event_inProgress) + { + if (SpawnResTimer) + if (SpawnResTimer< diff) + { + DoCast(m_creature,SPELL_SUMMON_BANSHEE); // Summons direktly on caster position + //DoCast(m_creature,SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN); // Dont needet ? + SpawnResTimer = 0; + }else SpawnResTimer -= diff; + + return; + } + + // This is used for a spell queue ... the spells should not castet if one spell is already casting + if (wait_Timer) + if (wait_Timer < diff) + { + wait_Timer = 0; + }else wait_Timer -= diff; + + if (Cleave_Timer < diff) + { + if (!wait_Timer) + { + if (undead) + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_WOE_STRIKE : SPELL_WOE_STRIKE); + else + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = rand()%5000 + 2000; + + wait_Timer = 1000; + } + }else Cleave_Timer -= diff; + + if (Smash_Timer < diff) + { + if (!wait_Timer) + { + if (undead) + DoCast(m_creature->getVictim(), SPELL_DARK_SMASH); + else + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_SMASH : SPELL_SMASH); + Smash_Timer = 10000; + + wait_Timer = 5000; + } + }else Smash_Timer -= diff; + + if (!undead) + { + if (Enrage_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_ENRAGE : SPELL_ENRAGE); + Enrage_Timer = 10000; + }else Enrage_Timer -= diff; + }else // In Undead form used to summon weapon + { + if (Enrage_Timer < diff) + { + if (!wait_Timer) + { + // Spawn target for Axe + Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); + if (target) + { + Creature* temp = m_creature->SummonCreature(ENTRY_THROW_TARGET,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,2000); + + DoCast(m_creature,SPELL_SHADOW_AXE_SUMMON); + } + Enrage_Timer = 30000; + } + }else Enrage_Timer -= diff; + } + + + if (Roar_Timer < diff) + { + if (!wait_Timer) + { + if (undead) + DoCast(m_creature,HeroicMode ? H_SPELL_DREADFUL_ROAR : SPELL_DREADFUL_ROAR); + else + DoCast(m_creature,HeroicMode ? H_SPELL_STAGGERING_ROAR : SPELL_STAGGERING_ROAR); + Roar_Timer = 10000; + + wait_Timer = 5000; + } + }else Roar_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_ingvar_the_plunderer(Creature* pCreature) +{ + return new boss_ingvar_the_plundererAI (pCreature); +} + +enum +{ +//we don't have that text in db so comment it until we get this text +// YELL_RESSURECT = -1574025, + +//Spells for Annhylde + SPELL_SCOURG_RESURRECTION_HEAL = 42704, //Heal Max + DummyAura + SPELL_SCOURG_RESURRECTION_BEAM = 42857, //Channeling Beam of Annhylde + SPELL_SCOURG_RESURRECTION_DUMMY = 42862, //Some Emote Dummy? + SPELL_INGVAR_TRANSFORM = 42796 +}; + +struct TRINITY_DLL_DECL mob_annhylde_the_callerAI : public ScriptedAI +{ + mob_annhylde_the_callerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + float x,y,z; + ScriptedInstance* pInstance; + uint32 Resurect_Timer; + uint32 Resurect_Phase; + + void Reset() + { + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING + MOVEMENTFLAG_HOVER); + m_creature->SetSpeed(MOVE_SWIM , 1.0f); + m_creature->SetSpeed(MOVE_RUN , 1.0f); + m_creature->SetSpeed(MOVE_WALK , 1.0f); + //m_creature->SetSpeed(MOVE_FLIGHT , 1.0f); + + m_creature->GetPosition(x,y,z); + DoTeleportTo(x+1,y,z+30); + + Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); + if (ingvar) + { + m_creature->GetMotionMaster()->MovePoint(1,x,y,z+15); + +// DoScriptText(YELL_RESSURECT,m_creature); + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); + if (ingvar) + { + switch (id) + { + case 1: + ingvar->RemoveAura(SPELL_SUMMON_BANSHEE); + ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_DUMMY,true); + DoCast(ingvar,SPELL_SCOURG_RESURRECTION_BEAM); + Resurect_Timer = 8000; + Resurect_Phase = 1; + break; + case 2: + m_creature->DealDamage(m_creature,m_creature->GetHealth()); + m_creature->RemoveCorpse(); + break; + } + } + } + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void EnterCombat(Unit *who) {} + void UpdateAI(const uint32 diff) + { + if (Resurect_Timer) + if (Resurect_Timer < diff) + { + if (Resurect_Phase == 1) + { + Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); + if (ingvar) + { + ingvar->SetStandState(UNIT_STAND_STATE_STAND); + ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_HEAL,false); + } + Resurect_Timer = 3000; + Resurect_Phase = 2; + }else if (Resurect_Phase == 2) + { + Creature* ingvar = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_INGVAR)); + if (ingvar) + { + ingvar->RemoveAurasDueToSpell(SPELL_SCOURG_RESURRECTION_DUMMY); + //ingvar->CastSpell(ingvar,SPELL_INGVAR_TRANSFORM,false); + ingvar->SetDisplayId(MODEL_INGVAR_UNDEAD); // Visual Hack - when he dies he becomes human model -> wrong + Creature* c_ingvar = ingvar; + + CAST_AI(boss_ingvar_the_plundererAI, (c_ingvar->AI()))->StartZombiePhase(); + + m_creature->GetMotionMaster()->MovePoint(2,x+1,y,z+30); + Resurect_Phase++; + } + } + + }else Resurect_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_annhylde_the_caller(Creature* pCreature) +{ + return new mob_annhylde_the_callerAI (pCreature); +} + +enum +{ + SPELL_SHADOW_AXE_DAMAGE = 42750, + H_SPELL_SHADOW_AXE_DAMAGE = 59719 +}; + +struct TRINITY_DLL_DECL mob_ingvar_throw_dummyAI : public ScriptedAI +{ + mob_ingvar_throw_dummyAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 Despawn_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + Unit* target = m_creature->FindNearestCreature(ENTRY_THROW_TARGET,50); + if (target) + { + DoCast(m_creature, HeroicMode ? H_SPELL_SHADOW_AXE_DAMAGE : SPELL_SHADOW_AXE_DAMAGE); + float x,y,z; + target->GetPosition(x,y,z); + m_creature->GetMotionMaster()->MovePoint(0,x,y,z); + } + Despawn_Timer = 7000; + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void EnterCombat(Unit *who) {} + void UpdateAI(const uint32 diff) + { + if (Despawn_Timer < diff) + { + m_creature->DealDamage(m_creature,m_creature->GetHealth()); + m_creature->RemoveCorpse(); + Despawn_Timer = 0; + }else Despawn_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ingvar_throw_dummy(Creature* pCreature) +{ + return new mob_ingvar_throw_dummyAI (pCreature); +} + +void AddSC_boss_ingvar_the_plunderer() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_ingvar_the_plunderer"; + newscript->GetAI = &GetAI_boss_ingvar_the_plunderer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_annhylde_the_caller"; + newscript->GetAI = &GetAI_mob_annhylde_the_caller; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ingvar_throw_dummy"; + newscript->GetAI = &GetAI_mob_ingvar_throw_dummy; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp new file mode 100644 index 00000000000..b7701a52472 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_keleseth.cpp @@ -0,0 +1,365 @@ +/* + * 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_Prince_Keleseth +SD%Complete: 90 +SDComment: Needs Prince Movements, Needs adjustments to blizzlike timers, Needs Shadowbolt castbar, Needs right Ressurect Visual, Needs Some Heroic Spells +SDCategory: Utgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "def_utgarde_keep.h" + +enum +{ + ACHIEVEMENT_ON_THE_ROCKS = 1919, + + SPELL_SHADOWBOLT = 43667, + SPELL_SHADOWBOLT_HEROIC = 59389, + SPELL_FROST_TOMB = 48400, + SPELL_FROST_TOMB_SUMMON = 42714, + SPELL_DECREPIFY = 42702, + SPELL_SCOURGE_RESSURRECTION = 42704, + CREATURE_FROSTTOMB = 23965, + CREATURE_SKELETON = 23970, + + SAY_AGGRO = -1574000, + SAY_FROST_TOMB = -1574001, + SAY_SKELETONS = -1574002, + SAY_KILL = -1574003, + SAY_DEATH = -1574004 +}; + +#define SKELETONSPAWN_Z 42.8668 + +float SkeletonSpawnPoint[5][5]= +{ + {156.2559, 259.2093}, + {156.2559, 259.2093}, + {156.2559, 259.2093}, + {156.2559, 259.2093}, + {156.2559, 259.2093}, +}; + +float AttackLoc[3]={197.636, 194.046, 40.8164}; + +bool ShatterFrostTomb; // needed for achievement: On The Rocks(1919) + +struct TRINITY_DLL_DECL mob_frost_tombAI : public ScriptedAI +{ + mob_frost_tombAI(Creature *c) : ScriptedAI(c) + { + FrostTombGUID = 0; + } + + uint64 FrostTombGUID; + + void SetPrisoner(Unit* uPrisoner) + { + FrostTombGUID = uPrisoner->GetGUID(); + } + + void Reset(){ FrostTombGUID = 0; } + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + + void JustDied(Unit *killer) + { + if (killer->GetGUID() != m_creature->GetGUID()) + ShatterFrostTomb = true; + + if (FrostTombGUID) + { + Unit* FrostTomb = Unit::GetUnit((*m_creature),FrostTombGUID); + if (FrostTomb) + FrostTomb->RemoveAurasDueToSpell(SPELL_FROST_TOMB); + } + } + + void UpdateAI(const uint32 diff) + { + Unit* temp = Unit::GetUnit((*m_creature),FrostTombGUID); + if ((temp && temp->isAlive() && !temp->HasAura(SPELL_FROST_TOMB)) || !temp) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } +}; + +struct TRINITY_DLL_DECL boss_kelesethAI : public ScriptedAI +{ + boss_kelesethAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Heroic = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + + uint32 FrostTombTimer; + uint32 SummonSkeletonsTimer; + uint32 RespawnSkeletonsTimer; + uint32 ShadowboltTimer; + uint64 SkeletonGUID[5]; + bool Skeletons; + bool Heroic; + bool RespawnSkeletons; + + void Reset() + { + ShadowboltTimer = 0; + Skeletons = false; + + ShatterFrostTomb = false; + + ResetTimer(); + + if (pInstance) + pInstance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + DoScriptText(SAY_KILL, m_creature); + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (Heroic && !ShatterFrostTomb) + { + AchievementEntry const *AchievOnTheRocks = GetAchievementStore()->LookupEntry(ACHIEVEMENT_ON_THE_ROCKS); + if (AchievOnTheRocks) + { + Map* pMap = m_creature->GetMap(); + if (pMap && pMap->IsDungeon()) + { + Map::PlayerList const &players = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + itr->getSource()->CompletedAchievement(AchievOnTheRocks); + } + } + } + + if (pInstance) + pInstance->SetData(DATA_PRINCEKELESETH_EVENT, DONE); + } + + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + + if (pInstance) + pInstance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS); + } + + void ResetTimer(uint32 inc = 0) + { + SummonSkeletonsTimer = 5000 + inc; + FrostTombTimer = 28000 + inc; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ShadowboltTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + m_creature->CastSpell(target, Heroic ? SPELL_SHADOWBOLT_HEROIC : SPELL_SHADOWBOLT, true); + ShadowboltTimer = 10000; + }else ShadowboltTimer -= diff; + + if (!Skeletons) + if ((SummonSkeletonsTimer < diff)) + { + Creature* Skeleton; + DoScriptText(SAY_SKELETONS, m_creature); + for(uint8 i = 0; i < 5; ++i) + { + Skeleton = m_creature->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1] , SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); + if (Skeleton) + { + Skeleton->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + Skeleton->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY() , m_creature->GetPositionZ()); + Skeleton->AddThreat(m_creature->getVictim(), 0.0f); + DoZoneInCombat(Skeleton); + } + } + Skeletons = true; + }else SummonSkeletonsTimer -= diff; + + if (FrostTombTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + { + //DoCast(target, SPELL_FROST_TOMB_SUMMON, true); + Creature* Chains = m_creature->SummonCreature(CREATURE_FROSTTOMB, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000); + if (Chains) + { + CAST_AI(mob_frost_tombAI, Chains->AI())->SetPrisoner(target); + Chains->CastSpell(target, SPELL_FROST_TOMB, true); + + DoScriptText(SAY_FROST_TOMB, m_creature); + } + } + FrostTombTimer = 15000; + }else FrostTombTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL mob_vrykul_skeletonAI : public ScriptedAI +{ + mob_vrykul_skeletonAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + uint32 Respawn_Time; + uint64 Target_Guid; + uint32 Decrepify_Timer; + + bool isDead; + + void Reset() + { + Respawn_Time = 12000; + Decrepify_Timer = 10000 + rand()%20000; + isDead = false; + } + + void EnterCombat(Unit *who){} + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetGUID() == m_creature->GetGUID()) + return; + + if (damage >= m_creature->GetHealth()) + { + PretendToDie(); + damage = 0; + } + } + + + void PretendToDie() + { + isDead = true; + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->GetMotionMaster()->MovementExpired(false); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + }; + + void Resurrect() + { + isDead = false; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->CastSpell(m_creature,SPELL_SCOURGE_RESSURRECTION,true); + + if (m_creature->getVictim()) + { + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + m_creature->AI()->AttackStart(m_creature->getVictim()); + } + else + m_creature->GetMotionMaster()->Initialize(); + }; + + void UpdateAI(const uint32 diff) + { + if (pInstance->GetData(DATA_PRINCEKELESETH_EVENT) == IN_PROGRESS) + { + if (isDead) + { + if (Respawn_Time < diff) + { + Resurrect(); + Respawn_Time = 12000; + }else Respawn_Time -= diff; + } + else + { + if (!UpdateVictim()) + return; + + if (Decrepify_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_DECREPIFY); + Decrepify_Timer = 30000; + }else Decrepify_Timer -= diff; + + DoMeleeAttackIfReady(); + } + }else + { + if (m_creature->isAlive()) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + + } +}; + +CreatureAI* GetAI_mob_frost_tomb(Creature* pCreature) +{ + return new mob_frost_tombAI(pCreature); +} + +CreatureAI* GetAI_boss_keleseth(Creature* pCreature) +{ + return new boss_kelesethAI (pCreature); +} + +CreatureAI* GetAI_mob_vrykul_skeleton(Creature* pCreature) +{ + return new mob_vrykul_skeletonAI (pCreature); +} + +void AddSC_boss_keleseth() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_keleseth"; + newscript->GetAI = &GetAI_boss_keleseth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_frost_tomb"; + newscript->GetAI = &GetAI_mob_frost_tomb; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_vrykul_skeleton"; + newscript->GetAI = &GetAI_mob_vrykul_skeleton; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp new file mode 100644 index 00000000000..49811125594 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp @@ -0,0 +1,397 @@ +/* + * 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_Skarvald_Dalronn +SD%Complete: 95 +SDComment: Needs adjustments to blizzlike timers, Yell Text + Sound to DB +SDCategory: Utgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "def_utgarde_keep.h" + +enum +{ + YELL_SKARVALD_AGGRO = -1574011, + YELL_SKARVALD_DAL_DIED = -1574012, + YELL_SKARVALD_SKA_DIEDFIRST = -1574013, + YELL_SKARVALD_KILL = -1574014, + YELL_SKARVALD_DAL_DIEDFIRST = -1574015, + + YELL_DALRONN_AGGRO = -1574016, + YELL_DALRONN_SKA_DIED = -1574017, + YELL_DALRONN_DAL_DIEDFIRST = -1574018, + YELL_DALRONN_KILL = -1574019, + YELL_DALRONN_SKA_DIEDFIRST = -1574020, + +//Spells of Skarvald and his Ghost + MOB_SKARVALD_THE_CONSTRUCTOR = 24200, + SPELL_CHARGE = 43651, + SPELL_STONE_STRIKE = 48583, + SPELL_SUMMON_SKARVALD_GHOST = 48613, + MOB_SKARVALD_GHOST = 27390, +//Spells of Dalronn and his Ghost + MOB_DALRONN_THE_CONTROLLER = 24201, + SPELL_SHADOW_BOLT = 43649, + H_SPELL_SHADOW_BOLT = 59575, + H_SPELL_SUMMON_SKELETONS = 52611, + SPELL_DEBILITATE = 43650, + SPELL_SUMMON_DALRONN_GHOST = 48612, + MOB_DALRONN_GHOST = 27389 +}; + +struct TRINITY_DLL_DECL boss_skarvald_the_constructorAI : public ScriptedAI +{ + boss_skarvald_the_constructorAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + + bool ghost; + bool HeroicMode; + uint32 Charge_Timer; + uint32 StoneStrike_Timer; + uint32 Response_Timer; + uint32 Check_Timer; + bool Dalronn_isDead; + + void Reset() + { + Charge_Timer = 5000; + StoneStrike_Timer = 10000; + Dalronn_isDead = false; + Check_Timer = 5000; + + ghost = (m_creature->GetEntry() == MOB_SKARVALD_GHOST); + if (!ghost) + { + Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); + if (dalronn && dalronn->isDead()) + CAST_CRE(dalronn)->Respawn(); + + if (pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED); + } + } + + void EnterCombat(Unit *who) + { + if (!ghost) + { + DoScriptText(YELL_SKARVALD_AGGRO,m_creature); + + Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); + if (dalronn && dalronn->isAlive() && !dalronn->getVictim()) + dalronn->getThreatManager().addThreat(who,0.0f); + + if (pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* Killer) + { + if (!ghost) + { + Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); + if (dalronn) + { + if (dalronn->isDead()) + { + DoScriptText(YELL_SKARVALD_DAL_DIED,m_creature); + + if (pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE); + } + else + { + DoScriptText(YELL_SKARVALD_SKA_DIEDFIRST,m_creature); + + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + //DoCast(m_creature,SPELL_SUMMON_SKARVALD_GHOST,true); + Creature* temp = m_creature->SummonCreature(MOB_SKARVALD_GHOST,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000); + if (temp) + { + temp->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); + temp->AI()->AttackStart(Killer); + } + } + } + } + } + + void KilledUnit(Unit *victim) + { + if (!ghost) + { + DoScriptText(YELL_SKARVALD_KILL,m_creature); + } + } + + void UpdateAI(const uint32 diff) + { + if (ghost) + { + if (pInstance->GetData(DATA_SKARVALD_DALRONN_EVENT) != IN_PROGRESS) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + if (!UpdateVictim()) + return; + + if (!ghost) + { + if (Check_Timer) + if (Check_Timer < diff) + { + Check_Timer = 5000; + Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); + if (dalronn && dalronn->isDead()) + { + Dalronn_isDead = true; + Response_Timer = 2000; + Check_Timer = 0; + } + }else Check_Timer -= diff; + + if (Response_Timer) + if (Dalronn_isDead) + if (Response_Timer < diff) + { + DoScriptText(YELL_SKARVALD_DAL_DIEDFIRST,m_creature); + + Response_Timer = 0; + }else Response_Timer -= diff; + } + + if (Charge_Timer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_CHARGE); + Charge_Timer = 5000+rand()%5000; + }else Charge_Timer -= diff; + + if (StoneStrike_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_STONE_STRIKE); + StoneStrike_Timer = 5000+rand()%5000; + }else StoneStrike_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_skarvald_the_constructor(Creature* pCreature) +{ + return new boss_skarvald_the_constructorAI (pCreature); +} + +struct TRINITY_DLL_DECL boss_dalronn_the_controllerAI : public ScriptedAI +{ + boss_dalronn_the_controllerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + + bool ghost; + bool HeroicMode; + uint32 ShadowBolt_Timer; + uint32 Debilitate_Timer; + uint32 Summon_Timer; + + uint32 Response_Timer; + uint32 Check_Timer; + uint32 AggroYell_Timer; + bool Skarvald_isDead; + + + void Reset() + { + ShadowBolt_Timer = 1000; + Debilitate_Timer = 5000; + Summon_Timer = 10000; + Check_Timer = 5000; + Skarvald_isDead = false; + AggroYell_Timer = 0; + + ghost = m_creature->GetEntry() == MOB_DALRONN_GHOST; + if (!ghost) + { + Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); + if (skarvald && skarvald->isDead()) + CAST_CRE(skarvald)->Respawn(); + + if (pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED); + } + } + + void EnterCombat(Unit *who) + { + if (!ghost) + { + Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); + if (skarvald && skarvald->isAlive() && !skarvald->getVictim()) + skarvald->getThreatManager().addThreat(who,0.0f); + + AggroYell_Timer = 5000; + + if (pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* Killer) + { + if (!ghost) + { + Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); + if (skarvald) + if (skarvald->isDead()) + { + DoScriptText(YELL_DALRONN_SKA_DIED,m_creature); + + if (pInstance) + pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE); + } + else + { + DoScriptText(YELL_DALRONN_DAL_DIEDFIRST,m_creature); + + m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + //DoCast(m_creature,SPELL_SUMMON_DALRONN_GHOST,true); + Creature* temp = m_creature->SummonCreature(MOB_DALRONN_GHOST,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000); + if (temp) + { + temp->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); + temp->AI()->AttackStart(Killer); + } + } + } + } + + void KilledUnit(Unit *victim) + { + if (!ghost) + { + DoScriptText(YELL_DALRONN_KILL,m_creature); + } + } + + void UpdateAI(const uint32 diff) + { + if (ghost) + { + if (pInstance->GetData(DATA_SKARVALD_DALRONN_EVENT) != IN_PROGRESS) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + if (!UpdateVictim()) + return; + + if (AggroYell_Timer) + if (AggroYell_Timer < diff) + { + DoScriptText(YELL_DALRONN_AGGRO,m_creature); + + AggroYell_Timer = 0; + }else AggroYell_Timer -= diff; + + if (!ghost) + { + if (Check_Timer) + if (Check_Timer < diff) + { + Check_Timer = 5000; + Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); + if (skarvald && skarvald->isDead()) + { + Skarvald_isDead = true; + Response_Timer = 2000; + Check_Timer = 0; + } + }else Check_Timer -= diff; + + if (Response_Timer) + if (Skarvald_isDead) + if (Response_Timer < diff) + { + DoScriptText(YELL_DALRONN_SKA_DIEDFIRST,m_creature); + + Response_Timer = 0; + }else Response_Timer -= diff; + } + + if (ShadowBolt_Timer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT); + ShadowBolt_Timer = 1000; + } + }else ShadowBolt_Timer -= diff; + + if (Debilitate_Timer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),SPELL_DEBILITATE); + Debilitate_Timer = 5000+rand()%5000; + } + }else Debilitate_Timer -= diff; + + if (HeroicMode) + if (Summon_Timer < diff) + { + DoCast(m_creature,H_SPELL_SUMMON_SKELETONS); + Summon_Timer = (rand()%10000) + 20000; + }else Summon_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_dalronn_the_controller(Creature* pCreature) +{ + return new boss_dalronn_the_controllerAI (pCreature); +} + +void AddSC_boss_skarvald_dalronn() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_skarvald_the_constructor"; + newscript->GetAI = &GetAI_boss_skarvald_the_constructor; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_dalronn_the_controller"; + newscript->GetAI = &GetAI_boss_dalronn_the_controller; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/def_utgarde_keep.h b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/def_utgarde_keep.h new file mode 100644 index 00000000000..b630e156564 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/def_utgarde_keep.h @@ -0,0 +1,35 @@ +/* + * 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 + */ + +#ifndef DEF_UTGARDE_KEEP_H +#define DEF_UTGARDE_KEEP_H + +#define DATA_PRINCEKELESETH 1 +#define DATA_SKARVALD 3 +#define DATA_DALRONN 4 +#define DATA_INGVAR 6 + +#define DATA_PRINCEKELESETH_EVENT 2 +#define DATA_SKARVALD_DALRONN_EVENT 5 +#define DATA_INGVAR_EVENT 7 + +#define EVENT_FORGE_1 8 +#define EVENT_FORGE_2 9 +#define EVENT_FORGE_3 10 + +#endif diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp new file mode 100644 index 00000000000..4c7668970da --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp @@ -0,0 +1,291 @@ +/* + * 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: Instance_Utgarde_Keep +SD%Complete: 90 +SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Utgarde Keep Scripts +SDCategory: Utgarde Keep +EndScriptData */ + +#include "precompiled.h" +#include "def_utgarde_keep.h" + +#define MAX_ENCOUNTER 3 + +#define ENTRY_BELLOW_1 186688 +#define ENTRY_BELLOW_2 186689 +#define ENTRY_BELLOW_3 186690 + +#define ENTRY_FORGEFIRE_1 186692 +#define ENTRY_FORGEFIRE_2 186693 +#define ENTRY_FORGEFIRE_3 186691 + +#define ENTRY_GLOWING_ANVIL_1 186609 +#define ENTRY_GLOWING_ANVIL_2 186610 +#define ENTRY_GLOWING_ANVIL_3 186611 + +/* Utgarde Keep encounters: +0 - Prince Keleseth +1 - Skarvald Dalronn +2 - Ingvar the Plunderer +*/ + +struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance +{ + instance_utgarde_keep(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 Keleseth; + uint64 Skarvald; + uint64 Dalronn; + uint64 Ingvar; + + uint64 forge_bellow[3]; + uint64 forge_fire[3]; + uint64 forge_anvil[3]; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + Keleseth = 0; + Skarvald = 0; + Dalronn =0; + Ingvar =0; + + for(uint8 i= 0; i < 3; ++i) + { + forge_bellow[i] = 0; + forge_fire[i] = 0; + forge_anvil[i] = 0; + } + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 23953: Keleseth = pCreature->GetGUID(); break; + case 24201: Dalronn = pCreature->GetGUID(); break; + case 24200: Skarvald = pCreature->GetGUID(); break; + case 23954: Ingvar = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + //door and object id + case ENTRY_BELLOW_1: forge_bellow[0] = pGo->GetGUID(); break; + case ENTRY_BELLOW_2: forge_bellow[1] = pGo->GetGUID(); break; + case ENTRY_BELLOW_3: forge_bellow[2] = pGo->GetGUID(); break; + case ENTRY_FORGEFIRE_1: forge_fire[0] = pGo->GetGUID(); break; + case ENTRY_FORGEFIRE_2: forge_fire[1] = pGo->GetGUID(); break; + case ENTRY_FORGEFIRE_3: forge_fire[2] = pGo->GetGUID(); break; + case ENTRY_GLOWING_ANVIL_1: forge_anvil[0] = pGo->GetGUID(); break; + case ENTRY_GLOWING_ANVIL_2: forge_anvil[1] = pGo->GetGUID(); break; + case ENTRY_GLOWING_ANVIL_3: forge_anvil[2] = pGo->GetGUID(); break; + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_PRINCEKELESETH: return Keleseth; + case DATA_DALRONN: return Dalronn; + case DATA_SKARVALD: return Skarvald; + case DATA_INGVAR: return Ingvar; + } + + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_PRINCEKELESETH_EVENT: + if (data == DONE) + { + //HandleGameObject(doorname, 0); + } + m_auiEncounter[0] = data; + break; + case DATA_SKARVALD_DALRONN_EVENT: + if (data == DONE) + { + //HandleGameObject(doorname, 0); + } + m_auiEncounter[1] = data; + break; + case DATA_INGVAR_EVENT: + if (data == DONE) + { + //HandleGameObject(doorname, 0); + } + m_auiEncounter[2] = data; + break; + case EVENT_FORGE_1: + if (data == NOT_STARTED) + { + HandleGameObject(forge_bellow[0],false); + HandleGameObject(forge_fire[0],false); + HandleGameObject(forge_anvil[0],false); + }else + { + HandleGameObject(forge_bellow[0],true); + HandleGameObject(forge_fire[0],true); + HandleGameObject(forge_anvil[0],true); + } + break; + case EVENT_FORGE_2: + if (data == NOT_STARTED) + { + HandleGameObject(forge_bellow[1],false); + HandleGameObject(forge_fire[1],false); + HandleGameObject(forge_anvil[1],false); + }else + { + HandleGameObject(forge_bellow[1],true); + HandleGameObject(forge_fire[1],true); + HandleGameObject(forge_anvil[1],true); + } + break; + case EVENT_FORGE_3: + if (data == NOT_STARTED) + { + HandleGameObject(forge_bellow[2],false); + HandleGameObject(forge_fire[2],false); + HandleGameObject(forge_anvil[2],false); + }else + { + HandleGameObject(forge_bellow[2],true); + HandleGameObject(forge_fire[2],true); + HandleGameObject(forge_anvil[2],true); + } + break; + } + + + if (data == DONE) + { + SaveToDB(); + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_PRINCEKELESETH_EVENT: return m_auiEncounter[0]; + case DATA_SKARVALD_DALRONN_EVENT: return m_auiEncounter[1]; + case DATA_INGVAR_EVENT: return m_auiEncounter[2]; + } + + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << "U K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2]; + + str_data = saveStream.str(); + + OUT_SAVE_INST_DATA_COMPLETE; + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + char dataHead1, dataHead2; + uint16 data0,data1,data2; + + std::istringstream loadStream(in); + loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2; + + if (dataHead1 == 'U' && dataHead2 == 'K') + { + m_auiEncounter[0] = data0; + m_auiEncounter[1] = data1; + m_auiEncounter[2] = data2; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + }else OUT_LOAD_INST_DATA_FAIL; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_utgarde_keep(Map* pMap) +{ + return new instance_utgarde_keep(pMap); +} + +void AddSC_instance_utgarde_keep() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_utgarde_keep"; + newscript->GetInstanceData = &GetInstanceData_instance_utgarde_keep; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp new file mode 100644 index 00000000000..d82e45f28d4 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_keep/utgarde_keep.cpp @@ -0,0 +1,160 @@ +/* + * 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 "precompiled.h" +#include "def_utgarde_keep.h" + +uint32 entry_search[3] = +{ + 186609, + 186610, + 186611 +}; + +struct TRINITY_DLL_DECL npc_dragonflayer_forge_masterAI : public ScriptedAI +{ + npc_dragonflayer_forge_masterAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + fm_Type = 0; + } + + ScriptedInstance* pInstance; + uint8 fm_Type; + + void Reset() + { + if (fm_Type == 0) fm_Type = GetForgeMasterType(); + CheckForge(); + } + + void CheckForge() + { + if (pInstance) + { + switch(fm_Type) + { + case 1: + pInstance->SetData(EVENT_FORGE_1,m_creature->isAlive() ? NOT_STARTED : DONE); + break; + case 2: + pInstance->SetData(EVENT_FORGE_2,m_creature->isAlive() ? NOT_STARTED : DONE); + break; + case 3: + pInstance->SetData(EVENT_FORGE_3,m_creature->isAlive() ? NOT_STARTED : DONE); + break; + } + } + } + + void JustDied(Unit *killer) + { + if (fm_Type == 0) fm_Type = GetForgeMasterType(); + if (pInstance) + { + switch(fm_Type) + { + case 1: + pInstance->SetData(EVENT_FORGE_1,DONE); + break; + case 2: + pInstance->SetData(EVENT_FORGE_2,DONE); + break; + case 3: + pInstance->SetData(EVENT_FORGE_3,DONE); + break; + } + } + } + + void EnterCombat(Unit *who) + { + if (fm_Type == 0) fm_Type = GetForgeMasterType(); + if (pInstance) + { + switch(fm_Type) + { + case 1: + pInstance->SetData(EVENT_FORGE_1,IN_PROGRESS); + break; + case 2: + pInstance->SetData(EVENT_FORGE_2,IN_PROGRESS); + break; + case 3: + pInstance->SetData(EVENT_FORGE_3,IN_PROGRESS); + break; + } + } + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE ,EMOTE_ONESHOT_NONE); + } + + uint8 GetForgeMasterType() + { + float diff = 30.0f; + int near_f = 0; + + for(uint8 i = 0; i < 3 ; ++i) + { + GameObject* temp; + temp = m_creature->FindNearestGameObject(entry_search[i],30); + if (temp) + { + if (m_creature->IsWithinDist(temp,diff,false)) + { + near_f = i + 1; + diff = m_creature->GetDistance2d(temp); + + } + } + } + + switch (near_f) + { + case 1: return 1; + case 2: return 2; + case 3: return 3; + default: return 0; + } + } + + void UpdateAI(const uint32 diff) + { + if (fm_Type == 0) + fm_Type = GetForgeMasterType(); + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_dragonflayer_forge_master(Creature* pCreature) +{ + return new npc_dragonflayer_forge_masterAI(pCreature); +} + +void AddSC_utgarde_keep() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_dragonflayer_forge_master"; + newscript->GetAI = &GetAI_npc_dragonflayer_forge_master; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp new file mode 100644 index 00000000000..503cae94f4d --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp @@ -0,0 +1,78 @@ +/* Script Data Start +SDName: Boss palehoof +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_palehoof' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCING_SMASH 48260 +#define SPELL_IMPALE 48261 +#define SPELL_WITHERING_ROAR 48256 + +//Yell +#define SAY_AGGRO -1575000 +#define SAY_SLAY_1 -1575001 +#define SAY_SLAY_2 -1575002 +#define SAY_DEATH -1575003 + +struct TRINITY_DLL_DECL boss_palehoofAI : public ScriptedAI +{ + boss_palehoofAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + + switch(rand()%2) + { + case 0: + DoScriptText(SAY_SLAY_1, m_creature); + break; + case 1: + DoScriptText(SAY_SLAY_2, m_creature); + break; + } + } +}; + +CreatureAI* GetAI_boss_palehoof(Creature* pCreature) +{ + return new boss_palehoofAI (pCreature); +} + +void AddSC_boss_palehoof() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_palehoof"; + newscript->GetAI = &GetAI_boss_palehoof; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp new file mode 100644 index 00000000000..f21ae75318a --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp @@ -0,0 +1,89 @@ +/* Script Data Start +SDName: Boss skadi +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_skadi' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Phase 0 "gauntlet even" Skadi on a flying mount, waves of adds charging to the group periodicaly carrying harpoons +//Phase 1 Kill the Skadi drake mount with harppons launcher +//Phase 2 Kill the Skadi + +//Skadi Spells +#define SPELL_CRUSH 50234 +#define SPELL_POISONED_SPEAR 50225 +#define SPELL_WHIRLWIND 50228 //random target, but not the tank approx. every 20s + +//Yell +#define SAY_AGGRO -1575004 +#define SAY_KILL_1 -1575005 +#define SAY_KILL_2 -1575006 +#define SAY_KILL_3 -1575007 +#define SAY_DEATH -1575008 +#define SAY_DRAKE_DEATH -1575009 +#define SAY_DRAKE_HIT_1 -1575010 +#define SAY_DRAKE_HIT_2 -1575011 +#define SAY_DRAKE_BREATH_1 -1575012 +#define SAY_DRAKE_BREATH_2 -1575013 +#define SAY_DRAKE_BREATH_3 -1575014 + +struct TRINITY_DLL_DECL boss_skadiAI : public ScriptedAI +{ + boss_skadiAI(Creature *c) : ScriptedAI(c) {} + + uint32 phase; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + phase = 0; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_KILL_1, m_creature);break; + case 1: DoScriptText(SAY_KILL_2, m_creature);break; + case 2: DoScriptText(SAY_KILL_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_skadi(Creature* pCreature) +{ + return new boss_skadiAI (pCreature); +} + +void AddSC_boss_skadi() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_skadi"; + newscript->GetAI = &GetAI_boss_skadi; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp new file mode 100644 index 00000000000..e43d0cd9d4d --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_svala.cpp @@ -0,0 +1,83 @@ +/* Script Data Start +SDName: Boss svala +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_svala' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CALL_FLAMES 48258 +#define SPELL_RITUAL_OF_THE_SWORD 48276 //Effect #1 Teleport, Effect #2 Dummy +#define SPELL_SINSTER_STRIKE 15667 + +//Yells +#define SAY_DIALOG_WITH_ARTHAS_1 -1575015 +#define SAY_DIALOG_WITH_ARTHAS_2 -1575016 +#define SAY_DIALOG_WITH_ARTHAS_3 -1575017 +#define SAY_AGGRO -1575018 +#define SAY_SLAY_1 -1575019 +#define SAY_SLAY_2 -1575020 +#define SAY_SLAY_3 -1575021 +#define SAY_DEATH -1575022 +#define SAY_SACRIFICE_PLAYER_1 -1575023 +#define SAY_SACRIFICE_PLAYER_2 -1575024 +#define SAY_SACRIFICE_PLAYER_3 -1575025 +#define SAY_SACRIFICE_PLAYER_4 -1575026 +#define SAY_SACRIFICE_PLAYER_5 -1575027 + +struct TRINITY_DLL_DECL boss_svalaAI : public ScriptedAI +{ + boss_svalaAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_svala(Creature* pCreature) +{ + return new boss_svalaAI (pCreature); +} + +void AddSC_boss_svala() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_svala"; + newscript->GetAI = &GetAI_boss_svala; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp new file mode 100644 index 00000000000..43a16a78db4 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp @@ -0,0 +1,85 @@ +/* Script Data Start +SDName: Boss ymiron +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = 'boss_ymiron' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_BANE 48294 +#define SPELL_DARK_SLASH 48292 +#define SPELL_FETID_ROT 48291 +#define SPELL_SCREAMS_OF_THE_DEAD 51750 +#define SPELL_SPIRIT_BURST 48529 +#define SPELL_SPIRIT_STRIKE 48423 +//every 20% stuns the party and runs to a boat + +//Yell +#define SAY_AGGRO -1575028 +#define SAY_SLAY_1 -1575029 +#define SAY_SLAY_2 -1575030 +#define SAY_SLAY_3 -1575031 +#define SAY_SLAY_4 -1575032 +#define SAY_DEATH -1575033 +#define SAY_SUMMON_BJORN -1575034 +#define SAY_SUMMON_HALDOR -1575035 +#define SAY_SUMMON_RANULF -1575036 +#define SAY_SUMMON_TORGYN -1575037 + +struct TRINITY_DLL_DECL boss_ymironAI : public ScriptedAI +{ + boss_ymironAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%4) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + case 3: DoScriptText(SAY_SLAY_4, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_ymiron(Creature* pCreature) +{ + return new boss_ymironAI (pCreature); +} + +void AddSC_boss_ymiron() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_ymiron"; + newscript->GetAI = &GetAI_boss_ymiron; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/def_pinnacle.h b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/def_pinnacle.h new file mode 100644 index 00000000000..82e2173fab5 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/def_pinnacle.h @@ -0,0 +1,4 @@ +#ifndef DEF_PINNACLE_H +#define DEF_PINNACLE_H + +#endif diff --git a/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp new file mode 100644 index 00000000000..e1361c8960e --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_pinnacle.h" + +struct TRINITY_DLL_DECL instance_pinnacle : public ScriptedInstance +{ + instance_pinnacle(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_pinnacle(Map* pMap) +{ + return new instance_pinnacle(pMap); +} + +void AddSC_instance_pinnacle() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_pinnacle"; + newscript->GetInstanceData = &GetInstanceData_instance_pinnacle; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_archavon.cpp b/src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_archavon.cpp new file mode 100644 index 00000000000..2a0e7fcd007 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_archavon.cpp @@ -0,0 +1,199 @@ +/*** SQL START *** +UPDATE `creature_template` SET `ScriptName`='boss_archavon' WHERE `entry`='31125'; +UPDATE `creature_template` SET `ScriptName`='mob_archavon_warder' WHERE `entry`='32353'; +*** SQL END ***/ +#include "precompiled.h" +#include "def_vault_of_archavon.h" + +#define EMOTE_BERSERK -1590002 + +//Spells Archavon +#define SPELL_ROCK_SHARDS 58678 +#define SPELL_CRUSHING_LEAP HEROIC(58960,60894)//Instant (10-80yr range) -- Leaps at an enemy, inflicting 8000 Physical damage, knocking all nearby enemies away, and creating a cloud of choking debris. +#define SPELL_STOMP HEROIC(58663,60880) +#define SPELL_IMPALE HEROIC(58666,60882) //Lifts an enemy off the ground with a spiked fist, inflicting 47125 to 52875 Physical damage and 9425 to 10575 additional damage each second for 8 sec. +#define SPELL_BERSERK 47008 +//Spells Archavon Warders +#define SPELL_ROCK_SHOWER HEROIC(60919,60923) +#define SPELL_SHIELD_CRUSH HEROIC(60897,60899) +#define SPELL_WHIRL HEROIC(60902,60916) + +//4 Warders spawned +#define ARCHAVON_WARDER 32353 //npc 32353 + +//Yell +#define SAY_LEAP "Archavon the Stone Watcher lunges for $N!" //$N should be the target + +#define EVENT_ROCK_SHARDS 1 //15s cd +#define EVENT_CHOKING_CLOUD 2 //30s cd +#define EVENT_STOMP 3 //45s cd +#define EVENT_IMPALE 4 +#define EVENT_BERSERK 5 //300s cd + +//mob +#define EVENT_ROCK_SHOWER 5 //set = 20s cd,unkown cd +#define EVENT_SHIELD_CRUSH 6 //set = 30s cd +#define EVENT_WHIRL 8 //set= 10s cd + +struct TRINITY_DLL_DECL boss_archavonAI : public ScriptedAI +{ + boss_archavonAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + EventMap events; + + void Reset() + { + events.Reset(); + + if (pInstance) + pInstance->SetData(DATA_ARCHAVON_EVENT, NOT_STARTED); + } + + void KilledUnit(Unit* Victim){} + + void JustDied(Unit* Killer) + { + if (pInstance) + pInstance->SetData(DATA_ARCHAVON_EVENT, DONE); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000); + events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000); + events.ScheduleEvent(EVENT_STOMP, 45000); + events.ScheduleEvent(EVENT_BERSERK, 300000); + + if (pInstance) + pInstance->SetData(DATA_ARCHAVON_EVENT, IN_PROGRESS); + } + + // Below UpdateAI may need review/debug. + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + events.Update(diff); + + if (me->hasUnitState(UNIT_STAT_CASTING)) + return; + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_ROCK_SHARDS: + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_ROCK_SHARDS); + events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000); + return; + case EVENT_CHOKING_CLOUD: + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_CRUSHING_LEAP, true); //10y~80y, ignore range + events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000); + return; + case EVENT_STOMP: + DoCast(me->getVictim(), SPELL_STOMP); + events.ScheduleEvent(EVENT_IMPALE, 3000); + events.ScheduleEvent(EVENT_STOMP, 45000); + return; + case EVENT_IMPALE: + DoCast(me->getVictim(), SPELL_IMPALE); + return; + case EVENT_BERSERK: + DoCast(m_creature, SPELL_BERSERK); + DoScriptText(EMOTE_BERSERK, m_creature); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +/*###### +## Mob Archavon Warder +######*/ +struct TRINITY_DLL_DECL mob_warderAI : public ScriptedAI //npc 32353 +{ + mob_warderAI(Creature *c) : ScriptedAI(c) {} + + EventMap events; + + void Reset() + { + events.Reset(); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + events.ScheduleEvent(EVENT_ROCK_SHOWER, 2000); + events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000); + events.ScheduleEvent(EVENT_WHIRL, 7500); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_ROCK_SHOWER: + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_ROCK_SHOWER); + events.ScheduleEvent(EVENT_ROCK_SHARDS, 6000); + return; + } + case EVENT_SHIELD_CRUSH: + DoCast(m_creature->getVictim(), SPELL_SHIELD_CRUSH); + events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000); + return; + case EVENT_WHIRL: + DoCast(m_creature->getVictim(), SPELL_WHIRL); + events.ScheduleEvent(EVENT_WHIRL, 8000); + return; + } + } + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_warder(Creature* pCreature) +{ + return new mob_warderAI (pCreature); +} + +CreatureAI* GetAI_boss_archavon(Creature* pCreature) +{ + return new boss_archavonAI (pCreature); +} + +void AddSC_boss_archavon() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_archavon"; + newscript->GetAI = &GetAI_boss_archavon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_archavon_warder"; + newscript->GetAI = &GetAI_mob_warder; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_emalon.cpp b/src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_emalon.cpp new file mode 100644 index 00000000000..94290a05007 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/vault_of_archavon/boss_emalon.cpp @@ -0,0 +1,275 @@ +#include "precompiled.h" +#include "def_vault_of_archavon.h" + +//Emalon spells +#define SPELL_CHAIN_LIGHTNING HEROIC(64213, 64215) +#define SPELL_LIGHTNING_NOVA HEROIC(64216, 65279) +#define SPELL_OVERCHARGE 64218 //Casted every 45 sec on a random Tempest Minion +#define SPELL_BERSERK 26662 + +//Tempest Minion spells +#define SPELL_SHOCK 64363 +#define SPELL_OVERCHARGED 64217 +#define SPELL_OVERCHARGED_BLAST 64219 //Casted when Overcharged reaches 10 stacks. Mob dies after that + +//Emotes +#define EMOTE_OVERCHARGE -1590000 +#define EMOTE_MINION_RESPAWN -1590001 +#define EMOTE_BERSERK -1590002 + +//Events +#define EVENT_CHAIN_LIGHTNING 1 +#define EVENT_LIGHTNING_NOVA 2 +#define EVENT_OVERCHARGE 3 +#define EVENT_BERSERK 4 +#define EVENT_SHOCK 5 + +//Creatures +#define MOB_TEMPEST_MINION 33998 + +float TempestMinions[4][5] = +{ + {33998, -203.980103, -281.287720, 91.650223, 1.598807}, + {33998, -233.489410, -281.139282, 91.652412, 1.598807}, + {33998, -233.267578, -297.104645, 91.681915, 1.598807}, + {33998, -203.842529, -297.097015, 91.745163, 1.598807} +}; + +/*###### +## Emalon the Storm Watcher +######*/ +struct TRINITY_DLL_DECL boss_emalonAI : public ScriptedAI +{ + boss_emalonAI(Creature *c) : ScriptedAI(c), summons(m_creature) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + EventMap events; + std::list MinionList; + SummonList summons; + + void Reset() + { + events.Reset(); + summons.DespawnAll(); + MinionList.clear(); + + Creature* Minion; + for (uint32 i = 0; i < 4; ++i) + { + Minion = m_creature->SummonCreature(((uint32)TempestMinions[i][0]),TempestMinions[i][1],TempestMinions[i][2],TempestMinions[i][3],TempestMinions[i][4],TEMPSUMMON_DEAD_DESPAWN, 0); + MinionList.push_back(Minion->GetGUID()); + if(Unit* target = m_creature->getVictim()) + Minion->AI()->AttackStart(target); + } + + if (pInstance) + pInstance->SetData(DATA_EMALON_EVENT, NOT_STARTED); + } + + void JustSummoned(Creature* summoned) + { + summons.Summon(summoned); + } + + void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} + + void JustDied(Unit* Killer) + { + summons.DespawnAll(); + + if (pInstance) + pInstance->SetData(DATA_EMALON_EVENT, DONE); + } + + void EnterCombat(Unit *who) + { + if(!MinionList.empty()) + { + for(std::list::const_iterator itr = MinionList.begin(); itr != MinionList.end(); ++itr) + { + Creature* Minion = (Unit::GetCreature(*m_creature, *itr)); + Minion->AI()->AttackStart(who); + } + } + + DoZoneInCombat(); + events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 5000); + events.ScheduleEvent(EVENT_LIGHTNING_NOVA, 40000); + events.ScheduleEvent(EVENT_BERSERK, 360000); + events.ScheduleEvent(EVENT_OVERCHARGE, 45000); + + if (pInstance) + pInstance->SetData(DATA_EMALON_EVENT, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + events.Update(diff); + + if(me->hasUnitState(UNIT_STAT_CASTING)) + return; + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_CHAIN_LIGHTNING: + if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_CHAIN_LIGHTNING); + events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 25000); + return; + case EVENT_LIGHTNING_NOVA: + DoCastAOE(SPELL_LIGHTNING_NOVA, false); + events.ScheduleEvent(EVENT_LIGHTNING_NOVA, 40000); + return; + case EVENT_OVERCHARGE: + if(Creature* Minion = GetClosestCreatureWithEntry(me, MOB_TEMPEST_MINION, 1000.0f)) + { + Minion->CastSpell(me, SPELL_OVERCHARGED, true); + Minion->SetHealth(Minion->GetMaxHealth()); + DoScriptText(EMOTE_OVERCHARGE, m_creature); + } + events.ScheduleEvent(EVENT_OVERCHARGE, 45000); + return; + case EVENT_BERSERK: + DoCast(m_creature, SPELL_BERSERK); + DoScriptText(EMOTE_BERSERK, m_creature); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +/*###### +## Tempest Minion +######*/ +struct TRINITY_DLL_DECL mob_tempest_minionAI : public ScriptedAI +{ + mob_tempest_minionAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + EmalonGUID = pInstance ? pInstance->GetData64(DATA_EMALON) : 0; + Emalon = Unit::GetCreature(*m_creature, EmalonGUID); + } + + ScriptedInstance* pInstance; + + EventMap events; + + uint64 EmalonGUID; + Creature* Emalon; + + uint32 OverchargedTimer; + + void Reset() + { + events.Reset(); + + OverchargedTimer = 0; + } + + void JustDied(Unit* Killer) + { + Creature* Emalon; + Emalon = Unit::GetCreature(*m_creature, EmalonGUID); + float x,y,z; + Emalon->GetPosition(x,y,z); + Emalon->SummonCreature(MOB_TEMPEST_MINION,x,y,z,m_creature->GetOrientation(),TEMPSUMMON_DEAD_DESPAWN,0); + DoScriptText(EMOTE_MINION_RESPAWN, m_creature); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + events.ScheduleEvent(EVENT_SHOCK, 20000); + + if(Emalon) + Emalon->AI()->AttackStart(who); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if(!UpdateVictim()) + return; + + events.Update(diff); + + if(me->hasUnitState(UNIT_STAT_CASTING)) + return; + + if(Aura *OverchargedAura = m_creature->GetAura(SPELL_OVERCHARGED)) + { + if(OverchargedAura->GetStackAmount() < 10) + { + if(OverchargedTimer < diff) + { + DoCast(me, SPELL_OVERCHARGED); + OverchargedTimer = 2000; + }else OverchargedTimer -=diff; + } + else + { + if(OverchargedAura->GetStackAmount() == 10) + { + DoCast(me,SPELL_OVERCHARGED_BLAST); + m_creature->setDeathState(JUST_DIED); + Creature* Emalon; + Emalon = Unit::GetCreature(*m_creature, EmalonGUID); + float x,y,z; + Emalon->GetPosition(x,y,z); + Emalon->SummonCreature(MOB_TEMPEST_MINION,x,y,z,m_creature->GetOrientation(),TEMPSUMMON_DEAD_DESPAWN,0); + DoScriptText(EMOTE_MINION_RESPAWN, m_creature); + } + } + } + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_SHOCK: + DoCast(me->getVictim(), SPELL_SHOCK); + events.ScheduleEvent(EVENT_SHOCK, 20000); + return; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_tempest_minion(Creature *_Creature) +{ + return new mob_tempest_minionAI (_Creature); +} + +CreatureAI* GetAI_boss_emalon(Creature *_Creature) +{ + return new boss_emalonAI (_Creature); +} + +void AddSC_boss_emalon() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_emalon"; + newscript->GetAI = &GetAI_boss_emalon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_tempest_minion"; + newscript->GetAI = &GetAI_mob_tempest_minion; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/vault_of_archavon/def_vault_of_archavon.h b/src/bindings/scripts/scripts/northrend/vault_of_archavon/def_vault_of_archavon.h new file mode 100644 index 00000000000..95c44035184 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/vault_of_archavon/def_vault_of_archavon.h @@ -0,0 +1,8 @@ +#ifndef DEF_ARCHAVON_H +#define DEF_ARCHAVON_H + +#define DATA_ARCHAVON_EVENT 1 +#define DATA_EMALON_EVENT 2 +#define DATA_EMALON 3 +#define DATA_ARCHAVON 4 +#endif diff --git a/src/bindings/scripts/scripts/northrend/vault_of_archavon/instance_vault_of_archavon.cpp b/src/bindings/scripts/scripts/northrend/vault_of_archavon/instance_vault_of_archavon.cpp new file mode 100644 index 00000000000..45d0a4be7ae --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/vault_of_archavon/instance_vault_of_archavon.cpp @@ -0,0 +1,124 @@ +#include "precompiled.h" +#include "def_vault_of_archavon.h" + +#define ENCOUNTERS 2 + +/* Vault of Archavon encounters: +1 - Archavon the Stone Watcher event +2 - Emalon the Storm Watcher event +*/ + +struct TRINITY_DLL_DECL instance_archavon : public ScriptedInstance +{ + instance_archavon(Map *Map) : ScriptedInstance(Map) {Initialize();}; + + uint32 Encounters[ENCOUNTERS]; + + uint64 Archavon; + uint64 Emalon; + + void Initialize() + { + Archavon = 0; + Emalon = 0; + + for(uint8 i = 0; i < ENCOUNTERS; i++) + Encounters[i] = NOT_STARTED; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < ENCOUNTERS; i++) + if(Encounters[i] == IN_PROGRESS) return true; + + return false; + } + + void OnCreatureCreate(Creature *creature, bool add) + { + switch(creature->GetEntry()) + { + case 31125: Archavon = creature->GetGUID(); break; + case 33993: Emalon = creature->GetGUID(); break; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_ARCHAVON_EVENT: return Encounters[0]; + case DATA_EMALON_EVENT: return Encounters[1]; + } + return 0; + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_ARCHAVON: return Archavon; + case DATA_EMALON: return Emalon; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_ARCHAVON_EVENT: Encounters[0] = data; break; + case DATA_EMALON_EVENT: Encounters[1] = data; break; + } + + if(data == DONE) + SaveToDB(); + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << Encounters[0] << " " << Encounters[1]; + char* out = new char[stream.str().length() + 1]; + strcpy(out, stream.str().c_str()); + if(out) + { + OUT_SAVE_INST_DATA_COMPLETE; + return out; + } + + return NULL; + } + + void Load(const char* in) + { + if(!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + std::istringstream stream(in); + stream >> Encounters[0] >> Encounters[1]; + for(uint8 i = 0; i < ENCOUNTERS; ++i) + if(Encounters[i] == IN_PROGRESS) + Encounters[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_archavon(Map* map) +{ + return new instance_archavon(map); +} + +void AddSC_instance_archavon() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_archavon"; + newscript->GetInstanceData = &GetInstanceData_instance_archavon; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/boss_cyanigosa.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/boss_cyanigosa.cpp new file mode 100644 index 00000000000..13ad8c27a75 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/boss_cyanigosa.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss cyanigosa +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_VACUM 58694 +#define SPELL_BLIZZARD 58693 +#define SPELL_MANA_DESTRUCTION 59374 +#define SPELL_TAIL_SWEEP 58690 +#define SPELL_UNCONTROLLABLE_ENERGY 58688 + +//Yells +#define SAY_AGGRO -1608000 +#define SAY_SLAY_1 -1608001 +#define SAY_SLAY_2 -1608002 +#define SAY_SLAY_3 -1608003 +#define SAY_DEATH -1608004 +#define SAY_SPAWN -1608005 +#define SAY_DISRUPTION -1608006 +#define SAY_BREATH_ATTACK -1608007 +#define SAY_SPECIAL_ATTACK_1 -1608008 +#define SAY_SPECIAL_ATTACK_2 -1608009 + +struct TRINITY_DLL_DECL boss_cyanigosaAI : public ScriptedAI +{ + boss_cyanigosaAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_cyanigosa(Creature* pCreature) +{ + return new boss_cyanigosaAI (pCreature); +} + +void AddSC_boss_cyanigosa() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_cyanigosa"; + newscript->GetAI = &GetAI_boss_cyanigosa; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/boss_erekem.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/boss_erekem.cpp new file mode 100644 index 00000000000..d5f18ac806f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/boss_erekem.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss erekem +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_BLOODLUST 54516 +#define SPELL_BREAK_BONDS 59463 +#define SPELL_CHAIN_HEAL 54481 +#define SPELL_EARTH_SHIELD 54479 +#define SPELL_EARTH_SHOCK 54511 +#define SPELL_LIGHTNING_BOLT 53044 +#define SPELL_STORMSTRIKE 51876 + +//Yells +#define SAY_AGGRO -1608010 +#define SAY_SLAY_1 -1608011 +#define SAY_SLAY_2 -1608012 +#define SAY_SLAY_3 -1608013 +#define SAY_DEATH -1608014 +#define SAY_SPAWN -1608015 +#define SAY_ADD_KILED -1608016 +#define SAY_BOTH_ADDS_KILED -1608017 + +struct TRINITY_DLL_DECL boss_erekemAI : public ScriptedAI +{ + boss_erekemAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_erekem(Creature* pCreature) +{ + return new boss_erekemAI (pCreature); +} + +void AddSC_boss_erekem() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_erekem"; + newscript->GetAI = &GetAI_boss_erekem; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/boss_ichoron.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/boss_ichoron.cpp new file mode 100644 index 00000000000..60b1c656808 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/boss_ichoron.cpp @@ -0,0 +1,81 @@ +/* Script Data Start +SDName: Boss ichoron +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_DRAINED 59820 +#define SPELL_FRENZY 54312 +#define SPELL_PROTECTIVE_BUBBLE 54306 +#define SPELL_WATER_BLAST 54237 +#define SPELL_WATER_BOLT_VOLLEY 54241 + +//Yells +#define SAY_AGGRO -1608018 +#define SAY_SLAY_1 -1608019 +#define SAY_SLAY_2 -1608020 +#define SAY_SLAY_3 -1608021 +#define SAY_DEATH -1608022 +#define SAY_SPAWN -1608023 +#define SAY_ENRAGE -1608024 +#define SAY_SHATTER -1608025 +#define SAY_BUBBLE -1608026 + +struct TRINITY_DLL_DECL boss_ichoronAI : public ScriptedAI +{ + boss_ichoronAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_ichoron(Creature* pCreature) +{ + return new boss_ichoronAI (pCreature); +} + +void AddSC_boss_ichoron() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_ichoron"; + newscript->GetAI = &GetAI_boss_ichoron; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/boss_lavanthor.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/boss_lavanthor.cpp new file mode 100644 index 00000000000..430a8acb178 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/boss_lavanthor.cpp @@ -0,0 +1,52 @@ +/* Script Data Start +SDName: Boss lavanthor +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CAUTERIZING_FLAMES 59466 +#define SPELL_FIREBOLT 54235 +#define SPELL_FLAME_BREATH 54282 +#define SPELL_LAVA_BURN 54249 + +struct TRINITY_DLL_DECL boss_lavanthorAI : public ScriptedAI +{ + boss_lavanthorAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_lavanthor(Creature* pCreature) +{ + return new boss_lavanthorAI (pCreature); +} + +void AddSC_boss_lavanthor() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_lavanthor"; + newscript->GetAI = &GetAI_boss_lavanthor; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/boss_moragg.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/boss_moragg.cpp new file mode 100644 index 00000000000..fdc18a3c549 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/boss_moragg.cpp @@ -0,0 +1,50 @@ +/* Script Data Start +SDName: Boss moragg +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_CORROSICE_SALIVA 54527 +#define SPELL_OPTIC_LINK 54396 + +struct TRINITY_DLL_DECL boss_moraggAI : public ScriptedAI +{ + boss_moraggAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_boss_moragg(Creature* pCreature) +{ + return new boss_moraggAI (pCreature); +} + +void AddSC_boss_moragg() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_moragg"; + newscript->GetAI = &GetAI_boss_moragg; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/boss_xevozz.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/boss_xevozz.cpp new file mode 100644 index 00000000000..b59c4aec4e1 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/boss_xevozz.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss xevozz +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_ARCANE_BARRAGE_VOLLEY 54202 +#define SPELL_ARCANE_BUFFET 54226 +#define SPELL_SUMMON_ETHEREAL_SPHERE_1 54102 +#define SPELL_SUMMON_ETHEREAL_SPHERE_2 54137 +#define SPELL_SUMMON_ETHEREAL_SPHERE_3 54138 + +//Yells +#define SAY_AGGRO -1608027 +#define SAY_SLAY_1 -1608028 +#define SAY_SLAY_2 -1608029 +#define SAY_SLAY_3 -1608030 +#define SAY_DEATH -1608031 +#define SAY_SPAWN -1608032 +#define SAY_CHARGED -1608033 +#define SAY_REPEAT_SUMMON_1 -1608034 +#define SAY_REPEAT_SUMMON_2 -1608035 +#define SAY_SUMMON_ENERGY -1608036 + +struct TRINITY_DLL_DECL boss_xevozzAI : public ScriptedAI +{ + boss_xevozzAI(Creature *c) : ScriptedAI(c) {} + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_xevozz(Creature* pCreature) +{ + return new boss_xevozzAI (pCreature); +} + +void AddSC_boss_xevozz() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_xevozz"; + newscript->GetAI = &GetAI_boss_xevozz; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/boss_zuramat.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/boss_zuramat.cpp new file mode 100644 index 00000000000..218b5915bec --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/boss_zuramat.cpp @@ -0,0 +1,82 @@ +/* Script Data Start +SDName: Boss zuramat +SDAuthor: LordVanMartin +SD%Complete: +SDComment: +SDCategory: +Script Data End */ + +/*** SQL START *** +update creature_template set scriptname = '' where entry = ''; +*** SQL END ***/ +#include "precompiled.h" + +//Spells +#define SPELL_SHROUD_OF_DARKNESS 54524 +#define SPELL_SUMMON_VOID_SENTRY 54524 +#define SPELL_VOID_SHIFT 54524 + +#define NPC_VOID_SENTRY 29364 + +//Yells +#define SAY_AGGRO -1608037 +#define SAY_SLAY_1 -1608038 +#define SAY_SLAY_2 -1608039 +#define SAY_SLAY_3 -1608040 +#define SAY_DEATH -1608041 +#define SAY_SPAWN -1608042 +#define SAY_SHIELD -1608043 +#define SAY_WHISPER -1608044 + +struct TRINITY_DLL_DECL boss_zuramatAI : public ScriptedAI +{ + boss_zuramatAI(Creature *c) : ScriptedAI(c) {} + + uint32 void_shift; + + void Reset() {} + void EnterCombat(Unit* who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + void KilledUnit(Unit *victim) + { + if (victim == m_creature) + return; + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature);break; + case 1: DoScriptText(SAY_SLAY_2, m_creature);break; + case 2: DoScriptText(SAY_SLAY_3, m_creature);break; + } + } +}; + +CreatureAI* GetAI_boss_zuramat(Creature* pCreature) +{ + return new boss_zuramatAI (pCreature); +} + +void AddSC_boss_zuramat() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_zuramat"; + newscript->GetAI = &GetAI_boss_zuramat; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/def_violet_hold.h b/src/bindings/scripts/scripts/northrend/violet_hold/def_violet_hold.h new file mode 100644 index 00000000000..71bc0d18d2f --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/def_violet_hold.h @@ -0,0 +1,4 @@ +#ifndef DEF_VIOLET_HOLD_H +#define DEF_VIOLET_HOLD_H + +#endif diff --git a/src/bindings/scripts/scripts/northrend/violet_hold/instance_violet_hold.cpp b/src/bindings/scripts/scripts/northrend/violet_hold/instance_violet_hold.cpp new file mode 100644 index 00000000000..98962b919e0 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/violet_hold/instance_violet_hold.cpp @@ -0,0 +1,21 @@ +#include "precompiled.h" +#include "def_violet_hold.h" + +struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance +{ + instance_violet_hold(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; +}; + +InstanceData* GetInstanceData_instance_violet_hold(Map* pMap) +{ + return new instance_violet_hold(pMap); +} + +void AddSC_instance_violet_hold() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_violet_hold"; + newscript->GetInstanceData = &GetInstanceData_instance_violet_hold; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/northrend/wintergrasp.cpp b/src/bindings/scripts/scripts/northrend/wintergrasp.cpp new file mode 100644 index 00000000000..275043d91e5 --- /dev/null +++ b/src/bindings/scripts/scripts/northrend/wintergrasp.cpp @@ -0,0 +1,60 @@ +/* Copyright (C) 2008 - 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 "precompiled.h" +#include "Wintergrasp.h" + +bool GossipHello_npc_demolisher_engineerer(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pPlayer->HasAura(SPELL_CORPORAL)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build catapult.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + else if (pPlayer->HasAura(SPELL_LIEUTENANT)) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build catapult.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build demolisher.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build siege engine.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); + } + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_demolisher_engineerer(Player* pPlayer, Creature* me, uint32 uiSender, uint32 uiAction) +{ + pPlayer->CLOSE_GOSSIP_MENU(); + switch(uiAction - GOSSIP_ACTION_INFO_DEF) + { + case 0: pPlayer->CastSpell(pPlayer, 56663, false, NULL, NULL, me->GetGUID()); break; + case 1: pPlayer->CastSpell(pPlayer, 56575, false, NULL, NULL, me->GetGUID()); break; + case 2: pPlayer->CastSpell(pPlayer, pPlayer->GetTeamId() ? 61408 : 56661, false, NULL, NULL, me->GetGUID()); break; + } + + return true; +} + +void AddSC_wintergrasp() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_demolisher_engineerer"; + newscript->pGossipHello = &GossipHello_npc_demolisher_engineerer; + newscript->pGossipSelect = &GossipSelect_npc_demolisher_engineerer; + newscript->RegisterSelf(); +} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp new file mode 100644 index 00000000000..414804a6576 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp @@ -0,0 +1,358 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Exarch_Maladaar +SD%Complete: 95 +SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player. +SDCategory: Auchindoun, Auchenai Crypts +EndScriptData */ + +/* ContentData +mob_stolen_soul +boss_exarch_maladaar +mob_avatar_of_martyred +EndContentData */ + +#include "precompiled.h" + +#define SPELL_MOONFIRE 37328 +#define SPELL_FIREBALL 37329 +#define SPELL_MIND_FLAY 37330 +#define SPELL_HEMORRHAGE 37331 +#define SPELL_FROSTSHOCK 37332 +#define SPELL_CURSE_OF_AGONY 37334 +#define SPELL_MORTAL_STRIKE 37335 +#define SPELL_FREEZING_TRAP 37368 +#define SPELL_HAMMER_OF_JUSTICE 37369 + +struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI +{ + mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {} + + uint8 myClass; + uint32 Class_Timer; + + void Reset() + { + Class_Timer = 1000; + } + + void EnterCombat(Unit *who) + { } + + void SetMyClass(uint8 myclass) + { + myClass = myclass; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Class_Timer < diff) + { + switch (myClass) + { + case CLASS_WARRIOR: + DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + Class_Timer = 6000; + break; + case CLASS_PALADIN: + DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); + Class_Timer = 6000; + break; + case CLASS_HUNTER: + DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP); + Class_Timer = 20000; + break; + case CLASS_ROGUE: + DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE); + Class_Timer = 10000; + break; + case CLASS_PRIEST: + DoCast(m_creature->getVictim(), SPELL_MIND_FLAY); + Class_Timer = 5000; + break; + case CLASS_SHAMAN: + DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK); + Class_Timer = 8000; + break; + case CLASS_MAGE: + DoCast(m_creature->getVictim(), SPELL_FIREBALL); + Class_Timer = 5000; + break; + case CLASS_WARLOCK: + DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY); + Class_Timer = 20000; + break; + case CLASS_DRUID: + DoCast(m_creature->getVictim(), SPELL_MOONFIRE); + Class_Timer = 10000; + break; + } + } else Class_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature) +{ + return new mob_stolen_soulAI (pCreature); +} + +#define SAY_INTRO -1558000 +#define SAY_SUMMON -1558001 + +#define SAY_AGGRO_1 -1558002 +#define SAY_AGGRO_2 -1558003 +#define SAY_AGGRO_3 -1558004 + +#define SAY_ROAR -1558005 +#define SAY_SOUL_CLEAVE -1558006 + +#define SAY_SLAY_1 -1558007 +#define SAY_SLAY_2 -1558008 + +#define SAY_DEATH -1558009 + +#define SPELL_RIBBON_OF_SOULS 32422 +#define SPELL_SOUL_SCREAM 32421 + +#define SPELL_STOLEN_SOUL 32346 +#define SPELL_STOLEN_SOUL_VISUAL 32395 + +#define SPELL_SUMMON_AVATAR 32424 + +#define ENTRY_STOLEN_SOUL 18441 + +struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI +{ + boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) + { + HasTaunted = false; + } + + uint32 soulmodel; + uint64 soulholder; + uint8 soulclass; + + uint32 Fear_timer; + uint32 Ribbon_of_Souls_timer; + uint32 StolenSoul_Timer; + + bool HasTaunted; + bool Avatar_summoned; + + void Reset() + { + soulmodel = 0; + soulholder = 0; + soulclass = 0; + + Fear_timer = 15000 + rand()% 5000; + Ribbon_of_Souls_timer = 5000; + StolenSoul_Timer = 25000 + rand()% 10000; + + Avatar_summoned = false; + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) + { + DoScriptText(SAY_INTRO, m_creature); + HasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(who); + } + + + void EnterCombat(Unit *who) + { + switch (rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == ENTRY_STOLEN_SOUL) + { + //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell. + summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); + summoned->SetDisplayId(soulmodel); + summoned->setFaction(m_creature->getFaction()); + + if (Unit *target = Unit::GetUnit(*m_creature,soulholder)) + { + + CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); + summoned->AI()->AttackStart(target); + } + } + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch (rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + //When Exarch Maladar is defeated D'ore appear. + m_creature->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25)) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(SAY_SUMMON, m_creature); + + DoCast(m_creature, SPELL_SUMMON_AVATAR); + Avatar_summoned = true; + StolenSoul_Timer = 15000 + rand()% 15000; + } + + if (StolenSoul_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (target->GetTypeId() == TYPEID_PLAYER) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + uint32 i = urand(1,2); + if (i == 1) + DoScriptText(SAY_ROAR, m_creature); + else + DoScriptText(SAY_SOUL_CLEAVE, m_creature); + + soulmodel = target->GetDisplayId(); + soulholder = target->GetGUID(); + soulclass = target->getClass(); + + DoCast(target,SPELL_STOLEN_SOUL); + m_creature->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + + StolenSoul_Timer = 20000 + rand()% 10000; + } else StolenSoul_Timer = 1000; + } + }else StolenSoul_Timer -= diff; + + if (Ribbon_of_Souls_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_RIBBON_OF_SOULS); + + Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000); + }else Ribbon_of_Souls_timer -= diff; + + if (Fear_timer < diff) + { + DoCast(m_creature,SPELL_SOUL_SCREAM); + Fear_timer = 15000 + rand()% 15000; + }else Fear_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) +{ + return new boss_exarch_maladaarAI (pCreature); +} + +#define SPELL_AV_MORTAL_STRIKE 16856 +#define SPELL_AV_SUNDER_ARMOR 16145 + +struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI +{ + mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {} + + uint32 Mortal_Strike_timer; + + void Reset() + { + Mortal_Strike_timer = 10000; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Mortal_Strike_timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE); + Mortal_Strike_timer = 10000 + rand()%20 * 1000; + } else Mortal_Strike_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) +{ + return new mob_avatar_of_martyredAI (pCreature); +} + +void AddSC_boss_exarch_maladaar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_exarch_maladaar"; + newscript->GetAI = &GetAI_boss_exarch_maladaar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_avatar_of_martyred"; + newscript->GetAI = &GetAI_mob_avatar_of_martyred; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_stolen_soul"; + newscript->GetAI = &GetAI_mob_stolen_soul; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp new file mode 100644 index 00000000000..4dfdd407731 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp @@ -0,0 +1,212 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +Name: Boss_Shirrak_the_dead_watcher +%Complete: 80 +Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented +Category: Auchindoun, Auchenai Crypts +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_INHIBITMAGIC 32264 +#define SPELL_ATTRACTMAGIC 32265 +#define N_SPELL_CARNIVOROUSBITE 36383 +#define H_SPELL_CARNIVOROUSBITE 39382 +#define SPELL_CARNIVOROUSBITE (HeroicMode?H_SPELL_CARNIVOROUSBITE:N_SPELL_CARNIVOROUSBITE) + +#define ENTRY_FOCUS_FIRE 18374 + +#define N_SPELL_FIERY_BLAST 32302 +#define H_SPELL_FIERY_BLAST 38382 +#define SPELL_FIERY_BLAST (HeroicMode?H_SPELL_FIERY_BLAST:N_SPELL_FIERY_BLAST) +#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual + +struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI +{ + boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 Inhibitmagic_Timer; + uint32 Attractmagic_Timer; + uint32 Carnivorousbite_Timer; + uint32 FocusFire_Timer; + bool HeroicMode; + Unit *focusedTarget; + + void Reset() + { + Inhibitmagic_Timer = 0; + Attractmagic_Timer = 28000; + Carnivorousbite_Timer = 10000; + FocusFire_Timer = 17000; + focusedTarget = NULL; + } + + void EnterCombat(Unit *who) + { } + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE) + { + summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false); + summoned->setFaction(m_creature->getFaction()); + summoned->SetLevel(m_creature->getLevel()); + summoned->addUnitState(UNIT_STAT_ROOT); + + if (focusedTarget) + summoned->AI()->AttackStart(focusedTarget); + } + } + + void UpdateAI(const uint32 diff) + { + //Inhibitmagic_Timer + if (Inhibitmagic_Timer < diff) + { + float dist; + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(m_creature, 45))) + { + i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC); + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 35) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 25) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 15) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + } + Inhibitmagic_Timer = 3000+(rand()%1000); + }else Inhibitmagic_Timer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Attractmagic_Timer + if (Attractmagic_Timer < diff) + { + DoCast(m_creature,SPELL_ATTRACTMAGIC); + Attractmagic_Timer = 30000; + Carnivorousbite_Timer = 1500; + }else Attractmagic_Timer -= diff; + + //Carnivorousbite_Timer + if (Carnivorousbite_Timer < diff) + { + DoCast(m_creature,SPELL_CARNIVOROUSBITE); + Carnivorousbite_Timer = 10000; + }else Carnivorousbite_Timer -= diff; + + //FocusFire_Timer + if (FocusFire_Timer < diff) + { + // Summon Focus Fire & Emote + Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + { + focusedTarget = target; + m_creature->SummonCreature(ENTRY_FOCUS_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500); + + // TODO: Find better way to handle emote + // Emote + std::string *emote = new std::string("focuses on "); + emote->append(target->GetName()); + emote->append("!"); + const char* text = emote->c_str(); + m_creature->MonsterTextEmote(text, 0, true); + delete emote; + } + FocusFire_Timer = 15000+(rand()%5000); + }else FocusFire_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature) +{ + return new boss_shirrak_the_dead_watcherAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI +{ + mob_focus_fireAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 FieryBlast_Timer; + bool fiery1, fiery2; + + void Reset() + { + FieryBlast_Timer = 3000+(rand()%1000); + fiery1 = fiery2 = true; + } + + void EnterCombat(Unit *who) + { } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //FieryBlast_Timer + if (fiery2 && FieryBlast_Timer < diff) + { + DoCast(m_creature,SPELL_FIERY_BLAST); + + if (fiery1) fiery1 = false; + else if (fiery2) fiery2 = false; + + FieryBlast_Timer = 1000; + }else FieryBlast_Timer -= diff; + + //DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_focus_fire(Creature* pCreature) +{ + return new mob_focus_fireAI (pCreature); +} + +void AddSC_boss_shirrak_the_dead_watcher() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_shirrak_the_dead_watcher"; + newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_focus_fire"; + newscript->GetAI = &GetAI_mob_focus_fire; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp new file mode 100644 index 00000000000..dcaaefee8c2 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -0,0 +1,369 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_NexusPrince_Shaffar +SD%Complete: 80 +SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro. +SDCategory: Auchindoun, Mana Tombs +EndScriptData */ + +/* ContentData +boss_nexusprince_shaffar +mob_ethereal_beacon +EndContentData */ + +#include "precompiled.h" + +enum +{ + SAY_INTRO = -1557000, + SAY_AGGRO_1 = -1557001, + SAY_AGGRO_2 = -1557002, + SAY_AGGRO_3 = -1557003, + SAY_SLAY_1 = -1557004, + SAY_SLAY_2 = -1557005, + SAY_SUMMON = -1557006, + SAY_DEAD = -1557007, + + SPELL_BLINK = 34605, + SPELL_FROSTBOLT = 32364, + SPELL_FIREBALL = 32363, + SPELL_FROSTNOVA = 32365, + + SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON + SPELL_ETHEREAL_BEACON_VISUAL = 32368, + + NPC_BEACON = 18431, + NPC_SHAFFAR = 18344, + + NR_INITIAL_BEACONS = 3 +}; + +struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI +{ + boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; } + + uint32 Blink_Timer; + uint32 Beacon_Timer; + uint32 FireBall_Timer; + uint32 Frostbolt_Timer; + uint32 FrostNova_Timer; + + SummonList summons; + + bool HasTaunted; + bool CanBlink; + + void Reset() + { + Blink_Timer = 1500; + Beacon_Timer = 10000; + FireBall_Timer = 8000; + Frostbolt_Timer = 4000; + FrostNova_Timer = 15000; + + CanBlink = false; + + float dist = 8.0f; + float posX, posY, posZ, angle; + m_creature->GetHomePosition(posX, posY, posZ, angle); + + m_creature->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + m_creature->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + m_creature->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + } + + void EnterEvadeMode() + { + summons.DespawnAll(); + ScriptedAI::EnterEvadeMode(); + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 100.0f)) + { + DoScriptText(SAY_INTRO, m_creature); + HasTaunted = true; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + DoZoneInCombat(); + summons.DoZoneInCombat(); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == NPC_BEACON) + { + summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); + + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + summons.Summon(summoned); + } + + void SummonedCreatureDespawn(Creature *summon) + { + summons.Despawn(summon); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEAD, m_creature); + summons.DespawnAll(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (FrostNova_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoCast(m_creature,SPELL_FROSTNOVA); + FrostNova_Timer = 17500 + rand()%7500; + CanBlink = true; + }else FrostNova_Timer -= diff; + + if (Frostbolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); + Frostbolt_Timer = 4500 + rand()%1500; + }else Frostbolt_Timer -= diff; + + if (FireBall_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FIREBALL); + FireBall_Timer = 4500 + rand()%1500; + }else FireBall_Timer -= diff; + + if (CanBlink) + { + if (Blink_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + //expire movement, will prevent from running right back to victim after cast + //(but should MoveChase be used again at a certain time or should he not move?) + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + DoCast(m_creature,SPELL_BLINK); + Blink_Timer = 1000 + rand()%1500; + CanBlink = false; + }else Blink_Timer -= diff; + } + + if (Beacon_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + if (!urand(0,3)) + DoScriptText(SAY_SUMMON, m_creature); + + DoCast(m_creature,SPELL_ETHEREAL_BEACON, true); + + Beacon_Timer = 10000; + }else Beacon_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) +{ + return new boss_nexusprince_shaffarAI (pCreature); +} + +enum +{ + SPELL_ARCANE_BOLT = 15254, + SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430 +}; + +struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI +{ + mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 Apprentice_Timer; + uint32 ArcaneBolt_Timer; + uint32 Check_Timer; + + void KillSelf() + { + m_creature->Kill(m_creature); + } + + void Reset() + { + Apprentice_Timer = (HeroicMode ? 10000 : 20000); + ArcaneBolt_Timer = 1000; + Check_Timer = 1000; + } + + void EnterCombat(Unit *who) + { + // Send Shaffar to fight + Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); + if (!Shaffar || Shaffar->isDead()) + { + KillSelf(); + return; + } + if (!Shaffar->isInCombat()) + Shaffar->AI()->AttackStart(who); + } + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature->getVictim()); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Check_Timer < diff) + { + Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); + if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) + { + KillSelf(); + return; + } + Check_Timer = 1000; + }else Check_Timer -= diff; + + if (ArcaneBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT); + ArcaneBolt_Timer = 2000 + rand()%2500; + }else ArcaneBolt_Timer -= diff; + + if (Apprentice_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true); + m_creature->ForcedDespawn(); + return; + }else Apprentice_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) +{ + return new mob_ethereal_beaconAI (pCreature); +} + +enum +{ + SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, + SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 +}; + +struct TRINITY_DLL_DECL mob_ethereal_apprenticeAI : public ScriptedAI +{ + mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {} + + uint32 Cast_Timer; + + bool isFireboltTurn; + + void Reset() + { + Cast_Timer = 3000; + isFireboltTurn = true; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Cast_Timer < diff) + { + if (isFireboltTurn) + { + m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true); + isFireboltTurn = false; + }else{ + m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true); + isFireboltTurn = true; + } + Cast_Timer = 3000; + }else Cast_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature) +{ + return new mob_ethereal_apprenticeAI (pCreature); +} + +void AddSC_boss_nexusprince_shaffar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_nexusprince_shaffar"; + newscript->GetAI = &GetAI_boss_nexusprince_shaffar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ethereal_beacon"; + newscript->GetAI = &GetAI_mob_ethereal_beacon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ethereal_apprentice"; + newscript->GetAI = &GetAI_mob_ethereal_apprentice; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp new file mode 100644 index 00000000000..77e1c535340 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.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_Pandemonius +SD%Complete: 75 +SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged. +SDCategory: Auchindoun, Mana Tombs +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO_1 -1557008 +#define SAY_AGGRO_2 -1557009 +#define SAY_AGGRO_3 -1557010 + +#define SAY_KILL_1 -1557011 +#define SAY_KILL_2 -1557012 + +#define SAY_DEATH -1557013 + +#define EMOTE_DARK_SHELL -1557014 + +#define SPELL_VOID_BLAST 32325 +#define H_SPELL_VOID_BLAST 38760 +#define SPELL_DARK_SHELL 32358 +#define H_SPELL_DARK_SHELL 38759 + +struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI +{ + boss_pandemoniusAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 VoidBlast_Timer; + uint32 DarkShell_Timer; + uint32 VoidBlast_Counter; + + void Reset() + { + VoidBlast_Timer = 8000+rand()%15000; + DarkShell_Timer = 20000; + VoidBlast_Counter = 0; + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (VoidBlast_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target,HeroicMode ? H_SPELL_VOID_BLAST : SPELL_VOID_BLAST); + VoidBlast_Timer = 500; + ++VoidBlast_Counter; + } + + if (VoidBlast_Counter == 5) + { + VoidBlast_Timer = 15000+rand()%10000; + VoidBlast_Counter = 0; + } + }else VoidBlast_Timer -= diff; + + if (!VoidBlast_Counter) + { + if (DarkShell_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(EMOTE_DARK_SHELL, m_creature); + + DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL); + DarkShell_Timer = 20000; + }else DarkShell_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) +{ + return new boss_pandemoniusAI (pCreature); +} + +void AddSC_boss_pandemonius() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_pandemonius"; + newscript->GetAI = &GetAI_boss_pandemonius; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp new file mode 100644 index 00000000000..00e43fa257d --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp @@ -0,0 +1,438 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Darkweaver_Syth +SD%Complete: 85 +SDComment: Shock spells/times need more work. Heroic partly implemented. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" + +#define SAY_SUMMON -1556000 + +#define SAY_AGGRO_1 -1556001 +#define SAY_AGGRO_2 -1556002 +#define SAY_AGGRO_3 -1556003 + +#define SAY_SLAY_1 -1556004 +#define SAY_SLAY_2 -1556005 + +#define SAY_DEATH -1556006 + +#define SPELL_FROST_SHOCK 21401 //37865 +#define SPELL_FLAME_SHOCK 34354 +#define SPELL_SHADOW_SHOCK 30138 +#define SPELL_ARCANE_SHOCK 37132 + +#define SPELL_CHAIN_LIGHTNING 15659 //15305 + +#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203 +#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205 +#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204 +#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206 + +#define SPELL_FLAME_BUFFET (HeroicMode?38141:33526) +#define SPELL_ARCANE_BUFFET (HeroicMode?38138:33527) +#define SPELL_FROST_BUFFET (HeroicMode?38142:33528) +#define SPELL_SHADOW_BUFFET (HeroicMode?38143:33529) + +struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI +{ + boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 flameshock_timer; + uint32 arcaneshock_timer; + uint32 frostshock_timer; + uint32 shadowshock_timer; + uint32 chainlightning_timer; + + bool summon90; + bool summon50; + bool summon10; + bool HeroicMode; + + void Reset() + { + flameshock_timer = 2000; + arcaneshock_timer = 4000; + frostshock_timer = 6000; + shadowshock_timer = 8000; + chainlightning_timer = 15000; + + summon90 = false; + summon50 = false; + summon10 = false; + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + void SythSummoning() + { + DoScriptText(SAY_SUMMON, m_creature); + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCast(m_creature,SPELL_SUMMON_SYTH_ARCANE,true); //front + DoCast(m_creature,SPELL_SUMMON_SYTH_FIRE,true); //back + DoCast(m_creature,SPELL_SUMMON_SYTH_FROST,true); //left + DoCast(m_creature,SPELL_SUMMON_SYTH_SHADOW,true); //right + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90) + { + SythSummoning(); + summon90 = true; + } + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50) + { + SythSummoning(); + summon50 = true; + } + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10) + { + SythSummoning(); + summon10 = true; + } + + if (flameshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_SHOCK); + + flameshock_timer = 10000 + rand()%5000; + } else flameshock_timer -= diff; + + if (arcaneshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_SHOCK); + + arcaneshock_timer = 10000 + rand()%5000; + } else arcaneshock_timer -= diff; + + if (frostshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_SHOCK); + + frostshock_timer = 10000 + rand()%5000; + } else frostshock_timer -= diff; + + if (shadowshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_SHOCK); + + shadowshock_timer = 10000 + rand()%5000; + } else shadowshock_timer -= diff; + + if (chainlightning_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_CHAIN_LIGHTNING); + + chainlightning_timer = 25000; + } else chainlightning_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature) +{ + return new boss_darkweaver_sythAI (pCreature); +} + +/* ELEMENTALS */ + +struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI +{ + mob_syth_fireAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 flameshock_timer; + uint32 flamebuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + flameshock_timer = 2500; + flamebuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (flameshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_SHOCK); + + flameshock_timer = 5000; + }else flameshock_timer -= diff; + + if (flamebuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_BUFFET); + + flamebuffet_timer = 5000; + }else flamebuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_fire(Creature* pCreature) +{ + return new mob_syth_fireAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI +{ + mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 arcaneshock_timer; + uint32 arcanebuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); + arcaneshock_timer = 2500; + arcanebuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (arcaneshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_SHOCK); + + arcaneshock_timer = 5000; + }else arcaneshock_timer -= diff; + + if (arcanebuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_BUFFET); + + arcanebuffet_timer = 5000; + }else arcanebuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature) +{ + return new mob_syth_arcaneAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI +{ + mob_syth_frostAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 frostshock_timer; + uint32 frostbuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + frostshock_timer = 2500; + frostbuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (frostshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_SHOCK); + + frostshock_timer = 5000; + }else frostshock_timer -= diff; + + if (frostbuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_BUFFET); + + frostbuffet_timer = 5000; + }else frostbuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_frost(Creature* pCreature) +{ + return new mob_syth_frostAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI +{ + mob_syth_shadowAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 shadowshock_timer; + uint32 shadowbuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + shadowshock_timer = 2500; + shadowbuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (shadowshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_SHOCK); + + shadowshock_timer = 5000; + }else shadowshock_timer -= diff; + + if (shadowbuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_BUFFET); + + shadowbuffet_timer = 5000; + }else shadowbuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature) +{ + return new mob_syth_shadowAI (pCreature); +} + +void AddSC_boss_darkweaver_syth() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_darkweaver_syth"; + newscript->GetAI = &GetAI_boss_darkweaver_syth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_fire"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_arcane"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_frost"; + newscript->GetAI = &GetAI_mob_syth_frost; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_shadow"; + newscript->GetAI = &GetAI_mob_syth_shadow; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp new file mode 100644 index 00000000000..7830fc10645 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp @@ -0,0 +1,221 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Talon_King_Ikiss +SD%Complete: 80 +SDComment: Heroic supported. Some details missing, but most are spell related. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" +#include "def_sethekk_halls.h" + +#define SAY_INTRO -1556007 + +#define SAY_AGGRO_1 -1556008 +#define SAY_AGGRO_2 -1556009 +#define SAY_AGGRO_3 -1556010 + +#define SAY_SLAY_1 -1556011 +#define SAY_SLAY_2 -1556012 +#define SAY_DEATH -1556013 +#define EMOTE_ARCANE_EXP -1556015 + +#define SPELL_BLINK 38194 +#define SPELL_BLINK_TELEPORT 38203 +#define SPELL_MANA_SHIELD 38151 +#define SPELL_ARCANE_BUBBLE 9438 +#define H_SPELL_SLOW 35032 + +#define SPELL_POLYMORPH 38245 +#define H_SPELL_POLYMORPH 43309 + +#define SPELL_ARCANE_VOLLEY 35059 +#define H_SPELL_ARCANE_VOLLEY 40424 + +#define SPELL_ARCANE_EXPLOSION 38197 +#define H_SPELL_ARCANE_EXPLOSION 40425 + +struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI +{ + boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + bool HeroicMode; + + uint32 ArcaneVolley_Timer; + uint32 Sheep_Timer; + uint32 Blink_Timer; + uint32 Slow_Timer; + + bool ManaShield; + bool Blink; + bool Intro; + + void Reset() + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + + ArcaneVolley_Timer = 5000; + Sheep_Timer = 8000; + Blink_Timer = 35000; + Slow_Timer = 15000+rand()%15000; + Blink = false; + Intro = false; + ManaShield = false; + } + + void MoveInLineOfSight(Unit *who) + { + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) + { + if (!Intro && m_creature->IsWithinDistInMap(who, 100)) + { + Intro = true; + DoScriptText(SAY_INTRO, m_creature); + } + + if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + { + //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_IKISSDOOREVENT, DONE); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Blink) + { + DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION); + m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true); + Blink = false; + } + + if (ArcaneVolley_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY); + ArcaneVolley_Timer = 7000+rand()%5000; + }else ArcaneVolley_Timer -= diff; + + if (Sheep_Timer < diff) + { + //second top aggro target in normal, random target in heroic correct? + Unit *target = NULL; + target = HeroicMode ? SelectUnit(SELECT_TARGET_RANDOM,0) : SelectUnit(SELECT_TARGET_TOPAGGRO,1); + if (target) + DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH); + Sheep_Timer = 15000+rand()%2500; + }else Sheep_Timer -= diff; + + //may not be correct time to cast + if (!ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20)) + { + DoCast(m_creature,SPELL_MANA_SHIELD); + ManaShield = true; + } + + if (HeroicMode) + { + if (Slow_Timer < diff) + { + DoCast(m_creature,H_SPELL_SLOW); + Slow_Timer = 15000+rand()%25000; + }else Slow_Timer -= diff; + } + + if (Blink_Timer < diff) + { + DoScriptText(EMOTE_ARCANE_EXP, m_creature); + + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + //Spell doesn't work, but we use for visual effect at least + DoCast(target,SPELL_BLINK); + + float X = target->GetPositionX(); + float Y = target->GetPositionY(); + float Z = target->GetPositionZ(); + + DoTeleportTo(X,Y,Z); + + DoCast(target,SPELL_BLINK_TELEPORT); + Blink = true; + } + Blink_Timer = 35000+rand()%5000; + }else Blink_Timer -= diff; + + if (!Blink) + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature) +{ + return new boss_talon_king_ikissAI (pCreature); +} + +void AddSC_boss_talon_king_ikiss() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_talon_king_ikiss"; + newscript->GetAI = &GetAI_boss_talon_king_ikiss; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h new file mode 100644 index 00000000000..6156f354d84 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h @@ -0,0 +1,14 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SETHEKK_HALLS_H +#define DEF_SETHEKK_HALLS_H + +enum +{ + DATA_IKISSDOOREVENT = 1, + TYPE_ANZU_ENCOUNTER = 2, +}; +#endif + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp new file mode 100644 index 00000000000..060e09a1325 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp @@ -0,0 +1,91 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance - Sethekk Halls +SD%Complete: 50 +SDComment: Instance Data for Sethekk Halls instance +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" +#include "def_sethekk_halls.h" + +enum +{ + NPC_ANZU = 23035, + IKISS_DOOR = 177203, +}; + +struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance +{ + instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 AnzuEncounter; + uint64 m_uiIkissDoorGUID; + + void Initialize() + { + AnzuEncounter = NOT_STARTED; + m_uiIkissDoorGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == NPC_ANZU && AnzuEncounter >= IN_PROGRESS) + { + pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + pCreature->RemoveCorpse(); + } else { + AnzuEncounter = IN_PROGRESS; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + if (pGo->GetEntry() == IKISS_DOOR) + m_uiIkissDoorGUID = pGo->GetGUID(); + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_IKISSDOOREVENT: + if (data == DONE) + DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); + break; + case TYPE_ANZU_ENCOUNTER: + AnzuEncounter = data; + break; + } + } +}; + +InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) +{ + return new instance_sethekk_halls(pMap); +} + +void AddSC_instance_sethekk_halls() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_sethekk_halls"; + newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp new file mode 100644 index 00000000000..f9961e10174 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.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_Ambassador_Hellmaw +SD%Complete: 80 +SDComment: Enrage spell missing/not known +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "escortAI.h" +#include "def_shadow_labyrinth.h" + +enum +{ + SAY_INTRO = -1555000, + SAY_AGGRO1 = -1555001, + SAY_AGGRO2 = -1555002, + SAY_AGGRO3 = -1555003, + SAY_HELP = -1555004, + SAY_SLAY1 = -1555005, + SAY_SLAY2 = -1555006, + SAY_DEATH = -1555007, + + SPELL_BANISH = 30231, + SPELL_CORROSIVE_ACID = 33551, + SPELL_FEAR = 33547, + SPELL_ENRAGE = 34970 +}; + +struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI +{ + boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + HeroicMode = pCreature->GetMap()->IsHeroic(); + } + + ScriptedInstance* m_pInstance; + bool HeroicMode; + + uint32 EventCheck_Timer; + uint32 CorrosiveAcid_Timer; + uint32 Fear_Timer; + uint32 Enrage_Timer; + bool Intro; + bool IsBanished; + bool Enraged; + + void Reset() + { + EventCheck_Timer = 5000; + CorrosiveAcid_Timer = 5000 + rand()%5000; + Fear_Timer = 25000 + rand()%5000; + Enrage_Timer = 180000; + Intro = false; + IsBanished = true; + Enraged = false; + + if (m_pInstance && m_creature->isAlive()) + { + if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) + m_creature->CastSpell(m_creature, SPELL_BANISH, true); + } + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, FAIL); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_creature->HasAura(SPELL_BANISH)) + return; + + npc_escortAI::MoveInLineOfSight(pWho); + } + + void WaypointReached(uint32 i) + { + } + + void DoIntro() + { + if (m_creature->HasAura(SPELL_BANISH)) + m_creature->RemoveAurasDueToSpell(SPELL_BANISH); + + IsBanished = false; + Intro = true; + + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) + { + DoScriptText(SAY_INTRO, m_creature); + Start(true, false, 0, NULL, false, true); + } + + m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!Intro && !IsBeingEscorted) + { + if (EventCheck_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) + { + DoIntro(); + return; + } + } + EventCheck_Timer = 5000; + return; + } + else + { + EventCheck_Timer -= diff; + return; + } + } + + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (m_creature->HasAura(SPELL_BANISH, 0)) + { + EnterEvadeMode(); + return; + } + + if (CorrosiveAcid_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CORROSIVE_ACID); + CorrosiveAcid_Timer = 15000 + rand()%10000; + }else CorrosiveAcid_Timer -= diff; + + if (Fear_Timer < diff) + { + DoCast(m_creature,SPELL_FEAR); + Fear_Timer = 20000 + rand()%15000; + }else Fear_Timer -= diff; + + if (HeroicMode) + { + if (!Enraged && Enrage_Timer < diff) + { + DoCast(m_creature,SPELL_ENRAGE); + Enraged = true; + }else Enrage_Timer -= diff; + } + } +}; + +CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) +{ + return new boss_ambassador_hellmawAI(pCreature); +} + +void AddSC_boss_ambassador_hellmaw() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_ambassador_hellmaw"; + newscript->GetAI = &GetAI_boss_ambassador_hellmaw; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp new file mode 100644 index 00000000000..73374c08f8c --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp @@ -0,0 +1,177 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Blackheart_the_Inciter +SD%Complete: 75 +SDComment: Incite Chaos not functional since core lacks Mind Control support +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define SPELL_INCITE_CHAOS 33676 +#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party +#define SPELL_CHARGE 33709 +#define SPELL_WAR_STOMP 33707 + +#define SAY_INTRO1 -1555008 +#define SAY_INTRO2 -1555009 +#define SAY_INTRO3 -1555010 +#define SAY_AGGRO1 -1555011 +#define SAY_AGGRO2 -1555012 +#define SAY_AGGRO3 -1555013 +#define SAY_SLAY1 -1555014 +#define SAY_SLAY2 -1555015 +#define SAY_HELP -1555016 +#define SAY_DEATH -1555017 + +#define SAY2_INTRO1 -1555018 +#define SAY2_INTRO2 -1555019 +#define SAY2_INTRO3 -1555020 +#define SAY2_AGGRO1 -1555021 +#define SAY2_AGGRO2 -1555022 +#define SAY2_AGGRO3 -1555023 +#define SAY2_SLAY1 -1555024 +#define SAY2_SLAY2 -1555025 +#define SAY2_HELP -1555026 +#define SAY2_DEATH -1555027 + +struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI +{ + boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + bool InciteChaos; + uint32 InciteChaos_Timer; + uint32 InciteChaosWait_Timer; + uint32 Charge_Timer; + uint32 Knockback_Timer; + + void Reset() + { + InciteChaos = false; + InciteChaos_Timer = 20000; + InciteChaosWait_Timer = 15000; + Charge_Timer = 5000; + Knockback_Timer = 15000; + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (InciteChaos) + { + if (InciteChaosWait_Timer < diff) + { + InciteChaos = false; + InciteChaosWait_Timer = 15000; + }else InciteChaosWait_Timer -= diff; + + return; + } + + if (InciteChaos_Timer < diff) + { + DoCast(m_creature, SPELL_INCITE_CHAOS); + + std::list t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (target && target->GetTypeId() == TYPEID_PLAYER) + target->CastSpell(target,SPELL_INCITE_CHAOS_B,true); + } + + DoResetThreat(); + InciteChaos = true; + InciteChaos_Timer = 40000; + return; + }else InciteChaos_Timer -= diff; + + //Charge_Timer + if (Charge_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_CHARGE); + Charge_Timer = 15000 + rand()%10000; + }else Charge_Timer -= diff; + + //Knockback_Timer + if (Knockback_Timer < diff) + { + DoCast(m_creature, SPELL_WAR_STOMP); + Knockback_Timer = 18000 + rand()%6000; + }else Knockback_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) +{ + return new boss_blackheart_the_inciterAI (pCreature); +} + +void AddSC_boss_blackheart_the_inciter() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_blackheart_the_inciter"; + newscript->GetAI = &GetAI_boss_blackheart_the_inciter; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp new file mode 100644 index 00000000000..0cc6255f3cf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp @@ -0,0 +1,321 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Grandmaster_Vorpil +SD%Complete: 100 +SDComment: +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define SAY_INTRO -1555028 +#define SAY_AGGRO1 -1555029 +#define SAY_AGGRO2 -1555030 +#define SAY_AGGRO3 -1555031 +#define SAY_HELP -1555032 +#define SAY_SLAY1 -1555033 +#define SAY_SLAY2 -1555034 +#define SAY_DEATH -1555035 + +#define SPELL_RAIN_OF_FIRE 33617 +#define H_SPELL_RAIN_OF_FIRE 39363 + +#define SPELL_DRAW_SHADOWS 33563 +#define SPELL_SHADOWBOLT_VOLLEY 33841 +#define SPELL_BANISH 38791 + +#define MOB_VOID_TRAVELER 19226 +#define SPELL_SACRIFICE 33587 +#define SPELL_SHADOW_NOVA 33846 +#define SPELL_EMPOWERING_SHADOWS 33783 +#define H_SPELL_EMPOWERING_SHADOWS 39364 + +#define MOB_VOID_PORTAL 19224 +#define SPELL_VOID_PORTAL_VISUAL 33569 + +float VorpilPosition[3] = {-252.8820,-264.3030,17.1}; + +float VoidPortalCoords[5][3] = +{ + {-283.5894, -239.5718, 12.7}, + {-306.5853, -258.4539, 12.7}, + {-295.8789, -269.0899, 12.7}, + {-209.3401, -262.7564, 17.1}, + {-261.4533, -297.3298, 17.1} +}; + +struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI +{ + mob_voidtravelerAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + Unit *Vorpil; + uint32 move; + bool sacrificed; + + void Reset() + { + Vorpil = NULL; + move = 0; + sacrificed = false; + } + + void EnterCombat(Unit *who){} + + void UpdateAI(const uint32 diff) + { + if (!Vorpil) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + if (move < diff) + { + if (sacrificed) + { + SpellEntry *spell = GET_SPELL(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS); + if (spell) + Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature)); + Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25); + DoCast(m_creature, SPELL_SHADOW_NOVA, true); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + m_creature->GetMotionMaster()->MoveFollow(Vorpil,0,0); + if (m_creature->IsWithinDist(Vorpil, 3)) + { + DoCast(m_creature, SPELL_SACRIFICE, false); + sacrificed = true; + move = 500; + return; + } + if (!Vorpil->isInCombat() || Vorpil->isDead()) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + move = 1000; + }else move -= diff; + } +}; +CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature) +{ + return new mob_voidtravelerAI (pCreature); +} + +struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI +{ + boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + Intro = false; + } + + ScriptedInstance *pInstance; + bool Intro, HelpYell; + bool sumportals; + bool HeroicMode; + + uint32 ShadowBoltVolley_Timer; + uint32 DrawShadows_Timer; + uint32 summonTraveler_Timer; + uint32 banish_Timer; + uint64 PortalsGuid[5]; + + void Reset() + { + ShadowBoltVolley_Timer = 7000 + rand()%7000; + DrawShadows_Timer = 45000; + summonTraveler_Timer = 90000; + banish_Timer = 17000; + HelpYell = false; + destroyPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); + } + + void summonPortals() + { + if (!sumportals) + { + for (int i = 0;i<5; ++i) + { + Creature *Portal = NULL; + Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000); + if (Portal) + { + PortalsGuid[i] = Portal->GetGUID(); + Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); + } + } + sumportals = true; + summonTraveler_Timer = 5000; + } + } + + void destroyPortals() + { + if (sumportals) + { + for (int i = 0;i < 5; i ++) + { + Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]); + if (Portal && Portal->isAlive()) + Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + PortalsGuid[i] = 0; + } + sumportals = false; + } + } + + void spawnVoidTraveler() + { + int pos = rand()%5; + m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000); + if (!HelpYell) + { + DoScriptText(SAY_HELP, m_creature); + HelpYell = true; + } + } + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) + CAST_AI(mob_voidtravelerAI, summoned->AI())->Vorpil = m_creature; + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + destroyPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + summonPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); + } + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who)) + { + DoScriptText(SAY_INTRO, m_creature); + Intro = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ShadowBoltVolley_Timer < diff) + { + DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY); + ShadowBoltVolley_Timer = 15000 + rand()%15000;; + }else ShadowBoltVolley_Timer -= diff; + + if (HeroicMode && banish_Timer < diff) + { + Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); + if (target) + { + DoCast(target,SPELL_BANISH); + banish_Timer = 16000; + } + }else banish_Timer -= diff; + + if (DrawShadows_Timer < diff) + { + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) + i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); + + m_creature->GetMap()->CreatureRelocation(m_creature, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f); + DoCast(m_creature,SPELL_DRAW_SHADOWS,true); + + DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE); + + ShadowBoltVolley_Timer = 6000; + DrawShadows_Timer = 30000; + }else DrawShadows_Timer -= diff; + + if (summonTraveler_Timer < diff) + { + spawnVoidTraveler(); + summonTraveler_Timer = 10000; + //enrage at 20% + if ((m_creature->GetHealth()*5) < m_creature->GetMaxHealth()) + summonTraveler_Timer = 5000; + }else summonTraveler_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) +{ + return new boss_grandmaster_vorpilAI (pCreature); +} + +void AddSC_boss_grandmaster_vorpil() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_grandmaster_vorpil"; + newscript->GetAI = &GetAI_boss_grandmaster_vorpil; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_voidtraveler"; + newscript->GetAI = &GetAI_mob_voidtraveler; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp new file mode 100644 index 00000000000..259f6091af6 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp @@ -0,0 +1,207 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Murmur +SD%Complete: 90 +SDComment: Timers may be incorrect +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define EMOTE_SONIC_BOOM -1555036 + +#define SPELL_SONIC_BOOM_CAST (HeroicMode?38796:33923) +#define SPELL_SONIC_BOOM_EFFECT (HeroicMode?38795:33666) +#define SPELL_RESONANCE 33657 +#define SPELL_MURMURS_TOUCH (HeroicMode?38794:33711) +#define SPELL_MAGNETIC_PULL 33689 +#define SPELL_SONIC_SHOCK 38797 +#define SPELL_THUNDERING_STORM 39365 + +struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI +{ + boss_murmurAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 SonicBoom_Timer; + uint32 MurmursTouch_Timer; + uint32 Resonance_Timer; + uint32 MagneticPull_Timer; + uint32 SonicShock_Timer; + uint32 ThunderingStorm_Timer; + bool HeroicMode; + bool SonicBoom; + + void Reset() + { + SonicBoom_Timer = 30000; + MurmursTouch_Timer = 8000 + rand()%12000; + Resonance_Timer = 5000; + MagneticPull_Timer = 15000 + rand()%15000; + ThunderingStorm_Timer = 15000; + SonicShock_Timer = 10000; + SonicBoom = false; + + //database should have `RegenHealth`=0 to prevent regen + uint32 hp = (m_creature->GetMaxHealth()*40)/100; + if (hp) m_creature->SetHealth(hp); + m_creature->ResetPlayerDamageReq(); + } + + void SonicBoomEffect() + { + std::list t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + //Not do anything without aura, spell can be resisted! + if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f)) + { + //This will be wrong calculation. Also, comments suggest it must deal damage + target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8)); + } + } + } + } + + void EnterCombat(Unit *who) { } + + // Sonic Boom instant damage (needs core fix instead of this) + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (target && target->isAlive() && spell && spell->Id == SPELL_SONIC_BOOM_EFFECT) + m_creature->DealDamage(target,(target->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target or casting + if (!UpdateVictim() || m_creature->IsNonMeleeSpellCasted(false)) + return; + + // Sonic Boom + if (SonicBoom) + { + DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true); + SonicBoomEffect(); + + SonicBoom = false; + Resonance_Timer = 1500; + } + if (SonicBoom_Timer < diff) + { + DoScriptText(EMOTE_SONIC_BOOM, m_creature); + DoCast(m_creature, SPELL_SONIC_BOOM_CAST); + SonicBoom_Timer = 30000; + SonicBoom = true; + return; + }else SonicBoom_Timer -= diff; + + // Murmur's Touch + if (MurmursTouch_Timer < diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) + DoCast(target, SPELL_MURMURS_TOUCH); + MurmursTouch_Timer = 25000 + rand()%10000; + }else MurmursTouch_Timer -= diff; + + // Resonance + if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim()))) + { + if (Resonance_Timer < diff) + { + DoCast(m_creature, SPELL_RESONANCE); + Resonance_Timer = 5000; + }else Resonance_Timer -= diff; + } + + // Magnetic Pull + if (MagneticPull_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + { + DoCast(target, SPELL_MAGNETIC_PULL); + MagneticPull_Timer = 15000+rand()%15000; + return; + } + MagneticPull_Timer = 500; + }else MagneticPull_Timer -= diff; + + if (HeroicMode) + { + // Thundering Storm + if (ThunderingStorm_Timer < diff) + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) + if (target->isAlive() && !m_creature->IsWithinDist(target, 35, false)) + DoCast(target, SPELL_THUNDERING_STORM, true); + ThunderingStorm_Timer = 15000; + }else ThunderingStorm_Timer -= diff; + + // Sonic Shock + if (SonicShock_Timer < diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) + if (target->isAlive()) + DoCast(target, SPELL_SONIC_SHOCK); + SonicShock_Timer = 10000+rand()%10000; + }else SonicShock_Timer -= diff; + } + + // Select nearest most aggro target if top aggro too far + if (!m_creature->isAttackReady()) + return; + if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) + if (target->isAlive() && m_creature->IsWithinMeleeRange(target)) + { + m_creature->TauntApply(target); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_murmur(Creature* pCreature) +{ + return new boss_murmurAI (pCreature); +} + +void AddSC_boss_murmur() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_murmur"; + newscript->GetAI = &GetAI_boss_murmur; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h new file mode 100644 index 00000000000..a78955368bf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h @@ -0,0 +1,15 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SHADOW_LABYRINTH_H +#define DEF_SHADOW_LABYRINTH_H + +#define TYPE_HELLMAW 1 +#define TYPE_OVERSEER 2 +#define DATA_BLACKHEARTTHEINCITEREVENT 3 +#define DATA_GRANDMASTERVORPILEVENT 4 +#define DATA_MURMUREVENT 5 +#define DATA_GRANDMASTERVORPIL 6 +#endif + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp new file mode 100644 index 00000000000..f8f3b73bffa --- /dev/null +++ b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp @@ -0,0 +1,227 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Shadow_Labyrinth +SD%Complete: 85 +SDComment: Some cleanup left along with save +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define MAX_ENCOUNTER 5 + +#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies +#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies + +/* Shadow Labyrinth encounters: +1 - Ambassador Hellmaw event +2 - Blackheart the Inciter event +3 - Grandmaster Vorpil event +4 - Murmur event +*/ + +struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance +{ + instance_shadow_labyrinth(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + uint64 m_uiRefectoryDoorGUID; + uint64 m_uiScreamingHallDoorGUID; + + uint64 m_uiGrandmasterVorpil; + uint32 m_uiFelOverseerCount; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiRefectoryDoorGUID = 0; + m_uiScreamingHallDoorGUID = 0; + + m_uiGrandmasterVorpil = 0; + m_uiFelOverseerCount = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case REFECTORY_DOOR: + m_uiRefectoryDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case SCREAMING_HALL_DOOR: + m_uiScreamingHallDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 18732: + m_uiGrandmasterVorpil = pCreature->GetGUID(); + break; + case 18796: + if (pCreature->isAlive()) + { + ++m_uiFelOverseerCount; + debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); + } + break; + } + } + + void SetData(uint32 type, uint32 uiData) + { + switch(type) + { + case TYPE_HELLMAW: + m_auiEncounter[0] = uiData; + break; + + case TYPE_OVERSEER: + if (uiData != DONE) + { + error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); + return; + } + if (m_uiFelOverseerCount) + { + --m_uiFelOverseerCount; + + if (m_uiFelOverseerCount) + debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); + else + { + m_auiEncounter[1] = DONE; + debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); + } + } + break; + + case DATA_BLACKHEARTTHEINCITEREVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiRefectoryDoorGUID); + m_auiEncounter[2] = uiData; + break; + + case DATA_GRANDMASTERVORPILEVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiScreamingHallDoorGUID); + m_auiEncounter[3] = uiData; + break; + + case DATA_MURMUREVENT: + m_auiEncounter[4] = uiData; + break; + } + + if (uiData == DONE) + { + if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0) + return; + + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_HELLMAW: return m_auiEncounter[0]; + case TYPE_OVERSEER: return m_auiEncounter[1]; + case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3]; + case DATA_MURMUREVENT: return m_auiEncounter[4]; + } + return false; + } + + uint64 GetData64(uint32 identifier) + { + if (identifier == DATA_GRANDMASTERVORPIL) + return m_uiGrandmasterVorpil; + + return 0; + } + + std::string GetSaveData() + { + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) +{ + return new instance_shadow_labyrinth(pMap); +} + +void AddSC_instance_shadow_labyrinth() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_shadow_labyrinth"; + newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/black_temple.cpp b/src/bindings/scripts/scripts/outland/black_temple/black_temple.cpp new file mode 100644 index 00000000000..7f0f1e570ba --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/black_temple.cpp @@ -0,0 +1,69 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Black_Temple +SD%Complete: 95 +SDComment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. TODO: Find proper gossip. +SDCategory: Black Temple +EndScriptData */ + +/* ContentData +npc_spirit_of_olum +EndContentData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +/*### +# npc_spirit_of_olum +####*/ + +#define SPELL_TELEPORT 41566 // s41566 - Teleport to Ashtongue NPC's +#define GOSSIP_OLUM1 "Teleport me to the other Ashtongue Deathsworn" + +bool GossipHello_npc_spirit_of_olum(Player* pPlayer, Creature* pCreature) +{ + ScriptedInstance* pInstance = (pCreature->GetInstanceData()); + + if (pInstance && (pInstance->GetData(DATA_SUPREMUSEVENT) >= DONE) && (pInstance->GetData(DATA_HIGHWARLORDNAJENTUSEVENT) >= DONE)) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_spirit_of_olum(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) + pPlayer->CLOSE_GOSSIP_MENU(); + + pPlayer->InterruptNonMeleeSpells(false); + pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, false); + return true; +} + +void AddSC_black_temple() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_spirit_of_olum"; + newscript->pGossipHello = &GossipHello_npc_spirit_of_olum; + newscript->pGossipSelect = &GossipSelect_npc_spirit_of_olum; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_bloodboil.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_bloodboil.cpp new file mode 100644 index 00000000000..12c3d445018 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_bloodboil.cpp @@ -0,0 +1,344 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Bloodboil +SD%Complete: 80 +SDComment: Bloodboil not working correctly, missing enrage +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +//Speech'n'Sound +#define SAY_AGGRO -1564029 +#define SAY_SLAY1 -1564030 +#define SAY_SLAY2 -1564031 +#define SAY_SPECIAL1 -1564032 +#define SAY_SPECIAL2 -1564033 +#define SAY_ENRAGE1 -1564034 +#define SAY_ENRAGE2 -1564035 +#define SAY_DEATH -1564036 + +//Spells +#define SPELL_ACID_GEYSER 40630 +#define SPELL_ACIDIC_WOUND 40481 +#define SPELL_ARCING_SMASH 40599 +#define SPELL_BLOODBOIL 42005 // This spell is AoE whereas it shouldn't be +#define SPELL_FEL_ACID 40508 +#define SPELL_FEL_RAGE_SELF 40594 +#define SPELL_FEL_RAGE_TARGET 40604 +#define SPELL_FEL_RAGE_2 40616 +#define SPELL_FEL_RAGE_3 41625 +#define SPELL_BEWILDERING_STRIKE 40491 +#define SPELL_EJECT1 40486 // 1000 Physical damage + knockback + script effect (should handle threat reduction I think) +#define SPELL_EJECT2 40597 // 1000 Physical damage + Stun (used in phase 2?) +#define SPELL_TAUNT_GURTOGG 40603 +#define SPELL_INSIGNIFIGANCE 40618 +#define SPELL_BERSERK 45078 + +//This is used to sort the players by distance in preparation for the Bloodboil cast. + +struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI +{ + boss_gurtogg_bloodboilAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint64 TargetGUID; + + float TargetThreat; + + uint32 BloodboilTimer; + uint32 BloodboilCount; + uint32 AcidGeyserTimer; + uint32 AcidicWoundTimer; + uint32 ArcingSmashTimer; + uint32 EnrageTimer; + uint32 FelAcidTimer; + uint32 EjectTimer; + uint32 BewilderingStrikeTimer; + uint32 PhaseChangeTimer; + + bool Phase1; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, NOT_STARTED); + + TargetGUID = 0; + + TargetThreat = 0; + + BloodboilTimer = 10000; + BloodboilCount = 0; + AcidGeyserTimer = 1000; + AcidicWoundTimer = 6000; + ArcingSmashTimer = 19000; + EnrageTimer = 600000; + FelAcidTimer = 25000; + EjectTimer = 10000; + BewilderingStrikeTimer = 15000; + PhaseChangeTimer = 60000; + + Phase1 = true; + + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); + } + + void EnterCombat(Unit *who) + { + DoZoneInCombat(); + DoScriptText(SAY_AGGRO, m_creature); + if (pInstance) + pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + if (pInstance) + pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + // Note: This seems like a very complicated fix. The fix needs to be handled by the core, as implementation of limited-target AoE spells are still not limited. + void CastBloodboil() + { + // Get the Threat List + std::list m_threatlist = m_creature->getThreatManager().getThreatList(); + + if (!m_threatlist.size()) // He doesn't have anyone in his threatlist, useless to continue + return; + + std::list targets; + std::list::iterator itr = m_threatlist.begin(); + for(; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container + { + Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + //only on alive players + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + targets.push_back(target); + } + + //Sort the list of players + targets.sort(ObjectDistanceOrderReversed(m_creature)); + //Resize so we only get top 5 + targets.resize(5); + + //Aura each player in the targets list with Bloodboil. Aura code copied+pasted from Aura command in Level3.cpp + /*SpellEntry const *spellInfo = GetSpellStore()->LookupEntry(SPELL_BLOODBOIL); + if (spellInfo) + { + for(std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr) + { + Unit* target = *itr; + if (!target) return; + for(uint32 i = 0;i<3; ++i) + { + uint8 eff = spellInfo->Effect[i]; + if (eff>=TOTAL_SPELL_EFFECTS) + continue; + + Aura *Aur = new Aura(spellInfo, i, NULL, target); + target->AddAura(Aur); + } + } + }*/ + } + + void RevertThreatOnTarget(uint64 guid) + { + Unit* pUnit = NULL; + pUnit = Unit::GetUnit((*m_creature), guid); + if (pUnit) + { + if (DoGetThreat(pUnit)) + DoModifyThreatPercent(pUnit, -100); + if (TargetThreat) + m_creature->AddThreat(pUnit, TargetThreat); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ArcingSmashTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH); + ArcingSmashTimer = 10000; + }else ArcingSmashTimer -= diff; + + if (FelAcidTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FEL_ACID); + FelAcidTimer = 25000; + }else FelAcidTimer -= diff; + + if (!m_creature->HasAura(SPELL_BERSERK)) + { + if (EnrageTimer < diff) + { + DoCast(m_creature, SPELL_BERSERK); + switch(rand()%2) + { + case 0: DoScriptText(SAY_ENRAGE1, m_creature); break; + case 1: DoScriptText(SAY_ENRAGE2, m_creature); break; + } + }else EnrageTimer -= diff; + } + + if (Phase1) + { + if (BewilderingStrikeTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BEWILDERING_STRIKE); + float mt_threat = DoGetThreat(m_creature->getVictim()); + if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) + m_creature->AddThreat(target, mt_threat); + BewilderingStrikeTimer = 20000; + }else BewilderingStrikeTimer -= diff; + + if (EjectTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_EJECT1); + DoModifyThreatPercent(m_creature->getVictim(), -40); + EjectTimer = 15000; + }else EjectTimer -= diff; + + if (AcidicWoundTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ACIDIC_WOUND); + AcidicWoundTimer = 10000; + }else AcidicWoundTimer -= diff; + + if (BloodboilTimer < diff) + { + if (BloodboilCount < 5) // Only cast it five times. + { + //CastBloodboil(); // Causes issues on windows, so is commented out. + DoCast(m_creature->getVictim(), SPELL_BLOODBOIL); + ++BloodboilCount; + BloodboilTimer = 10000*BloodboilCount; + } + }else BloodboilTimer -= diff; + } + + if (!Phase1) + { + if (AcidGeyserTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ACID_GEYSER); + AcidGeyserTimer = 30000; + }else AcidGeyserTimer -= diff; + + if (EjectTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_EJECT2); + EjectTimer = 15000; + }else EjectTimer -= diff; + } + + if (PhaseChangeTimer < diff) + { + if (Phase1) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target && target->isAlive()) + { + Phase1 = false; + + TargetThreat = DoGetThreat(target); + TargetGUID = target->GetGUID(); + target->CastSpell(m_creature, SPELL_TAUNT_GURTOGG, true); + if (DoGetThreat(target)) + DoModifyThreatPercent(target, -100); + m_creature->AddThreat(target, 50000000.0f); + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + // If VMaps are disabled, this spell can call the whole instance + DoCast(m_creature, SPELL_INSIGNIFIGANCE, true); + DoCast(target, SPELL_FEL_RAGE_TARGET, true); + DoCast(target,SPELL_FEL_RAGE_2, true); + /* These spells do not work, comment them out for now. + DoCast(target, SPELL_FEL_RAGE_2, true); + DoCast(target, SPELL_FEL_RAGE_3, true);*/ + + //Cast this without triggered so that it appears in combat logs and shows visual. + DoCast(m_creature, SPELL_FEL_RAGE_SELF); + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; + case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; + } + + AcidGeyserTimer = 1000; + PhaseChangeTimer = 30000; + } + }else // Encounter is a loop pretty much. Phase 1 -> Phase 2 -> Phase 1 -> Phase 2 till death or enrage + { + if (TargetGUID) + RevertThreatOnTarget(TargetGUID); + TargetGUID = 0; + Phase1 = true; + BloodboilTimer = 10000; + BloodboilCount = 0; + AcidicWoundTimer += 2000; + ArcingSmashTimer += 2000; + FelAcidTimer += 2000; + EjectTimer += 2000; + PhaseChangeTimer = 60000; + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); + } + }else PhaseChangeTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_gurtogg_bloodboil(Creature* pCreature) +{ + return new boss_gurtogg_bloodboilAI (pCreature); +} + +void AddSC_boss_gurtogg_bloodboil() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_gurtogg_bloodboil"; + newscript->GetAI = &GetAI_boss_gurtogg_bloodboil; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_illidan.cpp new file mode 100644 index 00000000000..2baa0abbe81 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_illidan.cpp @@ -0,0 +1,2208 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: boss_illidan_stormrage +SD%Complete: 90 +SDComment: Somewhat of a workaround for Parasitic Shadowfiend, unable to summon GOs for Cage Trap. +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +#define GETGO(obj, guid) GameObject* obj = pInstance->instance->GetGameObject(guid) +#define GETUNIT(unit, guid) Unit* unit = Unit::GetUnit(*m_creature, guid) +#define GETCRE(cre, guid) Creature* cre = Unit::GetCreature(*m_creature, guid) +#define HPPCT(unit) unit->GetHealth()*100 / unit->GetMaxHealth() + +/************* Quotes and Sounds ***********************/ +// Gossip for when a player clicks Akama +#define GOSSIP_ITEM "We are ready to face Illidan" + +// Yells for/by Akama +#define SAY_AKAMA_BEWARE "Be wary friends, The Betrayer meditates in the court just beyond." +#define SOUND_AKAMA_BEWARE 11388 +#define SAY_AKAMA_MINION "Come, my minions. Deal with this traitor as he deserves!" +#define SOUND_AKAMA_MINION 11465 +#define SAY_AKAMA_LEAVE "I'll deal with these mongrels. Strike now, friends! Strike at the betrayer!" +#define SOUND_AKAMA_LEAVE 11390 + +// Self explanatory +const char* SAY_KILL1 = "Who shall be next to taste my blades?!"; +#define SOUND_KILL1 11473 +const char* SAY_KILL2 = "This is too easy!"; +#define SOUND_KILL2 11472 + +// I think I'll fly now and let my subordinates take you on +#define SAY_TAKEOFF "I will not be touched by rabble such as you!" +#define SOUND_TAKEOFF 11479 +#define SAY_SUMMONFLAMES "Behold the flames of Azzinoth!" +#define SOUND_SUMMONFLAMES 11480 + +// When casting Eye Blast. Demon Fire will be appear on places that he casts this +#define SAY_EYE_BLAST "Stare into the eyes of the Betrayer!" +#define SOUND_EYE_BLAST 11481 + +// kk, I go big, dark and demon on you. +#define SAY_MORPH "Behold the power... of the demon within!" +#define SOUND_MORPH 11475 + +// I KILL! +#define SAY_ENRAGE "You've wasted too much time mortals, now you shall fall!" +#define SOUND_ENRAGE 11474 + +/************** Spells *************/ +// Normal Form +#define SPELL_SHEAR 37335 // 41032 is bugged, cannot be block/dodge/parry// Reduces Max. Health by 60% for 7 seconds. Can stack 19 times. 1.5 second cast +#define SPELL_FLAME_CRASH 40832 // Summons an invis/unselect passive mob that has an aura of flame in a circle around him. +#define SPELL_DRAW_SOUL 40904 // 5k Shadow Damage in front of him. Heals Illidan for 100k health (script effect) +#define SPELL_PARASITIC_SHADOWFIEND 41917 // DoT of 3k Shadow every 2 seconds. Lasts 10 seconds. (Script effect: Summon 2 parasites once the debuff has ticked off) +#define SPELL_PARASITIC_SHADOWFIEND2 41914 // Used by Parasitic +#define SPELL_SUMMON_PARASITICS 41915 // Summons 2 Parasitic Shadowfiends on the target. It's supposed to be cast as soon as the Parasitic Shadowfiend debuff is gone, but the spells aren't linked :( +#define SPELL_AGONIZING_FLAMES 40932 // 4k fire damage initial to target and anyone w/i 5 yards. PHASE 3 ONLY +#define SPELL_ENRAGE 40683 // Increases damage by 50% and attack speed by 30%. 20 seconds, PHASE 5 ONLY +// Flying (Phase 2) +#define SPELL_THROW_GLAIVE 39635 // Throws a glaive on the ground +#define SPELL_THROW_GLAIVE2 39849 // Animation for the above spell +#define SPELL_GLAIVE_RETURNS 39873 // Glaive flies back to Illidan +#define SPELL_FIREBALL 40598 // 2.5k-3.5k damage in 10 yard radius. 2 second cast time. +#define SPELL_DARK_BARRAGE 40585 // 10 second channeled spell, 3k shadow damage per second. +// Demon Form +#define SPELL_DEMON_TRANSFORM_1 40511 // First phase of animations for transforming into Dark Illidan (fall to ground) +#define SPELL_DEMON_TRANSFORM_2 40398 // Second phase of animations (kneel) +#define SPELL_DEMON_TRANSFORM_3 40510 // Final phase of animations (stand up and roar) +#define SPELL_DEMON_FORM 40506 // Transforms into Demon Illidan. Has an Aura of Dread on him. +#define SPELL_SHADOW_BLAST 41078 // 8k - 11k Shadow Damage. Targets highest threat. Has a splash effect, damaging anyone in 20 yards of the target. +#define SPELL_FLAME_BURST 41126 // Hurls fire at entire raid for ~3.5k damage every 10 seconds. Resistable. (Does not work: Script effect) +#define SPELL_FLAME_BURST_EFFECT 41131 // The actual damage. Have each player cast it on itself (workaround) +// Other Illidan spells +#define SPELL_KNEEL 39656 // Before beginning encounter, this is how he appears (talking to skully). +#define SPELL_SHADOW_PRISON 40647 // Illidan casts this spell to immobilize entire raid when he summons Maiev. +#define SPELL_DEATH 41220 // This spell doesn't do anything except stun Illidan and set him on his knees. +#define SPELL_BERSERK 45078 // Damage increased by 500%, attack speed by 150% +#define SPELL_DUAL_WIELD 42459 +//Phase Normal spells +#define SPELL_FLAME_CRASH_EFFECT 40836 // Firey blue ring of circle that the other flame crash summons +#define SPELL_SUMMON_SHADOWDEMON 41117 // Summon four shadowfiends +#define SPELL_SHADOWFIEND_PASSIVE 41913 // Passive aura for shadowfiends +#define SPELL_SHADOW_DEMON_PASSIVE 41079 // Adds the "shadowform" aura to Shadow Demons. +#define SPELL_CONSUME_SOUL 41080 // Once the Shadow Demons reach their target, they use this to kill them +#define SPELL_PARALYZE 41083 // Shadow Demons cast this on their target +#define SPELL_PURPLE_BEAM 39123 // Purple Beam connecting Shadow Demon to their target +//Phase Flight spells +#define SPELL_AZZINOTH_CHANNEL 39857 // Glaives cast it on Flames. Not sure if this is the right spell. +#define SPELL_EYE_BLAST_TRIGGER 40017 // This summons Demon Form every few seconds and deals ~20k damage in its radius +#define SPELL_EYE_BLAST 39908 // This does the blue flamey animation. +#define SPELL_BLAZE_EFFECT 40610 // Green flame on the ground, triggers damage (5k) every few seconds +#define SPELL_BLAZE_SUMMON 40637 // Summons the Blaze creature +#define SPELL_DEMON_FIRE 40029 // Blue fire trail left by Eye Blast. Deals 2k per second if players stand on it. +#define SPELL_FLAME_BLAST 40631 // Flames of Azzinoth use this. Frontal cone AoE 7k-9k damage. +#define SPELL_CHARGE 41581 //40602 // Flames of Azzinoth charges whoever is too far from them. They enrage after this. For simplicity, we'll use the same enrage as Illidan. +#define SPELL_FLAME_ENRAGE 45078 +//Akama spells +#define SPELL_AKAMA_DOOR_CHANNEL 41268 // Akama's channel spell on the door before the Temple Summit +#define SPELL_DEATHSWORN_DOOR_CHANNEL 41269 // Olum and Udalo's channel spell on the door before the Temple Summit +#define SPELL_AKAMA_DOOR_FAIL 41271 // Not sure where this is really used... +#define SPELL_HEALING_POTION 40535 // Akama uses this to heal himself to full. +#define SPELL_CHAIN_LIGHTNING 40536 // 6938 to 8062 for 5 targets +//Maiev spells +#define SPELL_CAGE_TRAP_DUMMY 40761 // Put this in DB for cage trap GO. +#define SPELL_CAGED 40695 // Caged Trap triggers will cast this on Illidan if he is within 3 yards +#define SPELL_CAGE_TRAP_SUMMON 40694 // Summons a Cage Trap GO (bugged) on the ground along with a Cage Trap Disturb Trigger mob (working) +#define SPELL_CAGE_TRAP_BEAM 40713 // 8 Triggers on the ground in an octagon cast spells like this on Illidan 'caging him' +#define SPELL_TELEPORT_VISUAL 41232 // Teleport visual for Maiev +#define SPELL_SHADOW_STRIKE 40685 // 4375 to 5625 every 3 seconds for 12 seconds +#define SPELL_THROW_DAGGER 41152 // 5400 to 6600 damage, need dagger +#define SPELL_FAN_BLADES 39954 // bugged visual + +// Other defines +#define CENTER_X 676.740 +#define CENTER_Y 305.297 +#define CENTER_Z 353.192 + +#define FLAME_ENRAGE_DISTANCE 30 +#define FLAME_CHARGE_DISTANCE 50 + +#define EQUIP_ID_MAIN_HAND 32837 +#define EQUIP_ID_OFF_HAND 32838 + +/**** Creature Summon and Recognition IDs ****/ +enum CreatureEntry +{ + EMPTY = 0, + AKAMA = 22990, + ILLIDAN_STORMRAGE = 22917, + BLADE_OF_AZZINOTH = 22996, + FLAME_OF_AZZINOTH = 22997, + MAIEV_SHADOWSONG = 23197, + SHADOW_DEMON = 23375, + DEMON_FIRE = 23069, + FLAME_CRASH = 23336, + ILLIDAN_DOOR_TRIGGER = 23412, + SPIRIT_OF_OLUM = 23411, + SPIRIT_OF_UDALO = 23410, + ILLIDARI_ELITE = 23226, + PARASITIC_SHADOWFIEND = 23498, + CAGE_TRAP_TRIGGER = 23292, +}; + +/*** Phase Names ***/ +enum PhaseIllidan +{ + PHASE_ILLIDAN_NULL = 0, + PHASE_NORMAL = 1, + PHASE_FLIGHT = 2, + PHASE_NORMAL_2 = 3, + PHASE_DEMON = 4, + PHASE_NORMAL_MAIEV = 5, + PHASE_TALK_SEQUENCE = 6, + PHASE_FLIGHT_SEQUENCE = 7, + PHASE_TRANSFORM_SEQUENCE = 8, + PHASE_ILLIDAN_MAX = 9, +};//Maiev uses the same phase + +enum PhaseAkama +{ + PHASE_AKAMA_NULL = 0, + PHASE_CHANNEL = 1, + PHASE_WALK = 2, + PHASE_TALK = 3, + PHASE_FIGHT_ILLIDAN = 4, + PHASE_FIGHT_MINIONS = 5, + PHASE_RETURN = 6, +}; + +enum EventIllidan +{ + EVENT_NULL = 0, + EVENT_BERSERK = 1, + //normal phase + EVENT_TAUNT = 2, + EVENT_SHEAR = 3, + EVENT_FLAME_CRASH = 4, + EVENT_PARASITIC_SHADOWFIEND = 5, + EVENT_PARASITE_CHECK = 6, + EVENT_DRAW_SOUL = 7, + EVENT_AGONIZING_FLAMES = 8, + EVENT_TRANSFORM_NORMAL = 9, + EVENT_ENRAGE = 10, + //flight phase + EVENT_FIREBALL = 2, + EVENT_DARK_BARRAGE = 3, + EVENT_EYE_BLAST = 4, + EVENT_MOVE_POINT = 5, + //demon phase + EVENT_SHADOW_BLAST = 2, + EVENT_FLAME_BURST = 3, + EVENT_SHADOWDEMON = 4, + EVENT_TRANSFORM_DEMON = 5, + //sequence phase + EVENT_TALK_SEQUENCE = 2, + EVENT_FLIGHT_SEQUENCE = 2, + EVENT_TRANSFORM_SEQUENCE = 2, +}; + +enum EventMaiev +{ + EVENT_MAIEV_NULL = 0, + EVENT_MAIEV_STEALTH = 1, + EVENT_MAIEV_TAUNT = 2, + EVENT_MAIEV_SHADOW_STRIKE = 3, + EVENT_MAIEV_THROW_DAGGER = 4, + EVENT_MAIEV_TRAP = 4, +}; + +static EventIllidan MaxTimer[]= +{ + EVENT_NULL, + EVENT_DRAW_SOUL, + EVENT_MOVE_POINT, + EVENT_TRANSFORM_NORMAL, + EVENT_TRANSFORM_DEMON, + EVENT_ENRAGE, + EVENT_TALK_SEQUENCE, + EVENT_FLIGHT_SEQUENCE, + EVENT_TRANSFORM_SEQUENCE +}; + +struct Yells +{ + uint32 sound; + char* text; + uint32 pCreature, timer, emote; + bool Talk; +}; + +static Yells Conversation[]= +{ + {11463, "Akama... your duplicity is hardly surprising. I should have slaughtered you and your malformed brethren long ago.", ILLIDAN_STORMRAGE, 8000, 0, true}, + {0, NULL, ILLIDAN_STORMRAGE, 5000, 396, true}, + {11389, "We've come to end your reign, Illidan. My people and all of Outland shall be free!", AKAMA, 7000, 25, true}, + {0, NULL, AKAMA, 5000, 66, true}, + {11464, "Boldly said. But I remain unconvinced.", ILLIDAN_STORMRAGE, 8000, 396, true}, + {11380, "The time has come! The moment is at hand!", AKAMA, 3000, 22, true}, + {0, NULL, AKAMA, 2000, 15, true}, + {11466, "You are not prepared!", ILLIDAN_STORMRAGE, 3000, 406, true}, + {0, NULL, EMPTY, 1000, 0, true}, + {0, NULL, EMPTY, 0, 0, false},//9 + {11476, "Is this it, mortals? Is this all the fury you can muster?", ILLIDAN_STORMRAGE, 8000, 0, true}, + {11491, "Their fury pales before mine, Illidan. We have some unsettled business between us.", MAIEV_SHADOWSONG, 8000, 5, true}, + {11477, "Maiev... How is this even possible?", ILLIDAN_STORMRAGE, 5000, 1, true}, + {11492, "Ah... my long hunt is finally over. Today, Justice will be done!", MAIEV_SHADOWSONG, 8000, 15, true}, + {11470, "Feel the hatred of ten thousand years!", ILLIDAN_STORMRAGE, 1000, 0, false},//14 + {11496, "Ahh... It is finished. You are beaten.", MAIEV_SHADOWSONG, 6000, 0, true},//15 + {11478, "You have won... Maiev...but the huntress... is nothing...without the hunt... you... are nothing... without me..", ILLIDAN_STORMRAGE, 30000, 65, true}, // Emote dead for now. Kill him later + {11497, "He is right. I feel nothing... I am nothing... Farewell, champions.", MAIEV_SHADOWSONG, 9000, 0, true}, + {11498, NULL, MAIEV_SHADOWSONG, 5000, 0, true}, + {11498, NULL, EMPTY, 1000, 0, true},//19 Maiev disappear + {11387, "The Light will fill these dismal halls once again. I swear it.", AKAMA, 8000, 0, true}, + {0, NULL, EMPTY, 1000, 0, false}//21 +}; + +static Yells RandomTaunts[]= +{ + {11467, "I can feel your hatred.", ILLIDAN_STORMRAGE, 0, 0, false}, + {11468, "Give in to your fear!", ILLIDAN_STORMRAGE, 0, 0, false}, + {11469, "You know nothing of power!", ILLIDAN_STORMRAGE, 0, 0, false}, + {11471, "Such... arrogance!", ILLIDAN_STORMRAGE, 0, 0, false} +}; + +static Yells MaievTaunts[]= +{ + {11493, "That is for Naisha!", MAIEV_SHADOWSONG, 0, false}, + {11494, "Bleed as I have bled!", MAIEV_SHADOWSONG, 0, 0, false}, + {11495, "There shall be no prison for you this time!", MAIEV_SHADOWSONG, 0, 0, false}, + {11500, "Meet your end, demon!", MAIEV_SHADOWSONG, 0, 0, false} +}; + +struct Locations +{ + float x, y, z; +}; + +static Locations HoverPosition[]= +{ + {657, 340, 355}, + {657, 275, 355}, + {705, 275, 355}, + {705, 340, 355} +}; + +static Locations GlaivePosition[]= +{ + {695.105, 305.303, 354.256}, + {659.338, 305.303, 354.256},//the distance between two glaives is 36 + {700.105, 305.303, 354.256}, + {664.338, 305.303, 354.256} +}; + +static Locations EyeBlast[]= +{ + {677, 350, 354},//start point, pass through glaive point + {677, 260, 354} +}; + +static Locations AkamaWP[]= +{ + {770.01, 304.50, 312.29}, // Bottom of the first stairs, at the doors + {780.66, 304.50, 319.74}, // Top of the first stairs + {790.13, 319.68, 319.76}, // Bottom of the second stairs (left from the entrance) + {787.17, 347.38, 341.42}, // Top of the second stairs + {781.34, 350.31, 341.44}, // Bottom of the third stairs + {762.60, 361.06, 353.60}, // Top of the third stairs + {756.35, 360.52, 353.27}, // Before the door-thingy + {743.82, 342.21, 353.00}, // Somewhere further + {732.69, 305.13, 353.00}, // In front of Illidan - (8) + {738.11, 365.44, 353.00}, // in front of the door-thingy (the other one!) + {792.18, 366.62, 341.42}, // Down the first flight of stairs + {796.84, 304.89, 319.76}, // Down the second flight of stairs + {782.01, 304.55, 319.76} // Final location - back at the initial gates. This is where he will fight the minions! (12) +}; +// 755.762, 304.0747, 312.1769 -- This is where Akama should be spawned +static Locations SpiritSpawns[]= +{ + {755.5426, 309.9156, 312.2129}, + {755.5426, 298.7923, 312.0834} +}; + +struct Animation // For the demon transformation +{ + uint32 aura, unaura, timer, size, displayid, phase; + bool equip; +}; + +static Animation DemonTransformation[]= +{ + {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, true}, + {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, true}, + {0, 0, 3000, 1073741824, 21322, 6, false},//stunned, cannot cast demon form + {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, false}, + {SPELL_DEMON_FORM, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 4, false}, + {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, false}, + {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, false}, + {0, SPELL_DEMON_FORM, 3000, 1069547520, 21135, 6, false}, + {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, true}, + {0, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 8, true} +}; + + + +/************************************** Illidan's AI ***************************************/ +struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI +{ + boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c), Summons(m_creature) + { + pInstance = c->GetInstanceData(); + m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); + + SpellEntry *TempSpell = GET_SPELL(SPELL_SHADOWFIEND_PASSIVE); + if (TempSpell) + TempSpell->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends + } + + ScriptedInstance* pInstance; + + PhaseIllidan Phase; + EventIllidan Event; + uint32 Timer[EVENT_ENRAGE + 1]; + + uint32 TalkCount; + uint32 TransformCount; + uint32 FlightCount; + + uint32 HoverPoint; + + uint64 AkamaGUID; + uint64 MaievGUID; + uint64 FlameGUID[2]; + uint64 GlaiveGUID[2]; + + SummonList Summons; + + void Reset(); + + void JustSummoned(Creature* summon); + + void SummonedCreatureDespawn(Creature* summon) + { + if (summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH) + { + for(uint8 i = 0; i < 2; ++i) + if (summon->GetGUID() == FlameGUID[i]) + FlameGUID[i] = 0; + + if (!FlameGUID[0] && !FlameGUID[1] && Phase != PHASE_ILLIDAN_NULL) + { + m_creature->InterruptNonMeleeSpells(true); + EnterPhase(PHASE_FLIGHT_SEQUENCE); + } + } + Summons.Despawn(summon); + } + + void MovementInform(uint32 MovementType, uint32 Data) + { + if (FlightCount == 7) //change hover point + { + if (m_creature->getVictim()) + { + m_creature->SetInFront(m_creature->getVictim()); + m_creature->StopMoving(); + } + EnterPhase(PHASE_FLIGHT); + } + else // handle flight sequence + Timer[EVENT_FLIGHT_SEQUENCE] = 1000; + } + + void EnterCombat(Unit *who) + { + m_creature->setActive(true); + DoZoneInCombat(); + } + + void AttackStart(Unit *who) + { + if (!who || Phase >= PHASE_TALK_SEQUENCE) + return; + + if (Phase == PHASE_FLIGHT || Phase == PHASE_DEMON) + AttackStartNoMove(who); + else + ScriptedAI::AttackStart(who); + } + + void MoveInLineOfSight(Unit *who) {} + + void JustDied(Unit *killer) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + if (!pInstance) + return; + + pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, DONE); // Completed + + for(uint8 i = DATA_GAMEOBJECT_ILLIDAN_DOOR_R; i < DATA_GAMEOBJECT_ILLIDAN_DOOR_L + 1; ++i) + pInstance->HandleGameObject(pInstance->GetData64(i), true); + } + + void KilledUnit(Unit *victim) + { + if (victim == m_creature) return; + // TODO: Find better way to handle emote + switch(rand()%2) + { + case 0: + m_creature->MonsterYell(SAY_KILL1, LANG_UNIVERSAL, victim->GetGUID()); + DoPlaySoundToSet(m_creature, SOUND_KILL1); + break; + case 1: + m_creature->MonsterYell(SAY_KILL2, LANG_UNIVERSAL, victim->GetGUID()); + DoPlaySoundToSet(m_creature, SOUND_KILL2); + break; + } + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= m_creature->GetHealth() && done_by != m_creature) + damage = 0; + if (done_by->GetGUID() == MaievGUID) + done_by->AddThreat(m_creature, -(3*(float)damage)/4); // do not let maiev tank him + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades! + { + if (!m_creature->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID)) + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + else + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); + m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + } + } + + void DeleteFromThreatList(uint64 TargetGUID) + { + for(std::list::iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr) + { + if ((*itr)->getUnitGuid() == TargetGUID) + { + (*itr)->removeReference(); + break; + } + } + } + + void Talk(uint32 count) + { + Timer[EVENT_TALK_SEQUENCE] = Conversation[count].timer; + + Creature* pCreature = NULL; + if (Conversation[count].pCreature == ILLIDAN_STORMRAGE) + pCreature = m_creature; + else if (Conversation[count].pCreature == AKAMA) + pCreature = (Unit::GetCreature((*m_creature), AkamaGUID)); + else if (Conversation[count].pCreature == MAIEV_SHADOWSONG) + pCreature = (Unit::GetCreature((*m_creature), MaievGUID)); + + if (pCreature) + { + if (Conversation[count].emote) + pCreature->HandleEmoteCommand(Conversation[count].emote); // Make the Creature do some animation! + if (Conversation[count].text) + pCreature->MonsterYell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the Creature yell out some text + if (Conversation[count].sound) + DoPlaySoundToSet(pCreature, Conversation[count].sound); // Play some sound on the creature + } + } + + void EnterPhase(PhaseIllidan NextPhase); + void CastEyeBlast(); + void SummonFlamesOfAzzinoth(); + void SummonMaiev(); + void HandleTalkSequence(); + void HandleFlightSequence() + { + switch(FlightCount) + { + case 1://lift off + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + m_creature->StopMoving(); + m_creature->MonsterYell(SAY_TAKEOFF, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, SOUND_TAKEOFF); + Timer[EVENT_FLIGHT_SEQUENCE] = 3000; + break; + case 2://move to center + m_creature->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); //+5, for SPELL_THROW_GLAIVE bug + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 3://throw one glaive + { + uint8 i=1; + Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (Glaive) + { + GlaiveGUID[i] = Glaive->GetGUID(); + Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Glaive->SetDisplayId(11686); + Glaive->setFaction(m_creature->getFaction()); + DoCast(Glaive, SPELL_THROW_GLAIVE2); + } + } + Timer[EVENT_FLIGHT_SEQUENCE] = 700; + break; + case 4://throw another + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + { + uint8 i=0; + Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (Glaive) + { + GlaiveGUID[i] = Glaive->GetGUID(); + Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Glaive->SetDisplayId(11686); + Glaive->setFaction(m_creature->getFaction()); + DoCast(Glaive, SPELL_THROW_GLAIVE, true); + } + } + Timer[EVENT_FLIGHT_SEQUENCE] = 5000; + break; + case 5://summon flames + SummonFlamesOfAzzinoth(); + Timer[EVENT_FLIGHT_SEQUENCE] = 3000; + break; + case 6://fly to hover point + m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 7://return to center + m_creature->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z); + Timer[EVENT_FLIGHT_SEQUENCE] = 0; + break; + case 8://glaive return + for(uint8 i = 0; i < 2; ++i) + { + if (GlaiveGUID[i]) + { + Unit* Glaive = Unit::GetUnit((*m_creature), GlaiveGUID[i]); + if (Glaive) + { + Glaive->CastSpell(m_creature, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us + Glaive->SetDisplayId(11686); // disappear but not die for now + } + } + } + Timer[EVENT_FLIGHT_SEQUENCE] = 2000; + break; + case 9://land + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->StopMoving(); + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); + for(uint8 i = 0; i < 2; ++i) + { + if (GlaiveGUID[i]) + { + if (GETUNIT(Glaive, GlaiveGUID[i])) + { + Glaive->SetVisibility(VISIBILITY_OFF); + Glaive->setDeathState(JUST_DIED); // Despawn the Glaive + } + GlaiveGUID[i] = 0; + } + } + Timer[EVENT_FLIGHT_SEQUENCE] = 2000; + break; + case 10://attack + DoResetThreat(); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + EnterPhase(PHASE_NORMAL_2); + break; + default: + break; + } + FlightCount++; + } + + void HandleTransformSequence() + { + if (DemonTransformation[TransformCount].unaura) + m_creature->RemoveAurasDueToSpell(DemonTransformation[TransformCount].unaura); + + if (DemonTransformation[TransformCount].aura) + DoCast(m_creature, DemonTransformation[TransformCount].aura, true); + + if (DemonTransformation[TransformCount].displayid) + m_creature->SetDisplayId(DemonTransformation[TransformCount].displayid); // It's morphin time! + + if (DemonTransformation[TransformCount].equip) + { + // Requip warglaives if needed + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); + m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + } + else + { + // Unequip warglaives if needed + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + } + + switch(TransformCount) + { + case 2: + DoResetThreat(); + break; + case 4: + EnterPhase(PHASE_DEMON); + break; + case 7: + DoResetThreat(); + break; + case 9: + if (MaievGUID) + EnterPhase(PHASE_NORMAL_MAIEV); // Depending on whether we summoned Maiev, we switch to either phase 5 or 3 + else + EnterPhase(PHASE_NORMAL_2); + break; + default: + break; + } + if (Phase == PHASE_TRANSFORM_SEQUENCE) + Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer; + TransformCount++; + } + + void UpdateAI(const uint32 diff) + { + if ((!UpdateVictim()) && Phase < PHASE_TALK_SEQUENCE) + return; + + Event = EVENT_NULL; + for(uint32 i = 1; i <= MaxTimer[Phase]; ++i) + { + if (Timer[i]) // Event is enabled + if (Timer[i] <= diff) + { + if (!Event) // No event with higher priority + Event = (EventIllidan)i; + } + else Timer[i] -= diff; + } + + switch(Phase) + { + case PHASE_NORMAL: + if (HPPCT(m_creature) < 65) + EnterPhase(PHASE_FLIGHT_SEQUENCE); + break; + + case PHASE_NORMAL_2: + if (HPPCT(m_creature) < 30) + EnterPhase(PHASE_TALK_SEQUENCE); + break; + + case PHASE_NORMAL_MAIEV: + if (HPPCT(m_creature) < 1) + EnterPhase(PHASE_TALK_SEQUENCE); + break; + + case PHASE_TALK_SEQUENCE: + if (Event == EVENT_TALK_SEQUENCE) + HandleTalkSequence(); + break; + + case PHASE_FLIGHT_SEQUENCE: + if (Event == EVENT_FLIGHT_SEQUENCE) + HandleFlightSequence(); + break; + + case PHASE_TRANSFORM_SEQUENCE: + if (Event == EVENT_TRANSFORM_SEQUENCE) + HandleTransformSequence(); + break; + } + + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + if (Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED)) + { + switch(Event) + { + //PHASE_NORMAL + case EVENT_BERSERK: + m_creature->MonsterYell(SAY_ENRAGE, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, SOUND_ENRAGE); + DoCast(m_creature, SPELL_BERSERK, true); + Timer[EVENT_BERSERK] = 5000;//The buff actually lasts forever. + break; + + case EVENT_TAUNT: + { + uint32 random = rand()%4; + char* yell = RandomTaunts[random].text; + uint32 soundid = RandomTaunts[random].sound; + if (yell) + m_creature->MonsterYell(yell, LANG_UNIVERSAL, 0); + if (soundid) + DoPlaySoundToSet(m_creature, soundid); + } + Timer[EVENT_TAUNT] = 25000 + rand()%10000; + break; + + case EVENT_SHEAR: + DoCast(m_creature->getVictim(), SPELL_SHEAR); + Timer[EVENT_SHEAR] = 25000 + (rand()%16 * 1000); + break; + + case EVENT_FLAME_CRASH: + DoCast(m_creature->getVictim(), SPELL_FLAME_CRASH); + Timer[EVENT_FLAME_CRASH] = 30000 + rand()%10000; + break; + + case EVENT_PARASITIC_SHADOWFIEND: + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true)) + m_creature->CastSpell(target, SPELL_PARASITIC_SHADOWFIEND, true); + Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000; + }break; + + case EVENT_PARASITE_CHECK: + Timer[EVENT_PARASITE_CHECK] = 0; + break; + + case EVENT_DRAW_SOUL: + DoCast(m_creature->getVictim(), SPELL_DRAW_SOUL); + Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000; + break; + + //PHASE_NORMAL_2 + case EVENT_AGONIZING_FLAMES: + DoCast(SelectUnit(SELECT_TARGET_RANDOM,0), SPELL_AGONIZING_FLAMES); + Timer[EVENT_AGONIZING_FLAMES] = 0; + break; + + case EVENT_TRANSFORM_NORMAL: + EnterPhase(PHASE_TRANSFORM_SEQUENCE); + break; + + //PHASE_NORMAL_MAIEV + case EVENT_ENRAGE: + DoCast(m_creature, SPELL_ENRAGE); + Timer[EVENT_ENRAGE] = 0; + break; + + default: + break; + } + DoMeleeAttackIfReady(); + } + + if (Phase == PHASE_FLIGHT) + { + switch(Event) + { + case EVENT_FIREBALL: + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); + Timer[EVENT_FIREBALL] = 3000; + break; + + case EVENT_DARK_BARRAGE: + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE); + Timer[EVENT_DARK_BARRAGE] = 0; + break; + + case EVENT_EYE_BLAST: + CastEyeBlast(); + Timer[EVENT_EYE_BLAST] = 0; + break; + + case EVENT_MOVE_POINT: + Phase = PHASE_FLIGHT_SEQUENCE; + Timer[EVENT_FLIGHT_SEQUENCE] = 0;//do not start Event when changing hover point + HoverPoint += (rand()%3 + 1); + if (HoverPoint > 3) + HoverPoint -= 4; + m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); + break; + + default: + break; + } + } + + if (Phase == PHASE_DEMON) + { + switch(Event) + { + case EVENT_SHADOW_BLAST: + m_creature->GetMotionMaster()->Clear(false); + if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 50)||!m_creature->IsWithinLOSInMap(m_creature->getVictim())) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30); + else + m_creature->GetMotionMaster()->MoveIdle(); + DoCast(m_creature->getVictim(), SPELL_SHADOW_BLAST); + Timer[EVENT_SHADOW_BLAST] = 4000; + break; + case EVENT_SHADOWDEMON: + DoCast(m_creature, SPELL_SUMMON_SHADOWDEMON); + Timer[EVENT_SHADOWDEMON] = 0; + Timer[EVENT_FLAME_BURST] += 10000; + break; + case EVENT_FLAME_BURST: + DoCast(m_creature, SPELL_FLAME_BURST); + Timer[EVENT_FLAME_BURST] = 15000; + break; + case EVENT_TRANSFORM_DEMON: + EnterPhase(PHASE_TRANSFORM_SEQUENCE); + break; + default: + break; + } + } + } +}; + +/********************************** End of Illidan AI ******************************************/ + +struct TRINITY_DLL_DECL flame_of_azzinothAI : public ScriptedAI +{ + flame_of_azzinothAI(Creature *c) : ScriptedAI(c) {} + + uint32 FlameBlastTimer; + uint32 CheckTimer; + uint64 GlaiveGUID; + + void Reset() + { + FlameBlastTimer = 15000; + CheckTimer = 5000; + GlaiveGUID = 0; + } + + void EnterCombat(Unit *who) {DoZoneInCombat();} + + void ChargeCheck() + { + Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 200, false); + if (target && (!m_creature->IsWithinCombatRange(target, FLAME_CHARGE_DISTANCE))) + { + m_creature->AddThreat(target, 5000000.0f); + AttackStart(target); + DoCast(target, SPELL_CHARGE); + m_creature->MonsterTextEmote("sets its gaze on $N!", target->GetGUID()); + } + } + + void EnrageCheck() + { + if (GETUNIT(Glaive, GlaiveGUID)) + { + if (!m_creature->IsWithinDistInMap(Glaive, FLAME_ENRAGE_DISTANCE)) + { + Glaive->InterruptNonMeleeSpells(true); + DoCast(m_creature, SPELL_FLAME_ENRAGE, true); + DoResetThreat(); + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target && target->isAlive()) + { + m_creature->AddThreat(m_creature->getVictim(), 5000000.0f); + AttackStart(m_creature->getVictim()); + } + } + else if (!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL)) + { + Glaive->CastSpell(m_creature, SPELL_AZZINOTH_CHANNEL, false); + m_creature->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE); + } + } + } + + void SetGlaiveGUID(uint64 guid){ GlaiveGUID = guid; } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (FlameBlastTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BLAZE_SUMMON, true); //appear at victim + DoCast(m_creature->getVictim(), SPELL_FLAME_BLAST); + FlameBlastTimer = 15000; //10000 is official-like? + DoZoneInCombat(); //in case someone is revived + }else FlameBlastTimer -= diff; + + if (CheckTimer < diff) + { + ChargeCheck(); + EnrageCheck(); + CheckTimer = 1000; + }else CheckTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + + + +/******* Functions and vars for Akama's AI ******/ +struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI +{ + npc_akama_illidanAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + PhaseAkama Phase; + bool Event; + uint32 Timer; + + uint64 IllidanGUID; + uint64 ChannelGUID; + uint64 SpiritGUID[2]; + uint64 GateGUID; + uint64 DoorGUID[2]; + + uint32 ChannelCount; + uint32 WalkCount; + uint32 TalkCount; + + void Reset() + { + if (pInstance) + { + pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED); + + IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE); + GateGUID = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_GATE); + DoorGUID[0] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_R); + DoorGUID[1] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_L); + + pInstance->HandleGameObject(GateGUID, false); + + for(uint8 i = 0; i < 2; ++i) + pInstance->HandleGameObject(DoorGUID[i], false); + + } + else + { + IllidanGUID = 0; + GateGUID = 0; + DoorGUID[0] = 0; + DoorGUID[1] = 0; + } + + ChannelGUID = 0; + SpiritGUID[0] = 0; + SpiritGUID[1] = 0; + + Phase = PHASE_AKAMA_NULL; + Timer = 0; + + ChannelCount = 0; + WalkCount = 0; + TalkCount = 0; + + KillAllElites(); + + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values.. + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + m_creature->setActive(false); + } + + // Do not call reset in Akama's evade mode, as this will stop him from summoning minions after he kills the first bit + void EnterEvadeMode() + { + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + } + + void EnterCombat(Unit *who) {} + void MoveInLineOfSight(Unit* who) {} + + void MovementInform(uint32 MovementType, uint32 Data) {Timer = 1;} + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage > m_creature->GetHealth() || done_by->GetGUID() != IllidanGUID) + damage = 0; + } + + void KillAllElites() + { + std::list& threatList = m_creature->getThreatManager().getThreatList(); + std::vector eliteList; + for(std::list::iterator itr = threatList.begin(); itr != threatList.end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); + if (pUnit && pUnit->GetEntry() == ILLIDARI_ELITE) + eliteList.push_back(pUnit); + } + for(std::vector::iterator itr = eliteList.begin(); itr != eliteList.end(); ++itr) + (*itr)->setDeathState(JUST_DIED); + EnterEvadeMode(); + } + + void BeginTalk() + { + if (!pInstance) + return; + + pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, IN_PROGRESS); + + for(uint8 i = 0; i < 2; ++i) + pInstance->HandleGameObject(DoorGUID[i], false); + + if (GETCRE(Illidan, IllidanGUID)) + { + Illidan->RemoveAurasDueToSpell(SPELL_KNEEL); + m_creature->SetInFront(Illidan); + Illidan->SetInFront(m_creature); + m_creature->GetMotionMaster()->MoveIdle(); + Illidan->GetMotionMaster()->MoveIdle(); + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->AkamaGUID = m_creature->GetGUID(); + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE); + } + } + + void BeginChannel() + { + m_creature->setActive(true); + + float x, y, z; + if (GETGO(Gate, GateGUID)) + Gate->GetPosition(x, y, z); + else + return;//if door not spawned, don't crash server + + if (Creature* Channel = m_creature->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000)) + { + ChannelGUID = Channel->GetGUID(); + Channel->SetDisplayId(11686); // Invisible but spell visuals can still be seen. + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + DoCast(Channel, SPELL_AKAMA_DOOR_FAIL); + } + + for(uint8 i = 0; i < 2; ++i) + if (Creature* Spirit = m_creature->SummonCreature(i ? SPIRIT_OF_OLUM : SPIRIT_OF_UDALO, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_DESPAWN, 20000)) + { + Spirit->SetVisibility(VISIBILITY_OFF); + SpiritGUID[i] = Spirit->GetGUID(); + } + } + + void BeginWalk() + { + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->SetSpeed(MOVE_RUN, 1.0f); + m_creature->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); + } + + void EnterPhase(PhaseAkama NextPhase) + { + if (!pInstance) return; + switch(NextPhase) + { + case PHASE_CHANNEL: + BeginChannel(); + Timer = 5000; + ChannelCount = 0; + break; + case PHASE_WALK: + if (Phase == PHASE_CHANNEL) + WalkCount = 0; + else if (Phase == PHASE_TALK) + { + if (GETCRE(Illidan, IllidanGUID)) + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID()); + EnterEvadeMode(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + WalkCount++; + } + BeginWalk(); + Timer = 0; + break; + case PHASE_TALK: + if (Phase == PHASE_WALK) + { + BeginTalk(); + Timer = 0; + } + else if (Phase == PHASE_FIGHT_ILLIDAN) + { + Timer = 1; + TalkCount = 0; + } + break; + case PHASE_FIGHT_ILLIDAN: + if (GETUNIT(Illidan, IllidanGUID)) + { + m_creature->AddThreat(Illidan, 10000000.0f); + m_creature->GetMotionMaster()->MoveChase(Illidan); + } + Timer = 30000; //chain lightning + break; + case PHASE_FIGHT_MINIONS: + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Timer = 10000 + rand()%6000;//summon minion + break; + case PHASE_RETURN: + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + KillAllElites(); + WalkCount = 0; + BeginWalk(); + Timer = 1; + break; + default: + break; + } + Phase = NextPhase; + Event = false; + } + + void HandleTalkSequence() + { + switch(TalkCount) + { + case 0: + if (GETCRE(Illidan, IllidanGUID)) + { + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->Timer[EVENT_TAUNT] += 30000; + Illidan->MonsterYell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(Illidan, SOUND_AKAMA_MINION); + } + Timer = 8000; + break; + case 1: + m_creature->MonsterYell(SAY_AKAMA_LEAVE, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, SOUND_AKAMA_LEAVE); + Timer = 3000; + break; + case 2: + EnterPhase(PHASE_WALK); + break; + } + TalkCount++; + } + + void HandleChannelSequence() + { + Unit* Channel, *Spirit[2]; + if (ChannelCount <= 5) + { + Channel = Unit::GetUnit((*m_creature), ChannelGUID); + Spirit[0] = Unit::GetUnit((*m_creature), SpiritGUID[0]); + Spirit[1] = Unit::GetUnit((*m_creature), SpiritGUID[1]); + if (!Channel || !Spirit[0] || !Spirit[1]) + return; + } + + switch(ChannelCount) + { + case 0: // channel failed + m_creature->InterruptNonMeleeSpells(true); + Timer = 2000; + break; + case 1: // spirit appear + Spirit[0]->SetVisibility(VISIBILITY_ON); + Spirit[1]->SetVisibility(VISIBILITY_ON); + Timer = 2000; + break; + case 2: // spirit help + DoCast(Channel, SPELL_AKAMA_DOOR_CHANNEL); + Spirit[0]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false); + Spirit[1]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false); + Timer = 5000; + break; + case 3: //open the gate + m_creature->InterruptNonMeleeSpells(true); + Spirit[0]->InterruptNonMeleeSpells(true); + Spirit[1]->InterruptNonMeleeSpells(true); + pInstance->HandleGameObject(GateGUID, true); + Timer = 2000; + break; + case 4: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); + Timer = 2000; + break; + case 5: + m_creature->MonsterYell(SAY_AKAMA_BEWARE, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, SOUND_AKAMA_BEWARE); + Channel->setDeathState(JUST_DIED); + Spirit[0]->SetVisibility(VISIBILITY_OFF); + Spirit[1]->SetVisibility(VISIBILITY_OFF); + Timer = 3000; + break; + case 6: + EnterPhase(PHASE_WALK); + break; + default: + break; + } + ChannelCount++; + } + + void HandleWalkSequence() + { + switch(WalkCount) + { + case 6: + for(uint8 i = 0; i < 2; ++i) + pInstance->HandleGameObject(DoorGUID[i], true); + break; + case 8: + if (Phase == PHASE_WALK) + EnterPhase(PHASE_TALK); + else + EnterPhase(PHASE_FIGHT_ILLIDAN); + break; + case 12: + EnterPhase(PHASE_FIGHT_MINIONS); + break; + } + + if (Phase == PHASE_WALK) + { + Timer = 0; + WalkCount++; + m_creature->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); + } + } + + void UpdateAI(const uint32 diff) + { + Event = false; + if (Timer) + { + if (Timer <= diff) + Event = true; + else Timer -= diff; + } + + if (Event) + { + switch(Phase) + { + case PHASE_CHANNEL: + HandleChannelSequence(); + break; + case PHASE_TALK: + HandleTalkSequence(); + break; + case PHASE_WALK: + case PHASE_RETURN: + HandleWalkSequence(); + break; + case PHASE_FIGHT_ILLIDAN: + { + GETUNIT(Illidan, IllidanGUID); + if (Illidan && HPPCT(Illidan) < 90) + EnterPhase(PHASE_TALK); + else + { + DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING); + Timer = 30000; + } + }break; + case PHASE_FIGHT_MINIONS: + { + float x, y, z; + m_creature->GetPosition(x, y, z); + Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); + //Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); + if (Elite) + { + Elite->AI()->AttackStart(m_creature); + Elite->AddThreat(m_creature, 1000000.0f); + AttackStart(Elite); + m_creature->AddThreat(Elite, 1000000.0f); + } + Timer = 10000 + rand()%6000; + GETUNIT(Illidan, IllidanGUID); + if (Illidan && HPPCT(Illidan) < 10) + EnterPhase(PHASE_RETURN); + } + break; + default: + break; + } + } + + if (!UpdateVictim()) + return; + + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 20) + DoCast(m_creature, SPELL_HEALING_POTION); + + DoMeleeAttackIfReady(); + } +}; + + +struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI +{ + boss_maievAI(Creature *c) : ScriptedAI(c) {}; + + uint64 IllidanGUID; + + PhaseIllidan Phase; + EventMaiev Event; + uint32 Timer[5]; + uint32 MaxTimer; + + void Reset() + { + MaxTimer = 0; + Phase = PHASE_NORMAL_MAIEV; + IllidanGUID = 0; + Timer[EVENT_MAIEV_STEALTH] = 0; + Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; + Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000; + SetEquipmentSlots(false, 44850, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, 45738); + } + + void EnterCombat(Unit *who) {} + void MoveInLineOfSight(Unit *who) {} + void EnterEvadeMode() {} + void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetGUID() != IllidanGUID) + damage = 0; + else + { + GETUNIT(Illidan, IllidanGUID); + if (Illidan && Illidan->getVictim() == m_creature) + damage = m_creature->GetMaxHealth()/10; + if (damage >= m_creature->GetHealth()) + damage = 0; + } + } + + void AttackStart(Unit *who) + { + if (!who || Timer[EVENT_MAIEV_STEALTH]) + return; + + if (Phase == PHASE_TALK_SEQUENCE) + AttackStartNoMove(who); + else if (Phase == PHASE_DEMON || Phase == PHASE_TRANSFORM_SEQUENCE) + { + GETUNIT(Illidan, IllidanGUID); + if (Illidan && m_creature->IsWithinDistInMap(Illidan, 25)) + BlinkToPlayer();//Do not let dread aura hurt her. + AttackStartNoMove(who); + } + else + ScriptedAI::AttackStart(who); + } + + void DoAction(const int32 param) + { + if (param > PHASE_ILLIDAN_NULL && param < PHASE_ILLIDAN_MAX) + EnterPhase(PhaseIllidan(param)); + } + + void EnterPhase(PhaseIllidan NextPhase)//This is in fact Illidan's phase. + { + switch(NextPhase) + { + case PHASE_TALK_SEQUENCE: + if (Timer[EVENT_MAIEV_STEALTH]) + { + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->SetVisibility(VISIBILITY_ON); + Timer[EVENT_MAIEV_STEALTH] = 0; + } + m_creature->InterruptNonMeleeSpells(false); + m_creature->GetMotionMaster()->Clear(false); + m_creature->AttackStop(); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID); + MaxTimer = 0; + break; + case PHASE_TRANSFORM_SEQUENCE: + MaxTimer = 4; + Timer[EVENT_MAIEV_TAUNT] += 10000; + Timer[EVENT_MAIEV_THROW_DAGGER] = 2000; + break; + case PHASE_DEMON: + break; + case PHASE_NORMAL_MAIEV: + MaxTimer = 4; + Timer[EVENT_MAIEV_TAUNT] += 10000; + Timer[EVENT_MAIEV_TRAP] = 22000; + break; + default: + break; + } + if (Timer[EVENT_MAIEV_STEALTH]) + MaxTimer = 1; + Phase = NextPhase; + } + + void BlinkTo(float x, float y, float z) + { + m_creature->AttackStop(); + m_creature->InterruptNonMeleeSpells(false); + m_creature->GetMotionMaster()->Clear(false); + DoTeleportTo(x, y, z); + DoCast(m_creature, SPELL_TELEPORT_VISUAL, true); + } + + void BlinkToPlayer() + { + if (GETCRE(Illidan, IllidanGUID)) + { + Unit* target = CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (!target || !m_creature->IsWithinDistInMap(target, 80) || Illidan->IsWithinDistInMap(target, 20)) + { + uint8 pos = rand()%4; + BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z); + } + else + { + float x, y, z; + target->GetPosition(x, y, z); + BlinkTo(x, y, z); + } + } + } + + void UpdateAI(const uint32 diff) + { + if ((!UpdateVictim()) + && !Timer[EVENT_MAIEV_STEALTH]) + return; + + Event = EVENT_MAIEV_NULL; + for(uint8 i = 1; i <= MaxTimer; ++i) + if (Timer[i]) + { + if (Timer[i] <= diff) + Event = (EventMaiev)i; + else Timer[i] -= diff; + } + + switch(Event) + { + case EVENT_MAIEV_STEALTH: + { + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Timer[EVENT_MAIEV_STEALTH] = 0; + BlinkToPlayer(); + EnterPhase(Phase); + }break; + case EVENT_MAIEV_TAUNT: + { + uint32 random = rand()%4; + char* text = MaievTaunts[random].text; + uint32 sound = MaievTaunts[random].sound; + m_creature->MonsterYell(text, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, sound); + Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; + }break; + case EVENT_MAIEV_SHADOW_STRIKE: + DoCast(m_creature->getVictim(), SPELL_SHADOW_STRIKE); + Timer[EVENT_MAIEV_SHADOW_STRIKE] = 60000; + break; + case EVENT_MAIEV_TRAP: + if (Phase == PHASE_NORMAL_MAIEV) + { + BlinkToPlayer(); + DoCast(m_creature, SPELL_CAGE_TRAP_SUMMON); + Timer[EVENT_MAIEV_TRAP] = 22000; + } + else + { + if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 40)) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30); + DoCast(m_creature->getVictim(), SPELL_THROW_DAGGER); + Timer[EVENT_MAIEV_THROW_DAGGER] = 2000; + } + break; + default: + break; + } + + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + if (GETCRE(Illidan, IllidanGUID)) + CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID()); + m_creature->AttackStop(); + Timer[EVENT_MAIEV_STEALTH] = 60000; //reappear after 1 minute + MaxTimer = 1; + } + + if (Phase == PHASE_NORMAL_MAIEV) + DoMeleeAttackIfReady(); + } +}; + + +bool GossipSelect_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event + { + pPlayer->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_akama_illidanAI, pCreature->AI())->EnterPhase(PHASE_CHANNEL); + } + return true; +} + +bool GossipHello_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature) +{ + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); + pPlayer->SEND_GOSSIP_MENU(10465, pCreature->GetGUID()); + + return true; +} + +struct TRINITY_DLL_DECL cage_trap_triggerAI : public ScriptedAI +{ + cage_trap_triggerAI(Creature *c) : ScriptedAI(c) {} + + uint64 IllidanGUID; + uint32 DespawnTimer; + + bool Active; + bool SummonedBeams; + + void Reset() + { + IllidanGUID = 0; + + Active = false; + SummonedBeams = false; + + DespawnTimer = 0; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit *who){} + + void MoveInLineOfSight(Unit *who) + { + if (!Active) + return; + + if (who && (who->GetTypeId() != TYPEID_PLAYER)) + { + if (who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan + { + if (!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED))) + { + IllidanGUID = who->GetGUID(); + who->CastSpell(who, SPELL_CAGED, true); + DespawnTimer = 5000; + if (who->HasAura(SPELL_ENRAGE)) + who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage + //if (GameObject* CageTrap = pInstance->instance->GetGameObject(pInstance->GetData64(CageTrapGUID))) + // CageTrap->SetLootState(GO_JUST_DEACTIVATED); + } + } + } + } + + void UpdateAI(const uint32 diff) + { + if (DespawnTimer) + if (DespawnTimer < diff) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + else DespawnTimer -= diff; + + //if (IllidanGUID && !SummonedBeams) + //{ + // if (Unit* Illidan = Unit::GetUnit(*m_creature, IllidanGUID) + // { + // //TODO: Find proper spells and properly apply 'caged' Illidan effect + // } + //} + } +}; + +bool GOHello_cage_trap(Player* pPlayer, GameObject* pGo) +{ + float x, y, z; + pPlayer->GetPosition(x, y, z); + + // Grid search for nearest live Creature of entry 23304 within 10 yards + if (Creature* pTrigger = pGo->FindNearestCreature(23304, 10.0f)) + CAST_AI(cage_trap_triggerAI, pTrigger->AI())->Active = true; + pGo->SetGoState(GO_STATE_ACTIVE); + return true; +} + +struct TRINITY_DLL_DECL shadow_demonAI : public ScriptedAI +{ + shadow_demonAI(Creature *c) : ScriptedAI(c) {} + + uint64 TargetGUID; + + void EnterCombat(Unit *who) {DoZoneInCombat();} + + void Reset() + { + TargetGUID = 0; + m_creature->CastSpell(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true); + } + + void JustDied(Unit *killer) + { + if (Unit* target = Unit::GetUnit((*m_creature), TargetGUID)) + target->RemoveAurasDueToSpell(SPELL_PARALYZE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) return; + + if (m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players. + + if (!m_creature->getVictim()->HasAura(SPELL_PARALYZE)) + { + TargetGUID = m_creature->getVictim()->GetGUID(); + m_creature->AddThreat(m_creature->getVictim(), 10000000.0f); + DoCast(m_creature->getVictim(), SPELL_PURPLE_BEAM, true); + DoCast(m_creature->getVictim(), SPELL_PARALYZE, true); + } + // Kill our target if we're very close. + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 3)) + DoCast(m_creature->getVictim(), SPELL_CONSUME_SOUL); + } +}; + +// Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap +struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI +{ + mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + uint64 IllidanGUID; + uint32 CheckTimer; + + void Reset() + { + if (pInstance) + IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE); + else + IllidanGUID = 0; + + CheckTimer = 5000; + DoCast(m_creature, SPELL_SHADOWFIEND_PASSIVE, true); + } + + void EnterCombat(Unit* who) { DoZoneInCombat(); } + + void DoMeleeAttackIfReady() + { + if (m_creature->isAttackReady() && m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + if (!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND) + && !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) + { + if (Creature* illidan = Unit::GetCreature((*m_creature),IllidanGUID))//summon only in 1. phase + if (CAST_AI(boss_illidan_stormrageAI, illidan->AI())->Phase == PHASE_NORMAL) + m_creature->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack + } + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->getVictim()) + { + if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) + AttackStart(target); + else + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->setDeathState(JUST_DIED); + return; + } + } + + if (CheckTimer < diff) + { + GETUNIT(Illidan, IllidanGUID); + if (!Illidan || CAST_CRE(Illidan)->IsInEvadeMode()) + { + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->setDeathState(JUST_DIED); + return; + }else CheckTimer = 5000; + }else CheckTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL blade_of_azzinothAI : public NullCreatureAI +{ + blade_of_azzinothAI(Creature* c) : NullCreatureAI(c) {} + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_THROW_GLAIVE2 || spell->Id == SPELL_THROW_GLAIVE) + me->SetDisplayId(21431);//appear when hit by Illidan's glaive + } +}; + +void boss_illidan_stormrageAI::Reset() +{ + if (pInstance) + pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED); + + if (AkamaGUID) + { + if (GETCRE(Akama, AkamaGUID)) + { + if (!Akama->isAlive()) + Akama->Respawn(); + else + { + CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterEvadeMode(); + Akama->GetMotionMaster()->MoveTargetedHome(); + CAST_AI(npc_akama_illidanAI, Akama->AI())->Reset(); + } + } + AkamaGUID = 0; + } + + MaievGUID = 0; + for(uint8 i = 0; i < 2; ++i) + { + FlameGUID[i] = 0; + GlaiveGUID[i] = 0; + } + + Phase = PHASE_ILLIDAN_NULL; + Event = EVENT_NULL; + Timer[EVENT_BERSERK] = 1500000; + + HoverPoint = 0; + TalkCount = 0; + FlightCount = 0; + TransformCount = 0; + + m_creature->SetDisplayId(21135); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->setActive(false); + Summons.DespawnAll(); +} + +void boss_illidan_stormrageAI::JustSummoned(Creature* summon) +{ + Summons.Summon(summon); + switch(summon->GetEntry()) + { + case PARASITIC_SHADOWFIEND: + { + if (Phase == PHASE_TALK_SEQUENCE) + { + summon->SetVisibility(VISIBILITY_OFF); + summon->setDeathState(JUST_DIED); + return; + } + Unit *target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true); + if (!target || target->HasAura(SPELL_PARASITIC_SHADOWFIEND) + || target->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); + if (target) + summon->AI()->AttackStart(target); + }break; + case SHADOW_DEMON: + if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players. + { + summon->AddThreat(target, 5000000.0f); + summon->AI()->AttackStart(target); + }break; + case MAIEV_SHADOWSONG: + { + summon->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk + summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + MaievGUID = summon->GetGUID(); + CAST_AI(boss_maievAI, summon->AI())->GetIllidanGUID(m_creature->GetGUID()); + summon->AI()->DoAction(PHASE_TALK_SEQUENCE); + }break; + case FLAME_OF_AZZINOTH: + { + summon->AI()->AttackStart(summon->SelectNearestTarget(999)); + }break; + default: + break; + } +} + +void boss_illidan_stormrageAI::HandleTalkSequence() +{ + switch(TalkCount) + { + case 0: + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + break; + case 8: + // Equip our warglaives! + SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); + m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + break; + case 9: + if (GETCRE(Akama, AkamaGUID)) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + m_creature->AddThreat(Akama, 100.0f); + CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN); + EnterPhase(PHASE_NORMAL); + } + break; + case 10: + SummonMaiev(); + break; + case 11: + if (GETUNIT(Maiev, MaievGUID)) + { + Maiev->SetVisibility(VISIBILITY_ON); // Maiev is now visible + Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); // onoz she looks like she teleported! + Maiev->SetInFront(m_creature); // Have her face us + m_creature->SetInFront(Maiev); // Face her, so it's not rude =P + Maiev->GetMotionMaster()->MoveIdle(); + m_creature->GetMotionMaster()->MoveIdle(); + }break; + case 14: + if (GETCRE(Maiev, MaievGUID)) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + Maiev->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + Maiev->AddThreat(m_creature, 10000000.0f); // Have Maiev add a lot of threat on us so that players don't pull her off if they damage her via AOE + Maiev->AI()->AttackStart(m_creature); // Force Maiev to attack us. + EnterPhase(PHASE_NORMAL_MAIEV); + }break; + case 15: + DoCast(m_creature, SPELL_DEATH); // Animate his kneeling + stun him + Summons.DespawnAll(); + break; + case 17: + if (GETUNIT(Akama, AkamaGUID)) + { + if (!m_creature->IsWithinDistInMap(Akama, 15)) + { + float x, y, z; + m_creature->GetPosition(x, y, z); + x += 10; y += 10; + Akama->GetMotionMaster()->Clear(false); + //Akama->GetMotionMaster()->MoveIdle(); + Akama->GetMap()->CreatureRelocation(m_creature, x, y, z, 0.0f); + Akama->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_NONE, 0);//Illidan must not die until Akama arrives. + Akama->GetMotionMaster()->MoveChase(m_creature); + } + } + break; + case 19: // Make Maiev leave + if (GETUNIT(Maiev, MaievGUID)) + { + Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); + Maiev->setDeathState(JUST_DIED); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); + } + break; + case 21: // Kill ourself. + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + break; + default: + break; + } + if (Phase == PHASE_TALK_SEQUENCE) + Talk(TalkCount); // This function does most of the talking + TalkCount++; +} + + +void boss_illidan_stormrageAI::CastEyeBlast() +{ + m_creature->InterruptNonMeleeSpells(false); + + m_creature->MonsterYell(SAY_EYE_BLAST, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, SOUND_EYE_BLAST); + + float distx, disty, dist[2]; + for(uint8 i = 0; i < 2; ++i) + { + distx = EyeBlast[i].x - HoverPosition[HoverPoint].x; + disty = EyeBlast[i].y - HoverPosition[HoverPoint].y; + dist[i] = distx * distx + disty * disty; + } + Locations initial = EyeBlast[dist[0] < dist[1] ? 0 : 1]; + for(uint8 i = 0; i < 2; ++i) + { + distx = GlaivePosition[i].x - HoverPosition[HoverPoint].x; + disty = GlaivePosition[i].y - HoverPosition[HoverPoint].y; + dist[i] = distx * distx + disty * disty; + } + Locations final = GlaivePosition[dist[0] < dist[1] ? 0 : 1]; + + final.x = 2 * final.x - initial.x; + final.y = 2 * final.y - initial.y; + + Creature* Trigger = m_creature->SummonTrigger(initial.x, initial.y, initial.z, 0, 13000); + if (!Trigger) return; + + Trigger->SetSpeed(MOVE_WALK, 3); + Trigger->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z); + + //Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID()); + DoCast(Trigger, SPELL_EYE_BLAST); +} + +void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth() +{ + m_creature->MonsterYell(SAY_SUMMONFLAMES, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, SOUND_SUMMONFLAMES); + + for(uint8 i = 0; i < 2; ++i) + { + if (GETUNIT(Glaive, GlaiveGUID[i])) + { + Creature* Flame = m_creature->SummonCreature(FLAME_OF_AZZINOTH, GlaivePosition[i+2].x, GlaivePosition[i+2].y, GlaivePosition[i+2].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); + if (Flame) + { + Flame->setFaction(m_creature->getFaction()); // Just in case the database has it as a different faction + Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE); + FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase + CAST_AI(flame_of_azzinothAI, Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]); + Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, false); // Glaives do some random Beam type channel on it. + } + } + } +} + +void boss_illidan_stormrageAI::SummonMaiev() +{ + m_creature->CastSpell(m_creature, SPELL_SHADOW_PRISON, true); + m_creature->CastSpell(m_creature, 40403, true); + if (!MaievGUID) // If Maiev cannot be summoned, reset the encounter and post some errors to the console. + { + EnterEvadeMode(); + m_creature->MonsterTextEmote("is unable to summon Maiev Shadowsong and enter Phase 4. Resetting Encounter.", 0); + error_log("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)"); + } +} + + +void boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase) +{ + DoZoneInCombat(); + switch(NextPhase) + { + case PHASE_NORMAL: + case PHASE_NORMAL_2: + case PHASE_NORMAL_MAIEV: + AttackStart(m_creature->getVictim()); + Timer[EVENT_TAUNT] = 32000; + Timer[EVENT_SHEAR] = 10000 + rand()%15 * 1000; + Timer[EVENT_FLAME_CRASH] = 20000; + Timer[EVENT_PARASITIC_SHADOWFIEND] = 25000; + Timer[EVENT_PARASITE_CHECK] = 0; + Timer[EVENT_DRAW_SOUL] = 30000; + if (NextPhase == PHASE_NORMAL) + break; + Timer[EVENT_AGONIZING_FLAMES] = 35000; + Timer[EVENT_TRANSFORM_NORMAL] = 60000; + if (NextPhase == PHASE_NORMAL_2) + break; + Timer[EVENT_ENRAGE] = 30000 + rand()%10 * 1000; + break; + case PHASE_FLIGHT: + Timer[EVENT_FIREBALL] = 1000; + if (!(rand()%4)) + Timer[EVENT_DARK_BARRAGE] = 10000; + Timer[EVENT_EYE_BLAST] = 10000 + rand()%15 * 1000; + Timer[EVENT_MOVE_POINT] = 20000 + rand()%20 * 1000; + break; + case PHASE_DEMON: + Timer[EVENT_SHADOW_BLAST] = 1000; + Timer[EVENT_FLAME_BURST] = 10000; + Timer[EVENT_SHADOWDEMON] = 30000; + Timer[EVENT_TRANSFORM_DEMON] = 60000; + AttackStart(m_creature->getVictim()); + break; + case PHASE_TALK_SEQUENCE: + Timer[EVENT_TALK_SEQUENCE] = 100; + m_creature->RemoveAllAuras(); + m_creature->InterruptNonMeleeSpells(false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); + m_creature->GetMotionMaster()->Clear(false); + m_creature->AttackStop(); + break; + case PHASE_FLIGHT_SEQUENCE: + if (Phase == PHASE_NORMAL) //lift off + { + FlightCount = 1; + Timer[EVENT_FLIGHT_SEQUENCE] = 1; + m_creature->RemoveAllAuras(); + m_creature->InterruptNonMeleeSpells(false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->GetMotionMaster()->Clear(false); + m_creature->AttackStop(); + } + else //land + Timer[EVENT_FLIGHT_SEQUENCE] = 2000; + break; + case PHASE_TRANSFORM_SEQUENCE: + if (Phase == PHASE_DEMON) + Timer[EVENT_TRANSFORM_SEQUENCE] = 500; + else + { + TransformCount = 0; + Timer[EVENT_TRANSFORM_SEQUENCE] = 500; + m_creature->MonsterYell(SAY_MORPH, LANG_UNIVERSAL, 0); + DoPlaySoundToSet(m_creature, SOUND_MORPH); + } + m_creature->GetMotionMaster()->Clear(); + m_creature->AttackStop(); + break; + default: + break; + } + if (MaievGUID) + { + GETCRE(Maiev, MaievGUID); + if (Maiev && Maiev->isAlive()) + Maiev->AI()->DoAction(NextPhase); + } + Phase = NextPhase; + Event = EVENT_NULL; +} + +CreatureAI* GetAI_boss_illidan_stormrage(Creature* pCreature) +{ + return new boss_illidan_stormrageAI (pCreature); +} + +CreatureAI* GetAI_npc_akama_at_illidan(Creature* pCreature) +{ + return new npc_akama_illidanAI(pCreature); +} + +CreatureAI* GetAI_boss_maiev(Creature* pCreature) +{ + return new boss_maievAI (pCreature); +} + +CreatureAI* GetAI_mob_flame_of_azzinoth(Creature* pCreature) +{ + return new flame_of_azzinothAI (pCreature); +} + +CreatureAI* GetAI_cage_trap_trigger(Creature* pCreature) +{ + return new cage_trap_triggerAI (pCreature); +} + +CreatureAI* GetAI_shadow_demon(Creature* pCreature) +{ + return new shadow_demonAI (pCreature); +} + +CreatureAI* GetAI_blade_of_azzinoth(Creature* pCreature) +{ + return new blade_of_azzinothAI (pCreature); +} + +CreatureAI* GetAI_parasitic_shadowfiend(Creature* pCreature) +{ + return new mob_parasitic_shadowfiendAI (pCreature); +} + +void AddSC_boss_illidan() +{ + Script* newscript; + + newscript = new Script; + newscript->Name = "boss_illidan_stormrage"; + newscript->GetAI = &GetAI_boss_illidan_stormrage; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_akama_illidan"; + newscript->GetAI = &GetAI_npc_akama_at_illidan; + newscript->pGossipHello = &GossipHello_npc_akama_at_illidan; + newscript->pGossipSelect = &GossipSelect_npc_akama_at_illidan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_maiev_shadowsong"; + newscript->GetAI = &GetAI_boss_maiev; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_flame_of_azzinoth"; + newscript->GetAI = &GetAI_mob_flame_of_azzinoth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_blade_of_azzinoth"; + newscript->GetAI = &GetAI_blade_of_azzinoth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "gameobject_cage_trap"; + newscript->pGOHello = &GOHello_cage_trap; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_cage_trap_trigger"; + newscript->GetAI = &GetAI_cage_trap_trigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shadow_demon"; + newscript->GetAI = &GetAI_shadow_demon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_parasitic_shadowfiend"; + newscript->GetAI = &GetAI_parasitic_shadowfiend; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_mother_shahraz.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_mother_shahraz.cpp new file mode 100644 index 00000000000..a33874c74cf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_mother_shahraz.cpp @@ -0,0 +1,315 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Mother_Shahraz +SD%Complete: 80 +SDComment: Saber Lash missing, Fatal Attraction slightly incorrect; need to damage only if affected players are within range of each other +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +//Speech'n'Sounds +#define SAY_TAUNT1 -1564018 +#define SAY_TAUNT2 -1564019 +#define SAY_TAUNT3 -1564020 +#define SAY_AGGRO -1564021 +#define SAY_SPELL1 -1564022 +#define SAY_SPELL2 -1564023 +#define SAY_SPELL3 -1564024 +#define SAY_SLAY1 -1564025 +#define SAY_SLAY2 -1564026 +#define SAY_ENRAGE -1564027 +#define SAY_DEATH -1564028 + +//Spells +#define SPELL_BEAM_SINISTER 40859 +#define SPELL_BEAM_VILE 40860 +#define SPELL_BEAM_WICKED 40861 +#define SPELL_BEAM_SINFUL 40827 +#define SPELL_ATTRACTION 40871 +#define SPELL_SILENCING_SHRIEK 40823 +#define SPELL_ENRAGE 23537 +#define SPELL_SABER_LASH 40810//43267 +#define SPELL_SABER_LASH_IMM 43690 +#define SPELL_TELEPORT_VISUAL 40869 +#define SPELL_BERSERK 45078 + +uint32 PrismaticAuras[]= +{ + 40880, // Shadow + 40882, // Fire + 40883, // Nature + 40891, // Arcane + 40896, // Frost + 40897, // Holy +}; + +struct Locations +{ + float x,y,z; +}; + +static Locations TeleportPoint[]= +{ + {959.996, 212.576, 193.843}, + {932.537, 231.813, 193.838}, + {958.675, 254.767, 193.822}, + {946.955, 201.316, 192.535}, + {944.294, 149.676, 197.551}, + {930.548, 284.888, 193.367}, + {965.997, 278.398, 195.777} +}; + +struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI +{ + boss_shahrazAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint64 TargetGUID[3]; + uint32 BeamTimer; + uint32 BeamCount; + uint32 CurrentBeam; + uint32 PrismaticShieldTimer; + uint32 FatalAttractionTimer; + uint32 FatalAttractionExplodeTimer; + uint32 ShriekTimer; + uint32 SaberTimer; + uint32 RandomYellTimer; + uint32 EnrageTimer; + uint32 ExplosionCount; + + bool Enraged; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, NOT_STARTED); + + for(uint8 i = 0; i<3; ++i) + TargetGUID[i] = 0; + + BeamTimer = 20000; // Timers may be incorrect + BeamCount = 0; + CurrentBeam = 0; // 0 - Sinister, 1 - Vile, 2 - Wicked, 3 - Sinful + PrismaticShieldTimer = 0; + FatalAttractionTimer = 60000; + FatalAttractionExplodeTimer = 70000; + ShriekTimer = 30000; + SaberTimer = 35000; + RandomYellTimer = 70000 + rand()%41 * 1000; + EnrageTimer = 600000; + ExplosionCount = 0; + + Enraged = false; + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS); + + DoZoneInCombat(); + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + if (pInstance) + pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + void TeleportPlayers() + { + uint32 random = rand()%7; + float X = TeleportPoint[random].x; + float Y = TeleportPoint[random].y; + float Z = TeleportPoint[random].z; + for(uint8 i = 0; i < 3; ++i) + { + Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) + { + TargetGUID[i] = pUnit->GetGUID(); + pUnit->CastSpell(pUnit, SPELL_TELEPORT_VISUAL, true); + DoTeleportPlayer(pUnit, X, Y, Z, pUnit->GetOrientation()); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !Enraged) + { + Enraged = true; + DoCast(m_creature, SPELL_ENRAGE, true); + DoScriptText(SAY_ENRAGE, m_creature); + } + + //Randomly cast one beam. + if (BeamTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (!target || !target->isAlive()) + return; + + BeamTimer = 9000; + + switch(CurrentBeam) + { + case 0: + DoCast(target, SPELL_BEAM_SINISTER); + break; + case 1: + DoCast(target, SPELL_BEAM_VILE); + break; + case 2: + DoCast(target, SPELL_BEAM_WICKED); + break; + case 3: + DoCast(target, SPELL_BEAM_SINFUL); + break; + } + BeamCount++; + uint32 Beam = CurrentBeam; + if (BeamCount > 3) + while(CurrentBeam == Beam) + CurrentBeam = rand()%3; + + }else BeamTimer -= diff; + + // Random Prismatic Shield every 15 seconds. + if (PrismaticShieldTimer < diff) + { + uint32 random = rand()%6; + if (PrismaticAuras[random]) + DoCast(m_creature, PrismaticAuras[random]); + PrismaticShieldTimer = 15000; + }else PrismaticShieldTimer -= diff; + + // Select 3 random targets (can select same target more than once), teleport to a random location then make them cast explosions until they get away from each other. + if (FatalAttractionTimer < diff) + { + ExplosionCount = 0; + + TeleportPlayers(); + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPELL2, m_creature); break; + case 1: DoScriptText(SAY_SPELL3, m_creature); break; + } + FatalAttractionExplodeTimer = 2000; + FatalAttractionTimer = 40000 + rand()%31 * 1000; + }else FatalAttractionTimer -= diff; + + if (FatalAttractionExplodeTimer < diff) + { + // Just make them explode three times... they're supposed to keep exploding while they are in range, but it'll take too much code. I'll try to think of an efficient way for it later. + if (ExplosionCount < 3) + { + for(uint8 i = 0; i < 3; ++i) + { + Unit* pUnit = NULL; + if (TargetGUID[i]) + { + pUnit = Unit::GetUnit((*m_creature), TargetGUID[i]); + if (pUnit) + pUnit->CastSpell(pUnit, SPELL_ATTRACTION, true); + TargetGUID[i] = 0; + } + } + + ExplosionCount++; + FatalAttractionExplodeTimer = 1000; + } + else + { + FatalAttractionExplodeTimer = FatalAttractionTimer + 2000; + ExplosionCount = 0; + } + }else FatalAttractionExplodeTimer -= diff; + + if (ShriekTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SILENCING_SHRIEK); + ShriekTimer = 25000+rand()%10 * 1000; + }else ShriekTimer -= diff; + + if (SaberTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SABER_LASH); + SaberTimer = 25000+rand()%10 * 1000; + }else SaberTimer -= diff; + + //Enrage + if (!m_creature->HasAura(SPELL_BERSERK)) + if (EnrageTimer < diff) + { + DoCast(m_creature, SPELL_BERSERK); + DoScriptText(SAY_ENRAGE, m_creature); + }else EnrageTimer -= diff; + + //Random taunts + if (RandomYellTimer < diff) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_TAUNT1, m_creature); break; + case 1: DoScriptText(SAY_TAUNT2, m_creature); break; + case 2: DoScriptText(SAY_TAUNT3, m_creature); break; + } + RandomYellTimer = 60000 + rand()%91 * 1000; + }else RandomYellTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shahraz(Creature* pCreature) +{ + return new boss_shahrazAI (pCreature); +} + +void AddSC_boss_mother_shahraz() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_mother_shahraz"; + newscript->GetAI = &GetAI_boss_shahraz; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp new file mode 100644 index 00000000000..aa81259e451 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_reliquary_of_souls.cpp @@ -0,0 +1,710 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Reliquary_of_Souls +SD%Complete: 90 +SDComment: +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" +#include "Spell.h" + +//Sound'n'speech +//Suffering +#define SUFF_SAY_FREED -1564047 +#define SUFF_SAY_AGGRO -1564048 +#define SUFF_SAY_SLAY1 -1564049 +#define SUFF_SAY_SLAY2 -1564050 +#define SUFF_SAY_SLAY3 -1564051 +#define SUFF_SAY_RECAP -1564052 +#define SUFF_SAY_AFTER -1564053 +#define SUFF_EMOTE_ENRAGE -1564054 + +//Desire +#define DESI_SAY_FREED -1564055 +#define DESI_SAY_SLAY1 -1564056 +#define DESI_SAY_SLAY2 -1564057 +#define DESI_SAY_SLAY3 -1564058 +#define DESI_SAY_SPEC -1564059 +#define DESI_SAY_RECAP -1564060 +#define DESI_SAY_AFTER -1564061 + +//Anger +#define ANGER_SAY_FREED -1564062 +#define ANGER_SAY_FREED2 -1564063 +#define ANGER_SAY_SLAY1 -1564064 +#define ANGER_SAY_SLAY2 -1564065 +#define ANGER_SAY_SPEC -1564066 +#define ANGER_SAY_BEFORE -1564067 +#define ANGER_SAY_DEATH -1564068 + +//Spells +#define AURA_OF_SUFFERING 41292 +#define AURA_OF_SUFFERING_ARMOR 42017 // linked aura, need core support +#define ESSENCE_OF_SUFFERING_PASSIVE 41296 // periodic trigger 41294 +#define ESSENCE_OF_SUFFERING_PASSIVE2 41623 +#define SPELL_FIXATE_TARGET 41294 // dummy, select target +#define SPELL_FIXATE_TAUNT 41295 // force taunt +#define SPELL_ENRAGE 41305 +#define SPELL_SOUL_DRAIN 41303 + +#define AURA_OF_DESIRE 41350 +#define AURA_OF_DESIRE_DAMAGE 41352 +#define SPELL_RUNE_SHIELD 41431 +#define SPELL_DEADEN 41410 +#define SPELL_SOUL_SHOCK 41426 + +#define AURA_OF_ANGER 41337 +#define SPELL_SELF_SEETHE 41364 // force cast 41520 +#define SPELL_ENEMY_SEETHE 41520 +#define SPELL_SOUL_SCREAM 41545 +#define SPELL_SPITE_TARGET 41376 // cast 41377 after 6 sec +#define SPELL_SPITE_DAMAGE 41377 + +#define ENSLAVED_SOUL_PASSIVE 41535 +#define SPELL_SOUL_RELEASE 41542 +#define SPELL_SUBMERGE 37550 //dropout 'head' + +#define CREATURE_ENSLAVED_SOUL 23469 +#define NUMBER_ENSLAVED_SOUL 8 + +struct Position2d +{ + float x,y; +}; + +static Position2d Coords[]= +{ + {450.4, 212.3}, + {542.1, 212.3}, + {542.1, 168.3}, + {542.1, 137.4}, + {450.4, 137.4}, + {450.4, 168.3} +}; + +struct TRINITY_DLL_DECL npc_enslaved_soulAI : public ScriptedAI +{ + npc_enslaved_soulAI(Creature *c) : ScriptedAI(c) {} + + uint64 ReliquaryGUID; + + void Reset() {ReliquaryGUID = 0;} + + void EnterCombat(Unit* who) + { + m_creature->CastSpell(m_creature, ENSLAVED_SOUL_PASSIVE, true); + DoZoneInCombat(); + } + + void JustDied(Unit *killer); +}; + +struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI +{ + boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + EssenceGUID = 0; + } + + ScriptedInstance* pInstance; + + uint64 EssenceGUID; + + uint32 Phase; + uint32 Counter; + uint32 Timer; + + uint32 SoulCount; + uint32 SoulDeathCount; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, NOT_STARTED); + + if (EssenceGUID) + { + if (Creature* Essence = Unit::GetCreature(*m_creature, EssenceGUID)) + { + Essence->ForcedDespawn(); + } + EssenceGUID = 0; + } + + Phase = 0; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + m_creature->RemoveAurasDueToSpell(SPELL_SUBMERGE); + } + + void EnterCombat(Unit* who) + { + m_creature->AddThreat(who, 10000.0f); + DoZoneInCombat(); + if (pInstance) + pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, IN_PROGRESS); + + Phase = 1; + Counter = 0; + Timer = 0; + } + + bool SummonSoul() + { + uint32 random = rand()%6; + float x = Coords[random].x; + float y = Coords[random].y; + Creature* Soul = m_creature->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0); + if (!Soul) return false; + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + CAST_AI(npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = m_creature->GetGUID(); + Soul->AI()->AttackStart(target); + }else EnterEvadeMode(); + return true; + } + + void MergeThreatList(Creature* target) + { + if (!target) + return; + + std::list& m_threatlist = target->getThreatManager().getThreatList(); + std::list::iterator itr = m_threatlist.begin(); + for(; itr != m_threatlist.end(); itr++) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); + if (pUnit) + { + m_creature->AddThreat(pUnit, 1.0f); // This is so that we make sure the unit is in Reliquary's threat list before we reset the unit's threat. + m_creature->getThreatManager().modifyThreatPercent(pUnit, -100); + float threat = target->getThreatManager().getThreat(pUnit); + m_creature->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences). + } + } + } + + void JustDied(Unit* killer) + { + if (pInstance) + pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!Phase) + return; + + if (m_creature->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist + { + EnterEvadeMode(); + return; + } + + Creature* Essence; + if (EssenceGUID) + { + Essence = Unit::GetCreature(*m_creature, EssenceGUID); + if (!Essence) + { + EnterEvadeMode(); + return; + } + } + + if (Timer < diff) + { + switch(Counter) + { + case 0: + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); // I R ANNNGRRRY! + DoStartNoMovement(m_creature); + Timer = 3000; + break; + case 1: + Timer = 2800; + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SUBMERGE); // Release the cube + DoCast(m_creature,SPELL_SUBMERGE); + DoStartNoMovement(m_creature); + break; + case 2: + Timer = 5000; + if (Creature* Summon = DoSpawnCreature(23417+Phase, 0, 0, 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0)) + { + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); // Ribs: open + Summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0)); + EssenceGUID = Summon->GetGUID(); + DoStartNoMovement(m_creature); + }else EnterEvadeMode(); + break; + case 3: + Timer = 1000; + if (Phase == 3) + { + if (!Essence->isAlive()) + m_creature->CastSpell(m_creature, 7, true); + else return; + } + else + { + if (Essence->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + { + MergeThreatList(Essence); + Essence->RemoveAllAuras(); + Essence->DeleteThreatList(); + Essence->GetMotionMaster()->MoveFollow(m_creature,0.0f,0.0f); + }else return; + } + break; + case 4: + Timer = 1500; + if (Essence->IsWithinDistInMap(m_creature, 10)) + { + Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); //rotate and disappear + Timer = 2000; + m_creature->RemoveAurasDueToSpell(SPELL_SUBMERGE); + } + else + { + MergeThreatList(Essence); + Essence->RemoveAllAuras(); + Essence->DeleteThreatList(); + Essence->GetMotionMaster()->MoveFollow(m_creature, 0, 0); + return; + } + break; + case 5: + if (Phase == 1) + { + DoScriptText(SUFF_SAY_AFTER, Essence); + } + else + { + DoScriptText(DESI_SAY_AFTER, Essence); + } + Essence->ForcedDespawn(); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0); + EssenceGUID = 0; + SoulCount = 0; + SoulDeathCount = 0; + Timer = 3000; + break; + case 6: + if (SoulCount < NUMBER_ENSLAVED_SOUL) + { + if (SummonSoul()) + SoulCount++; + Timer = 500; + return; + }break; + case 7: + if (SoulDeathCount >= SoulCount) + { + Counter = 1; + Phase++; + Timer = 5000; + } + return; + default: + break; + } + Counter++; + }else Timer -= diff; + } +}; + +struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI +{ + boss_essence_of_sufferingAI(Creature *c) : ScriptedAI(c) {} + + uint64 StatAuraGUID; + + uint32 AggroYellTimer; + uint32 FixateTimer; + uint32 EnrageTimer; + uint32 SoulDrainTimer; + uint32 AuraTimer; + + void Reset() + { + StatAuraGUID = 0; + + AggroYellTimer = 5000; + FixateTimer = 8000; + EnrageTimer = 30000; + SoulDrainTimer = 45000; + AuraTimer = 5000; + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (damage >= m_creature->GetHealth()) + { + damage = 0; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->Yell(SUFF_SAY_RECAP,LANG_UNIVERSAL,0); + DoScriptText(SUFF_SAY_RECAP, m_creature); + } + } + + void EnterCombat(Unit *who) + { + if (!m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) + { + DoScriptText(SUFF_SAY_FREED, m_creature); + DoZoneInCombat(); + m_creature->CastSpell(m_creature, AURA_OF_SUFFERING, true); // linked aura need core support + m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE, true); + m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE2, true); + } + else return; + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SUFF_SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SUFF_SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SUFF_SAY_SLAY3, m_creature); break; + } + } + + void CastFixate() + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + if (m_threatlist.empty()) + return; // No point continuing if empty threatlist. + std::list targets; + std::list::iterator itr = m_threatlist.begin(); + for(; itr != m_threatlist.end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); + if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) // Only alive players + targets.push_back(pUnit); + } + if (targets.empty()) + return; // No targets added for some reason. No point continuing. + targets.sort(ObjectDistanceOrder(m_creature)); // Sort players by distance. + targets.resize(1); // Only need closest target. + Unit* target = targets.front(); // Get the first target. + if (target) + target->CastSpell(m_creature, SPELL_FIXATE_TAUNT, true); + DoResetThreat(); + m_creature->AddThreat(target,1000000); + } + + void UpdateAI(const uint32 diff) + { + if (m_creature->isInCombat()) + { + //Supposed to be cast on nearest target + if (FixateTimer < diff) + { + CastFixate(); + FixateTimer = 5000; + if (!(rand()%16)) + { + DoScriptText(SUFF_SAY_AGGRO, m_creature); + } + }else FixateTimer -= diff; + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + if (EnrageTimer < diff) + { + DoCast(m_creature, SPELL_ENRAGE); + EnrageTimer = 60000; + DoScriptText(SUFF_EMOTE_ENRAGE, m_creature); + }else EnrageTimer -= diff; + + if (SoulDrainTimer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM,0), SPELL_SOUL_DRAIN); + SoulDrainTimer = 60000; + }else SoulDrainTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI +{ + boss_essence_of_desireAI(Creature *c) : ScriptedAI(c) {} + + uint32 RuneShieldTimer; + uint32 DeadenTimer; + uint32 SoulShockTimer; + + void Reset() + { + RuneShieldTimer = 60000; + DeadenTimer = 30000; + SoulShockTimer = 5000; + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by == m_creature) + return; + + if (damage >= m_creature->GetHealth()) + { + damage = 0; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoScriptText(SUFF_SAY_RECAP, m_creature); + } + else + { + int32 bp0 = damage / 2; + m_creature->CastCustomSpell(done_by, AURA_OF_DESIRE_DAMAGE, &bp0, NULL, NULL, true); + } + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]) + for(uint8 i = 0; i < 3; ++i) + if (spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST) + if (m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_SOUL_SHOCK + || m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_DEADEN) + m_creature->InterruptSpell(CURRENT_GENERIC_SPELL, false); + } + + void EnterCombat(Unit *who) + { + DoScriptText(DESI_SAY_FREED, m_creature); + DoZoneInCombat(); + DoCast(m_creature, AURA_OF_DESIRE, true); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(DESI_SAY_SLAY1, m_creature); break; + case 1: DoScriptText(DESI_SAY_SLAY2, m_creature); break; + case 2: DoScriptText(DESI_SAY_SLAY3, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (RuneShieldTimer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + m_creature->CastSpell(m_creature, SPELL_RUNE_SHIELD, true); + SoulShockTimer += 2000; + DeadenTimer += 2000; + RuneShieldTimer = 60000; + }else RuneShieldTimer -= diff; + + if (SoulShockTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SOUL_SHOCK); + SoulShockTimer = 5000; + }else SoulShockTimer -= diff; + + if (DeadenTimer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature->getVictim(), SPELL_DEADEN); + DeadenTimer = 25000 + rand()%10000; + if (!(rand()%2)) + { + DoScriptText(DESI_SAY_SPEC, m_creature); + } + }else DeadenTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI +{ + boss_essence_of_angerAI(Creature *c) : ScriptedAI(c) {} + + uint64 AggroTargetGUID; + + uint32 CheckTankTimer; + uint32 SoulScreamTimer; + uint32 SpiteTimer; + + std::list SpiteTargetGUID; + + bool CheckedAggro; + + void Reset() + { + AggroTargetGUID = 0; + + CheckTankTimer = 5000; + SoulScreamTimer = 10000; + SpiteTimer = 30000; + + SpiteTargetGUID.clear(); + + CheckedAggro = false; + } + + void EnterCombat(Unit *who) + { + switch(rand()%2) + { + case 0: DoScriptText(ANGER_SAY_FREED, m_creature); break; + case 1: DoScriptText(ANGER_SAY_FREED2, m_creature); break; + } + + DoZoneInCombat(); + DoCast(m_creature, AURA_OF_ANGER, true); + } + + void JustDied(Unit *victim) + { + DoScriptText(ANGER_SAY_DEATH, m_creature); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(ANGER_SAY_SLAY1, m_creature); break; + case 1: DoScriptText(ANGER_SAY_SLAY2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (!CheckedAggro) + { + AggroTargetGUID = m_creature->getVictim()->GetGUID(); + CheckedAggro = true; + } + + if (CheckTankTimer < diff) + { + if (m_creature->getVictim()->GetGUID() != AggroTargetGUID) + { + DoScriptText(ANGER_SAY_BEFORE, m_creature); + DoCast(m_creature, SPELL_SELF_SEETHE, true); + AggroTargetGUID = m_creature->getVictim()->GetGUID(); + } + CheckTankTimer = 2000; + }else CheckTankTimer -= diff; + + if (SoulScreamTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SOUL_SCREAM); + SoulScreamTimer = 9000 + rand()%2000; + if (!(rand()%3)) + { + DoScriptText(ANGER_SAY_SPEC, m_creature); + } + }else SoulScreamTimer -= diff; + + if (SpiteTimer < diff) + { + DoCast(m_creature, SPELL_SPITE_TARGET); + SpiteTimer = 30000; + DoScriptText(ANGER_SAY_SPEC, m_creature); + }else SpiteTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +void npc_enslaved_soulAI::JustDied(Unit *killer) +{ + if (ReliquaryGUID) + { + Creature* Reliquary = (Unit::GetCreature((*m_creature), ReliquaryGUID)); + if (Reliquary) + CAST_AI(boss_reliquary_of_soulsAI, Reliquary->AI())->SoulDeathCount++; + } + DoCast(m_creature, SPELL_SOUL_RELEASE, true); +} + +CreatureAI* GetAI_boss_reliquary_of_souls(Creature* pCreature) +{ + return new boss_reliquary_of_soulsAI (pCreature); +} + +CreatureAI* GetAI_boss_essence_of_suffering(Creature* pCreature) +{ + return new boss_essence_of_sufferingAI (pCreature); +} + +CreatureAI* GetAI_boss_essence_of_desire(Creature* pCreature) +{ + return new boss_essence_of_desireAI (pCreature); +} + +CreatureAI* GetAI_boss_essence_of_anger(Creature* pCreature) +{ + return new boss_essence_of_angerAI (pCreature); +} + +CreatureAI* GetAI_npc_enslaved_soul(Creature* pCreature) +{ + return new npc_enslaved_soulAI (pCreature); +} + +void AddSC_boss_reliquary_of_souls() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_reliquary_of_souls"; + newscript->GetAI = &GetAI_boss_reliquary_of_souls; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_essence_of_suffering"; + newscript->GetAI = &GetAI_boss_essence_of_suffering; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_essence_of_desire"; + newscript->GetAI = &GetAI_boss_essence_of_desire; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_essence_of_anger"; + newscript->GetAI = &GetAI_boss_essence_of_anger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_enslaved_soul"; + newscript->GetAI = &GetAI_npc_enslaved_soul; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_shade_of_akama.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_shade_of_akama.cpp new file mode 100644 index 00000000000..ea987bf4963 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_shade_of_akama.cpp @@ -0,0 +1,870 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Shade_of_Akama +SD%Complete: 90 +SDComment: Seems to be complete. +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +#define SAY_DEATH -1564013 +#define SAY_LOW_HEALTH -1564014 +// Ending cinematic text +#define SAY_FREE -1564015 +#define SAY_BROKEN_FREE_01 -1564016 +#define SAY_BROKEN_FREE_02 -1564017 + +#define GOSSIP_ITEM "We are ready to fight alongside you, Akama" + +struct Location +{ + float x, y, o, z; +}; + +static Location ChannelerLocations[]= +{ + {463.161285, 401.219757, 3.141592}, + {457.377625, 391.227661, 2.106461}, + {446.012421, 391.227661, 1.071904}, + {439.533783, 401.219757, 0.000000}, + {446.012421, 411.211853, 5.210546}, + {457.377625, 411.211853, 4.177494} +}; + +static Location SpawnLocations[]= +{ + {498.652740, 461.728119, 0}, + {498.505003, 339.619324, 0} +}; + +static Location AkamaWP[]= +{ + {482.352448, 401.162720, 0, 112.783928}, + {469.597443, 402.264404, 0, 118.537910} +}; + +static Location BrokenCoords[]= +{ + {541.375916, 401.439575, M_PI, 112.783997}, // The place where Akama channels + {534.130005, 352.394531, 2.164150, 112.783737}, // Behind a 'pillar' which is behind the east alcove + {499.621185, 341.534729, 1.652856, 112.783730}, // East Alcove + {499.151093, 461.036438, 4.770888, 112.78370}, // West Alcove +}; + +static Location BrokenWP[]= +{ + {492.491638, 400.744690, 3.122336, 112.783737}, + {494.335724, 382.221771, 2.676230, 112.783737}, + {489.555939, 373.507202, 2.416263, 112.783737}, + {491.136353, 427.868774, 3.519748, 112.783737}, +}; + +// Locations +#define Z1 118.543144 +#define Z2 120.783768 +#define Z_SPAWN 113.537949 +#define AGGRO_X 482.793182 +#define AGGRO_Y 401.270172 +#define AGGRO_Z 112.783928 +#define AKAMA_X 514.583984 +#define AKAMA_Y 400.601013 +#define AKAMA_Z 112.783997 + +// Spells +#define SPELL_VERTEX_SHADE_BLACK 39833 +#define SPELL_SHADE_SOUL_CHANNEL 40401 +#define SPELL_DESTRUCTIVE_POISON 40874 +#define SPELL_LIGHTNING_BOLT 42024 +#define SPELL_AKAMA_SOUL_CHANNEL 40447 +#define SPELL_AKAMA_SOUL_RETRIEVE 40902 +#define AKAMA_SOUL_EXPEL 40855 +#define SPELL_SHADE_SOUL_CHANNEL_2 40520 + +// Channeler entry +#define CREATURE_CHANNELER 23421 +#define CREATURE_SORCERER 23215 +#define CREATURE_DEFENDER 23216 +#define CREATURE_BROKEN 23319 + +const uint32 spawnEntries[4]= { 23523, 23318, 23524 }; + +struct TRINITY_DLL_DECL mob_ashtongue_channelerAI : public ScriptedAI +{ + mob_ashtongue_channelerAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} + + uint64 ShadeGUID; + + void Reset() {} + void JustDied(Unit* killer); + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) {} +}; + +struct TRINITY_DLL_DECL mob_ashtongue_sorcererAI : public ScriptedAI +{ + mob_ashtongue_sorcererAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} + + uint64 ShadeGUID; + uint32 CheckTimer; + bool StartBanishing; + + void Reset() + { + StartBanishing = false; + CheckTimer = 5000; + } + + void JustDied(Unit* killer); + void EnterCombat(Unit* who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) + { + if (StartBanishing) + return; + + if (CheckTimer < diff) + { + Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); + if (Shade && Shade->isAlive() && m_creature->isAlive()) + { + if (m_creature->IsWithinDist(Shade, 20,false)) + { + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveIdle(); + DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL, true); + DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL_2, true); + + StartBanishing = true; + } + } + CheckTimer = 2000; + }else CheckTimer -= diff; + } +}; + +struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI +{ + boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c), summons(m_creature) + { + pInstance = c->GetInstanceData(); + AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0; + m_creature->setActive(true);//if view distance is too low + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + } + + ScriptedInstance* pInstance; + + std::list Channelers; + std::list Sorcerers; + uint64 AkamaGUID; + + uint32 SorcererCount; + uint32 DeathCount; + + uint32 ReduceHealthTimer; + uint32 SummonTimer; + uint32 ResetTimer; + uint32 DefenderTimer; // They are on a flat 15 second timer, independant of the other summon Creature timer. + + bool IsBanished; + bool HasKilledAkama; + bool reseting; + bool GridSearcherSucceeded; + bool HasKilledAkamaAndReseting; + SummonList summons; + + void Reset() + { + reseting = true; + HasKilledAkamaAndReseting = false; + + GridSearcherSucceeded = false; + + Sorcerers.clear(); + summons.DespawnAll();//despawn all adds + + if (Creature* Akama = Unit::GetCreature(*m_creature, AkamaGUID)) + { + Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//turn gossip on so players can restart the event + if (Akama->isDead()) + { + Akama->Respawn();//respawn akama if dead + Akama->AI()->EnterEvadeMode(); + } + } + SorcererCount = 0; + DeathCount = 0; + + SummonTimer = 10000; + ReduceHealthTimer = 0; + ResetTimer = 60000; + DefenderTimer = 15000; + + IsBanished = true; + HasKilledAkama = false; + + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //m_creature->GetMotionMaster()->Clear(); + //m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); + + if (pInstance && m_creature->isAlive()) + pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED); + + reseting = false; + } + void JustDied(Unit* killer) + { + summons.DespawnAll(); + } + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524) + summons.Summon(summon); + } + void SummonedCreatureDespawn(Creature *summon) + { + if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524) + summons.Despawn(summon); + } + + void MoveInLineOfSight(Unit *who) + { + if (!GridSearcherSucceeded) + { + FindChannelers(); + + if (!Channelers.empty()) + { + for(std::list::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) + { + Creature* Channeler = (Unit::GetCreature(*m_creature, *itr)); + if (Channeler) + { + if (Channeler->isDead()) + { + Channeler->RemoveCorpse(); + Channeler->Respawn(); + } + + Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true); + Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true); + Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + GridSearcherSucceeded = true; + } + } + }else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); + } + } + + void AttackStart(Unit* who) + { + if (!who || IsBanished) return; + + if (who->isTargetableForAttack() && who != m_creature) + DoStartMovement(who); + } + + void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer + { + if (reseting) + return; + + debug_log("TSCR: Increasing Death Count for Shade of Akama encounter"); + ++DeathCount; + m_creature->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2); + if (guid) + { + if (Sorcerers.empty()) + error_log("SD2 ERROR: Shade of Akama - attempt to remove guid %u from Sorcerers list but list is already empty", guid); + else Sorcerers.remove(guid); + } + } + + void SummonCreature() + { + uint32 random = rand()%2; + float X = SpawnLocations[random].x; + float Y = SpawnLocations[random].y; + // max of 6 sorcerers can be summoned + if ((rand()%3 == 0) && (DeathCount > 0) && (SorcererCount < 7)) + { + Creature* Sorcerer = m_creature->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0); + if (Sorcerer) + { + CAST_AI(mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = m_creature->GetGUID(); + Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + Sorcerer->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + Sorcerers.push_back(Sorcerer->GetGUID()); + --DeathCount; + ++SorcererCount; + } + } + else + { + for(uint8 i = 0; i < 3; ++i) + { + Creature* Spawn = m_creature->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); + if (Spawn) + { + Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z); + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + Spawn->AI()->AttackStart(target); + } + } + } + } + + void FindChannelers() + { + std::list ChannelerList; + m_creature->GetCreatureListWithEntryInGrid(ChannelerList,CREATURE_CHANNELER,50.0f); + + if (!ChannelerList.empty()) + { + for(std::list::iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr) + { + CAST_AI(mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = m_creature->GetGUID(); + Channelers.push_back((*itr)->GetGUID()); + debug_log("TSCR: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID()); + } + } + else error_log("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy"); + } + + void SetSelectableChannelers() + { + if (Channelers.empty()) + { + error_log("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy"); + return; + } + + for(std::list::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) + if (Creature* Channeler = (Unit::GetCreature(*m_creature, *itr))) + Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void SetAkamaGUID(uint64 guid) { AkamaGUID = guid; } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->isInCombat()) + return; + + if (IsBanished) + { + // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check + if (m_creature->getThreatManager().getThreatList().size() < 2) + { + EnterEvadeMode(); + return; + } + + if (DefenderTimer < diff) + { + uint32 ran = rand()%2; + Creature* Defender = m_creature->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); + if (Defender) + { + Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + bool move = true; + if (AkamaGUID) + { + if (Creature* Akama = Unit::GetCreature(*m_creature, AkamaGUID)) + { + float x, y, z; + Akama->GetPosition(x,y,z); + // They move towards AKama + Defender->GetMotionMaster()->MovePoint(0, x, y, z); + Defender->AI()->AttackStart(Akama); + }else move = false; + }else move = false; + if (!move) + Defender->GetMotionMaster()->MovePoint(0, AKAMA_X, AKAMA_Y, AKAMA_Z); + } + DefenderTimer = 15000; + }else DefenderTimer -= diff; + + if (SummonTimer < diff) + { + SummonCreature(); + SummonTimer = 35000; + }else SummonTimer -= diff; + + if (DeathCount >= 6) + { + if (AkamaGUID) + { + Creature* Akama = Unit::GetCreature((*m_creature), AkamaGUID); + if (Akama && Akama->isAlive()) + { + IsBanished = false; + m_creature->GetMotionMaster()->Clear(false); + m_creature->GetMotionMaster()->MoveChase(Akama); + Akama->GetMotionMaster()->Clear(); + // Shade should move to Akama, not the other way around + Akama->GetMotionMaster()->MoveIdle(); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // Crazy amount of threat + m_creature->AddThreat(Akama, 10000000.0f); + Akama->AddThreat(m_creature, 10000000.0f); + m_creature->Attack(Akama, true); + Akama->Attack(m_creature, true); + } + } + } + } + else // No longer banished, let's fight Akama now + { + if (ReduceHealthTimer < diff) + { + if (AkamaGUID) + { + Creature* Akama = Unit::GetCreature((*m_creature), AkamaGUID); + if (Akama && Akama->isAlive()) + { + //10 % less health every few seconds. + m_creature->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + ReduceHealthTimer = 12000; + } + } + }else ReduceHealthTimer -= diff; + + if (HasKilledAkama) + { + if (!HasKilledAkamaAndReseting)//do not let players kill Shade if Akama is dead and Shade is waiting for ResetTimer!! event would bug + { + HasKilledAkamaAndReseting = true; + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(); + //m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->GetMotionMaster()->MoveTargetedHome(); + } + if (ResetTimer < diff) + { + EnterEvadeMode();// Reset a little while after killing Akama, evade and respawn Akama + return; + }else ResetTimer -= diff; + } + + DoMeleeAttackIfReady(); + } + } +}; + +void mob_ashtongue_channelerAI::JustDied(Unit* killer) +{ + Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); + if (Shade && Shade->isAlive()) + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(); + else error_log("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama."); +} + +void mob_ashtongue_sorcererAI::JustDied(Unit* killer) +{ + Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); + if (Shade && Shade->isAlive()) + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(m_creature->GetGUID()); + else error_log("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama."); +} + +struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI +{ + npc_akamaAI(Creature* c) : ScriptedAI(c), summons(m_creature) + { + ShadeHasDied = false; + StartCombat = false; + pInstance = c->GetInstanceData(); + ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : NOT_STARTED; + m_creature->setActive(true); + EventBegun = false; + CastSoulRetrieveTimer = 0; + SoulRetrieveTimer = 0; + SummonBrokenTimer = 0; + EndingTalkCount = 0; + WayPointId = 0; + BrokenSummonIndex = 0; + BrokenList.clear(); + HasYelledOnce = false; + } + + ScriptedInstance* pInstance; + + uint64 ShadeGUID; + + uint32 DestructivePoisonTimer; + uint32 LightningBoltTimer; + uint32 CheckTimer; + uint32 CastSoulRetrieveTimer; + uint32 SoulRetrieveTimer; + uint32 SummonBrokenTimer; + uint32 EndingTalkCount; + uint32 WayPointId; + uint32 BrokenSummonIndex; + + std::list BrokenList; + + bool EventBegun; + bool ShadeHasDied; + bool StartCombat; + bool HasYelledOnce; + SummonList summons; + + void Reset() + { + DestructivePoisonTimer = 15000; + LightningBoltTimer = 10000; + CheckTimer = 2000; + + if (!EventBegun) + { + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values + m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + } + summons.DespawnAll(); + } + + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == CREATURE_BROKEN) + summons.Summon(summon); + } + void SummonedCreatureDespawn(Creature *summon) + { + if (summon->GetEntry() == CREATURE_BROKEN) + summons.Despawn(summon); + } + + void EnterCombat(Unit* who) {} + + void BeginEvent(Player* pl) + { + if (!pInstance) + return; + + ShadeGUID = pInstance->GetData64(DATA_SHADEOFAKAMA); + if (!ShadeGUID) + return; + + Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); + if (Shade) + { + pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS); + // Prevent players from trying to restart event + m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetAkamaGUID(m_creature->GetGUID()); + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetSelectableChannelers(); + Shade->AddThreat(m_creature, 1000000.0f); + m_creature->CombatStart(Shade); + Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + Shade->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); + if (pl) Shade->AddThreat(pl, 1.0f); + DoZoneInCombat(Shade); + EventBegun = true; + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + switch(id) + { + case 0: ++WayPointId; break; + + case 1: + if (Creature* Shade = Unit::GetCreature(*m_creature, ShadeGUID)) + { + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID); + DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE); + EndingTalkCount = 0; + SoulRetrieveTimer = 16000; + } + break; + } + } + + void JustDied(Unit* killer) + { + DoScriptText(SAY_DEATH, m_creature); + EventBegun = false; + ShadeHasDied = false; + StartCombat = false; + CastSoulRetrieveTimer = 0; + SoulRetrieveTimer = 0; + SummonBrokenTimer = 0; + EndingTalkCount = 0; + WayPointId = 0; + BrokenSummonIndex = 0; + BrokenList.clear(); + HasYelledOnce = false; + Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); + if (Shade && Shade->isAlive()) + CAST_AI(boss_shade_of_akamaAI, Shade->AI())->HasKilledAkama = true; + summons.DespawnAll(); + } + + void UpdateAI(const uint32 diff) + { + if (!EventBegun) + return; + + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15 && !HasYelledOnce) + { + DoScriptText(SAY_LOW_HEALTH, m_creature); + HasYelledOnce = true; + } + + if (ShadeGUID && !StartCombat) + { + Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); + if (Shade && Shade->isAlive()) + { + if (CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IsBanished) + { + if (CastSoulRetrieveTimer < diff) + { + DoCast(Shade, SPELL_AKAMA_SOUL_CHANNEL); + CastSoulRetrieveTimer = 500; + }else CastSoulRetrieveTimer -= diff; + } + else + { + m_creature->InterruptNonMeleeSpells(false); + StartCombat = true; + } + } + } + + if (ShadeHasDied && (WayPointId == 1)) + { + if (pInstance) pInstance->SetData(DATA_SHADEOFAKAMAEVENT, DONE); + m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z); + ++WayPointId; + } + + if (!ShadeHasDied && StartCombat) + { + if (CheckTimer < diff) + { + if (ShadeGUID) + { + Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); + if (Shade && !Shade->isAlive()) + { + ShadeHasDied = true; + WayPointId = 0; + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z); + } + if (Shade && Shade->isAlive()) + { + if (Shade->getThreatManager().getThreatList().size() < 2) + Shade->AI()->EnterEvadeMode(); + } + } + CheckTimer = 5000; + }else CheckTimer -= diff; + } + + if (SummonBrokenTimer && BrokenSummonIndex < 4) + { + if (SummonBrokenTimer <= diff) + { + for(uint8 i = 0; i < 4; ++i) + { + float x = BrokenCoords[BrokenSummonIndex].x + (i*5); + float y = BrokenCoords[BrokenSummonIndex].y + (1*5); + float z = BrokenCoords[BrokenSummonIndex].z; + float o = BrokenCoords[BrokenSummonIndex].o; + Creature* Broken = m_creature->SummonCreature(CREATURE_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000); + if (Broken) + { + float wx = BrokenWP[BrokenSummonIndex].x + (i*5); + float wy = BrokenWP[BrokenSummonIndex].y + (i*5); + float wz = BrokenWP[BrokenSummonIndex].z; + Broken->GetMotionMaster()->MovePoint(0, wx, wy, wz); + Broken->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + BrokenList.push_back(Broken->GetGUID()); + } + } + ++BrokenSummonIndex; + SummonBrokenTimer = 1000; + }else SummonBrokenTimer -= diff; + } + + if (SoulRetrieveTimer) + if (SoulRetrieveTimer <= diff) + { + switch(EndingTalkCount) + { + case 0: + m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); + ++EndingTalkCount; + SoulRetrieveTimer = 2000; + SummonBrokenTimer = 1; + break; + case 1: + DoScriptText(SAY_FREE, m_creature); + ++EndingTalkCount; + SoulRetrieveTimer = 25000; + break; + case 2: + if (!BrokenList.empty()) + { + bool Yelled = false; + for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) + if (Creature* pUnit = Unit::GetCreature(*m_creature, *itr)) + { + if (!Yelled) + { + DoScriptText(SAY_BROKEN_FREE_01, pUnit); + Yelled = true; + } + pUnit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); + } + } + ++EndingTalkCount; + SoulRetrieveTimer = 1500; + break; + case 3: + if (!BrokenList.empty()) + { + for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) + if (Creature* pUnit = Unit::GetCreature(*m_creature, *itr)) + // This is the incorrect spell, but can't seem to find the right one. + pUnit->CastSpell(pUnit, 39656, true); + } + ++EndingTalkCount; + SoulRetrieveTimer = 5000; + break; + case 4: + if (!BrokenList.empty()) + { + for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) + if (Creature* pUnit = Unit::GetCreature((*m_creature), *itr)) + pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0); + } + SoulRetrieveTimer = 0; + break; + } + }else SoulRetrieveTimer -= diff; + + if (!UpdateVictim()) + return; + + if (DestructivePoisonTimer < diff) + { + Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); + if (Shade && Shade->isAlive()) + DoCast(Shade, SPELL_DESTRUCTIVE_POISON); + DestructivePoisonTimer = 15000; + }else DestructivePoisonTimer -= diff; + + if (LightningBoltTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT); + LightningBoltTimer = 10000; + }else LightningBoltTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shade_of_akama(Creature* pCreature) +{ + return new boss_shade_of_akamaAI (pCreature); +} + +CreatureAI* GetAI_mob_ashtongue_channeler(Creature* pCreature) +{ + return new mob_ashtongue_channelerAI (pCreature); +} + +CreatureAI* GetAI_mob_ashtongue_sorcerer(Creature* pCreature) +{ + return new mob_ashtongue_sorcererAI (pCreature); +} + +CreatureAI* GetAI_npc_akama_shade(Creature* pCreature) +{ + return new npc_akamaAI (pCreature); +} + +bool GossipSelect_npc_akama(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time + { + pPlayer->CLOSE_GOSSIP_MENU(); + CAST_AI(npc_akamaAI, pCreature->AI())->BeginEvent(pPlayer); + } + + return true; +} + +bool GossipHello_npc_akama(Player* pPlayer, Creature* pCreature) +{ + if (pPlayer->isAlive()) + { + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); + } + + return true; +} + +void AddSC_boss_shade_of_akama() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_shade_of_akama"; + newscript->GetAI = &GetAI_boss_shade_of_akama; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ashtongue_channeler"; + newscript->GetAI = &GetAI_mob_ashtongue_channeler; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ashtongue_sorcerer"; + newscript->GetAI = &GetAI_mob_ashtongue_sorcerer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_akama_shade"; + newscript->GetAI = &GetAI_npc_akama_shade; + newscript->pGossipHello = &GossipHello_npc_akama; + newscript->pGossipSelect = &GossipSelect_npc_akama; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_supremus.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_supremus.cpp new file mode 100644 index 00000000000..669b0a25629 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_supremus.cpp @@ -0,0 +1,296 @@ +/* Copyright (C) 2006 - 2008 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Supremus +SD%Complete: 95 +SDComment: Need to implement molten punch +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +#define EMOTE_NEW_TARGET -1564010 +#define EMOTE_PUNCH_GROUND -1564011 //DoScriptText(EMOTE_PUNCH_GROUND, m_creature); +#define EMOTE_GROUND_CRACK -1564012 + +//Spells +#define SPELL_MOLTEN_PUNCH 40126 +#define SPELL_HATEFUL_STRIKE 41926 +#define SPELL_MOLTEN_FLAME 40980 +#define SPELL_VOLCANIC_ERUPTION 40117 +#define SPELL_VOLCANIC_SUMMON 40276 +#define SPELL_BERSERK 45078 + +#define CREATURE_VOLCANO 23085 +#define CREATURE_STALKER 23095 + +#define PHASE_STRIKE 1 +#define PHASE_CHASE 2 + +#define EVENT_BERSERK 1 +#define EVENT_SWITCH_PHASE 2 +#define EVENT_FLAME 3 +#define EVENT_VOLCANO 4 +#define EVENT_SWITCH_TARGET 5 +#define EVENT_HATEFUL_STRIKE 6 + +#define GCD_CAST 1 + +struct TRINITY_DLL_DECL molten_flameAI : public NullCreatureAI +{ + molten_flameAI(Creature *c) : NullCreatureAI(c) {} + + void InitializeAI() + { + float x, y, z; + me->GetNearPoint(me, x, y, z, 1, 100, M_PI*2*rand_norm()); + me->GetMotionMaster()->MovePoint(0, x, y, z); + me->SetVisibility(VISIBILITY_OFF); + me->CastSpell(me,SPELL_MOLTEN_FLAME,true); + } +}; + +struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI +{ + boss_supremusAI(Creature *c) : ScriptedAI(c), summons(m_creature) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + EventMap events; + SummonList summons; + uint32 phase; + + void Reset() + { + if (pInstance) + { + if (m_creature->isAlive()) + { + pInstance->SetData(DATA_SUPREMUSEVENT, NOT_STARTED); + //ToggleDoors(true); + } + //else ToggleDoors(false); + } + + phase = 0; + + events.Reset(); + summons.DespawnAll(); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_SUPREMUSEVENT, IN_PROGRESS); + + ChangePhase(); + events.ScheduleEvent(EVENT_BERSERK, 900000, GCD_CAST); + events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST); + } + + void ChangePhase() + { + if (!phase || phase == PHASE_CHASE) + { + phase = PHASE_STRIKE; + summons.DoAction(EVENT_VOLCANO, 0); + events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); + m_creature->SetSpeed(MOVE_RUN, 1.2f); + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); + } + else + { + phase = PHASE_CHASE; + events.ScheduleEvent(EVENT_VOLCANO, 5000, GCD_CAST, PHASE_CHASE); + events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE); + m_creature->SetSpeed(MOVE_RUN, 0.9f); + m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); + } + DoResetThreat(); + DoZoneInCombat(); + events.SetPhase(phase); + events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000, GCD_CAST); + } + + void JustDied(Unit *killer) + { + if (pInstance) + { + pInstance->SetData(DATA_SUPREMUSEVENT, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GAMEOBJECT_SUPREMUS_DOORS), true); + } + summons.DespawnAll(); + } + + void JustSummoned(Creature *summon) {summons.Summon(summon);} + void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} + + Unit* CalculateHatefulStrikeTarget() + { + uint32 health = 0; + Unit* target = NULL; + + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + std::list::iterator i = m_threatlist.begin(); + for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit && m_creature->IsWithinMeleeRange(pUnit)) + { + if (pUnit->GetHealth() > health) + { + health = pUnit->GetHealth(); + target = pUnit; + } + } + } + + return target; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_BERSERK: + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + break; + case EVENT_FLAME: + DoCast(m_creature, SPELL_MOLTEN_PUNCH); + events.DelayEvents(1500, GCD_CAST); + events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST); + break; + case EVENT_HATEFUL_STRIKE: + if (Unit* target = CalculateHatefulStrikeTarget()) + DoCast(target, SPELL_HATEFUL_STRIKE); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); + break; + case EVENT_SWITCH_TARGET: + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) + { + DoResetThreat(); + m_creature->AddThreat(target, 5000000.0f); + DoScriptText(EMOTE_NEW_TARGET, m_creature); + } + events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE); + break; + case EVENT_VOLCANO: + { + Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); + if (!target) target = m_creature->getVictim(); + if (target) + { + //DoCast(target, SPELL_VOLCANIC_SUMMON);//movement bugged + m_creature->SummonCreature(CREATURE_VOLCANO,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); + DoScriptText(EMOTE_GROUND_CRACK, m_creature); + events.DelayEvents(1500, GCD_CAST); + } + events.ScheduleEvent(EVENT_VOLCANO, 10000, GCD_CAST, PHASE_CHASE); + return; + } + case EVENT_SWITCH_PHASE: + ChangePhase(); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL npc_volcanoAI : public Scripted_NoMovementAI +{ + npc_volcanoAI(Creature *c) : Scripted_NoMovementAI(c) {} + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); + me->SetReactState(REACT_PASSIVE); + wait = 3000; + } + uint32 wait; + + void EnterCombat(Unit *who) {} + + void MoveInLineOfSight(Unit *who) {} + + void DoAction(const uint32 info) + { + m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION); + } + + void UpdateAI(const uint32 diff) + { + if (wait<=diff)//wait 3secs before casting + { + DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); + wait = 60000; + } + else wait -= diff; + } + +}; + +CreatureAI* GetAI_boss_supremus(Creature* pCreature) +{ + return new boss_supremusAI (pCreature); +} + +CreatureAI* GetAI_molten_flame(Creature* pCreature) +{ + return new molten_flameAI (pCreature); +} + +CreatureAI* GetAI_npc_volcano(Creature* pCreature) +{ + return new npc_volcanoAI (pCreature); +} + +void AddSC_boss_supremus() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_supremus"; + newscript->GetAI = &GetAI_boss_supremus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="molten_flame"; + newscript->GetAI = &GetAI_molten_flame; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_volcano"; + newscript->GetAI = &GetAI_npc_volcano; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_teron_gorefiend.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_teron_gorefiend.cpp new file mode 100644 index 00000000000..25a82877388 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_teron_gorefiend.cpp @@ -0,0 +1,520 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Teron_Gorefiend +SD%Complete: 60 +SDComment: Requires Mind Control support for Ghosts. +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + + //Speech'n'sound +#define SAY_INTRO -1564037 +#define SAY_AGGRO -1564038 +#define SAY_SLAY1 -1564039 +#define SAY_SLAY2 -1564040 +#define SAY_SPELL1 -1564041 +#define SAY_SPELL2 -1564042 +#define SAY_SPECIAL1 -1564043 +#define SAY_SPECIAL2 -1564044 +#define SAY_ENRAGE -1564045 +#define SAY_DEATH -1564046 + +//Spells +#define SPELL_INCINERATE 40239 +#define SPELL_CRUSHING_SHADOWS 40243 +#define SPELL_SHADOWBOLT 40185 +#define SPELL_PASSIVE_SHADOWFORM 40326 +#define SPELL_SHADOW_OF_DEATH 40251 +#define SPELL_BERSERK 45078 + +#define SPELL_ATROPHY 40327 // Shadowy Constructs use this when they get within melee range of a player + +#define CREATURE_DOOM_BLOSSOM 23123 +#define CREATURE_SHADOWY_CONSTRUCT 23111 + +struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI +{ + mob_doom_blossomAI(Creature *c) : ScriptedAI(c) {} + + uint32 CheckTeronTimer; + uint32 ShadowBoltTimer; + uint64 TeronGUID; + + void Reset() + { + CheckTeronTimer = 5000; + ShadowBoltTimer = 12000; + TeronGUID = 0; + } + + void EnterCombat(Unit *who) { } + void AttackStart(Unit* who) { } + void MoveInLineOfSight(Unit* who) { } + + void Despawn() + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + } + + void UpdateAI(const uint32 diff) + { + if (CheckTeronTimer < diff) + { + if (TeronGUID) + { + DoZoneInCombat(); + + Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID)); + if ((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode())) + Despawn(); + } + else + Despawn(); + + CheckTeronTimer = 5000; + }else CheckTeronTimer -= diff; + + if (ShadowBoltTimer < diff && m_creature->isInCombat()) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT); + ShadowBoltTimer = 10000; + }else ShadowBoltTimer -= diff; + return; + } + + void SetTeronGUID(uint64 guid){ TeronGUID = guid; } +}; + +struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI +{ + mob_shadowy_constructAI(Creature* c) : ScriptedAI(c) {} + + uint64 GhostGUID; + uint64 TeronGUID; + + uint32 CheckPlayerTimer; + uint32 CheckTeronTimer; + + void Reset() + { + GhostGUID = 0; + TeronGUID = 0; + + CheckPlayerTimer = 2000; + CheckTeronTimer = 5000; + } + + void EnterCombat(Unit* who) { } + + void MoveInLineOfSight(Unit *who) + { + if (!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + +/* Comment it out for now. NOTE TO FUTURE DEV: UNCOMMENT THIS OUT ONLY AFTER MIND CONTROL IS IMPLEMENTED + void DamageTaken(Unit* done_by, uint32 &damage) + { + if (done_by->GetGUID() != GhostGUID) + damage = 0; // Only the ghost can deal damage. + } + */ + + void CheckPlayers() + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + if (m_threatlist.empty()) + return; // No threat list. Don't continue. + std::list::iterator itr = m_threatlist.begin(); + std::list targets; + for(; itr != m_threatlist.end(); ++itr) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); + if (pUnit && pUnit->isAlive()) + targets.push_back(pUnit); + } + targets.sort(ObjectDistanceOrder(m_creature)); + Unit* target = targets.front(); + if (target && m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target))) + { + DoCast(target, SPELL_ATROPHY); + m_creature->AI()->AttackStart(target); + } + } + + void UpdateAI(const uint32 diff) + { + if (CheckPlayerTimer < diff) + { + CheckPlayers(); + CheckPlayerTimer = 3000; + }else CheckPlayerTimer -= diff; + + if (CheckTeronTimer < diff) + { + Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID)); + if (!Teron || !Teron->isAlive() || Teron->IsInEvadeMode()) + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + CheckTeronTimer = 5000; + }else CheckTeronTimer -= diff; + } +}; + +struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI +{ + boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 IncinerateTimer; + uint32 SummonDoomBlossomTimer; + uint32 EnrageTimer; + uint32 CrushingShadowsTimer; + uint32 ShadowOfDeathTimer; + uint32 SummonShadowsTimer; + uint32 RandomYellTimer; + uint32 AggroTimer; + + uint64 AggroTargetGUID; + uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost + + bool Intro; + bool Done; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED); + + IncinerateTimer = 20000 + rand()%11000; + SummonDoomBlossomTimer = 12000; + EnrageTimer = 600000; + CrushingShadowsTimer = 22000; + SummonShadowsTimer = 60000; + RandomYellTimer = 50000; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // Start off unattackable so that the intro is done properly + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + AggroTimer = 20000; + AggroTargetGUID = 0; + Intro = false; + Done = false; + } + + void EnterCombat(Unit *who) {} + + void MoveInLineOfSight(Unit* pWho) + { + if (!Intro && pWho->GetTypeId() == TYPEID_PLAYER && pWho->isTargetableForAttack() && m_creature->IsHostileTo(pWho) && pWho->isInAccessiblePlaceFor(m_creature)) + { + if (m_creature->IsWithinDistInMap(pWho, VISIBLE_RANGE) && m_creature->IsWithinLOSInMap(pWho)) + { + if (pInstance) + pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS); + + m_creature->GetMotionMaster()->Clear(false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoScriptText(SAY_INTRO, m_creature); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK); + AggroTargetGUID = pWho->GetGUID(); + Intro = true; + } + } + if (Done) + ScriptedAI::MoveInLineOfSight(pWho); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + if (pInstance) + pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + float CalculateRandomLocation(float Loc, uint32 radius) + { + float coord = Loc; + switch(rand()%2) + { + case 0: + coord += rand()%radius; + break; + case 1: + coord -= rand()%radius; + break; + } + return coord; + } + + void SetThreatList(Creature* Blossom) + { + if (!Blossom) return; + + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + std::list::iterator i = m_threatlist.begin(); + for(i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit && pUnit->isAlive()) + { + float threat = DoGetThreat(pUnit); + Blossom->AddThreat(pUnit, threat); + } + } + } + + void MindControlGhost() + { + /************************************************************************/ + /** NOTE FOR FUTURE DEVELOPER: PROPERLY IMPLEMENT THE GHOST PORTION *****/ + /** ONLY AFTER TrinIty FULLY IMPLEMENTS MIND CONTROL ABILITIES *****/ + /** THE CURRENT CODE IN THIS FUNCTION IS ONLY THE BEGINNING OF *****/ + /** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/ + /************************************************************************/ + + Unit* Ghost = NULL; + if (GhostGUID) + Ghost = Unit::GetUnit((*m_creature), GhostGUID); + if (Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH)) + { + /*float x,y,z; + Ghost->GetPosition(x,y,z); + Creature* control = m_creature->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000); + if (control) + { + CAST_PLR(Ghost)->Possess(control); + Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, + false); + }*/ + for(uint8 i = 0; i < 4; ++i) + { + Creature* Construct = NULL; + float X = CalculateRandomLocation(Ghost->GetPositionX(), 10); + float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10); + Construct = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, Ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); + if (Construct) + { + Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true); + SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List. + CAST_AI(mob_shadowy_constructAI, Construct->AI())->GhostGUID = GhostGUID; + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!target) // someone's trying to solo. + target = m_creature->getVictim(); + + if (target) + Construct->GetMotionMaster()->MoveChase(target); + } + } + } + } + + void UpdateAI(const uint32 diff) + { + if (Intro && !Done) + { + if (AggroTimer < diff) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + DoScriptText(SAY_AGGRO, m_creature); + m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); + Done = true; + if (AggroTargetGUID) + { + Unit* pUnit = Unit::GetUnit((*m_creature), AggroTargetGUID); + if (pUnit) + AttackStart(pUnit); + + DoZoneInCombat(); + } + else + { + EnterEvadeMode(); + return; + } + }else AggroTimer -= diff; + } + + if (!UpdateVictim() || !Done) + return; + + if (SummonShadowsTimer < diff) + { + //MindControlGhost(); + + for(uint8 i = 0; i < 2; ++i) + { + Creature* Shadow = NULL; + float X = CalculateRandomLocation(m_creature->GetPositionX(), 10); + Shadow = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0); + if (Shadow) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!target) + target = m_creature->getVictim(); + + if (target) + Shadow->AI()->AttackStart(target); + } + } + SummonShadowsTimer = 60000; + }else SummonShadowsTimer -= diff; + + if (SummonDoomBlossomTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + float X = CalculateRandomLocation(target->GetPositionX(), 20); + float Y = CalculateRandomLocation(target->GetPositionY(), 20); + float Z = target->GetPositionZ(); + Z = m_creature->GetMap()->GetVmapHeight(X, Y, Z, true); + Creature* DoomBlossom = m_creature->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000); + if (DoomBlossom) + { + DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoomBlossom->setFaction(m_creature->getFaction()); + DoomBlossom->AddThreat(target, 1.0f); + CAST_AI(mob_doom_blossomAI, DoomBlossom->AI())->SetTeronGUID(m_creature->GetGUID()); + target->CombatStart(DoomBlossom); + SetThreatList(DoomBlossom); + SummonDoomBlossomTimer = 35000; + } + } + }else SummonDoomBlossomTimer -= diff; + + if (IncinerateTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!target) + target = m_creature->getVictim(); + + if (target) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; + case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; + } + DoCast(target, SPELL_INCINERATE); + IncinerateTimer = 20000 + rand()%31 * 1000; + } + }else IncinerateTimer -= diff; + + if (CrushingShadowsTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target && target->isAlive()) + DoCast(target, SPELL_CRUSHING_SHADOWS); + CrushingShadowsTimer = 10000 + rand()%16 * 1000; + }else CrushingShadowsTimer -= diff; + + /*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/ + /*if (ShadowOfDeathTimer < diff) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + + if (!target) + target = m_creature->getVictim(); + + if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) + { + DoCast(target, SPELL_SHADOW_OF_DEATH); + GhostGUID = target->GetGUID(); + ShadowOfDeathTimer = 30000; + SummonShadowsTimer = 53000; // Make it VERY close but slightly less so that we can check if the aura is still on the player + } + }else ShadowOfDeathTimer -= diff;*/ + + if (RandomYellTimer < diff) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SPELL1, m_creature); break; + case 1: DoScriptText(SAY_SPELL2, m_creature); break; + } + RandomYellTimer = 50000 + rand()%51 * 1000; + }else RandomYellTimer -= diff; + + if (!m_creature->HasAura(SPELL_BERSERK)) + { + if (EnrageTimer < diff) + { + DoCast(m_creature, SPELL_BERSERK); + DoScriptText(SAY_ENRAGE, m_creature); + }else EnrageTimer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_doom_blossom(Creature* pCreature) +{ + return new mob_doom_blossomAI(pCreature); +} + +CreatureAI* GetAI_mob_shadowy_construct(Creature* pCreature) +{ + return new mob_shadowy_constructAI(pCreature); +} + +CreatureAI* GetAI_boss_teron_gorefiend(Creature* pCreature) +{ + return new boss_teron_gorefiendAI (pCreature); +} + +void AddSC_boss_teron_gorefiend() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "mob_doom_blossom"; + newscript->GetAI = &GetAI_mob_doom_blossom; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_shadowy_construct"; + newscript->GetAI = &GetAI_mob_shadowy_construct; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_teron_gorefiend"; + newscript->GetAI = &GetAI_boss_teron_gorefiend; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/boss_warlord_najentus.cpp b/src/bindings/scripts/scripts/outland/black_temple/boss_warlord_najentus.cpp new file mode 100644 index 00000000000..1616333b007 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/boss_warlord_najentus.cpp @@ -0,0 +1,226 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warlord_Najentus +SD%Complete: 95 +SDComment: +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +enum +{ + SAY_AGGRO = -1564000, + SAY_NEEDLE1 = -1564001, + SAY_NEEDLE2 = -1564002, + SAY_SLAY1 = -1564003, + SAY_SLAY2 = -1564004, + SAY_SPECIAL1 = -1564005, + SAY_SPECIAL2 = -1564006, + SAY_ENRAGE1 = -1564007, //is this text actually in use? + SAY_ENRAGE2 = -1564008, + SAY_DEATH = -1564009, + + //Spells + SPELL_NEEDLE_SPINE = 39992, + SPELL_TIDAL_BURST = 39878, + SPELL_TIDAL_SHIELD = 39872, + SPELL_IMPALING_SPINE = 39837, + SPELL_CREATE_NAJENTUS_SPINE = 39956, + SPELL_HURL_SPINE = 39948, + SPELL_BERSERK = 26662, + + GOBJECT_SPINE = 185584, + + EVENT_BERSERK = 1, + EVENT_YELL = 2, + EVENT_NEEDLE = 3, + EVENT_SPINE = 4, + EVENT_SHIELD = 5, + + GCD_CAST = 1, + GCD_YELL = 2 +}; + +struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI +{ + boss_najentusAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + EventMap events; + + uint64 SpineTargetGUID; + + void Reset() + { + events.Reset(); + + SpineTargetGUID = 0; + + if (pInstance) + pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(rand()%2 ? SAY_SLAY1 : SAY_SLAY2, m_creature); + events.DelayEvents(5000, GCD_YELL); + } + + void JustDied(Unit *victim) + { + if (pInstance) + pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD)) + { + m_creature->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD); + m_creature->CastSpell(m_creature, SPELL_TIDAL_BURST, true); + ResetTimer(); + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, IN_PROGRESS); + + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + events.ScheduleEvent(EVENT_BERSERK, 480000, GCD_CAST); + events.ScheduleEvent(EVENT_YELL, 45000 + (rand()%76)*1000, GCD_YELL); + ResetTimer(); + } + + bool RemoveImpalingSpine() + { + if (!SpineTargetGUID) return false; + Unit* target = Unit::GetUnit(*m_creature, SpineTargetGUID); + if (target && target->HasAura(SPELL_IMPALING_SPINE)) + target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE); + SpineTargetGUID=0; + return true; + } + + void ResetTimer(uint32 inc = 0) + { + events.RescheduleEvent(EVENT_NEEDLE, 10000 + inc, GCD_CAST); + events.RescheduleEvent(EVENT_SPINE, 20000 + inc, GCD_CAST); + events.RescheduleEvent(EVENT_SHIELD, 60000 + inc); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_SHIELD: + m_creature->CastSpell(m_creature, SPELL_TIDAL_SHIELD, true); + ResetTimer(45000); + break; + case EVENT_BERSERK: + DoScriptText(SAY_ENRAGE2, m_creature); + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + events.DelayEvents(15000, GCD_YELL); + break; + case EVENT_SPINE: + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); + if (!target) target = m_creature->getVictim(); + if (target) + { + m_creature->CastSpell(target, SPELL_IMPALING_SPINE, true); + SpineTargetGUID = target->GetGUID(); + //must let target summon, otherwise you cannot click the spine + target->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30); + DoScriptText(rand()%2 ? SAY_NEEDLE1 : SAY_NEEDLE2, m_creature); + events.DelayEvents(1500, GCD_CAST); + events.DelayEvents(15000, GCD_YELL); + } + events.ScheduleEvent(EVENT_SPINE, 21000, GCD_CAST); + return; + } + case EVENT_NEEDLE: + { + //m_creature->CastSpell(m_creature, SPELL_NEEDLE_SPINE, true); + std::list target; + SelectTargetList(target, 3, SELECT_TARGET_RANDOM, 80, true); + for(std::list::iterator i = target.begin(); i != target.end(); ++i) + m_creature->CastSpell(*i, 39835, true); + events.ScheduleEvent(EVENT_NEEDLE, 15000+rand()%10000, GCD_CAST); + events.DelayEvents(1500, GCD_CAST); + return; + } + case EVENT_YELL: + DoScriptText(rand()%2 ? SAY_SPECIAL1 : SAY_SPECIAL2, m_creature); + events.ScheduleEvent(EVENT_YELL, 25000 + (rand()%76)*1000, GCD_YELL); + events.DelayEvents(15000, GCD_YELL); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +bool GOHello_go_najentus_spine(Player* pPlayer, GameObject* pGo) +{ + if (ScriptedInstance* pInstance = pGo->GetInstanceData()) + if (Creature* Najentus = Unit::GetCreature(*pGo, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS))) + if (CAST_AI(boss_najentusAI, Najentus->AI())->RemoveImpalingSpine()) + { + pPlayer->CastSpell(pPlayer, SPELL_CREATE_NAJENTUS_SPINE, true); + pGo->DeleteObjectWithOwner(); + } + return true; +} + +CreatureAI* GetAI_boss_najentus(Creature* pCreature) +{ + return new boss_najentusAI (pCreature); +} + +void AddSC_boss_najentus() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_najentus"; + newscript->GetAI = &GetAI_boss_najentus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "go_najentus_spine"; + newscript->pGOHello = &GOHello_go_najentus_spine; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/def_black_temple.h b/src/bindings/scripts/scripts/outland/black_temple/def_black_temple.h new file mode 100644 index 00000000000..c98c0b1c363 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/def_black_temple.h @@ -0,0 +1,39 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_BLACK_TEMPLE_H +#define DEF_BLACK_TEMPLE_H + +enum +{ + DATA_AKAMA = 1, + DATA_AKAMA_SHADE = 2, + DATA_GURTOGGBLOODBOILEVENT = 3, + DATA_HIGHWARLORDNAJENTUS = 4, + DATA_HIGHWARLORDNAJENTUSEVENT = 5, + DATA_ILLIDANSTORMRAGE = 6, + DATA_ILLIDANSTORMRAGEEVENT = 7, + DATA_ILLIDARICOUNCILEVENT = 8, + DATA_ILLIDARICOUNCIL = 9, + DATA_LADYMALANDE = 10, + DATA_HIGHNETHERMANCERZEREVOR = 11, + DATA_GATHIOSTHESHATTERER = 12, + DATA_VERASDARKSHADOW = 13, + DATA_MOTHERSHAHRAZEVENT = 14, + DATA_RELIQUARYOFSOULSEVENT = 15, + DATA_SHADEOFAKAMA = 16, + DATA_SHADEOFAKAMAEVENT = 17, + DATA_SUPREMUS = 18, + DATA_SUPREMUSEVENT = 19, + DATA_TERONGOREFIENDEVENT = 20, + DATA_GAMEOBJECT_NAJENTUS_GATE = 21, + DATA_GAMEOBJECT_ILLIDAN_GATE = 22, + DATA_GAMEOBJECT_ILLIDAN_DOOR_R = 23, + DATA_GAMEOBJECT_ILLIDAN_DOOR_L = 24, + DATA_GAMEOBJECT_SUPREMUS_DOORS = 25, + DATA_BLOOD_ELF_COUNCIL_VOICE = 26 +}; + +#endif + diff --git a/src/bindings/scripts/scripts/outland/black_temple/illidari_council.cpp b/src/bindings/scripts/scripts/outland/black_temple/illidari_council.cpp new file mode 100644 index 00000000000..6b86140b659 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/illidari_council.cpp @@ -0,0 +1,872 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Illidari_Council +SD%Complete: 95 +SDComment: Circle of Healing not working properly. +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +//Speech'n'Sounds +#define SAY_GATH_SLAY -1564085 +#define SAY_GATH_SLAY_COMNT -1564089 +#define SAY_GATH_DEATH -1564093 +#define SAY_GATH_SPECIAL1 -1564077 +#define SAY_GATH_SPECIAL2 -1564081 + +#define SAY_VERA_SLAY -1564086 +#define SAY_VERA_COMNT -1564089 +#define SAY_VERA_DEATH -1564094 +#define SAY_VERA_SPECIAL1 -1564078 +#define SAY_VERA_SPECIAL2 -1564082 + +#define SAY_MALA_SLAY -1564087 +#define SAY_MALA_COMNT -1564090 +#define SAY_MALA_DEATH -1564095 +#define SAY_MALA_SPECIAL1 -1564079 +#define SAY_MALA_SPECIAL2 -1564083 + +#define SAY_ZERE_SLAY -1564088 +#define SAY_ZERE_COMNT -1564091 +#define SAY_ZERE_DEATH -1564096 +#define SAY_ZERE_SPECIAL1 -1564080 +#define SAY_ZERE_SPECIAL2 -1564084 + +#define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly." + +#define AKAMAID 23089 + +struct CouncilYells +{ + int32 entry; + uint32 timer; +}; + +static CouncilYells CouncilAggro[]= +{ + {-1564069, 5000}, // Gathios + {-1564070, 5500}, // Veras + {-1564071, 5000}, // Malande + {-1564072, 0}, // Zerevor +}; + +// Need to get proper timers for this later +static CouncilYells CouncilEnrage[]= +{ + {-1564073, 2000}, // Gathios + {-1564074, 6000}, // Veras + {-1564075, 5000}, // Malande + {-1564076, 0}, // Zerevor +}; + +// High Nethermancer Zerevor's spells +#define SPELL_FLAMESTRIKE 41481 +#define SPELL_BLIZZARD 41482 +#define SPELL_ARCANE_BOLT 41483 +#define SPELL_ARCANE_EXPLOSION 41524 +#define SPELL_DAMPEN_MAGIC 41478 + +// Lady Malande's spells +#define SPELL_EMPOWERED_SMITE 41471 +#define SPELL_CIRCLE_OF_HEALING 41455 +#define SPELL_REFLECTIVE_SHIELD 41475 +#define SPELL_DIVINE_WRATH 41472 +#define SPELL_HEAL_VISUAL 24171 + +// Gathios the Shatterer's spells +#define SPELL_BLESS_PROTECTION 41450 +#define SPELL_BLESS_SPELLWARD 41451 +#define SPELL_CONSECRATION 41541 +#define SPELL_HAMMER_OF_JUSTICE 41468 +#define SPELL_SEAL_OF_COMMAND 41469 +#define SPELL_SEAL_OF_BLOOD 41459 +#define SPELL_CHROMATIC_AURA 41453 +#define SPELL_DEVOTION_AURA 41452 + +// Veras Darkshadow's spells +#define SPELL_DEADLY_POISON 41485 +#define SPELL_ENVENOM 41487 +#define SPELL_VANISH 41479 + +#define SPELL_BERSERK 45078 + +struct TRINITY_DLL_DECL mob_blood_elf_council_voice_triggerAI : public ScriptedAI +{ + mob_blood_elf_council_voice_triggerAI(Creature* c) : ScriptedAI(c) + { + for(uint8 i = 0; i < 4; ++i) + Council[i] = 0; + } + + uint64 Council[4]; + + uint32 EnrageTimer; + uint32 AggroYellTimer; + + uint8 YellCounter; // Serves as the counter for both the aggro and enrage yells + + bool EventStarted; + + void Reset() + { + EnrageTimer = 900000; // 15 minutes + AggroYellTimer = 500; + + YellCounter = 0; + + EventStarted = false; + } + + // finds and stores the GUIDs for each Council member using instance data system. + void LoadCouncilGUIDs() + { + if (ScriptedInstance* pInstance = (m_creature->GetInstanceData())) + { + Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); + Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW); + Council[2] = pInstance->GetData64(DATA_LADYMALANDE); + Council[3] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); + }else error_log(ERROR_INST_DATA); + } + + void EnterCombat(Unit* who) {} + + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + if (!EventStarted) + return; + + if (YellCounter > 3) + return; + + if (AggroYellTimer) + { + if (AggroYellTimer <= diff) + { + if (Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter])) + { + DoScriptText(CouncilAggro[YellCounter].entry, pMember); + AggroYellTimer = CouncilAggro[YellCounter].timer; + } + ++YellCounter; + if (YellCounter > 3) + YellCounter = 0; // Reuse for Enrage Yells + }else AggroYellTimer -= diff; + } + + if (EnrageTimer) + { + if (EnrageTimer <= diff) + { + if (Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter])) + { + pMember->CastSpell(pMember, SPELL_BERSERK, true); + DoScriptText(CouncilEnrage[YellCounter].entry, pMember); + EnrageTimer = CouncilEnrage[YellCounter].timer; + } + ++YellCounter; + }else EnrageTimer -= diff; + } + } +}; + +struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI +{ + mob_illidari_councilAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + for(uint8 i = 0; i < 4; ++i) + Council[i] = 0; + } + + ScriptedInstance* pInstance; + + uint64 Council[4]; + + uint32 CheckTimer; + uint32 EndEventTimer; + + uint8 DeathCount; + + bool EventBegun; + + void Reset() + { + CheckTimer = 2000; + EndEventTimer = 0; + + DeathCount = 0; + + Creature* pMember = NULL; + for(uint8 i = 0; i < 4; ++i) + { + if (pMember = (Unit::GetCreature((*m_creature), Council[i]))) + { + if (!pMember->isAlive()) + { + pMember->RemoveCorpse(); + pMember->Respawn(); + } + pMember->AI()->EnterEvadeMode(); + } + } + + if (pInstance) + { + pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, NOT_STARTED); + if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) + VoiceTrigger->AI()->EnterEvadeMode(); + } + + EventBegun = false; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetDisplayId(11686); + } + + void EnterCombat(Unit *who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + + void StartEvent(Unit *target) + { + if (!pInstance) return; + + if (target && target->isAlive()) + { + Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); + Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); + Council[2] = pInstance->GetData64(DATA_LADYMALANDE); + Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW); + + // Start the event for the Voice Trigger + if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) + { + CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->LoadCouncilGUIDs(); + CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->EventStarted = true; + } + + for(uint8 i = 0; i < 4; ++i) + { + Unit* Member = NULL; + if (Council[i]) + { + Member = Unit::GetUnit((*m_creature), Council[i]); + if (Member && Member->isAlive()) + CAST_CRE(Member)->AI()->AttackStart(target); + } + } + + pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, IN_PROGRESS); + + EventBegun = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!EventBegun) return; + + if (EndEventTimer) + { + if (EndEventTimer <= diff) + { + if (DeathCount > 3) + { + if (pInstance) + { + if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) + VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE); + m_creature->SummonCreature(AKAMAID,746.466980f,304.394989f,311.90208f,6.272870f,TEMPSUMMON_DEAD_DESPAWN,0); + } + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + + Creature* pMember = (Unit::GetCreature(*m_creature, Council[DeathCount])); + if (pMember && pMember->isAlive()) + pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + ++DeathCount; + EndEventTimer = 1500; + }else EndEventTimer -= diff; + } + + if (CheckTimer) + { + if (CheckTimer <= diff) + { + uint8 EvadeCheck = 0; + for(uint8 i = 0; i < 4; ++i) + { + if (Council[i]) + { + if (Creature* Member = (Unit::GetCreature((*m_creature), Council[i]))) + { + // This is the evade/death check. + if (Member->isAlive() && !Member->getVictim()) + ++EvadeCheck; //If all members evade, we reset so that players can properly reset the event + else if (!Member->isAlive()) // If even one member dies, kill the rest, set instance data, and kill self. + { + EndEventTimer = 1000; + CheckTimer = 0; + return; + } + } + } + } + + if (EvadeCheck > 3) + Reset(); + + CheckTimer = 2000; + }else CheckTimer -= diff; + } + + } +}; + +struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI +{ + boss_illidari_councilAI(Creature* c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + for(uint8 i = 0; i < 4; ++i) + Council[i] = 0; + LoadedGUIDs = false; + } + + uint64 Council[4]; + + ScriptedInstance* pInstance; + + bool LoadedGUIDs; + + void EnterCombat(Unit* who) + { + if (pInstance) + { + Creature* Controller = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ILLIDARICOUNCIL))); + if (Controller) + CAST_AI(mob_illidari_councilAI, Controller->AI())->StartEvent(who); + } + else + { + error_log(ERROR_INST_DATA); + EnterEvadeMode(); + return; + } + DoZoneInCombat(); + // Load GUIDs on first aggro because the Creature guids are only set as the creatures are created in world- + // this means that for each pCreature, it will attempt to LoadGUIDs even though some of the other creatures are + // not in world, and thus have no GUID set in the instance data system. Putting it in aggro ensures that all the creatures + // have been loaded and have their GUIDs set in the instance data system. + if (!LoadedGUIDs) + LoadGUIDs(); + } + + void EnterEvadeMode() + { + for(uint8 i = 0; i < 4; ++i) + { + if (Unit* pUnit = Unit::GetUnit(*m_creature, Council[i])) + if (pUnit != m_creature && pUnit->getVictim()) + { + AttackStart(pUnit->getVictim()); + return; + } + } + ScriptedAI::EnterEvadeMode(); + } + + void DamageTaken(Unit* done_by, uint32 &damage) + { + if (done_by == m_creature) + return; + + damage /= 4; + for(uint8 i = 0; i < 4; ++i) + { + if (Creature* pUnit = Unit::GetCreature(*m_creature, Council[i])) + if (pUnit != m_creature && damage < pUnit->GetHealth()) + { + pUnit->SetHealth(pUnit->GetHealth() - damage); + pUnit->LowerPlayerDamageReq(damage); + } + } + } + + void LoadGUIDs() + { + if (!pInstance) + { + error_log(ERROR_INST_DATA); + return; + } + + Council[0] = pInstance->GetData64(DATA_LADYMALANDE); + Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); + Council[2] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); + Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW); + + LoadedGUIDs = true; + } +}; + +struct TRINITY_DLL_DECL boss_gathios_the_shattererAI : public boss_illidari_councilAI +{ + boss_gathios_the_shattererAI(Creature *c) : boss_illidari_councilAI(c) {} + + uint32 ConsecrationTimer; + uint32 HammerOfJusticeTimer; + uint32 SealTimer; + uint32 AuraTimer; + uint32 BlessingTimer; + + void Reset() + { + ConsecrationTimer = 40000; + HammerOfJusticeTimer = 10000; + SealTimer = 40000; + AuraTimer = 90000; + BlessingTimer = 60000; + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_GATH_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_GATH_DEATH, m_creature); + } + + Unit* SelectCouncilMember() + { + Unit* pUnit = m_creature; + uint32 member = 0; // He chooses Lady Malande most often + + if (rand()%10 == 0) // But there is a chance he picks someone else. + member = urand(1, 3); + + if (member != 2) // No need to create another pointer to us using Unit::GetUnit + pUnit = Unit::GetUnit((*m_creature), Council[member]); + return pUnit; + } + + void CastAuraOnCouncil() + { + uint32 spellid = 0; + switch(rand()%2) + { + case 0: spellid = SPELL_DEVOTION_AURA; break; + case 1: spellid = SPELL_CHROMATIC_AURA; break; + } + for(uint8 i = 0; i < 4; ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), Council[i]); + if (pUnit) + pUnit->CastSpell(pUnit, spellid, true, 0, 0, m_creature->GetGUID()); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (BlessingTimer < diff) + { + if (Unit* pUnit = SelectCouncilMember()) + { + switch(rand()%2) + { + case 0: DoCast(pUnit, SPELL_BLESS_SPELLWARD); break; + case 1: DoCast(pUnit, SPELL_BLESS_PROTECTION); break; + } + } + BlessingTimer = 60000; + }else BlessingTimer -= diff; + + if (ConsecrationTimer < diff) + { + DoCast(m_creature, SPELL_CONSECRATION); + ConsecrationTimer = 40000; + }else ConsecrationTimer -= diff; + + if (HammerOfJusticeTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + // is in ~10-40 yd range + if (m_creature->IsInRange(target, 10.0f, 40.0f, false)) + { + DoCast(target, SPELL_HAMMER_OF_JUSTICE); + HammerOfJusticeTimer = 20000; + } + } + }else HammerOfJusticeTimer -= diff; + + if (SealTimer < diff) + { + switch(rand()%2) + { + case 0: DoCast(m_creature, SPELL_SEAL_OF_COMMAND); break; + case 1: DoCast(m_creature, SPELL_SEAL_OF_BLOOD); break; + } + SealTimer = 40000; + }else SealTimer -= diff; + + if (AuraTimer < diff) + { + CastAuraOnCouncil(); + AuraTimer = 90000; + }else AuraTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI +{ + boss_high_nethermancer_zerevorAI(Creature *c) : boss_illidari_councilAI(c) {} + + uint32 BlizzardTimer; + uint32 FlamestrikeTimer; + uint32 ArcaneBoltTimer; + uint32 DampenMagicTimer; + uint32 Cooldown; + uint32 ArcaneExplosionTimer; + + void Reset() + { + BlizzardTimer = 30000 + rand()%61 * 1000; + FlamestrikeTimer = 30000 + rand()%61 * 1000; + ArcaneBoltTimer = 10000; + DampenMagicTimer = 2000; + ArcaneExplosionTimer = 14000; + Cooldown = 0; + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_ZERE_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_ZERE_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Cooldown) + { + if (Cooldown < diff) Cooldown = 0; + else + { + Cooldown -= diff; + return; // Don't cast any other spells if global cooldown is still ticking + } + } + + if (DampenMagicTimer < diff) + { + DoCast(m_creature, SPELL_DAMPEN_MAGIC); + Cooldown = 1000; + DampenMagicTimer = 67200; // almost 1,12 minutes + ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen. + }else DampenMagicTimer -= diff; + + if (ArcaneExplosionTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); + Cooldown = 1000; + ArcaneExplosionTimer = 14000; + }else ArcaneExplosionTimer -= diff; + + if (ArcaneBoltTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_BOLT); + ArcaneBoltTimer = 3000; + Cooldown = 2000; + }else ArcaneBoltTimer -= diff; + + if (BlizzardTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, SPELL_BLIZZARD); + BlizzardTimer = 45000 + rand()%46 * 1000; + FlamestrikeTimer += 10000; + Cooldown = 1000; + } + }else BlizzardTimer -= diff; + + if (FlamestrikeTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, SPELL_FLAMESTRIKE); + FlamestrikeTimer = 55000 + rand()%46 * 1000; + BlizzardTimer += 10000; + Cooldown = 2000; + } + }else FlamestrikeTimer -= diff; + } +}; + +struct TRINITY_DLL_DECL boss_lady_malandeAI : public boss_illidari_councilAI +{ + boss_lady_malandeAI(Creature *c) : boss_illidari_councilAI(c) {} + + uint32 EmpoweredSmiteTimer; + uint32 CircleOfHealingTimer; + uint32 DivineWrathTimer; + uint32 ReflectiveShieldTimer; + + void Reset() + { + EmpoweredSmiteTimer = 38000; + CircleOfHealingTimer = 20000; + DivineWrathTimer = 40000; + ReflectiveShieldTimer = 0; + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_MALA_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_MALA_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (EmpoweredSmiteTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, SPELL_EMPOWERED_SMITE); + EmpoweredSmiteTimer = 38000; + } + }else EmpoweredSmiteTimer -= diff; + + if (CircleOfHealingTimer < diff) + { + DoCast(m_creature, SPELL_CIRCLE_OF_HEALING); + CircleOfHealingTimer = 60000; + }else CircleOfHealingTimer -= diff; + + if (DivineWrathTimer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target, SPELL_DIVINE_WRATH); + DivineWrathTimer = 40000 + rand()%41 * 1000; + } + }else DivineWrathTimer -= diff; + + if (ReflectiveShieldTimer < diff) + { + DoCast(m_creature, SPELL_REFLECTIVE_SHIELD); + ReflectiveShieldTimer = 65000; + }else ReflectiveShieldTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_veras_darkshadowAI : public boss_illidari_councilAI +{ + boss_veras_darkshadowAI(Creature *c) : boss_illidari_councilAI(c) {} + + uint64 EnvenomTargetGUID; + + uint32 DeadlyPoisonTimer; + uint32 VanishTimer; + uint32 AppearEnvenomTimer; + + bool HasVanished; + + void Reset() + { + EnvenomTargetGUID = 0; + + DeadlyPoisonTimer = 20000; + VanishTimer = 60000 + rand()%61 * 1000; + AppearEnvenomTimer = 150000; + + HasVanished = false; + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void KilledUnit(Unit *victim) + { + DoScriptText(SAY_VERA_SLAY, m_creature); + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_VERA_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!HasVanished) + { + if (DeadlyPoisonTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_DEADLY_POISON); + DeadlyPoisonTimer = 15000 + rand()%31 * 1000; + }else DeadlyPoisonTimer -= diff; + + if (AppearEnvenomTimer < diff) // Cast Envenom. This is cast 4 seconds after Vanish is over + { + DoCast(m_creature->getVictim(), SPELL_ENVENOM); + AppearEnvenomTimer = 90000; + }else AppearEnvenomTimer -= diff; + + if (VanishTimer < diff) // Disappear and stop attacking, but follow a random unit + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + VanishTimer = 30000; + AppearEnvenomTimer= 28000; + HasVanished = true; + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoResetThreat(); + // Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking + m_creature->AddThreat(target, 500000.0f); + m_creature->GetMotionMaster()->MoveChase(target); + } + }else VanishTimer -= diff; + + DoMeleeAttackIfReady(); + } + else + { + if (VanishTimer < diff) // Become attackable and poison current target + { + Unit* target = m_creature->getVictim(); + DoCast(target, SPELL_DEADLY_POISON); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + DoResetThreat(); + m_creature->AddThreat(target, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after. + DeadlyPoisonTimer += 6000; + VanishTimer = 90000; + AppearEnvenomTimer = 4000; + HasVanished = false; + }else VanishTimer -= diff; + + if (AppearEnvenomTimer < diff) // Appear 2 seconds before becoming attackable (Shifting out of vanish) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + m_creature->SetVisibility(VISIBILITY_ON); + AppearEnvenomTimer = 6000; + }else AppearEnvenomTimer -= diff; + } + } +}; + +CreatureAI* GetAI_mob_blood_elf_council_voice_trigger(Creature* c) +{ + return new mob_blood_elf_council_voice_triggerAI(c); +} + +CreatureAI* GetAI_mob_illidari_council(Creature* pCreature) +{ + return new mob_illidari_councilAI (pCreature); +} + +CreatureAI* GetAI_boss_gathios_the_shatterer(Creature* pCreature) +{ + return new boss_gathios_the_shattererAI (pCreature); +} + +CreatureAI* GetAI_boss_lady_malande(Creature* pCreature) +{ + return new boss_lady_malandeAI (pCreature); +} + +CreatureAI* GetAI_boss_veras_darkshadow(Creature* pCreature) +{ + return new boss_veras_darkshadowAI (pCreature); +} + +CreatureAI* GetAI_boss_high_nethermancer_zerevor(Creature* pCreature) +{ + return new boss_high_nethermancer_zerevorAI (pCreature); +} + +void AddSC_boss_illidari_council() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="mob_illidari_council"; + newscript->GetAI = &GetAI_mob_illidari_council; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_blood_elf_council_voice_trigger"; + newscript->GetAI = &GetAI_mob_blood_elf_council_voice_trigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_gathios_the_shatterer"; + newscript->GetAI = &GetAI_boss_gathios_the_shatterer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_lady_malande"; + newscript->GetAI = &GetAI_boss_lady_malande; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_veras_darkshadow"; + newscript->GetAI = &GetAI_boss_veras_darkshadow; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_high_nethermancer_zerevor"; + newscript->GetAI = &GetAI_boss_high_nethermancer_zerevor; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/black_temple/instance_black_temple.cpp b/src/bindings/scripts/scripts/outland/black_temple/instance_black_temple.cpp new file mode 100644 index 00000000000..173632009ba --- /dev/null +++ b/src/bindings/scripts/scripts/outland/black_temple/instance_black_temple.cpp @@ -0,0 +1,346 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Instance_Black_Temple +SD%Complete: 100 +SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts +SDCategory: Black Temple +EndScriptData */ + +#include "precompiled.h" +#include "def_black_temple.h" + +#define MAX_ENCOUNTER 9 + +/* Black Temple encounters: +0 - High Warlord Naj'entus event +1 - Supremus Event +2 - Shade of Akama Event +3 - Teron Gorefiend Event +4 - Gurtogg Bloodboil Event +5 - Reliquary Of Souls Event +6 - Mother Shahraz Event +7 - Illidari Council Event +8 - Illidan Stormrage Event +*/ + +struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance +{ + instance_black_temple(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + uint64 Najentus; + uint64 Akama; // This is the Akama that starts the Illidan encounter. + uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter. + uint64 ShadeOfAkama; + uint64 Supremus; + uint64 LadyMalande; + uint64 GathiosTheShatterer; + uint64 HighNethermancerZerevor; + uint64 VerasDarkshadow; + uint64 IllidariCouncil; + uint64 BloodElfCouncilVoice; + uint64 IllidanStormrage; + + uint64 NajentusGate; + uint64 MainTempleDoors; + uint64 ShadeOfAkamaDoor; + uint64 CommonDoor;//Teron + uint64 TeronDoor; + uint64 GuurtogDoor; + uint64 MotherDoor; + uint64 TempleDoor;//Befor mother + uint64 CouncilDoor; + uint64 SimpleDoor;//council + uint64 IllidanGate; + uint64 IllidanDoor[2]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + Najentus = 0; + Akama = 0; + Akama_Shade = 0; + ShadeOfAkama = 0; + Supremus = 0; + LadyMalande = 0; + GathiosTheShatterer = 0; + HighNethermancerZerevor = 0; + VerasDarkshadow = 0; + IllidariCouncil = 0; + BloodElfCouncilVoice = 0; + IllidanStormrage = 0; + + NajentusGate = 0; + MainTempleDoors = 0; + ShadeOfAkamaDoor= 0; + CommonDoor = 0;//teron + TeronDoor = 0; + GuurtogDoor = 0; + MotherDoor = 0; + TempleDoor = 0; + SimpleDoor = 0;//Bycouncil + CouncilDoor = 0; + IllidanGate = 0; + IllidanDoor[0] = 0; + IllidanDoor[1] = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + Player* GetPlayerInMap() + { + Map::PlayerList const& players = instance->GetPlayers(); + + if (!players.isEmpty()) + { + for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) + { + if (Player* plr = itr->getSource()) + return plr; + } + } + + debug_log("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); + return NULL; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 22887: Najentus = pCreature->GetGUID(); break; + case 23089: Akama = pCreature->GetGUID(); break; + case 22990: Akama_Shade = pCreature->GetGUID(); break; + case 22841: ShadeOfAkama = pCreature->GetGUID(); break; + case 22898: Supremus = pCreature->GetGUID(); break; + case 22917: IllidanStormrage = pCreature->GetGUID(); break; + case 22949: GathiosTheShatterer = pCreature->GetGUID(); break; + case 22950: HighNethermancerZerevor = pCreature->GetGUID(); break; + case 22951: LadyMalande = pCreature->GetGUID(); break; + case 22952: VerasDarkshadow = pCreature->GetGUID(); break; + case 23426: IllidariCouncil = pCreature->GetGUID(); break; + case 23499: BloodElfCouncilVoice = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 185483: NajentusGate = pGo->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards) + if (m_auiEncounter[0] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185882: MainTempleDoors = pGo->GetGUID();// Main Temple Doors - right past Supermoose (Supremus) + if (m_auiEncounter[1] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185478: ShadeOfAkamaDoor = pGo->GetGUID();break; + case 185480: CommonDoor = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);;break; + case 186153: TeronDoor = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);;break; + case 185892: GuurtogDoor = pGo->GetGUID(); + if (m_auiEncounter[4] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185479: TempleDoor = pGo->GetGUID(); + if (m_auiEncounter[5] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185482: MotherDoor = pGo->GetGUID(); + if (m_auiEncounter[6] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185481: CouncilDoor = pGo->GetGUID(); + if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break; + case 186152: SimpleDoor = pGo->GetGUID(); + if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break; + case 185905: IllidanGate = pGo->GetGUID(); break; // Gate leading to Temple Summit + case 186261: IllidanDoor[0] = pGo->GetGUID(); break; // Right door at Temple Summit + case 186262: IllidanDoor[1] = pGo->GetGUID(); break; // Left door at Temple Summit + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_HIGHWARLORDNAJENTUS: return Najentus; + case DATA_AKAMA: return Akama; + case DATA_AKAMA_SHADE: return Akama_Shade; + case DATA_SHADEOFAKAMA: return ShadeOfAkama; + case DATA_SUPREMUS: return Supremus; + case DATA_ILLIDANSTORMRAGE: return IllidanStormrage; + case DATA_GATHIOSTHESHATTERER: return GathiosTheShatterer; + case DATA_HIGHNETHERMANCERZEREVOR: return HighNethermancerZerevor; + case DATA_LADYMALANDE: return LadyMalande; + case DATA_VERASDARKSHADOW: return VerasDarkshadow; + case DATA_ILLIDARICOUNCIL: return IllidariCouncil; + case DATA_GAMEOBJECT_NAJENTUS_GATE: return NajentusGate; + case DATA_GAMEOBJECT_ILLIDAN_GATE: return IllidanGate; + case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return IllidanDoor[0]; + case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return IllidanDoor[1]; + case DATA_GAMEOBJECT_SUPREMUS_DOORS: return MainTempleDoors; + case DATA_BLOOD_ELF_COUNCIL_VOICE: return BloodElfCouncilVoice; + } + + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_HIGHWARLORDNAJENTUSEVENT: + if (data == DONE) + { + HandleGameObject(NajentusGate, true); + } + m_auiEncounter[0] = data;break; + case DATA_SUPREMUSEVENT: + if (data == DONE) + { + HandleGameObject(NajentusGate, true); + } + m_auiEncounter[1] = data; break; + case DATA_SHADEOFAKAMAEVENT: + if (data == IN_PROGRESS) + { + HandleGameObject(ShadeOfAkamaDoor, false); + }else HandleGameObject(ShadeOfAkamaDoor, true); + m_auiEncounter[2] = data; break; + case DATA_TERONGOREFIENDEVENT: + if (data == IN_PROGRESS) + { + HandleGameObject(TeronDoor, false); + HandleGameObject(CommonDoor, false); + }else + { + HandleGameObject(TeronDoor, true); + HandleGameObject(CommonDoor, true); + } + m_auiEncounter[3] = data; break; + case DATA_GURTOGGBLOODBOILEVENT: + if (data == DONE) + { + HandleGameObject(GuurtogDoor, true); + } + m_auiEncounter[4] = data; break; + case DATA_RELIQUARYOFSOULSEVENT: + if (data == DONE) + { + HandleGameObject(TempleDoor, true); + } + m_auiEncounter[5] = data; break; + case DATA_MOTHERSHAHRAZEVENT: + if (data == DONE) + { + HandleGameObject(MotherDoor, true); + } + m_auiEncounter[6] = data; break; + case DATA_ILLIDARICOUNCILEVENT: + if (data == IN_PROGRESS) + { + HandleGameObject(CouncilDoor, false); + HandleGameObject(SimpleDoor, false); + }else + { + HandleGameObject(CouncilDoor, true); + HandleGameObject(SimpleDoor, true); + } + m_auiEncounter[7] = data; break; + case DATA_ILLIDANSTORMRAGEEVENT: m_auiEncounter[8] = data; break; + } + + if (data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] + << " " << m_auiEncounter[5] << " " << m_auiEncounter[6] << " " << m_auiEncounter[7] + << " " << m_auiEncounter[8]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_HIGHWARLORDNAJENTUSEVENT: return m_auiEncounter[0]; + case DATA_SUPREMUSEVENT: return m_auiEncounter[1]; + case DATA_SHADEOFAKAMAEVENT: return m_auiEncounter[2]; + case DATA_TERONGOREFIENDEVENT: return m_auiEncounter[3]; + case DATA_GURTOGGBLOODBOILEVENT: return m_auiEncounter[4]; + case DATA_RELIQUARYOFSOULSEVENT: return m_auiEncounter[5]; + case DATA_MOTHERSHAHRAZEVENT: return m_auiEncounter[6]; + case DATA_ILLIDARICOUNCILEVENT: return m_auiEncounter[7]; + case DATA_ILLIDANSTORMRAGEEVENT: return m_auiEncounter[8]; + } + + return 0; + } + + std::string GetSaveData() + { + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] + >> m_auiEncounter[3] >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] + >> m_auiEncounter[7] >> m_auiEncounter[8]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_black_temple(Map* pMap) +{ + return new instance_black_temple(pMap); +} + +void AddSC_instance_black_temple() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_black_temple"; + newscript->GetInstanceData = &GetInstanceData_instance_black_temple; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp new file mode 100644 index 00000000000..1e62083f1f9 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp @@ -0,0 +1,759 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Fathomlord_Karathress +SD%Complete: 70 +SDComment: Cyclone workaround +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" +#include "escortAI.h" + +#define SAY_AGGRO -1548021 +#define SAY_GAIN_BLESSING -1548022 +#define SAY_GAIN_ABILITY1 -1548023 +#define SAY_GAIN_ABILITY2 -1548024 +#define SAY_GAIN_ABILITY3 -1548025 +#define SAY_SLAY1 -1548026 +#define SAY_SLAY2 -1548027 +#define SAY_SLAY3 -1548028 +#define SAY_DEATH -1548029 + +//Karathress spells +#define SPELL_CATACLYSMIC_BOLT 38441 +#define SPELL_POWER_OF_SHARKKIS 38455 +#define SPELL_POWER_OF_TIDALVESS 38452 +#define SPELL_POWER_OF_CARIBDIS 38451 +#define SPELL_ENRAGE 24318 +#define SPELL_SEAR_NOVA 38445 +#define SPELL_BLESSING_OF_THE_TIDES 38449 + +//Sharkkis spells +#define SPELL_LEECHING_THROW 29436 +#define SPELL_THE_BEAST_WITHIN 38373 +#define SPELL_MULTISHOT 38366 +#define SPELL_SUMMON_FATHOM_LURKER 38433 +#define SPELL_SUMMON_FATHOM_SPOREBAT 38431 +#define SPELL_PET_ENRAGE 19574 + +//Tidalvess spells +#define SPELL_FROST_SHOCK 38234 +#define SPELL_SPITFIRE_TOTEM 38236 +#define SPELL_POISON_CLEANSING_TOTEM 38306 +// Spell obsolete +// #define SPELL_POISON_CLEANSING_EFFECT 8167 +#define SPELL_EARTHBIND_TOTEM 38304 +#define SPELL_EARTHBIND_TOTEM_EFFECT 6474 +#define SPELL_WINDFURY_WEAPON 38184 + +//Caribdis Spells +#define SPELL_WATER_BOLT_VOLLEY 38335 +#define SPELL_TIDAL_SURGE 38358 +#define SPELL_TIDAL_SURGE_FREEZE 38357 +#define SPELL_HEAL 38330 +#define SPELL_SUMMON_CYCLONE 38337 +#define SPELL_CYCLONE_CYCLONE 29538 + +//Yells and Quotes +#define SAY_GAIN_BLESSING_OF_TIDES "Your overconfidence will be your undoing! Guards, lend me your strength!" +#define SOUND_GAIN_BLESSING_OF_TIDES 11278 +#define SAY_MISC "Alana be'lendor!" //don't know what use this +#define SOUND_MISC 11283 + +//Summoned Unit GUIDs +#define CREATURE_CYCLONE 22104 +#define CREATURE_FATHOM_SPOREBAT 22120 +#define CREATURE_FATHOM_LURKER 22119 +#define CREATURE_SPITFIRE_TOTEM 22091 +#define CREATURE_EARTHBIND_TOTEM 22486 +#define CREATURE_POISON_CLEANSING_TOTEM 22487 + +//entry and position for Seer Olum +#define SEER_OLUM 22820 +#define OLUM_X 446.78f +#define OLUM_Y -542.76f +#define OLUM_Z -7.54773f +#define OLUM_O 0.401581f + +//Fathom-Lord Karathress AI +struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI +{ + boss_fathomlord_karathressAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Advisors[0] = 0; + Advisors[1] = 0; + Advisors[2] = 0; + } + + ScriptedInstance* pInstance; + + uint32 CataclysmicBolt_Timer; + uint32 Enrage_Timer; + uint32 SearNova_Timer; + + bool BlessingOfTides; + + uint64 Advisors[3]; + + void Reset() + { + CataclysmicBolt_Timer = 10000; + Enrage_Timer = 600000; //10 minutes + SearNova_Timer = 20000+rand()%40000; // 20 - 60 seconds + + BlessingOfTides = false; + + + + if (pInstance) + { + uint64 RAdvisors[3]; + RAdvisors[0] = pInstance->GetData64(DATA_SHARKKIS); + RAdvisors[1] = pInstance->GetData64(DATA_TIDALVESS); + RAdvisors[2] = pInstance->GetData64(DATA_CARIBDIS); + //Respawn of the 3 Advisors + Creature* pAdvisor = NULL; + for(int i=0; i<3; ++i) + + if (RAdvisors[i]) + { + pAdvisor = (Unit::GetCreature((*m_creature), RAdvisors[i])); + if (pAdvisor && !pAdvisor->isAlive()) + { + pAdvisor->Respawn(); + pAdvisor->AI()->EnterEvadeMode(); + pAdvisor->GetMotionMaster()->MoveTargetedHome(); + } + } + pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); + } + + + } + + void EventSharkkisDeath() + { + DoScriptText(SAY_GAIN_ABILITY1, m_creature); + DoCast(m_creature, SPELL_POWER_OF_SHARKKIS); + } + + void EventTidalvessDeath() + { + DoScriptText(SAY_GAIN_ABILITY2, m_creature); + DoCast(m_creature, SPELL_POWER_OF_TIDALVESS); + } + + void EventCaribdisDeath() + { + DoScriptText(SAY_GAIN_ABILITY3, m_creature); + DoCast(m_creature, SPELL_POWER_OF_CARIBDIS); + } + + void GetAdvisors() + { + if (!pInstance) + return; + + Advisors[0] = pInstance->GetData64(DATA_SHARKKIS); + Advisors[1] = pInstance->GetData64(DATA_TIDALVESS); + Advisors[2] = pInstance->GetData64(DATA_CARIBDIS); + } + + void StartEvent(Unit *who) + { + if (!pInstance) + return; + + GetAdvisors(); + + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + + pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); + pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit *killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, DONE); + + //support for quest 10944 + m_creature->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000); + } + + void EnterCombat(Unit *who) + { + StartEvent(who); + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + + if (target) + { + AttackStart(target); + GetAdvisors(); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) + { + EnterEvadeMode(); + return; + } + + //CataclysmicBolt_Timer + if (CataclysmicBolt_Timer < diff) + { + //select a random unit other than the main tank + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1); + + //if there aren't other units, cast on the tank + if (!target) + target = m_creature->getVictim(); + + if (target) + DoCast(target, SPELL_CATACLYSMIC_BOLT); + CataclysmicBolt_Timer = 10000; + }else CataclysmicBolt_Timer -= diff; + + //SearNova_Timer + if (SearNova_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SEAR_NOVA); + SearNova_Timer = 20000+rand()%40000; + }else SearNova_Timer -= diff; + + //Enrage_Timer + if (Enrage_Timer < diff) + { + DoCast(m_creature, SPELL_ENRAGE); + Enrage_Timer = 90000; + }else Enrage_Timer -= diff; + + //Blessing of Tides Trigger + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 75 && !BlessingOfTides) + { + BlessingOfTides = true; + bool continueTriggering; + Creature* Advisor; + for(uint8 i = 0; i < 4; ++i) + if (Advisors[i]) + { + Advisor = (Unit::GetCreature(*m_creature, Advisors[i])); + if (Advisor) + { + if (Advisor->isAlive()) + { + continueTriggering = true; + break; + } + } + } + if (continueTriggering) + { + DoCast(m_creature, SPELL_BLESSING_OF_THE_TIDES); + m_creature->MonsterYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, NULL); + DoPlaySoundToSet(m_creature, SOUND_GAIN_BLESSING_OF_TIDES); + } + } + + DoMeleeAttackIfReady(); + } +}; + +//Fathom-Guard Sharkkis AI +struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI +{ + boss_fathomguard_sharkkisAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 LeechingThrow_Timer; + uint32 TheBeastWithin_Timer; + uint32 Multishot_Timer; + uint32 Pet_Timer; + + bool pet; + + uint64 SummonedPet; + + + void Reset() + { + LeechingThrow_Timer = 20000; + TheBeastWithin_Timer = 30000; + Multishot_Timer = 15000; + Pet_Timer = 10000; + + pet = false; + + Creature *Pet = Unit::GetCreature(*m_creature, SummonedPet); + if (Pet && Pet->isAlive()) + { + Pet->DealDamage(Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + + SummonedPet = 0; + + if (pInstance) + pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); + } + + void JustDied(Unit *victim) + { + if (pInstance) + { + Creature *Karathress = NULL; + Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); + + if (Karathress) + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath(); + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath(); + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); + pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + + if (target) + { + AttackStart(target); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) + { + EnterEvadeMode(); + return; + } + + //LeechingThrow_Timer + if (LeechingThrow_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_LEECHING_THROW); + LeechingThrow_Timer = 20000; + }else LeechingThrow_Timer -= diff; + + //Multishot_Timer + if (Multishot_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_MULTISHOT); + Multishot_Timer = 20000; + }else Multishot_Timer -= diff; + + //TheBeastWithin_Timer + if (TheBeastWithin_Timer < diff) + { + DoCast(m_creature, SPELL_THE_BEAST_WITHIN); + Creature *Pet = Unit::GetCreature(*m_creature, SummonedPet); + if (Pet && Pet->isAlive()) + { + Pet->CastSpell(Pet, SPELL_PET_ENRAGE, true); + } + TheBeastWithin_Timer = 30000; + }else TheBeastWithin_Timer -= diff; + + //Pet_Timer + if (Pet_Timer < diff && pet == false) + { + pet = true; + //uint32 spell_id; + uint32 pet_id; + switch(rand()%2) + { + case 0: + //spell_id = SPELL_SUMMON_FATHOM_LURKER; + pet_id = CREATURE_FATHOM_LURKER; + break; + case 1: + //spell_id = SPELL_SUMMON_FATHOM_SPOREBAT; + pet_id = CREATURE_FATHOM_SPOREBAT; + break; + } + //DoCast(m_creature, spell_id, true); + Creature *Pet = DoSpawnCreature(pet_id,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (Pet && target) + { + Pet->AI()->AttackStart(target); + SummonedPet = Pet->GetGUID(); + } + }else Pet_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Fathom-Guard Tidalvess AI +struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI +{ + boss_fathomguard_tidalvessAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 FrostShock_Timer; + uint32 Spitfire_Timer; + uint32 PoisonCleansing_Timer; + uint32 Earthbind_Timer; + + void Reset() + { + FrostShock_Timer = 25000; + Spitfire_Timer = 60000; + PoisonCleansing_Timer = 30000; + Earthbind_Timer = 45000; + + if (pInstance) + pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); + } + + void JustDied(Unit *victim) + { + if (pInstance) + { + Creature *Karathress = NULL; + Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); + + if (Karathress) + if (!m_creature->isAlive() && Karathress) + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventTidalvessDeath(); + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); + pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); + } + DoCast(m_creature, SPELL_WINDFURY_WEAPON); + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + + if (target) + { + AttackStart(target); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) + { + EnterEvadeMode(); + return; + } + + if (!m_creature->HasAura(SPELL_WINDFURY_WEAPON)) + { + DoCast(m_creature, SPELL_WINDFURY_WEAPON); + } + + //FrostShock_Timer + if (FrostShock_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK); + FrostShock_Timer = 25000+rand()%5000; + }else FrostShock_Timer -= diff; + + //Spitfire_Timer + if (Spitfire_Timer < diff) + { + DoCast(m_creature, SPELL_SPITFIRE_TOTEM); + Unit *SpitfireTotem = Unit::GetUnit(*m_creature, CREATURE_SPITFIRE_TOTEM); + if (SpitfireTotem) + { + CAST_CRE(SpitfireTotem)->AI()->AttackStart(m_creature->getVictim()); + } + Spitfire_Timer = 60000; + }else Spitfire_Timer -= diff; + + //PoisonCleansing_Timer + if (PoisonCleansing_Timer < diff) + { + DoCast(m_creature, SPELL_POISON_CLEANSING_TOTEM); + PoisonCleansing_Timer = 30000; + }else PoisonCleansing_Timer -= diff; + + //Earthbind_Timer + if (Earthbind_Timer < diff) + { + DoCast(m_creature, SPELL_EARTHBIND_TOTEM); + Earthbind_Timer = 45000; + }else Earthbind_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Fathom-Guard Caribdis AI +struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI +{ + boss_fathomguard_caribdisAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 WaterBoltVolley_Timer; + uint32 TidalSurge_Timer; + uint32 Heal_Timer; + uint32 Cyclone_Timer; + + void Reset() + { + WaterBoltVolley_Timer = 35000; + TidalSurge_Timer = 15000+rand()%5000; + Heal_Timer = 55000; + Cyclone_Timer = 30000+rand()%10000; + + if (pInstance) + pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); + } + + void JustDied(Unit *victim) + { + if (pInstance) + { + Creature *Karathress = NULL; + Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); + + if (Karathress) + if (!m_creature->isAlive() && Karathress) + CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventCaribdisDeath(); + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); + pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); + + if (target) + { + AttackStart(target); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) + { + EnterEvadeMode(); + return; + } + + //WaterBoltVolley_Timer + if (WaterBoltVolley_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WATER_BOLT_VOLLEY); + WaterBoltVolley_Timer = 30000; + }else WaterBoltVolley_Timer -= diff; + + //TidalSurge_Timer + if (TidalSurge_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_TIDAL_SURGE); + // Hacky way to do it - won't trigger elseways + m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_TIDAL_SURGE_FREEZE, true); + TidalSurge_Timer = 15000+rand()%5000; + }else TidalSurge_Timer -= diff; + + //Cyclone_Timer + if (Cyclone_Timer < diff) + { + //DoCast(m_creature, SPELL_SUMMON_CYCLONE); // Doesn't work + Cyclone_Timer = 30000+rand()%10000; + Creature *Cyclone = m_creature->SummonCreature(CREATURE_CYCLONE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000); + if (Cyclone) + { + CAST_CRE(Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f); + Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Cyclone->setFaction(m_creature->getFaction()); + Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true); + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + { + Cyclone->AI()->AttackStart(target); + } + } + }else Cyclone_Timer -= diff; + + //Heal_Timer + if (Heal_Timer < diff) + { + // It can be cast on any of the mobs + Unit *pUnit = NULL; + + while(pUnit == NULL || !pUnit->isAlive()) + { + pUnit = selectAdvisorUnit(); + } + + if (pUnit && pUnit->isAlive()) + DoCast(pUnit, SPELL_HEAL); + Heal_Timer = 60000; + }else Heal_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + Unit* selectAdvisorUnit() + { + Unit* pUnit = NULL; + if (pInstance) + { + switch(rand()%4) + { + case 0: + pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)); + break; + case 1: + pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SHARKKIS)); + break; + case 2: + pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_TIDALVESS)); + break; + case 3: + pUnit = m_creature; + break; + } + }else pUnit = m_creature; + + return pUnit; + } +}; + +CreatureAI* GetAI_boss_fathomlord_karathress(Creature* pCreature) +{ + return new boss_fathomlord_karathressAI (pCreature); +} + +CreatureAI* GetAI_boss_fathomguard_sharkkis(Creature* pCreature) +{ + return new boss_fathomguard_sharkkisAI (pCreature); +} + +CreatureAI* GetAI_boss_fathomguard_tidalvess(Creature* pCreature) +{ + return new boss_fathomguard_tidalvessAI (pCreature); +} + +CreatureAI* GetAI_boss_fathomguard_caribdis(Creature* pCreature) +{ + return new boss_fathomguard_caribdisAI (pCreature); +} + +void AddSC_boss_fathomlord_karathress() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_fathomlord_karathress"; + newscript->GetAI = &GetAI_boss_fathomlord_karathress; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_fathomguard_sharkkis"; + newscript->GetAI = &GetAI_boss_fathomguard_sharkkis; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_fathomguard_tidalvess"; + newscript->GetAI = &GetAI_boss_fathomguard_tidalvess; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_fathomguard_caribdis"; + newscript->GetAI = &GetAI_boss_fathomguard_caribdis; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp new file mode 100644 index 00000000000..434e088cd99 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp @@ -0,0 +1,386 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hydross_The_Unstable +SD%Complete: 90 +SDComment: Some details and adjustments left to do, probably nothing major. Spawns may be spawned in different way/location. +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" + +#define SAY_AGGRO -1548000 +#define SAY_SWITCH_TO_CLEAN -1548001 +#define SAY_CLEAN_SLAY1 -1548002 +#define SAY_CLEAN_SLAY2 -1548003 +#define SAY_CLEAN_DEATH -1548004 +#define SAY_SWITCH_TO_CORRUPT -1548005 +#define SAY_CORRUPT_SLAY1 -1548006 +#define SAY_CORRUPT_SLAY2 -1548007 +#define SAY_CORRUPT_DEATH -1548008 + +#define SWITCH_RADIUS 18 + +#define MODEL_CORRUPT 20609 +#define MODEL_CLEAN 20162 + +#define SPELL_WATER_TOMB 38235 +#define SPELL_MARK_OF_HYDROSS1 38215 +#define SPELL_MARK_OF_HYDROSS2 38216 +#define SPELL_MARK_OF_HYDROSS3 38217 +#define SPELL_MARK_OF_HYDROSS4 38218 +#define SPELL_MARK_OF_HYDROSS5 38231 +#define SPELL_MARK_OF_HYDROSS6 40584 +#define SPELL_MARK_OF_CORRUPTION1 38219 +#define SPELL_MARK_OF_CORRUPTION2 38220 +#define SPELL_MARK_OF_CORRUPTION3 38221 +#define SPELL_MARK_OF_CORRUPTION4 38222 +#define SPELL_MARK_OF_CORRUPTION5 38230 +#define SPELL_MARK_OF_CORRUPTION6 40583 +#define SPELL_VILE_SLUDGE 38246 +#define SPELL_ENRAGE 27680 //this spell need verification +#define SPELL_SUMMON_WATER_ELEMENT 36459 //not in use yet(in use ever?) +#define SPELL_ELEMENTAL_SPAWNIN 25035 +#define SPELL_BLUE_BEAM 40227 //channeled Hydross Beam Helper (not in use yet) + +#define ENTRY_PURE_SPAWN 22035 +#define ENTRY_TAINTED_SPAWN 22036 +#define ENTRY_BEAM_DUMMY 21934 + +#define HYDROSS_X -239.439 +#define HYDROSS_Y -363.481 + +#define SPAWN_X_DIFF1 6.934003 +#define SPAWN_Y_DIFF1 -11.255012 +#define SPAWN_X_DIFF2 -6.934003 +#define SPAWN_Y_DIFF2 11.255012 +#define SPAWN_X_DIFF3 -12.577011 +#define SPAWN_Y_DIFF3 -4.72702 +#define SPAWN_X_DIFF4 12.577011 +#define SPAWN_Y_DIFF4 4.72702 + +struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI +{ + boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c), Summons(m_creature) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + uint64 beams[2]; + uint32 PosCheck_Timer; + uint32 MarkOfHydross_Timer; + uint32 MarkOfCorruption_Timer; + uint32 WaterTomb_Timer; + uint32 VileSludge_Timer; + uint32 MarkOfHydross_Count; + uint32 MarkOfCorruption_Count; + uint32 EnrageTimer; + bool CorruptedForm; + bool beam; + SummonList Summons; + + void Reset() + { + DeSummonBeams(); + beams[0] = 0; + beams[1] = 0; + PosCheck_Timer = 2500; + MarkOfHydross_Timer = 15000; + MarkOfCorruption_Timer = 15000; + WaterTomb_Timer = 7000; + VileSludge_Timer = 7000; + MarkOfHydross_Count = 0; + MarkOfCorruption_Count = 0; + EnrageTimer = 600000; + + CorruptedForm = false; + m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + + m_creature->SetDisplayId(MODEL_CLEAN); + + if (pInstance) + pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED); + beam = false; + Summons.DespawnAll(); + } + + void SummonBeams() + { + Creature* beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0); + if (beamer) + { + beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true); + beamer->SetDisplayId(11686); //invisible + beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + beams[0]=beamer->GetGUID(); + } + beamer = beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0); + if (beamer) + { + beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true); + beamer->SetDisplayId(11686); //invisible + beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + beams[1]=beamer->GetGUID(); + } + } + void DeSummonBeams() + { + for(uint8 i=0;i<2; ++i) + { + Creature* mob = Unit::GetCreature(*m_creature,beams[i]); + if (mob) + { + mob->setDeathState(DEAD); + mob->RemoveCorpse(); + } + } + } + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + if (CorruptedForm) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_CORRUPT_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_CORRUPT_SLAY2, m_creature); break; + } + } + else + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_CLEAN_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_CLEAN_SLAY2, m_creature); break; + } + } + } + + void JustSummoned(Creature* summoned) + { + if (summoned->GetEntry() == ENTRY_PURE_SPAWN) + { + summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); + Summons.Summon(summoned); + } + if (summoned->GetEntry() == ENTRY_TAINTED_SPAWN) + { + summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); + summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); + Summons.Summon(summoned); + } + } + + void SummonedCreatureDespawn(Creature *summon) + { + Summons.Despawn(summon); + } + + void JustDied(Unit *victim) + { + if (CorruptedForm) + DoScriptText(SAY_CORRUPT_DEATH, m_creature); + else + DoScriptText(SAY_CLEAN_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, DONE); + Summons.DespawnAll(); + } + + void UpdateAI(const uint32 diff) + { + if (!beam) + { + SummonBeams(); + beam=true; + } + //Return since we have no target + if (!UpdateVictim()) + return; + + // corrupted form + if (CorruptedForm) + { + //MarkOfCorruption_Timer + if (MarkOfCorruption_Timer < diff) + { + if (MarkOfCorruption_Count <= 5) + { + uint32 mark_spell; + + switch(MarkOfCorruption_Count) + { + case 0: mark_spell = SPELL_MARK_OF_CORRUPTION1; break; + case 1: mark_spell = SPELL_MARK_OF_CORRUPTION2; break; + case 2: mark_spell = SPELL_MARK_OF_CORRUPTION3; break; + case 3: mark_spell = SPELL_MARK_OF_CORRUPTION4; break; + case 4: mark_spell = SPELL_MARK_OF_CORRUPTION5; break; + case 5: mark_spell = SPELL_MARK_OF_CORRUPTION6; break; + } + + DoCast(m_creature->getVictim(), mark_spell); + + if (MarkOfCorruption_Count < 5) + MarkOfCorruption_Count++; + } + + MarkOfCorruption_Timer = 15000; + }else MarkOfCorruption_Timer -= diff; + + //VileSludge_Timer + if (VileSludge_Timer < diff) + { + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + DoCast(target, SPELL_VILE_SLUDGE); + + VileSludge_Timer = 15000; + }else VileSludge_Timer -= diff; + + //PosCheck_Timer + if (PosCheck_Timer < diff) + { + if (m_creature->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS)) + { + // switch to clean form + m_creature->SetDisplayId(MODEL_CLEAN); + CorruptedForm = false; + MarkOfHydross_Count = 0; + + DoScriptText(SAY_SWITCH_TO_CLEAN, m_creature); + DoResetThreat(); + SummonBeams(); + + // spawn 4 adds + DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + + m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + } + + PosCheck_Timer = 2500; + }else PosCheck_Timer -=diff; + } + // clean form + else + { + //MarkOfHydross_Timer + if (MarkOfHydross_Timer < diff) + { + if (MarkOfHydross_Count <= 5) + { + uint32 mark_spell; + + switch(MarkOfHydross_Count) + { + case 0: mark_spell = SPELL_MARK_OF_HYDROSS1; break; + case 1: mark_spell = SPELL_MARK_OF_HYDROSS2; break; + case 2: mark_spell = SPELL_MARK_OF_HYDROSS3; break; + case 3: mark_spell = SPELL_MARK_OF_HYDROSS4; break; + case 4: mark_spell = SPELL_MARK_OF_HYDROSS5; break; + case 5: mark_spell = SPELL_MARK_OF_HYDROSS6; break; + } + + DoCast(m_creature->getVictim(), mark_spell); + + if (MarkOfHydross_Count < 5) + MarkOfHydross_Count++; + } + + MarkOfHydross_Timer = 15000; + }else MarkOfHydross_Timer -= diff; + + //WaterTomb_Timer + if (WaterTomb_Timer < diff) + { + Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); + if (target) + DoCast(target, SPELL_WATER_TOMB); + + WaterTomb_Timer = 7000; + }else WaterTomb_Timer -= diff; + + //PosCheck_Timer + if (PosCheck_Timer < diff) + { + if (!m_creature->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS)) + { + // switch to corrupted form + m_creature->SetDisplayId(MODEL_CORRUPT); + MarkOfCorruption_Count = 0; + CorruptedForm = true; + + DoScriptText(SAY_SWITCH_TO_CORRUPT, m_creature); + DoResetThreat(); + DeSummonBeams(); + + // spawn 4 adds + DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + + m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + } + + PosCheck_Timer = 2500; + }else PosCheck_Timer -=diff; + } + + //EnrageTimer + if (EnrageTimer < diff) + { + DoCast(m_creature, SPELL_ENRAGE); + EnrageTimer = 60000; + }else EnrageTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_hydross_the_unstable(Creature* pCreature) +{ + return new boss_hydross_the_unstableAI (pCreature); +} + +void AddSC_boss_hydross_the_unstable() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_hydross_the_unstable"; + newscript->GetAI = &GetAI_boss_hydross_the_unstable; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp new file mode 100644 index 00000000000..c1a2280653c --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp @@ -0,0 +1,1066 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA + */ + +/* ScriptData +SDName: Boss_Lady_Vashj +SD%Complete: 99 +SDComment: Missing blizzlike Shield Generators coords +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" +#include "simple_ai.h" +#include "Spell.h" + +#define SAY_INTRO -1548042 +#define SAY_AGGRO1 -1548043 +#define SAY_AGGRO2 -1548044 +#define SAY_AGGRO3 -1548045 +#define SAY_AGGRO4 -1548046 +#define SAY_PHASE1 -1548047 +#define SAY_PHASE2 -1548048 +#define SAY_PHASE3 -1548049 +#define SAY_BOWSHOT1 -1548050 +#define SAY_BOWSHOT2 -1548051 +#define SAY_SLAY1 -1548052 +#define SAY_SLAY2 -1548053 +#define SAY_SLAY3 -1548054 +#define SAY_DEATH -1548055 + +#define SPELL_SURGE 38044 +#define SPELL_MULTI_SHOT 38310 +#define SPELL_SHOCK_BLAST 38509 +#define SPELL_ENTANGLE 38316 +#define SPELL_STATIC_CHARGE_TRIGGER 38280 +#define SPELL_FORKED_LIGHTNING 40088 +#define SPELL_SHOOT 40873 +#define SPELL_POISON_BOLT 40095 +#define SPELL_TOXIC_SPORES 38575 +#define SPELL_MAGIC_BARRIER 38112 + +#define MIDDLE_X 30.134 +#define MIDDLE_Y -923.65 +#define MIDDLE_Z 42.9 + +#define SPOREBAT_X 30.977156 +#define SPOREBAT_Y -925.297761 +#define SPOREBAT_Z 77.176567 +#define SPOREBAT_O 5.223932 + +#define SHIED_GENERATOR_CHANNEL 19870 +#define ENCHANTED_ELEMENTAL 21958 +#define TAINTED_ELEMENTAL 22009 +#define COILFANG_STRIDER 22056 +#define COILFANG_ELITE 22055 +#define TOXIC_SPOREBAT 22140 +#define TOXIC_SPORES_TRIGGER 22207 + +float ElementPos[8][4] = +{ + {8.3, -835.3, 21.9, 5}, + {53.4, -835.3, 21.9, 4.5}, + {96, -861.9, 21.8, 4}, + {96, -986.4, 21.4, 2.5}, + {54.4, -1010.6, 22, 1.8}, + {9.8, -1012, 21.7, 1.4}, + {-35, -987.6, 21.5, 0.8}, + {-58.9, -901.6, 21.5, 6} +}; + +float ElementWPPos[8][3] = +{ + {71.700752, -883.905884, 41.097168}, + {45.039848, -868.022827, 41.097015}, + {14.585141, -867.894470, 41.097061}, + {-25.415508, -906.737732, 41.097061}, + {-11.801594, -963.405884, 41.097067}, + {14.556657, -979.051514, 41.097137}, + {43.466549, -979.406677, 41.097027}, + {69.945908, -964.663940, 41.097054} +}; + +float SporebatWPPos[8][3] = +{ + {31.6,-896.3,59.1}, + {9.1, -913.9, 56}, + {5.2, -934.4, 52.4}, + {20.7, -946.9, 49.7}, + {41, -941.9, 51}, + {47.7, -927.3, 55}, + {42.2, -912.4, 51.7}, + {27, -905.9, 50} +}; + +float CoilfangElitePos[3][4] = +{ + {28.84, -923.28, 42.9, 6}, + {31.183281, -953.502625, 41.523602, 1.640957}, + {58.895180, -923.124268, 41.545307, 3.152848} +}; + +float CoilfangStriderPos[3][4] = +{ + {66.427010, -948.778503, 41.262245, 2.584220}, + {7.513962, -959.538208, 41.300422, 1.034629}, + {-12.843201, -907.798401, 41.239620, 6.087094} +}; + +float ShieldGeneratorChannelPos[4][4] = +{ + {49.6262, -902.181, 43.0975, 3.95683}, + {10.988, -901.616, 42.5371, 5.4373}, + {10.3859, -944.036, 42.5446, 0.779888}, + {49.3126, -943.398, 42.5501, 2.40174} +}; + +//Lady Vashj AI +struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI +{ + boss_lady_vashjAI (Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + Intro = false; + JustCreated = true; + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on Creature create (no need do intro if wiped) + } + + ScriptedInstance *pInstance; + + uint64 ShieldGeneratorChannel[4]; + + uint32 AggroTimer; + uint32 ShockBlast_Timer; + uint32 Entangle_Timer; + uint32 StaticCharge_Timer; + uint32 ForkedLightning_Timer; + uint32 Check_Timer; + uint32 EnchantedElemental_Timer; + uint32 TaintedElemental_Timer; + uint32 CoilfangElite_Timer; + uint32 CoilfangStrider_Timer; + uint32 SummonSporebat_Timer; + uint32 SummonSporebat_StaticTimer; + uint8 EnchantedElemental_Pos; + uint8 Phase; + + bool Entangle; + bool Intro; + bool CanAttack; + bool JustCreated; + + void Reset() + { + AggroTimer = 19000; + ShockBlast_Timer = 1+rand()%60000; + Entangle_Timer = 30000; + StaticCharge_Timer = 10000+rand()%15000; + ForkedLightning_Timer = 2000; + Check_Timer = 15000; + EnchantedElemental_Timer = 5000; + TaintedElemental_Timer = 50000; + CoilfangElite_Timer = 45000+rand()%5000; + CoilfangStrider_Timer = 60000+rand()%10000; + SummonSporebat_Timer = 10000; + SummonSporebat_StaticTimer = 30000; + EnchantedElemental_Pos = 0; + Phase = 0; + + Entangle = false; + if (JustCreated) + { + CanAttack = false; + JustCreated = false; + }else CanAttack = true; + + Unit *remo; + for(uint8 i = 0; i < 4; ++i) + { + remo = Unit::GetUnit(*m_creature, ShieldGeneratorChannel[i]); + if (remo) + remo->setDeathState(JUST_DIED); + } + + if (pInstance) + pInstance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); + ShieldGeneratorChannel[0] = 0; + ShieldGeneratorChannel[1] = 0; + ShieldGeneratorChannel[2] = 0; + ShieldGeneratorChannel[3] = 0; + + m_creature->SetCorpseDelay(1000*60*60); + } + + //Called when a tainted elemental dies + void EventTaintedElementalDeath() + { + //the next will spawn 50 seconds after the previous one's death + if (TaintedElemental_Timer > 50000) + TaintedElemental_Timer = 50000; + } + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_LADYVASHJEVENT, DONE); + } + + void StartEvent() + { + switch(rand()%4) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + case 3: DoScriptText(SAY_AGGRO4, m_creature); break; + } + + Phase = 1; + + if (pInstance) + pInstance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + //remove old tainted cores to prevent cheating in phase 2 + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin();i != PlayerList.end(); ++i) + { + if (Player* i_pl = i->getSource()) + { + i_pl->DestroyItemCount(31088, 1, true); + } + } + } + StartEvent();//this is EnterCombat(), so were are 100% in combat, start the event + + if (Phase != 2) + AttackStart(who); + } + + void MoveInLineOfSight(Unit *who) + { + if (!Intro) + { + Intro = true; + DoScriptText(SAY_INTRO, m_creature); + } + if (!CanAttack) + return; + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) + { + //if (who->HasStealthAura()) + // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + + if (!m_creature->isInCombat())//AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking + StartEvent(); + + if (Phase != 2) + AttackStart(who); + } + } + } + + void CastShootOrMultishot() + { + switch(rand()%2) + { + case 0: + //Shoot + //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage. + DoCast(m_creature->getVictim(), SPELL_SHOOT); + break; + case 1: + //Multishot + //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage. + DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT); + break; + } + if (rand()%3) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_BOWSHOT1, m_creature); break; + case 1: DoScriptText(SAY_BOWSHOT2, m_creature); break; + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!CanAttack && Intro) + { + if (AggroTimer < diff) + { + CanAttack = true; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + AggroTimer=19000; + }else + { + AggroTimer-=diff; + return; + } + } + //to prevent abuses during phase 2 + if (Phase == 2 && !m_creature->getVictim() && m_creature->isInCombat()) + { + EnterEvadeMode(); + return; + } + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Phase == 1 || Phase == 3) + { + //ShockBlast_Timer + if (ShockBlast_Timer < diff) + { + //Shock Burst + //Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list. + DoCast(m_creature->getVictim(), SPELL_SHOCK_BLAST); + m_creature->TauntApply(m_creature->getVictim()); + + ShockBlast_Timer = 1000+rand()%14000; //random cooldown + }else ShockBlast_Timer -= diff; + + //StaticCharge_Timer + if (StaticCharge_Timer < diff) + { + //Static Charge + //Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic. + Unit *target = NULL; + target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true); + + if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) + //cast Static Charge every 2 seconds for 20 seconds + DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); + + StaticCharge_Timer = 10000+rand()%20000; //blizzlike + }else StaticCharge_Timer -= diff; + + //Entangle_Timer + if (Entangle_Timer < diff) + { + if (!Entangle) + { + //Entangle + //Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom. + DoCast(m_creature->getVictim(), SPELL_ENTANGLE); + Entangle = true; + Entangle_Timer = 10000; + } + else + { + CastShootOrMultishot(); + Entangle = false; + Entangle_Timer = 20000+rand()%5000; + } + }else Entangle_Timer -= diff; + + //Phase 1 + if (Phase == 1) + { + //Start phase 2 + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 70) + { + //Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable. + Phase = 2; + + m_creature->GetMotionMaster()->Clear(); + DoTeleportTo(MIDDLE_X, MIDDLE_Y, MIDDLE_Z); + + Creature *pCreature; + for(uint8 i = 0; i < 4; ++i) + { + pCreature = m_creature->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0); + if (pCreature) + ShieldGeneratorChannel[i] = pCreature->GetGUID(); + } + DoScriptText(SAY_PHASE2, m_creature); + } + } + //Phase 3 + else + { + //SummonSporebat_Timer + if (SummonSporebat_Timer < diff) + { + Creature *Sporebat = NULL; + Sporebat = m_creature->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (Sporebat) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + Sporebat->AI()->AttackStart(target); + } + + //summon sporebats faster and faster + if (SummonSporebat_StaticTimer > 1000) + SummonSporebat_StaticTimer -= 1000; + + SummonSporebat_Timer = SummonSporebat_StaticTimer; + + if (SummonSporebat_Timer < 5000) + SummonSporebat_Timer = 5000; + + }else SummonSporebat_Timer -= diff; + } + + //Melee attack + DoMeleeAttackIfReady(); + + //Check_Timer - used to check if somebody is in melee range + if (Check_Timer < diff) + { + bool InMeleeRange = false; + Unit *target; + std::list t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + //if in melee range + if (target && target->IsWithinDistInMap(m_creature, 5)) + { + InMeleeRange = true; + break; + } + } + + //if nobody is in melee range + if (!InMeleeRange) + CastShootOrMultishot(); + + Check_Timer = 5000; + }else Check_Timer -= diff; + } + //Phase 2 + else + { + //ForkedLightning_Timer + if (ForkedLightning_Timer < diff) + { + //Forked Lightning + //Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage. + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (!target) + target = m_creature->getVictim(); + + DoCast(target, SPELL_FORKED_LIGHTNING); + + ForkedLightning_Timer = 2000+rand()%6000; //blizzlike + }else ForkedLightning_Timer -= diff; + + //EnchantedElemental_Timer + if (EnchantedElemental_Timer < diff) + { + Creature *Elemental; + Elemental = m_creature->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (EnchantedElemental_Pos == 7) + EnchantedElemental_Pos = 0; + else + EnchantedElemental_Pos++; + + EnchantedElemental_Timer = 10000+rand()%5000; + }else EnchantedElemental_Timer -= diff; + + //TaintedElemental_Timer + if (TaintedElemental_Timer < diff) + { + Creature *Tain_Elemental; + uint32 pos = rand()%8; + Tain_Elemental = m_creature->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_DEAD_DESPAWN, 0); + + TaintedElemental_Timer = 120000; + }else TaintedElemental_Timer -= diff; + + //CoilfangElite_Timer + if (CoilfangElite_Timer < diff) + { + uint32 pos = rand()%3; + Creature* CoilfangElite = NULL; + CoilfangElite = m_creature->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (CoilfangElite) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + CoilfangElite->AI()->AttackStart(target); + else if (m_creature->getVictim()) + CoilfangElite->AI()->AttackStart(m_creature->getVictim()); + } + CoilfangElite_Timer = 45000+rand()%5000; + }else CoilfangElite_Timer -= diff; + + //CoilfangStrider_Timer + if (CoilfangStrider_Timer < diff) + { + uint32 pos = rand()%3; + Creature* CoilfangStrider = NULL; + CoilfangStrider = m_creature->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (CoilfangStrider) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + CoilfangStrider->AI()->AttackStart(target); + else if (m_creature->getVictim()) + CoilfangStrider->AI()->AttackStart(m_creature->getVictim()); + } + CoilfangStrider_Timer = 60000+rand()%10000; + }else CoilfangStrider_Timer -= diff; + + //Check_Timer + if (Check_Timer < diff) + { + //Start Phase 3 + if (pInstance && pInstance->GetData(DATA_CANSTARTPHASE3)) + { + //set life 50% + m_creature->SetHealth(m_creature->GetMaxHealth()/2); + + m_creature->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER); + + DoScriptText(SAY_PHASE3, m_creature); + + Phase = 3; + + //return to the tank + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + Check_Timer = 1000; + }else Check_Timer -= diff; + } + } +}; + +//Enchanted Elemental +//If one of them reaches Vashj he will increase her damage done by 5%. +struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI +{ + mob_enchanted_elementalAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + uint32 move; + uint32 phase; + float x, y, z; + Creature *Vashj; + + void Reset() + { + m_creature->SetSpeed(MOVE_WALK,0.6);//walk + m_creature->SetSpeed(MOVE_RUN,0.6);//run + move = 0; + phase = 1; + Vashj = NULL; + + for (int i = 0;i<8; ++i)//search for nearest waypoint (up on stairs) + { + if (!x || !y || !z) + { + x = ElementWPPos[i][0]; + y = ElementWPPos[i][1]; + z = ElementWPPos[i][2]; + } + else + { + if (m_creature->GetDistance(ElementWPPos[i][0],ElementWPPos[i][1],ElementWPPos[i][2]) < m_creature->GetDistance(x,y,z)) + { + x = ElementWPPos[i][0]; + y = ElementWPPos[i][1]; + z = ElementWPPos[i][2]; + } + } + } + if (pInstance) + Vashj = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); + } + + void EnterCombat(Unit *who) { return; } + + void MoveInLineOfSight(Unit *who){return;} + + void UpdateAI(const uint32 diff) + { + if (!pInstance) + return; + + if (!Vashj) + { + return; + } + + if (move < diff) + { + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + if (phase == 1) + { + m_creature->GetMotionMaster()->MovePoint(0, x, y, z); + } + if (phase == 1 && m_creature->IsWithinDist3d(x,y,z, 0.1)) + { + phase = 2; + } + if (phase == 2) + { + m_creature->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); + phase = 3; + } + if (phase == 3) + { + m_creature->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); + if (m_creature->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3)) + { + SpellEntry *spell = GET_SPELL(SPELL_SURGE); + if (spell) + { + uint8 eff_mask=0; + for (int i=0; i<3; ++i) + { + if (!spell->Effect[i]) + continue; + eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, Vashj, Vashj)); + } + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + if (!Vashj->isInCombat() || CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead()) + { + //call Unsummon() + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + move = 1000; + }else move -= diff; + } +}; + +//Tainted Elemental +//This mob has 7,900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3,000 nature damage and placing a posion doing 2,000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental +struct TRINITY_DLL_DECL mob_tainted_elementalAI : public ScriptedAI +{ + mob_tainted_elementalAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 PoisonBolt_Timer; + uint32 Despawn_Timer; + + void Reset() + { + PoisonBolt_Timer = 5000+rand()%5000; + Despawn_Timer = 30000; + } + + void JustDied(Unit *killer) + { + if (pInstance) + { + Creature *Vashj = NULL; + Vashj = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_LADYVASHJ))); + + if (Vashj) + CAST_AI(boss_lady_vashjAI, Vashj->AI())->EventTaintedElementalDeath(); + } + } + + void EnterCombat(Unit *who) + { + m_creature->AddThreat(who, 0.1f); + } + + void UpdateAI(const uint32 diff) + { + //PoisonBolt_Timer + if (PoisonBolt_Timer < diff) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (target && target->IsWithinDistInMap(m_creature, 30)) + DoCast(target, SPELL_POISON_BOLT); + + PoisonBolt_Timer = 5000+rand()%5000; + }else PoisonBolt_Timer -= diff; + + //Despawn_Timer + if (Despawn_Timer < diff) + { + //call Unsummon() + m_creature->setDeathState(DEAD); + + //to prevent crashes + Despawn_Timer = 1000; + }else Despawn_Timer -= diff; + } +}; + +//Toxic Sporebat +//Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it. +struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI +{ + mob_toxic_sporebatAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + EnterEvadeMode(); + } + + ScriptedInstance *pInstance; + + uint32 movement_timer; + uint32 ToxicSpore_Timer; + uint32 bolt_timer; + uint32 Check_Timer; + + void Reset() + { + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->setFaction(14); + movement_timer = 0; + ToxicSpore_Timer = 5000; + bolt_timer = 5500; + Check_Timer = 1000; + } + + void EnterCombat(Unit *who) + { + + } + + void MoveInLineOfSight(Unit *who) + { + + } + + void MovementInform(uint32 type, uint32 id) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id == 1) + movement_timer = 0; + } + + void UpdateAI (const uint32 diff) + { + //Random movement + if (movement_timer < diff) + { + uint32 rndpos = rand()%8; + m_creature->GetMotionMaster()->MovePoint(1,SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]); + movement_timer = 6000; + }else movement_timer -= diff; + + //toxic spores + if (bolt_timer < diff) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + { + Creature* trig = m_creature->SummonCreature(TOXIC_SPORES_TRIGGER,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); + if (trig) + { + trig->setFaction(14); + trig->CastSpell(trig, SPELL_TOXIC_SPORES,true); + } + } + bolt_timer = 10000+rand()%5000; + } + else bolt_timer -= diff; + + //Check_Timer + if (Check_Timer < diff) + { + if (pInstance) + { + //check if vashj is death + Unit *Vashj = NULL; + Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); + if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3)) + { + //remove + m_creature->setDeathState(DEAD); + m_creature->RemoveCorpse(); + m_creature->setFaction(35); + } + } + + Check_Timer = 1000; + }else Check_Timer -= diff; + } +}; + +//Coilfang Elite +//It's an elite Naga mob with 170,000 HP. It does about 5000 damage on plate, and has a nasty cleave hitting for about 7500 damage +CreatureAI* GetAI_mob_coilfang_elite(Creature* pCreature) +{ + SimpleAI* ai = new SimpleAI (pCreature); + + ai->Spell[0].Enabled = true; + ai->Spell[0].Spell_Id = 31345; //Cleave + ai->Spell[0].Cooldown = 15000; + ai->Spell[0].CooldownRandomAddition = 5000; + ai->Spell[0].First_Cast = 5000; + ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_RANDOM; + + ai->EnterEvadeMode(); + + return ai; +} + +//Coilfang Strider +//It hits plate for about 8000 damage, has a Mind Blast spell doing about 3000 shadow damage, and a Psychic Scream Aura, which fears everybody in a 8 yard range of it every 2-3 seconds , for 5 seconds and increasing their movement speed by 150% during the fear. +CreatureAI* GetAI_mob_coilfang_strider(Creature* pCreature) +{ + SimpleAI* ai = new SimpleAI (pCreature); + + ai->Spell[0].Enabled = true; + ai->Spell[0].Spell_Id = 41374; //Mind Blast + ai->Spell[0].Cooldown = 30000; + ai->Spell[0].CooldownRandomAddition = 10000; + ai->Spell[0].First_Cast = 8000; + ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; + + //Scream aura not implemented + + ai->EnterEvadeMode(); + + return ai; +} + +struct TRINITY_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI +{ + mob_shield_generator_channelAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + uint32 Check_Timer; + bool Casted; + void Reset() + { + Check_Timer = 0; + Casted = false; + m_creature->SetDisplayId(11686); //invisible + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + + void EnterCombat(Unit *who) { return; } + + void MoveInLineOfSight(Unit *who) { return; } + + void UpdateAI (const uint32 diff) + { + if (!pInstance) + return; + + if (Check_Timer < diff) + { + Unit *Vashj = NULL; + Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); + + if (Vashj && Vashj->isAlive()) + { + //start visual channel + if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER)) + { + m_creature->CastSpell(Vashj,SPELL_MAGIC_BARRIER,true); + Casted = true; + } + } + Check_Timer = 1000; + }else Check_Timer -= diff; + } +}; + +bool ItemUse_item_tainted_core(Player* pPlayer, Item* _Item, SpellCastTargets const& targets) +{ + ScriptedInstance *pInstance = (pPlayer->GetInstanceData()) ? (pPlayer->GetInstanceData()) : NULL; + + if (!pInstance) + { + pPlayer->GetSession()->SendNotification("Instance script not initialized"); + return true; + } + + Creature *Vashj = NULL; + Vashj = (Unit::GetCreature((*pPlayer), pInstance->GetData64(DATA_LADYVASHJ))); + if (Vashj && CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase == 2) + { + if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId()==TYPEID_GAMEOBJECT) + { + uint32 identifier; + uint8 channel_identifier; + switch(targets.getGOTarget()->GetEntry()) + { + case 185052: + identifier = DATA_SHIELDGENERATOR1; + channel_identifier = 0; + break; + case 185053: + identifier = DATA_SHIELDGENERATOR2; + channel_identifier = 1; + break; + case 185051: + identifier = DATA_SHIELDGENERATOR3; + channel_identifier = 2; + break; + case 185054: + identifier = DATA_SHIELDGENERATOR4; + channel_identifier = 3; + break; + default: + return true; + } + + if (pInstance->GetData(identifier)) + { + pPlayer->GetSession()->SendNotification("Already deactivated"); + return true; + } + + //get and remove channel + Unit *Channel = NULL; + Channel = Unit::GetCreature(*Vashj, CAST_AI(boss_lady_vashjAI, Vashj->AI())->ShieldGeneratorChannel[channel_identifier]); + if (Channel) + { + //call Unsummon() + Channel->setDeathState(JUST_DIED); + } + + pInstance->SetData(identifier, 1); + + //remove this item + pPlayer->DestroyItemCount(31088, 1, true); + return true; + } + else if (targets.getUnitTarget()->GetTypeId() == TYPEID_UNIT) + return false; + else if (targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER) + { + pPlayer->DestroyItemCount(31088, 1, true); + pPlayer->CastSpell(targets.getUnitTarget(), 38134, true); + return true; + } + } + return true; +} + +CreatureAI* GetAI_boss_lady_vashj(Creature* pCreature) +{ + return new boss_lady_vashjAI (pCreature); +} + +CreatureAI* GetAI_mob_enchanted_elemental(Creature* pCreature) +{ + return new mob_enchanted_elementalAI (pCreature); +} + +CreatureAI* GetAI_mob_tainted_elemental(Creature* pCreature) +{ + return new mob_tainted_elementalAI (pCreature); +} + +CreatureAI* GetAI_mob_toxic_sporebat(Creature* pCreature) +{ + return new mob_toxic_sporebatAI (pCreature); +} + +CreatureAI* GetAI_mob_shield_generator_channel(Creature* pCreature) +{ + return new mob_shield_generator_channelAI (pCreature); +} + +void AddSC_boss_lady_vashj() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_lady_vashj"; + newscript->GetAI = &GetAI_boss_lady_vashj; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_enchanted_elemental"; + newscript->GetAI = &GetAI_mob_enchanted_elemental; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_tainted_elemental"; + newscript->GetAI = &GetAI_mob_tainted_elemental; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_toxic_sporebat"; + newscript->GetAI = &GetAI_mob_toxic_sporebat; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_coilfang_elite"; + newscript->GetAI = &GetAI_mob_coilfang_elite; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_coilfang_strider"; + newscript->GetAI = &GetAI_mob_coilfang_strider; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_shield_generator_channel"; + newscript->GetAI = &GetAI_mob_shield_generator_channel; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="item_tainted_core"; + newscript->pItemUse = &ItemUse_item_tainted_core; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp new file mode 100644 index 00000000000..e43afc2926f --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp @@ -0,0 +1,808 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Leotheras_The_Blind +SD%Complete: 80 +SDComment: Possesion Support +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" + +// --- Spells used by Leotheras The Blind +#define SPELL_WHIRLWIND 37640 +#define SPELL_CHAOS_BLAST 37674 +#define SPELL_BERSERK 26662 +#define SPELL_INSIDIOUS_WHISPER 37676 +#define SPELL_DUAL_WIELD 42459 + +// --- Spells used in banish phase --- +#define BANISH_BEAM 38909 +#define AURA_BANISH 37833 + +// --- Spells used by Greyheart Spellbinders +#define SPELL_EARTHSHOCK 39076 +#define SPELL_MINDBLAST 37531 + +// --- Spells used by Inner Demons and Creature ID +#define INNER_DEMON_ID 21857 +#define AURA_DEMONIC_ALIGNMENT 37713 +#define SPELL_SHADOWBOLT 39309 +#define SPELL_SOUL_LINK 38007 +#define SPELL_CONSUMING_MADNESS 37749 //not supported by core yet + +//Misc. +#define MODEL_DEMON 20125 +#define MODEL_NIGHTELF 20514 +#define DEMON_FORM 21875 +#define MOB_SPELLBINDER 21806 + +#define SAY_AGGRO -1548009 +#define SAY_SWITCH_TO_DEMON -1548010 +#define SAY_INNER_DEMONS -1548011 +#define SAY_DEMON_SLAY1 -1548012 +#define SAY_DEMON_SLAY2 -1548013 +#define SAY_DEMON_SLAY3 -1548014 +#define SAY_NIGHTELF_SLAY1 -1548015 +#define SAY_NIGHTELF_SLAY2 -1548016 +#define SAY_NIGHTELF_SLAY3 -1548017 +#define SAY_FINAL_FORM -1548018 +#define SAY_FREE -1548019 +#define SAY_DEATH -1548020 + +struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI +{ + mob_inner_demonAI(Creature *c) : ScriptedAI(c) + { + victimGUID = 0; + } + + uint32 ShadowBolt_Timer; + + uint32 Link_Timer; + uint64 victimGUID; + + void Reset() + { + ShadowBolt_Timer = 10000; + Link_Timer = 1000; + } + void JustDied(Unit *victim) + { + Unit* pUnit = Unit::GetUnit((*m_creature),victimGUID); + if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER)) + pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (done_by->GetGUID() != victimGUID && done_by->GetGUID() != m_creature->GetGUID()) + { + damage = 0; + DoModifyThreatPercent(done_by, -100); + } + } + + void EnterCombat(Unit *who) + { + if (!victimGUID) return; + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (m_creature->getVictim()->GetGUID() != victimGUID) + { + DoModifyThreatPercent(m_creature->getVictim(), -100); + Unit* owner = Unit::GetUnit((*m_creature),victimGUID); + if (owner && owner->isAlive()) + { + m_creature->AddThreat(owner,999999); + AttackStart(owner); + }else if (owner && owner->isDead()) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + } + + if (Link_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SOUL_LINK, true); + Link_Timer = 1000; + }else Link_Timer -= diff; + + + if (!m_creature->HasAura(AURA_DEMONIC_ALIGNMENT)) + DoCast(m_creature, AURA_DEMONIC_ALIGNMENT,true); + + if (ShadowBolt_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT, false); + ShadowBolt_Timer = 10000; + }else ShadowBolt_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +//Original Leotheras the Blind AI +struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI +{ + boss_leotheras_the_blindAI(Creature *c) : ScriptedAI(c) + { + m_creature->GetPosition(x,y,z); + pInstance = c->GetInstanceData(); + Demon = 0; + + for(uint8 i = 0; i < 3; ++i)//clear guids + SpellBinderGUID[i] = 0; + } + + ScriptedInstance *pInstance; + + uint32 Whirlwind_Timer; + uint32 ChaosBlast_Timer; + uint32 SwitchToDemon_Timer; + uint32 SwitchToHuman_Timer; + uint32 Berserk_Timer; + uint32 InnerDemons_Timer; + uint32 BanishTimer; + + bool DealDamage; + bool NeedThreatReset; + bool DemonForm; + bool IsFinalForm; + bool EnrageUsed; + float x,y,z; + + uint64 InnderDemon[5]; + uint32 InnderDemon_Count; + uint64 Demon; + uint64 SpellBinderGUID[3]; + + void Reset() + { + CheckChannelers(); + BanishTimer = 1000; + Whirlwind_Timer = 15000; + ChaosBlast_Timer = 1000; + SwitchToDemon_Timer = 45000; + SwitchToHuman_Timer = 60000; + Berserk_Timer = 600000; + InnerDemons_Timer = 30000; + m_creature->SetCanDualWield(true); + DealDamage = true; + DemonForm = false; + IsFinalForm = false; + NeedThreatReset = false; + EnrageUsed = false; + InnderDemon_Count = 0; + m_creature->SetSpeed(MOVE_RUN, 2.0f, true); + m_creature->SetDisplayId(MODEL_NIGHTELF); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); + m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); + m_creature->SetCorpseDelay(1000*60*60); + if (pInstance) + pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED); + } + + void CheckChannelers(bool DoEvade = true) + { + for(uint8 i = 0; i < 3; ++i) + { + if (Creature *add = Unit::GetCreature(*m_creature,SpellBinderGUID[i])) + add->DisappearAndDie(); + + float nx = x; + float ny = y; + float o = 2.4f; + if (i == 0) {nx += 10; ny -= 5; o=2.5f;} + if (i == 1) {nx -= 8; ny -= 7; o=0.9f;} + if (i == 2) {nx -= 3; ny += 9; o=5.0f;} + Creature* binder = m_creature->SummonCreature(MOB_SPELLBINDER,nx,ny,z,o,TEMPSUMMON_DEAD_DESPAWN,0); + if (binder) + SpellBinderGUID[i] = binder->GetGUID(); + + } + } + void MoveInLineOfSight(Unit *who) + { + if (m_creature->HasAura(AURA_BANISH)) + return; + + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) + { + if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius)) + { + // Check first that object is in an angle in front of this one before LoS check + if (m_creature->HasInArc(M_PI/2.0f, who) && m_creature->IsWithinLOSInMap(who)) + { + AttackStart(who); + } + } + } + } + + void StartEvent() + { + DoScriptText(SAY_AGGRO, m_creature); + if (pInstance) + pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, IN_PROGRESS); + } + + void CheckBanish() + { + uint8 AliveChannelers = 0; + for(uint8 i = 0; i < 3; ++i) + { + Unit *add = Unit::GetUnit(*m_creature,SpellBinderGUID[i]); + if (add && add->isAlive()) + AliveChannelers++; + } + + // channelers == 0 remove banish aura + if (AliveChannelers == 0 && m_creature->HasAura(AURA_BANISH)) + { + // removing banish aura + m_creature->RemoveAurasDueToSpell(AURA_BANISH); + + // Leotheras is getting immune again + m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, true); + + // changing model to bloodelf + m_creature->SetDisplayId(MODEL_NIGHTELF); + + // and reseting equipment + m_creature->LoadEquipment(m_creature->GetEquipmentId()); + + if (pInstance && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + { + Unit *victim = NULL; + victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); + if (victim) + m_creature->getThreatManager().addThreat(victim, 1); + StartEvent(); + } + } + else if (AliveChannelers != 0 && !m_creature->HasAura(AURA_BANISH)) + { + // channelers != 0 apply banish aura + // removing Leotheras banish immune to apply AURA_BANISH + m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, false); + DoCast(m_creature, AURA_BANISH); + + // changing model + m_creature->SetDisplayId(MODEL_DEMON); + + // and removing weapons + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); + } + } + + //Despawn all Inner Demon summoned + void DespawnDemon() + { + for(uint8 i=0; i<5; ++i) + { + if (InnderDemon[i]) + { + //delete creature + Creature* pCreature = Unit::GetCreature((*m_creature), InnderDemon[i]); + if (pCreature && pCreature->isAlive()) + { + pCreature->ForcedDespawn(); + } + InnderDemon[i] = 0; + } + } + + InnderDemon_Count = 0; + } + + void CastConsumingMadness() //remove this once SPELL_INSIDIOUS_WHISPER is supported by core + { + for(uint8 i=0; i<5; ++i) + { + if (InnderDemon[i] > 0) + { + Creature* pUnit = Unit::GetCreature((*m_creature), InnderDemon[i]); + if (pUnit && pUnit->isAlive()) + { + Unit* pUnit_target = Unit::GetUnit(*pUnit, CAST_AI(mob_inner_demonAI, pUnit->AI())->victimGUID); + if (pUnit_target && pUnit_target->isAlive()) + { + pUnit->CastSpell(pUnit_target, SPELL_CONSUMING_MADNESS, true); + DoModifyThreatPercent(pUnit_target, -100); + } + } + } + } + } + + void KilledUnit(Unit *victim) + { + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + + if (DemonForm) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_DEMON_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_DEMON_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_DEMON_SLAY3, m_creature); break; + } + } + else + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_NIGHTELF_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_NIGHTELF_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_NIGHTELF_SLAY3, m_creature); break; + } + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + //despawn copy + if (Demon) + { + if (Creature* pDemon = Unit::GetCreature(*m_creature, Demon)) + pDemon->ForcedDespawn(); + } + if (pInstance) + pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, DONE); + } + + void EnterCombat(Unit *who) + { + if (m_creature->HasAura(AURA_BANISH)) + return; + + m_creature->LoadEquipment(m_creature->GetEquipmentId()); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (m_creature->HasAura(AURA_BANISH) || !UpdateVictim()) + { + if (BanishTimerHasAura(SPELL_WHIRLWIND)) + if (Whirlwind_Timer < diff) + { + Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (newTarget) + { + DoResetThreat(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MovePoint(0,newTarget->GetPositionX(),newTarget->GetPositionY(),newTarget->GetPositionZ()); + } + Whirlwind_Timer = 2000; + }else Whirlwind_Timer -= diff; + + // reseting after changing forms and after ending whirlwind + if (NeedThreatReset && !m_creature->HasAura(SPELL_WHIRLWIND)) + { + // when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding) + if (DemonForm) + InnerDemons_Timer = 30000; + else + Whirlwind_Timer = 15000; + + NeedThreatReset = false; + DoResetThreat(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + + //Enrage_Timer (10 min) + if (Berserk_Timer < diff && !EnrageUsed) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, SPELL_BERSERK); + EnrageUsed = true; + }else Berserk_Timer -= diff; + + if (!DemonForm) + { + //Whirldind Timer + if (!m_creature->HasAura(SPELL_WHIRLWIND)) + { + if (Whirlwind_Timer < diff) + { + DoCast(m_creature, SPELL_WHIRLWIND); + // while whirlwinding this variable is used to countdown target's change + Whirlwind_Timer = 2000; + NeedThreatReset = true; + }else Whirlwind_Timer -= diff; + } + //Switch_Timer + + if (!IsFinalForm) + if (SwitchToDemon_Timer < diff) + { + //switch to demon form + m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0); + m_creature->SetDisplayId(MODEL_DEMON); + DoScriptText(SAY_SWITCH_TO_DEMON, m_creature); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); + DemonForm = true; + NeedThreatReset = true; + SwitchToDemon_Timer = 45000; + }else SwitchToDemon_Timer -= diff; + DoMeleeAttackIfReady(); + } + else + { + //ChaosBlast_Timer + if (!m_creature->getVictim()) + return; + if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) + m_creature->StopMoving(); + if (ChaosBlast_Timer < diff) + { + // will cast only when in range of spell + if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) + { + //m_creature->CastSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, true); + int damage = 100; + m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); + } + ChaosBlast_Timer = 3000; + }else ChaosBlast_Timer -= diff; + //Summon Inner Demon + if (InnerDemons_Timer < diff) + { + std::list& ThreatList = m_creature->getThreatManager().getThreatList(); + std::vector TargetList; + for(std::list::iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr) + { + Unit *tempTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != m_creature->getVictim()->GetGUID() && TargetList.size()<5) + TargetList.push_back(tempTarget); + } + SpellEntry *spell = GET_SPELL(SPELL_INSIDIOUS_WHISPER); + for(std::vector::iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr) + { + if ((*itr) && (*itr)->isAlive()) + { + Creature * demon = m_creature->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (demon) + { + demon->AI()->AttackStart((*itr)); + CAST_AI(mob_inner_demonAI, demon->AI())->victimGUID = (*itr)->GetGUID(); + + uint8 eff_mask=0; + for (int i=0; i<3; ++i) + { + if (!spell->Effect[i]) + continue; + eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, (*itr), (*itr))); + if (InnderDemon_Count > 4) InnderDemon_Count = 0; + + //Safe storing of creatures + InnderDemon[InnderDemon_Count] = demon->GetGUID(); + + //Update demon count + InnderDemon_Count++; + } + } + } + DoScriptText(SAY_INNER_DEMONS, m_creature); + + InnerDemons_Timer = 999999; + }else InnerDemons_Timer -= diff; + + //Switch_Timer + if (SwitchToHuman_Timer < diff) + { + //switch to nightelf form + m_creature->SetDisplayId(MODEL_NIGHTELF); + m_creature->LoadEquipment(m_creature->GetEquipmentId()); + + CastConsumingMadness(); + DespawnDemon(); + + DemonForm = false; + NeedThreatReset = true; + + SwitchToHuman_Timer = 60000; + }else SwitchToHuman_Timer -= diff; + } + + if (!IsFinalForm && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15) + { + //at this point he divides himself in two parts + CastConsumingMadness(); + DespawnDemon(); + Creature *Copy = NULL; + Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 6000); + if (Copy) + { + Demon = Copy->GetGUID(); + if (m_creature->getVictim()) + Copy->AI()->AttackStart(m_creature->getVictim()); + } + //set nightelf final form + IsFinalForm = true; + DemonForm = false; + + DoScriptText(SAY_FINAL_FORM, m_creature); + m_creature->SetDisplayId(MODEL_NIGHTELF); + m_creature->LoadEquipment(m_creature->GetEquipmentId()); + } + } +}; + +//Leotheras the Blind Demon Form AI +struct TRINITY_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI +{ + boss_leotheras_the_blind_demonformAI(Creature *c) : ScriptedAI(c) {} + + uint32 ChaosBlast_Timer; + bool DealDamage; + + void Reset() + { + ChaosBlast_Timer = 1000; + DealDamage = true; + } + + void StartEvent() + { + DoScriptText(SAY_FREE, m_creature); + } + + void KilledUnit(Unit *victim) + { + if (victim->GetTypeId() != TYPEID_PLAYER) + return; + + switch(rand()%3) + { + case 0: DoScriptText(SAY_DEMON_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_DEMON_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_DEMON_SLAY3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + //invisibility (blizzlike, at the end of the fight he doesn't die, he disappears) + m_creature->CastSpell(m_creature, 8149, true); + } + + void EnterCombat(Unit *who) + { + StartEvent(); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + //ChaosBlast_Timer + if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) + m_creature->StopMoving(); + + if (ChaosBlast_Timer < diff) + { + // will cast only when in range od spell + if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) + { + //m_creature->CastSpell(m_creature->getVictim(),SPELL_CHAOS_BLAST,true); + int damage = 100; + m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); + ChaosBlast_Timer = 3000; + } + }else ChaosBlast_Timer -= diff; + + //Do NOT deal any melee damage to the target. + } +}; +struct TRINITY_DLL_DECL mob_greyheart_spellbinderAI : public ScriptedAI +{ + mob_greyheart_spellbinderAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData();; + leotherasGUID = 0; + AddedBanish = false; + } + + ScriptedInstance *pInstance; + + uint64 leotherasGUID; + + uint32 Mindblast_Timer; + uint32 Earthshock_Timer; + + bool AddedBanish; + + void Reset() + { + Mindblast_Timer = 3000 + rand()%5000; + Earthshock_Timer = 5000 + rand()%5000; + + if (pInstance) + { + pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0); + Creature *leotheras = Unit::GetCreature(*m_creature, leotherasGUID); + if (leotheras && leotheras->isAlive()) + CAST_AI(boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(false); + } + } + + void EnterCombat(Unit *who) + { + m_creature->InterruptNonMeleeSpells(false); + if (pInstance) + pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, who->GetGUID()); + } + + void JustRespawned() + { + AddedBanish = false; + Reset(); + } + + void CastChanneling() + { + if (!m_creature->isInCombat() && !m_creature->m_currentSpells[CURRENT_CHANNELED_SPELL]) + { + if (leotherasGUID) + { + Creature *leotheras = Unit::GetCreature(*m_creature, leotherasGUID); + if (leotheras && leotheras->isAlive()) + DoCast(leotheras, BANISH_BEAM); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (pInstance) + { + if (!leotherasGUID) + leotherasGUID = pInstance->GetData64(DATA_LEOTHERAS); + + if (!m_creature->isInCombat() && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + { + Unit *victim = NULL; + victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); + if (victim) + AttackStart(victim); + } + } + + if (!UpdateVictim()) + { + CastChanneling(); + return; + } + + if (pInstance && !pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) + { + EnterEvadeMode(); + return; + } + + if (Mindblast_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (target)DoCast(target, SPELL_MINDBLAST); + + Mindblast_Timer = 10000 + rand()%5000; + }else Mindblast_Timer -= diff; + + if (Earthshock_Timer < diff) + { + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator itr = PlayerList.begin();itr != PlayerList.end(); ++itr) + { + if (Player* i_pl = itr->getSource()) + { + bool isCasting = false; + for(uint8 i = 0; i < CURRENT_MAX_SPELL; ++i) + if (i_pl->m_currentSpells[i]) + isCasting = true; + + if (isCasting) + { + DoCast(i_pl, SPELL_EARTHSHOCK); + break; + } + } + } + Earthshock_Timer = 8000 + rand()%7000; + }else Earthshock_Timer -= diff; + DoMeleeAttackIfReady(); + } + + void JustDied(Unit *killer) {} +}; +CreatureAI* GetAI_boss_leotheras_the_blind(Creature* pCreature) +{ + return new boss_leotheras_the_blindAI (pCreature); +} + +CreatureAI* GetAI_boss_leotheras_the_blind_demonform(Creature* pCreature) +{ + return new boss_leotheras_the_blind_demonformAI (pCreature); +} + +CreatureAI* GetAI_mob_greyheart_spellbinder(Creature* pCreature) +{ + return new mob_greyheart_spellbinderAI (pCreature); +} + +CreatureAI* GetAI_mob_inner_demon(Creature* pCreature) +{ + return new mob_inner_demonAI (pCreature); +} +void AddSC_boss_leotheras_the_blind() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_leotheras_the_blind"; + newscript->GetAI = &GetAI_boss_leotheras_the_blind; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_leotheras_the_blind_demonform"; + newscript->GetAI = &GetAI_boss_leotheras_the_blind_demonform; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_greyheart_spellbinder"; + newscript->GetAI = &GetAI_mob_greyheart_spellbinder; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_inner_demon"; + newscript->GetAI = &GetAI_mob_inner_demon; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp new file mode 100644 index 00000000000..38abc8f1507 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp @@ -0,0 +1,489 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: boss_the_lurker_below +SD%Complete: 80 +SDComment: Coilfang Frenzy, find out how could we fishing in the strangepool +SDCategory: The Lurker Below +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" +#include "simple_ai.h" +#include "Spell.h" + +#define SPELL_SPOUT 37433 +#define SPELL_SPOUT_ANIM 42835 +#define SPELL_SPOUT_BREATH 37431 +#define SPELL_KNOCKBACK 19813 +#define SPELL_GEYSER 37478 +#define SPELL_WHIRL 37660 +#define SPELL_WATERBOLT 37138 +#define SPELL_SUBMERGE 37550 +#define SPELL_EMERGE 20568 +#define SPELL_SCALDINGWATER 37284 + +#define EMOTE_SPOUT "takes a deep breath." + +#define SPOUT_DIST 100 + +#define MOB_COILFANG_GUARDIAN 21873 +#define MOB_COILFANG_AMBUSHER 21865 + +//Ambusher spells +#define SPELL_SPREAD_SHOT 37790 +#define SPELL_SHOOT 37770 + +//Guardian spells +#define SPELL_ARCINGSMASH 38761 // Wrong SpellId. Can't find the right one. +#define SPELL_HAMSTRING 26211 + +float AddPos[9][3] = +{ + {2.8553810, -459.823914, -19.182686}, //MOVE_AMBUSHER_1 X, Y, Z + {12.400000, -466.042267, -19.182686}, //MOVE_AMBUSHER_2 X, Y, Z + {51.366653, -460.836060, -19.182686}, //MOVE_AMBUSHER_3 X, Y, Z + {62.597980, -457.433044, -19.182686}, //MOVE_AMBUSHER_4 X, Y, Z + {77.607452, -384.302765, -19.182686}, //MOVE_AMBUSHER_5 X, Y, Z + {63.897900, -378.984924, -19.182686}, //MOVE_AMBUSHER_6 X, Y, Z + {34.447250, -387.333618, -19.182686}, //MOVE_GUARDIAN_1 X, Y, Z + {14.388216, -423.468018, -19.625271}, //MOVE_GUARDIAN_2 X, Y, Z + {42.471519, -445.115295, -19.769423} //MOVE_GUARDIAN_3 X, Y, Z +}; + +enum RotationType +{ + NOROTATE = 0, + CLOCKWISE = 1, + COUNTERCLOCKWISE = 2, +}; + +struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI +{ + boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature) + { + pInstance = c->GetInstanceData(); + SpellEntry *TempSpell = GET_SPELL(SPELL_SPOUT_ANIM); + if (TempSpell) + { + TempSpell->Effect[0] = 0;//remove all spell effect, only anim is needed + TempSpell->Effect[1] = 0; + TempSpell->Effect[2] = 0; + } + } + + ScriptedInstance* pInstance; + SummonList Summons; + + bool Spawned; + bool Submerged; + + double SpoutAngle; + + uint8 RotType; + + uint32 RotTimer; + uint32 SpoutAnimTimer; + uint32 WaterboltTimer; + uint32 SpoutTimer; + uint32 WhirlTimer;//after avery spout + uint32 PhaseTimer; + uint32 GeyserTimer; + + void Reset() + { + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING + MOVEMENTFLAG_LEVITATING); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetCorpseDelay(1000*60*60); + + RotType = NOROTATE; + + SpoutAngle = 0; + SpoutAnimTimer = 1000; + RotTimer = 20000; + WaterboltTimer = 3000; + SpoutTimer = 15000; + WhirlTimer = 18000;//after avery spout + PhaseTimer = 120000; + GeyserTimer = rand()%5000 + 15000; + + Submerged = false; + Spawned = false; + + Summons.DespawnAll(); + + if (pInstance) + pInstance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED); + + /*if (pInstance->GetData(DATA_STRANGE_POOL) != DONE) + { + m_creature->SetReactState(REACT_PASSIVE); + m_creature->SetVisibility(VISIBILITY_OFF); + }else { + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->SetReactState(REACT_AGGRESSIVE); + }*/ + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + AttackStart(who); + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS); + + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + AttackStart(who); + } + } + + void JustDied(Unit* Killer) + { + if (pInstance) + pInstance->SetData(DATA_THELURKERBELOWEVENT, DONE); + + Summons.DespawnAll(); + } + + void Rotate(const uint32 diff) + { + bool Spout = false; + switch (RotType) + { + case NOROTATE: + return; + case CLOCKWISE://20secs for 360turn + //no target if rotating! + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + SpoutAngle += (double)diff/20000*(double)M_PI*2; + if (SpoutAngle >= M_PI*2)SpoutAngle = 0; + m_creature->SetOrientation(SpoutAngle); + m_creature->StopMoving(); + Spout = true; + break; + case COUNTERCLOCKWISE://20secs for 360turn + //no target if rotating! + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + SpoutAngle -= (double)diff/20000*(double)M_PI*2; + if (SpoutAngle <= 0)SpoutAngle = M_PI*2; + m_creature->SetOrientation(SpoutAngle); + m_creature->StopMoving(); + Spout = true; + break; + } + + if (!Spout) + return; + + if (RotTimerInterruptNonMeleeSpells(false); + WhirlTimer = 4000; //whirl directly after spout ends + return; + }else RotTimer-=diff; + + if (SpoutAnimTimerGetMap(); + if (pMap->IsDungeon() && pInstance->GetData(DATA_THELURKERBELOWEVENT) == IN_PROGRESS) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + Player *target = i->getSource(); + if (target && target->isAlive() && m_creature->HasInArc((double)diff/20000*(double)M_PI*2,target) && m_creature->IsWithinDist(target, SPOUT_DIST) && !target->IsInWater()) + DoCast(target,SPELL_SPOUT,true);//only knock back palyers in arc, in 100yards, not in water + } + } + } + + void StartRotate(Unit* victim) + { + switch (rand()%2) + { + case 0: RotType = CLOCKWISE; break; + case 1: RotType = COUNTERCLOCKWISE; break; + } + RotTimer=20000; + + if (victim) + SpoutAngle = m_creature->GetAngle(victim); + + m_creature->MonsterTextEmote(EMOTE_SPOUT,0,true); + //DoCast(m_creature,SPELL_SPOUT_BREATH);//take breath anim + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim() /*|| !m_creature->getVictim()*/)//rotate resets target + return; + + //Check if players in water and if in water cast spell + Map* pMap = m_creature->GetMap(); + if (pMap->IsDungeon() && pInstance->GetData(DATA_THELURKERBELOWEVENT) == IN_PROGRESS) + { + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + + if (PlayerList.isEmpty()) + return; + + for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + { + if (i->getSource()->isAlive() && i->getSource()->IsInWater() && !i->getSource()->HasAura(SPELL_SCALDINGWATER)) + i->getSource()->CastSpell(i->getSource(), SPELL_SCALDINGWATER, true); + else if (!i->getSource()->IsInWater()) + i->getSource()->RemoveAurasDueToSpell(SPELL_SCALDINGWATER); + } + } + + Rotate(diff);//always check rotate things + if (!Submerged) + { + if (PhaseTimer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_SUBMERGE); + PhaseTimer = 60000;//60secs submerged + Submerged = true; + }else PhaseTimer-=diff; + } + + if (!Submerged && RotType == NOROTATE)//is not spouting and not submerged + { + if (SpoutTimer < diff) + { + if (m_creature->getVictim() && RotType == NOROTATE) + StartRotate(m_creature->getVictim());//start spout and random rotate + + SpoutTimer= 35000; + return; + }else SpoutTimer -= diff; + + //Whirl directly after a Spout and at random times + if (WhirlTimer < diff) + { + WhirlTimer = rand()%5000 + 15000; + DoCast(m_creature,SPELL_WHIRL); + WaterboltTimer += 5000;//add 5secs to waterbolt timer, to add some time to run back to boss + }else WhirlTimer -= diff; + + if (GeyserTimer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM,1); + + if (target) + DoCast(target,SPELL_GEYSER,true); + else + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + DoCast(target,SPELL_GEYSER,true); + + GeyserTimer = rand()%5000 + 15000; + }else GeyserTimer -= diff; + + if (WaterboltTimer < diff) + { + Unit* target = SelectTarget(SELECT_TARGET_NEAREST,0,14,true); + if (!target) + { + target = SelectUnit(SELECT_TARGET_RANDOM,0); + if (target) + DoCast(target,SPELL_WATERBOLT); + } + WaterboltTimer = 3000; + }else WaterboltTimer -= diff; + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + + }else if (!Submerged) + return; + else if (Submerged)//phase 2, submerged + { + if (PhaseTimer < diff) + { + Submerged = false; + m_creature->InterruptNonMeleeSpells(false);//shouldn't be any + m_creature->RemoveAllAuras(); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED); + m_creature->RemoveFlag(UNIT_FIELD_BYTES_1,9); + DoCast(m_creature,SPELL_EMERGE); + Spawned = false; + SpoutTimer = 4000; // directly cast Spout after emerging! + WhirlTimer = 26000; + PhaseTimer = 120000; + return; + }else PhaseTimer-=diff; + + if (!m_creature->isInCombat()) + DoZoneInCombat(); + + if (!Spawned) + { + m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + //spawn adds + for (uint8 i = 0; i < 9; ++i) + { + Creature* Summoned; + if (i < 7) + Summoned = m_creature->SummonCreature(MOB_COILFANG_AMBUSHER,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + else Summoned = m_creature->SummonCreature(MOB_COILFANG_GUARDIAN,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + + if (Summoned) + Summons.Summon(Summoned); + Spawned = true; + } + } + } + } + }; + +CreatureAI* GetAI_mob_coilfang_guardian(Creature* pCreature) +{ + SimpleAI* ai = new SimpleAI (pCreature); + + ai->Spell[0].Enabled = true; + ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH; + ai->Spell[0].Cooldown = 15000; + ai->Spell[0].First_Cast = 5000; + ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; + + ai->Spell[1].Enabled = true; + ai->Spell[1].Spell_Id = SPELL_HAMSTRING; + ai->Spell[1].Cooldown = 10000; + ai->Spell[1].First_Cast = 2000; + ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; + + return ai; +} + +struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI +{ + mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c) + { + SpellEntry *TempSpell = GET_SPELL(SPELL_SHOOT); + if (TempSpell) + TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg + } + + uint32 MultiShotTimer; + uint32 ShootBowTimer; + + void Reset() + { + MultiShotTimer = 10000; + ShootBowTimer = 4000; + + } + + void EnterCombat(Unit *who) + { + + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + AttackStart(who); + } + } + + void UpdateAI(const uint32 diff) + { + if (MultiShotTimer < diff) + { + if (m_creature->getVictim()) + DoCast(m_creature->getVictim(), SPELL_SPREAD_SHOT, true); + + MultiShotTimer = 10000; + ShootBowTimer += 1500;//add global cooldown + }else MultiShotTimer -= diff; + + if (ShootBowTimer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + int bp0 = 1100; + if (target) + m_creature->CastCustomSpell(target,SPELL_SHOOT,&bp0,NULL,NULL,true); + ShootBowTimer = 4000; + MultiShotTimer += 1500;//add global cooldown + }else ShootBowTimer -= diff; + } +}; + +CreatureAI* GetAI_mob_coilfang_ambusher(Creature* pCreature) +{ + return new mob_coilfang_ambusherAI (pCreature); +} + +CreatureAI* GetAI_boss_the_lurker_below(Creature* pCreature) +{ + return new boss_the_lurker_belowAI (pCreature); +} + +void AddSC_boss_the_lurker_below() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_the_lurker_below"; + newscript->GetAI = &GetAI_boss_the_lurker_below; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_coilfang_guardian"; + newscript->GetAI = &GetAI_mob_coilfang_guardian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_coilfang_ambusher"; + newscript->GetAI = &GetAI_mob_coilfang_ambusher; + newscript->RegisterSelf(); +} + + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp new file mode 100644 index 00000000000..80e05cc494b --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp @@ -0,0 +1,372 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Morogrim_Tidewalker +SD%Complete: 90 +SDComment: Water globules don't explode properly, remove hacks +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" + +#define SAY_AGGRO -1548030 +#define SAY_SUMMON1 -1548031 +#define SAY_SUMMON2 -1548032 +#define SAY_SUMMON_BUBL1 -1548033 +#define SAY_SUMMON_BUBL2 -1548034 +#define SAY_SLAY1 -1548035 +#define SAY_SLAY2 -1548036 +#define SAY_SLAY3 -1548037 +#define SAY_DEATH -1548038 +#define EMOTE_WATERY_GRAVE -1548039 +#define EMOTE_EARTHQUAKE -1548040 +#define EMOTE_WATERY_GLOBULES -1548041 + +#define SPELL_TIDAL_WAVE 37730 +#define SPELL_WATERY_GRAVE 38049 +#define SPELL_EARTHQUAKE 37764 +#define SPELL_WATERY_GRAVE_EXPLOSION 37852 + +#define WATERY_GRAVE_X1 334.64 +#define WATERY_GRAVE_Y1 -728.89 +#define WATERY_GRAVE_Z1 -14.42 +#define WATERY_GRAVE_X2 365.51 +#define WATERY_GRAVE_Y2 -737.14 +#define WATERY_GRAVE_Z2 -14.44 +#define WATERY_GRAVE_X3 366.19 +#define WATERY_GRAVE_Y3 -709.59 +#define WATERY_GRAVE_Z3 -14.36 +#define WATERY_GRAVE_X4 372.93 +#define WATERY_GRAVE_Y4 -690.96 +#define WATERY_GRAVE_Z4 -14.44 + +#define SPELL_WATERY_GRAVE_1 38023 +#define SPELL_WATERY_GRAVE_2 38024 +#define SPELL_WATERY_GRAVE_3 38025 +#define SPELL_WATERY_GRAVE_4 37850 + +#define SPELL_SUMMON_WATER_GLOBULE_1 37854 +#define SPELL_SUMMON_WATER_GLOBULE_2 37858 +#define SPELL_SUMMON_WATER_GLOBULE_3 37860 +#define SPELL_SUMMON_WATER_GLOBULE_4 37861 + +/*#define SPELL_SUMMON_MURLOC_A6 39813 +#define SPELL_SUMMON_MURLOC_A7 39814 +#define SPELL_SUMMON_MURLOC_A8 39815 +#define SPELL_SUMMON_MURLOC_A9 39816 +#define SPELL_SUMMON_MURLOC_A10 39817 + +#define SPELL_SUMMON_MURLOC_B6 39818 +#define SPELL_SUMMON_MURLOC_B7 39819 +#define SPELL_SUMMON_MURLOC_B8 39820 +#define SPELL_SUMMON_MURLOC_B9 39821 +#define SPELL_SUMMON_MURLOC_B10 39822*/ + +float MurlocCords[10][5] = +{ + {21920, 424.36, -715.4, -7.14, 0.124}, + {21920, 425.13, -719.3, -7.14, 0.124}, + {21920, 425.05, -724.23, -7.14, 0.124}, + {21920, 424.91, -728.68, -7.14, 0.124}, + {21920, 424.84, -732.18, -7.14, 0.124}, + {21920, 321.05, -734.2, -13.15, 0.124}, + {21920, 321.05, -729.4, -13.15, 0.124}, + {21920, 321.05, -724.03, -13.15, 0.124}, + {21920, 321.05, -718.73, -13.15, 0.124}, + {21920, 321.05, -714.24, -13.15, 0.124} +}; + +//Creatures +#define WATER_GLOBULE 21913 +#define TIDEWALKER_LURKER 21920 + +//Morogrim Tidewalker AI +struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI +{ + boss_morogrim_tidewalkerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + Map::PlayerList const *PlayerList; + + uint32 TidalWave_Timer; + uint32 WateryGrave_Timer; + uint32 Earthquake_Timer; + uint32 WateryGlobules_Timer; + uint32 globulespell[4]; + int8 Playercount; + int8 counter; + + bool Earthquake; + bool Phase2; + + void Reset() + { + TidalWave_Timer = 10000; + WateryGrave_Timer = 30000; + Earthquake_Timer = 40000; + WateryGlobules_Timer = 0; + globulespell[0] = SPELL_SUMMON_WATER_GLOBULE_1; + globulespell[1] = SPELL_SUMMON_WATER_GLOBULE_2; + globulespell[2] = SPELL_SUMMON_WATER_GLOBULE_3; + globulespell[3] = SPELL_SUMMON_WATER_GLOBULE_4; + + Earthquake = false; + Phase2 = false; + + if (pInstance) + pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED); + } + + void StartEvent() + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, DONE); + } + + void EnterCombat(Unit *who) + { + PlayerList = &m_creature->GetMap()->GetPlayers(); + Playercount = PlayerList->getSize(); + StartEvent(); + } + + void ApplyWateryGrave(Unit* pPlayer, uint8 i) + { + switch(i) + { + case 0: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_1, true); break; + case 1: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_2, true); break; + case 2: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_3, true); break; + case 3: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_4, true); break; + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Earthquake_Timer + if (Earthquake_Timer < diff) + { + if (!Earthquake) + { + DoCast(m_creature->getVictim(), SPELL_EARTHQUAKE); + Earthquake = true; + Earthquake_Timer = 10000; + } + else + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SUMMON1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON2, m_creature); break; + } + + for(uint8 i = 0; i < 10; ++i) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + Creature* Murloc = m_creature->SummonCreature(MurlocCords[i][0],MurlocCords[i][1],MurlocCords[i][2],MurlocCords[i][3],MurlocCords[i][4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + if (target && Murloc) + Murloc->AI()->AttackStart(target); + } + DoScriptText(EMOTE_EARTHQUAKE, m_creature); + Earthquake = false; + Earthquake_Timer = 40000+rand()%5000; + } + }else Earthquake_Timer -= diff; + + //TidalWave_Timer + if (TidalWave_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_TIDAL_WAVE); + TidalWave_Timer = 20000; + }else TidalWave_Timer -= diff; + + if (!Phase2) + { + //WateryGrave_Timer + if (WateryGrave_Timer < diff) + { + //Teleport 4 players under the waterfalls + Unit *target; + using std::set; + setlist; + set::iterator itr; + for(uint8 i = 0; i < 4; ++i) + { + counter = 0; + do{target = SelectTarget(SELECT_TARGET_RANDOM, 1, 50, true); //target players only + if (counter < Playercount) + break; + if (target) itr = list.find(target->GetGUID()); + counter++; + }while(itr != list.end()); + if (target){list.insert(target->GetGUID()); + ApplyWateryGrave(target, i); + } + } + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SUMMON_BUBL1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON_BUBL2, m_creature); break; + } + + DoScriptText(EMOTE_WATERY_GRAVE, m_creature); + WateryGrave_Timer = 30000; + }else WateryGrave_Timer -= diff; + + //Start Phase2 + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) + Phase2 = true; + } + else + { + //WateryGlobules_Timer + if (WateryGlobules_Timer < diff) + { + Unit* globuletarget; + using std::set; + setglobulelist; + set::iterator itr; + for (int8 g = 0; g < 4; g++) //one unit cant cast more than one spell per update, so some players have to cast for us XD + { + counter = 0; + do {globuletarget = SelectTarget(SELECT_TARGET_RANDOM, 0,50,true); + if (globuletarget) itr = globulelist.find(globuletarget->GetGUID()); + if (counter > Playercount) + break; + counter++; + } while (itr != globulelist.end()); + if (globuletarget)globulelist.insert(globuletarget->GetGUID()); + globuletarget->CastSpell(globuletarget, globulespell[g], true); + } + DoScriptText(EMOTE_WATERY_GLOBULES, m_creature); + WateryGlobules_Timer = 25000; + }else WateryGlobules_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +//Water Globule AI +#define SPELL_GLOBULE_EXPLOSION 37871 + +struct TRINITY_DLL_DECL mob_water_globuleAI : public ScriptedAI +{ + mob_water_globuleAI(Creature *c) : ScriptedAI(c) {} + + uint32 Check_Timer; + + void Reset() + { + Check_Timer = 1000; + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->setFaction(14); + } + + void EnterCombat(Unit *who) {} + + void MoveInLineOfSight(Unit *who) + { + if (!who || m_creature->getVictim()) + return; + + if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) + { + //no attack radius check - it attacks the first target that moves in his los + //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Check_Timer < diff) + { + if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 5)) + { + DoCast(m_creature->getVictim(), SPELL_GLOBULE_EXPLOSION); + + //despawn + m_creature->ForcedDespawn(); + return; + } + Check_Timer = 500; + }else Check_Timer -= diff; + + //do NOT deal any melee damage to the target. + } +}; + +CreatureAI* GetAI_boss_morogrim_tidewalker(Creature* pCreature) +{ + return new boss_morogrim_tidewalkerAI (pCreature); +} +CreatureAI* GetAI_mob_water_globule(Creature* pCreature) +{ + return new mob_water_globuleAI (pCreature); +} + +void AddSC_boss_morogrim_tidewalker() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_morogrim_tidewalker"; + newscript->GetAI = &GetAI_boss_morogrim_tidewalker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_water_globule"; + newscript->GetAI = &GetAI_mob_water_globule; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h new file mode 100644 index 00000000000..13144bc93c0 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h @@ -0,0 +1,32 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SERPENT_SHRINE_H +#define DEF_SERPENT_SHRINE_H + +#define DATA_CANSTARTPHASE3 1 +#define DATA_CARIBDIS 2 +#define DATA_HYDROSSTHEUNSTABLEEVENT 3 +#define DATA_KARATHRESS 4 +#define DATA_KARATHRESSEVENT 5 +#define DATA_KARATHRESSEVENT_STARTER 6 +#define DATA_LADYVASHJ 7 +#define DATA_LADYVASHJEVENT 8 +#define DATA_LEOTHERASTHEBLINDEVENT 9 +#define DATA_MOROGRIMTIDEWALKEREVENT 10 +#define DATA_SHARKKIS 11 +#define DATA_SHIELDGENERATOR1 12 +#define DATA_SHIELDGENERATOR2 13 +#define DATA_SHIELDGENERATOR3 14 +#define DATA_SHIELDGENERATOR4 15 +#define DATA_THELURKERBELOW 16 +#define DATA_THELURKERBELOWEVENT 17 +#define DATA_TIDALVESS 18 +#define DATA_FATHOMLORDKARATHRESSEVENT 19 +#define DATA_LEOTHERAS 20 +#define DATA_LEOTHERAS_EVENT_STARTER 21 +#define DATA_CONTROL_CONSOLE 22 +#define DATA_STRANGE_POOL 23 +#endif + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp new file mode 100644 index 00000000000..ebeda6aa565 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp @@ -0,0 +1,285 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Serpent_Shrine +SD%Complete: 100 +SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Serpent Shrine Scripts +SDCategory: Coilfang Resevoir, Serpent Shrine Cavern +EndScriptData */ + +#include "precompiled.h" +#include "def_serpent_shrine.h" + +#define MAX_ENCOUNTER 6 + +/* Serpentshrine cavern encounters: +0 - Hydross The Unstable event +1 - Leotheras The Blind Event +2 - The Lurker Below Event +3 - Fathom-Lord Karathress Event +4 - Morogrim Tidewalker Event +5 - Lady Vashj Event +*/ + +bool GOHello_go_bridge_console(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = pGo->GetInstanceData(); + + if (!pInstance) + return false; + + if (pInstance) + pInstance->SetData(DATA_CONTROL_CONSOLE, DONE); + + return true; +} + +struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance +{ + instance_serpentshrine_cavern(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 LurkerBelow; + uint64 Sharkkis; + uint64 Tidalvess; + uint64 Caribdis; + uint64 LadyVashj; + uint64 Karathress; + uint64 KarathressEvent_Starter; + uint64 LeotherasTheBlind; + uint64 LeotherasEventStarter; + + uint64 ControlConsole; + uint64 BridgePart[3]; + uint64 StrangePool; + + bool ShieldGeneratorDeactivated[4]; + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + LurkerBelow = 0; + Sharkkis = 0; + Tidalvess = 0; + Caribdis = 0; + LadyVashj = 0; + Karathress = 0; + KarathressEvent_Starter = 0; + LeotherasTheBlind = 0; + LeotherasEventStarter = 0; + + ControlConsole = 0; + BridgePart[0] = 0; + BridgePart[1] = 0; + BridgePart[2] = 0; + StrangePool = 0; + + ShieldGeneratorDeactivated[0] = false; + ShieldGeneratorDeactivated[1] = false; + ShieldGeneratorDeactivated[2] = false; + ShieldGeneratorDeactivated[3] = false; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 184568: + ControlConsole = pGo->GetGUID(); + pGo->setActive(true); + break; + + case 184203: + BridgePart[0] = pGo->GetGUID(); + pGo->setActive(true); + break; + + case 184204: + BridgePart[1] = pGo->GetGUID(); + pGo->setActive(true); + break; + + case 184205: + BridgePart[2] = pGo->GetGUID(); + pGo->setActive(true); + break; + case 184956: + StrangePool = pGo->GetGUID(); + if (pGo->isActiveObject()) + SetData(DATA_STRANGE_POOL, DONE); + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 21212: LadyVashj = pCreature->GetGUID(); break; + case 21214: Karathress = pCreature->GetGUID(); break; + case 21966: Sharkkis = pCreature->GetGUID(); break; + case 21217: LurkerBelow = pCreature->GetGUID(); break; + case 21965: Tidalvess = pCreature->GetGUID(); break; + case 21964: Caribdis = pCreature->GetGUID(); break; + case 21215: LeotherasTheBlind = pCreature->GetGUID(); break;} + } + + void SetData64(uint32 type, uint64 data) + { + if (type == DATA_KARATHRESSEVENT_STARTER) + KarathressEvent_Starter = data; + if (type == DATA_LEOTHERAS_EVENT_STARTER) + LeotherasEventStarter = data; + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_THELURKERBELOW: return LurkerBelow; + case DATA_SHARKKIS: return Sharkkis; + case DATA_TIDALVESS: return Tidalvess; + case DATA_CARIBDIS: return Caribdis; + case DATA_LADYVASHJ: return LadyVashj; + case DATA_KARATHRESS: return Karathress; + case DATA_KARATHRESSEVENT_STARTER: return KarathressEvent_Starter; + case DATA_LEOTHERAS: return LeotherasTheBlind; + case DATA_LEOTHERAS_EVENT_STARTER: return LeotherasEventStarter; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_STRANGE_POOL: StrangePool = data; + case DATA_CONTROL_CONSOLE: + if (data == DONE) + { + HandleGameObject(BridgePart[0], true); + HandleGameObject(BridgePart[0], true); + HandleGameObject(BridgePart[0], true); + } + ControlConsole = data; + case DATA_HYDROSSTHEUNSTABLEEVENT: m_auiEncounter[0] = data; break; + case DATA_LEOTHERASTHEBLINDEVENT: m_auiEncounter[1] = data; break; + case DATA_THELURKERBELOWEVENT: m_auiEncounter[2] = data; break; + case DATA_KARATHRESSEVENT: m_auiEncounter[3] = data; break; + case DATA_MOROGRIMTIDEWALKEREVENT: m_auiEncounter[4] = data; break; + //Lady Vashj + case DATA_LADYVASHJEVENT: + if (data == NOT_STARTED) + { + ShieldGeneratorDeactivated[0] = false; + ShieldGeneratorDeactivated[1] = false; + ShieldGeneratorDeactivated[2] = false; + ShieldGeneratorDeactivated[3] = false; + } + m_auiEncounter[5] = data; break; + case DATA_SHIELDGENERATOR1:ShieldGeneratorDeactivated[0] = (data) ? true : false; break; + case DATA_SHIELDGENERATOR2:ShieldGeneratorDeactivated[1] = (data) ? true : false; break; + case DATA_SHIELDGENERATOR3:ShieldGeneratorDeactivated[2] = (data) ? true : false; break; + case DATA_SHIELDGENERATOR4:ShieldGeneratorDeactivated[3] = (data) ? true : false; break; + } + + if (data == DONE) + SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_HYDROSSTHEUNSTABLEEVENT: return m_auiEncounter[0]; + case DATA_LEOTHERASTHEBLINDEVENT: return m_auiEncounter[1]; + case DATA_THELURKERBELOWEVENT: return m_auiEncounter[2]; + case DATA_KARATHRESSEVENT: return m_auiEncounter[3]; + case DATA_MOROGRIMTIDEWALKEREVENT: return m_auiEncounter[4]; + //Lady Vashj + case DATA_LADYVASHJEVENT: return m_auiEncounter[5]; + case DATA_SHIELDGENERATOR1: return ShieldGeneratorDeactivated[0]; + case DATA_SHIELDGENERATOR2: return ShieldGeneratorDeactivated[1]; + case DATA_SHIELDGENERATOR3: return ShieldGeneratorDeactivated[2]; + case DATA_SHIELDGENERATOR4: return ShieldGeneratorDeactivated[3]; + case DATA_CANSTARTPHASE3: + if (ShieldGeneratorDeactivated[0] && ShieldGeneratorDeactivated[1] && ShieldGeneratorDeactivated[2] && ShieldGeneratorDeactivated[3])return 1;break; + } + return 0; + } + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " + << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5]; + 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_serpentshrine_cavern(Map* pMap) +{ + return new instance_serpentshrine_cavern(pMap); +} + +void AddSC_instance_serpentshrine_cavern() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "instance_serpent_shrine"; + newscript->GetInstanceData = &GetInstanceData_instance_serpentshrine_cavern; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="go_bridge_console"; + newscript->pGOHello = &GOHello_go_bridge_console; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp new file mode 100644 index 00000000000..3bec4de6876 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp @@ -0,0 +1,197 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hydromancer_Thespia +SD%Complete: 80 +SDComment: Needs additional adjustments (when instance script is adjusted) +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +/* ContentData +boss_hydromancer_thespia +mob_coilfang_waterelemental +EndContentData */ + +#include "precompiled.h" +#include "def_steam_vault.h" + +#define SAY_SUMMON -1545000 +#define SAY_AGGRO_1 -1545001 +#define SAY_AGGRO_2 -1545002 +#define SAY_AGGRO_3 -1545003 +#define SAY_SLAY_1 -1545004 +#define SAY_SLAY_2 -1545005 +#define SAY_DEAD -1545006 + +#define SPELL_LIGHTNING_CLOUD 25033 +#define SPELL_LUNG_BURST 31481 +#define SPELL_ENVELOPING_WINDS 31718 + +struct TRINITY_DLL_DECL boss_thespiaAI : public ScriptedAI +{ + boss_thespiaAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + bool HeroicMode; + + uint32 LightningCloud_Timer; + uint32 LungBurst_Timer; + uint32 EnvelopingWinds_Timer; + + void Reset() + { + LightningCloud_Timer = 15000; + LungBurst_Timer = 7000; + EnvelopingWinds_Timer = 9000; + + if (pInstance && m_creature->isAlive()) + pInstance->SetData(TYPE_HYDROMANCER_THESPIA, NOT_STARTED); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEAD, m_creature); + + if (pInstance) + pInstance->SetData(TYPE_HYDROMANCER_THESPIA, DONE); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + if (pInstance) + pInstance->SetData(TYPE_HYDROMANCER_THESPIA, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //LightningCloud_Timer + if (LightningCloud_Timer < diff) + { + //cast twice in Heroic mode + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_LIGHTNING_CLOUD); + if (HeroicMode) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_LIGHTNING_CLOUD); + LightningCloud_Timer = 15000+rand()%10000; + }else LightningCloud_Timer -=diff; + + //LungBurst_Timer + if (LungBurst_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_LUNG_BURST); + LungBurst_Timer = 7000+rand()%5000; + }else LungBurst_Timer -=diff; + + //EnvelopingWinds_Timer + if (EnvelopingWinds_Timer < diff) + { + //cast twice in Heroic mode + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_ENVELOPING_WINDS); + if (HeroicMode) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_ENVELOPING_WINDS); + EnvelopingWinds_Timer = 10000+rand()%5000; + }else EnvelopingWinds_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +#define SPELL_WATER_BOLT_VOLLEY 34449 +#define H_SPELL_WATER_BOLT_VOLLEY 37924 + +struct TRINITY_DLL_DECL mob_coilfang_waterelementalAI : public ScriptedAI +{ + mob_coilfang_waterelementalAI(Creature *c) : ScriptedAI(c) {} + + bool HeroicMode; + uint32 WaterBoltVolley_Timer; + + void Reset() + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + WaterBoltVolley_Timer = 3000+rand()%3000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (WaterBoltVolley_Timer < diff) + { + DoCast(m_creature, HeroicMode ? H_SPELL_WATER_BOLT_VOLLEY : SPELL_WATER_BOLT_VOLLEY); + WaterBoltVolley_Timer = 7000+rand()%5000; + }else WaterBoltVolley_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_thespiaAI(Creature* pCreature) +{ + return new boss_thespiaAI (pCreature); +} + +CreatureAI* GetAI_mob_coilfang_waterelementalAI(Creature* pCreature) +{ + return new mob_coilfang_waterelementalAI (pCreature); +} + +void AddSC_boss_hydromancer_thespia() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_hydromancer_thespia"; + newscript->GetAI = &GetAI_boss_thespiaAI; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_coilfang_waterelemental"; + newscript->GetAI = &GetAI_mob_coilfang_waterelementalAI; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp new file mode 100644 index 00000000000..d8cc2e0ef47 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp @@ -0,0 +1,279 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Mekgineer_Steamrigger +SD%Complete: 60 +SDComment: Mechanics' interrrupt heal doesn't work very well, also a proper movement needs to be implemented -> summon further away and move towards target to repair. +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +/* ContentData +boss_mekgineer_steamrigger +mob_steamrigger_mechanic +EndContentData */ + +#include "precompiled.h" +#include "def_steam_vault.h" + +#define SAY_MECHANICS -1545007 +#define SAY_AGGRO_1 -1545008 +#define SAY_AGGRO_2 -1545009 +#define SAY_AGGRO_3 -1545010 +#define SAY_AGGRO_4 -1545011 +#define SAY_SLAY_1 -1545012 +#define SAY_SLAY_2 -1545013 +#define SAY_SLAY_3 -1545014 +#define SAY_DEATH -1545015 + +#define SPELL_SUPER_SHRINK_RAY 31485 +#define SPELL_SAW_BLADE 31486 +#define SPELL_ELECTRIFIED_NET 35107 +#define H_SPELL_ENRAGE 1 //corrent enrage spell not known + +#define ENTRY_STREAMRIGGER_MECHANIC 17951 + +struct TRINITY_DLL_DECL boss_mekgineer_steamriggerAI : public ScriptedAI +{ + boss_mekgineer_steamriggerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + bool HeroicMode; + + uint32 Shrink_Timer; + uint32 Saw_Blade_Timer; + uint32 Electrified_Net_Timer; + bool Summon75; + bool Summon50; + bool Summon25; + + void Reset() + { + Shrink_Timer = 20000; + Saw_Blade_Timer = 15000; + Electrified_Net_Timer = 10000; + + Summon75 = false; + Summon50 = false; + Summon25 = false; + + if (pInstance && m_creature->isAlive()) + pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, NOT_STARTED); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, DONE); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + case 2: DoScriptText(SAY_SLAY_3, m_creature); break; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + if (pInstance) + pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, IN_PROGRESS); + } + + //no known summon spells exist + void SummonMechanichs() + { + DoScriptText(SAY_MECHANICS, m_creature); + + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + + if (rand()%2) + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,-7,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + if (rand()%2) + DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,7,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Shrink_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SUPER_SHRINK_RAY); + Shrink_Timer = 20000; + }else Shrink_Timer -= diff; + + if (Saw_Blade_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,SPELL_SAW_BLADE); + else + DoCast(m_creature->getVictim(),SPELL_SAW_BLADE); + + Saw_Blade_Timer = 15000; + } else Saw_Blade_Timer -= diff; + + if (Electrified_Net_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ELECTRIFIED_NET); + Electrified_Net_Timer = 10000; + } + else Electrified_Net_Timer -= diff; + + if (!Summon75) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 75) + { + SummonMechanichs(); + Summon75 = true; + } + } + + if (!Summon50) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) + { + SummonMechanichs(); + Summon50 = true; + } + } + + if (!Summon25) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) + { + SummonMechanichs(); + Summon25 = true; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_mekgineer_steamrigger(Creature* pCreature) +{ + return new boss_mekgineer_steamriggerAI (pCreature); +} + +#define SPELL_DISPEL_MAGIC 17201 +#define SPELL_REPAIR 31532 +#define H_SPELL_REPAIR 37936 + +#define MAX_REPAIR_RANGE (13.0f) //we should be at least at this range for repair +#define MIN_REPAIR_RANGE (7.0f) //we can stop movement at this range to repair but not required + +struct TRINITY_DLL_DECL mob_steamrigger_mechanicAI : public ScriptedAI +{ + mob_steamrigger_mechanicAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint32 Repair_Timer; + + void Reset() + { + Repair_Timer = 2000; + } + + void MoveInLineOfSight(Unit* who) + { + //react only if attacked + return; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (Repair_Timer < diff) + { + if (pInstance && pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS) + { + if (Unit* pMekgineer = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER))) + { + if (m_creature->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE)) + { + //are we already channeling? Doesn't work very well, find better check? + if (!m_creature->GetUInt32Value(UNIT_CHANNEL_SPELL)) + { + //m_creature->GetMotionMaster()->MovementExpired(); + //m_creature->GetMotionMaster()->MoveIdle(); + + DoCast(m_creature,HeroicMode ? H_SPELL_REPAIR : SPELL_REPAIR, true); + } + Repair_Timer = 5000; + } + else + { + //m_creature->GetMotionMaster()->MovementExpired(); + //m_creature->GetMotionMaster()->MoveFollow(pMekgineer,0,0); + } + } + }else Repair_Timer = 5000; + }else Repair_Timer -= diff; + + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_steamrigger_mechanic(Creature* pCreature) +{ + return new mob_steamrigger_mechanicAI (pCreature); +} + +void AddSC_boss_mekgineer_steamrigger() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_mekgineer_steamrigger"; + newscript->GetAI = &GetAI_boss_mekgineer_steamrigger; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_steamrigger_mechanic"; + newscript->GetAI = &GetAI_mob_steamrigger_mechanic; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp new file mode 100644 index 00000000000..0f4f2689398 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp @@ -0,0 +1,213 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warlord_Kalithres +SD%Complete: 65 +SDComment: Contains workarounds regarding warlord's rage spells not acting as expected. Both scripts here require review and fine tuning. +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +#include "precompiled.h" +#include "def_steam_vault.h" + +#define SAY_INTRO -1545016 +#define SAY_REGEN -1545017 +#define SAY_AGGRO1 -1545018 +#define SAY_AGGRO2 -1545019 +#define SAY_AGGRO3 -1545020 +#define SAY_SLAY1 -1545021 +#define SAY_SLAY2 -1545022 +#define SAY_DEATH -1545023 + +#define SPELL_SPELL_REFLECTION 31534 +#define SPELL_IMPALE 39061 +#define SPELL_WARLORDS_RAGE 37081 +#define SPELL_WARLORDS_RAGE_NAGA 31543 + +#define SPELL_WARLORDS_RAGE_PROC 36453 + +struct TRINITY_DLL_DECL mob_naga_distillerAI : public ScriptedAI +{ + mob_naga_distillerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + //hack, due to really weird spell behaviour :( + if (pInstance) + { + if (pInstance->GetData(TYPE_DISTILLER) == IN_PROGRESS) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + } + + void EnterCombat(Unit *who) { } + + void StartRageGen(Unit *caster) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + DoCast(m_creature,SPELL_WARLORDS_RAGE_NAGA,true); + + if (pInstance) + pInstance->SetData(TYPE_DISTILLER,IN_PROGRESS); + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + if (m_creature->GetHealth() <= damage) + if (pInstance) + pInstance->SetData(TYPE_DISTILLER,DONE); + } +}; + +struct TRINITY_DLL_DECL boss_warlord_kalithreshAI : public ScriptedAI +{ + boss_warlord_kalithreshAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 Reflection_Timer; + uint32 Impale_Timer; + uint32 Rage_Timer; + bool CanRage; + + void Reset() + { + Reflection_Timer = 10000; + Impale_Timer = 7000+rand()%7000; + Rage_Timer = 45000; + CanRage = false; + + if (pInstance) + pInstance->SetData(TYPE_WARLORD_KALITHRESH, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if (pInstance) + pInstance->SetData(TYPE_WARLORD_KALITHRESH, IN_PROGRESS); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + //hack :( + if (spell->Id == SPELL_WARLORDS_RAGE_PROC) + if (pInstance) + if (pInstance->GetData(TYPE_DISTILLER) == DONE) + m_creature->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC); + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(TYPE_WARLORD_KALITHRESH, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Rage_Timer < diff) + { + if (Creature* distiller = me->FindNearestCreature(17954, 100.0f)) + { + DoScriptText(SAY_REGEN, m_creature); + DoCast(m_creature,SPELL_WARLORDS_RAGE); + CAST_AI(mob_naga_distillerAI, distiller->AI())->StartRageGen(m_creature); + } + Rage_Timer = 3000+rand()%15000; + }else Rage_Timer -= diff; + + //Reflection_Timer + if (Reflection_Timer < diff) + { + DoCast(m_creature, SPELL_SPELL_REFLECTION); + Reflection_Timer = 15000+rand()%10000; + }else Reflection_Timer -= diff; + + //Impale_Timer + if (Impale_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_IMPALE); + + Impale_Timer = 7500+rand()%5000; + }else Impale_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_naga_distiller(Creature* pCreature) +{ + return new mob_naga_distillerAI (pCreature); +} + +CreatureAI* GetAI_boss_warlord_kalithresh(Creature* pCreature) +{ + return new boss_warlord_kalithreshAI (pCreature); +} + +void AddSC_boss_warlord_kalithresh() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="mob_naga_distiller"; + newscript->GetAI = &GetAI_mob_naga_distiller; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_warlord_kalithresh"; + newscript->GetAI = &GetAI_boss_warlord_kalithresh; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/def_steam_vault.h b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/def_steam_vault.h new file mode 100644 index 00000000000..4b407ac4816 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/def_steam_vault.h @@ -0,0 +1,17 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_STEAM_VAULT_H +#define DEF_STEAM_VAULT_H + +#define TYPE_HYDROMANCER_THESPIA 1 +#define TYPE_MEKGINEER_STEAMRIGGER 2 +#define TYPE_WARLORD_KALITHRESH 3 +#define TYPE_DISTILLER 4 + +#define DATA_MEKGINEERSTEAMRIGGER 5 +#define DATA_KALITRESH 6 +#define DATA_THESPIA 7 +#endif + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp new file mode 100644 index 00000000000..29616a123ad --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/steam_vault/instance_steam_vault.cpp @@ -0,0 +1,231 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Steam_Vault +SD%Complete: 80 +SDComment: Instance script and access panel GO +SDCategory: Coilfang Resevoir, The Steamvault +EndScriptData */ + +#include "precompiled.h" +#include "def_steam_vault.h" + +#define MAX_ENCOUNTER 4 + +#define MAIN_CHAMBERS_DOOR 183049 +#define ACCESS_PANEL_HYDRO 184125 +#define ACCESS_PANEL_MEK 184126 + +/* Steam Vaults encounters: +1 - Hydromancer Thespia Event +2 - Mekgineer Steamrigger Event +3 - Warlord Kalithresh Event +*/ + +bool GOHello_go_main_chambers_access_panel(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = pGo->GetInstanceData(); + + if (!pInstance) + return false; + + if (pGo->GetEntry() == ACCESS_PANEL_HYDRO && (pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == DONE || pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL)) + pInstance->SetData(TYPE_HYDROMANCER_THESPIA,SPECIAL); + + if (pGo->GetEntry() == ACCESS_PANEL_MEK && (pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE || pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL)) + pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER,SPECIAL); + + return true; +} + +struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance +{ + instance_steam_vault(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 ThespiaGUID; + uint64 MekgineerGUID; + uint64 KalithreshGUID; + + uint64 MainChambersDoor; + uint64 AccessPanelHydro; + uint64 AccessPanelMek; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + ThespiaGUID = 0; + MekgineerGUID = 0; + KalithreshGUID = 0; + MainChambersDoor = 0; + AccessPanelHydro = 0; + AccessPanelMek = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 17797: ThespiaGUID = pCreature->GetGUID(); break; + case 17796: MekgineerGUID = pCreature->GetGUID(); break; + case 17798: KalithreshGUID = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case MAIN_CHAMBERS_DOOR: MainChambersDoor = pGo->GetGUID(); break; + case ACCESS_PANEL_HYDRO: AccessPanelHydro = pGo->GetGUID(); break; + case ACCESS_PANEL_MEK: AccessPanelMek = pGo->GetGUID(); break; + } + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_HYDROMANCER_THESPIA: + if (data == SPECIAL) + { + HandleGameObject(AccessPanelHydro, true); + + if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL) + HandleGameObject(MainChambersDoor, true); + + debug_log("TSCR: Instance Steamvault: Access panel used."); + } + m_auiEncounter[0] = data; + break; + case TYPE_MEKGINEER_STEAMRIGGER: + if (data == SPECIAL) + { + HandleGameObject(AccessPanelMek, true); + + if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL) + HandleGameObject(MainChambersDoor, true); + + debug_log("TSCR: Instance Steamvault: Access panel used."); + } + m_auiEncounter[1] = data; + break; + case TYPE_WARLORD_KALITHRESH: + m_auiEncounter[2] = data; + break; + case TYPE_DISTILLER: + m_auiEncounter[3] = data; + break; + } + + if (data == DONE || data == SPECIAL) + SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_HYDROMANCER_THESPIA: + return m_auiEncounter[0]; + case TYPE_MEKGINEER_STEAMRIGGER: + return m_auiEncounter[1]; + case TYPE_WARLORD_KALITHRESH: + return m_auiEncounter[2]; + case TYPE_DISTILLER: + return m_auiEncounter[3]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_THESPIA: + return ThespiaGUID; + case DATA_MEKGINEERSTEAMRIGGER: + return MekgineerGUID; + case DATA_KALITRESH: + return KalithreshGUID; + } + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + char* out = new char[stream.str().length() + 1]; + strcpy(out, stream.str().c_str()); + if (out) + { + OUT_SAVE_INST_DATA_COMPLETE; + return out; + } + return NULL; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + OUT_LOAD_INST_DATA(in); + std::istringstream stream(in); + stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_steam_vault(Map* pMap) +{ + return new instance_steam_vault(pMap); +} + +void AddSC_instance_steam_vault() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "go_main_chambers_access_panel"; + newscript->pGOHello = &GOHello_go_main_chambers_access_panel; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "instance_steam_vault"; + newscript->GetInstanceData = &GetInstanceData_instance_steam_vault; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp new file mode 100644 index 00000000000..309c63d857e --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_hungarfen.cpp @@ -0,0 +1,156 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Hungarfen +SD%Complete: 95 +SDComment: Need confirmation if spell data are same in both modes. Summons should have faster rate in heroic +SDCategory: Coilfang Resevoir, Underbog +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_FOUL_SPORES 31673 +#define SPELL_ACID_GEYSER 38739 + +struct TRINITY_DLL_DECL boss_hungarfenAI : public ScriptedAI +{ + boss_hungarfenAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + bool Root; + uint32 Mushroom_Timer; + uint32 AcidGeyser_Timer; + + void Reset() + { + Root = false; + Mushroom_Timer = 5000; // 1 mushroom after 5s, then one per 10s. This should be different in heroic mode + AcidGeyser_Timer = 10000; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20) + { + if (!Root) + { + DoCast(m_creature,SPELL_FOUL_SPORES); + Root = true; + } + } + + if (Mushroom_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + m_creature->SummonCreature(17990, target->GetPositionX()+(rand()%8), target->GetPositionY()+(rand()%8), target->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); + else + m_creature->SummonCreature(17990, m_creature->GetPositionX()+(rand()%8), m_creature->GetPositionY()+(rand()%8), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); + + Mushroom_Timer = 10000; + }else Mushroom_Timer -= diff; + + if (AcidGeyser_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ACID_GEYSER); + AcidGeyser_Timer = 10000+rand()%7500; + }else AcidGeyser_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_hungarfen(Creature* pCreature) +{ + return new boss_hungarfenAI (pCreature); +} + +#define SPELL_SPORE_CLOUD 34168 +#define SPELL_PUTRID_MUSHROOM 31690 +#define SPELL_GROW 31698 + +struct TRINITY_DLL_DECL mob_underbog_mushroomAI : public ScriptedAI +{ + mob_underbog_mushroomAI(Creature *c) : ScriptedAI(c) {} + + bool Stop; + uint32 Grow_Timer; + uint32 Shrink_Timer; + + void Reset() + { + Stop = false; + Grow_Timer = 0; + Shrink_Timer = 20000; + + DoCast(m_creature,SPELL_PUTRID_MUSHROOM,true); + DoCast(m_creature,SPELL_SPORE_CLOUD,true); + } + + void MoveInLineOfSight(Unit *who) { return; } + + void AttackStart(Unit* who) { return; } + + void EnterCombat(Unit* who) { } + + void UpdateAI(const uint32 diff) + { + if (Stop) + return; + + if (Grow_Timer <= diff) + { + DoCast(m_creature,SPELL_GROW); + Grow_Timer = 3000; + }else Grow_Timer -= diff; + + if (Shrink_Timer <= diff) + { + m_creature->RemoveAurasDueToSpell(SPELL_GROW); + Stop = true; + }else Shrink_Timer -= diff; + } +}; +CreatureAI* GetAI_mob_underbog_mushroom(Creature* pCreature) +{ + return new mob_underbog_mushroomAI (pCreature); +} + +void AddSC_boss_hungarfen() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_hungarfen"; + newscript->GetAI = &GetAI_boss_hungarfen; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_underbog_mushroom"; + newscript->GetAI = &GetAI_mob_underbog_mushroom; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp new file mode 100644 index 00000000000..6da2a022adf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/underbog/boss_the_black_stalker.cpp @@ -0,0 +1,191 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_the_black_stalker +SD%Complete: 95 +SDComment: Timers may be incorrect +SDCategory: Coilfang Resevoir, Underbog +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_LEVITATE 31704 +#define SPELL_SUSPENSION 31719 +#define SPELL_LEVITATION_PULSE 31701 +#define SPELL_MAGNETIC_PULL 31705 +#define SPELL_CHAIN_LIGHTNING 31717 +#define SPELL_STATIC_CHARGE 31715 +#define SPELL_SUMMON_SPORE_STRIDER 38755 + +#define ENTRY_SPORE_STRIDER 22299 + +struct TRINITY_DLL_DECL boss_the_black_stalkerAI : public ScriptedAI +{ + boss_the_black_stalkerAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 SporeStriders_Timer; + uint32 Levitate_Timer; + uint32 ChainLightning_Timer; + uint32 StaticCharge_Timer; + uint64 LevitatedTarget; + uint32 LevitatedTarget_Timer; + bool InAir; + uint32 check_Timer; + std::list Striders; + + void Reset() + { + Levitate_Timer = 12000; + ChainLightning_Timer = 6000; + StaticCharge_Timer = 10000; + SporeStriders_Timer = 10000+rand()%5000; + check_Timer = 5000; + LevitatedTarget = 0; + LevitatedTarget_Timer = 0; + Striders.clear(); + } + + void EnterCombat(Unit *who) {} + + void JustSummoned(Creature *summon) + { + if (summon && summon->GetEntry() == ENTRY_SPORE_STRIDER) + { + Striders.push_back(summon->GetGUID()); + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1)) + summon->AI()->AttackStart(target); + else + if (m_creature->getVictim()) + summon->AI()->AttackStart(m_creature->getVictim()); + } + } + + void JustDied(Unit *who) + { + for(std::list::iterator i = Striders.begin(); i != Striders.end(); ++i) + if (Creature *strider = Unit::GetCreature(*m_creature, *i)) + { + strider->SetLootRecipient(NULL); + strider->DealDamage(strider,strider->GetMaxHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + strider->RemoveCorpse(); + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + // Evade if too far + if (check_Timer < diff) + { + float x,y,z,o; + m_creature->GetHomePosition(x,y,z,o); + if (!m_creature->IsWithinDist3d(x,y,z, 60)) + { + EnterEvadeMode(); + return; + } + check_Timer = 1000; + }else check_Timer -= diff; + + // Spore Striders + if (HeroicMode && SporeStriders_Timer < diff) + { + DoCast(m_creature,SPELL_SUMMON_SPORE_STRIDER); + SporeStriders_Timer = 10000+rand()%5000; + }else SporeStriders_Timer -= diff; + + // Levitate + if (LevitatedTarget) + { + if (LevitatedTarget_Timer < diff) + { + if (Unit* target = Unit::GetUnit(*m_creature, LevitatedTarget)) + { + if (!target->HasAura(SPELL_LEVITATE)) + { + LevitatedTarget = 0; + return; + } + if (InAir) + { + target->AddAura(SPELL_SUSPENSION, target); + LevitatedTarget = 0; + } + else + { + target->CastSpell(target, SPELL_MAGNETIC_PULL, true); + InAir = true; + LevitatedTarget_Timer = 1500; + } + } + else + LevitatedTarget = 0; + }else LevitatedTarget_Timer -= diff; + } + if (Levitate_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1)) + { + DoCast(target, SPELL_LEVITATE); + LevitatedTarget = target->GetGUID(); + LevitatedTarget_Timer = 2000; + InAir = false; + } + Levitate_Timer = 12000+rand()%3000; + }else Levitate_Timer -= diff; + + // Chain Lightning + if (ChainLightning_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target, SPELL_CHAIN_LIGHTNING); + ChainLightning_Timer = 7000; + }else ChainLightning_Timer -= diff; + + // Static Charge + if (StaticCharge_Timer < diff) + { + if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,true)) + DoCast(target, SPELL_STATIC_CHARGE); + StaticCharge_Timer = 10000; + }else StaticCharge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_the_black_stalker(Creature* pCreature) +{ + return new boss_the_black_stalkerAI (pCreature); +} + +void AddSC_boss_the_black_stalker() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_the_black_stalker"; + newscript->GetAI = &GetAI_boss_the_black_stalker; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/gruuls_lair/boss_gruul.cpp b/src/bindings/scripts/scripts/outland/gruuls_lair/boss_gruul.cpp new file mode 100644 index 00000000000..dc4d9df18c4 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/gruuls_lair/boss_gruul.cpp @@ -0,0 +1,260 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gruul +SD%Complete: 60 +SDComment: Ground Slam need further development (knock back effect and shatter effect must be added to mangos) +SDCategory: Gruul's Lair +EndScriptData */ + +#include "precompiled.h" +#include "def_gruuls_lair.h" + +enum +{ + SAY_AGGRO = -1565010, + SAY_SLAM1 = -1565011, + SAY_SLAM2 = -1565012, + SAY_SHATTER1 = -1565013, + SAY_SHATTER2 = -1565014, + SAY_SLAY1 = -1565015, + SAY_SLAY2 = -1565016, + SAY_SLAY3 = -1565017, + SAY_DEATH = -1565018, + + EMOTE_GROW = -1565019, + + SPELL_GROWTH = 36300, + SPELL_CAVE_IN = 36240, + SPELL_GROUND_SLAM = 33525, //AoE Ground Slam applying Ground Slam to everyone with a script effect (most likely the knock back, we can code it to a set knockback) + SPELL_REVERBERATION = 36297, + SPELL_SHATTER = 33654, + + SPELL_SHATTER_EFFECT = 33671, + SPELL_HURTFUL_STRIKE = 33813, + SPELL_STONED = 33652, //Spell is self cast by target + + SPELL_MAGNETIC_PULL = 28337, + SPELL_KNOCK_BACK = 24199, //Knockback spell until correct implementation is made +}; + +struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI +{ + boss_gruulAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 m_uiGrowth_Timer; + uint32 m_uiCaveIn_Timer; + uint32 m_uiCaveIn_StaticTimer; + uint32 m_uiGroundSlamTimer; + uint32 m_uiHurtfulStrike_Timer; + uint32 m_uiReverberation_Timer; + + bool m_bPerformingGroundSlam; + + void Reset() + { + m_uiGrowth_Timer= 30000; + m_uiCaveIn_Timer= 27000; + m_uiCaveIn_StaticTimer = 30000; + m_uiGroundSlamTimer= 35000; + m_bPerformingGroundSlam= false; + m_uiHurtfulStrike_Timer= 8000; + m_uiReverberation_Timer= 60000+45000; + + if (pInstance) + pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS); + } + + void KilledUnit() + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + { + pInstance->SetData(DATA_GRUULEVENT, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_GRUULDOOR), true); // Open the encounter door + } + } + + void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) + { + //This to emulate effect1 (77) of SPELL_GROUND_SLAM, knock back to any direction + //It's initially wrong, since this will cause fall damage, which is by comments, not intended. + if (pSpell->Id == SPELL_GROUND_SLAM) + { + if (pTarget->GetTypeId() == TYPEID_PLAYER) + { + switch(rand()%2) + { + case 0: pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true, NULL, NULL, m_creature->GetGUID()); break; + case 1: pTarget->CastSpell(pTarget, SPELL_KNOCK_BACK, true, NULL, NULL, m_creature->GetGUID()); break; + } + } + } + + //this part should be in mangos + if (pSpell->Id == SPELL_SHATTER) + { + //this spell must have custom handling in mangos, dealing damage based on distance + pTarget->CastSpell(pTarget, SPELL_SHATTER_EFFECT, true); + + if (pTarget->HasAura(SPELL_STONED)) + pTarget->RemoveAurasDueToSpell(SPELL_STONED); + + //clear this, if we are still performing + if (m_bPerformingGroundSlam) + { + m_bPerformingGroundSlam = false; + + //and correct movement, if not already + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) + { + if (m_creature->getVictim()) + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + } + } + } + } + + void UpdateAI(const uint32 uiDiff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + // Growth + // Gruul can cast this spell up to 30 times + if (m_uiGrowth_Timer < uiDiff) + { + DoScriptText(EMOTE_GROW, m_creature); + DoCast(m_creature,SPELL_GROWTH); + m_uiGrowth_Timer = 30000; + } + else + m_uiGrowth_Timer -= uiDiff; + + if (m_bPerformingGroundSlam) + { + if (m_uiGroundSlamTimer < uiDiff) + { + m_uiGroundSlamTimer =120000; + m_uiHurtfulStrike_Timer= 8000; + + if (m_uiReverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter + m_uiReverberation_Timer += 10000; + + DoCast(m_creature, SPELL_SHATTER); + } + else + m_uiGroundSlamTimer -= uiDiff; + } + else + { + // Hurtful Strike + if (m_uiHurtfulStrike_Timer < uiDiff) + { + Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO,1); + + if (target && m_creature->IsWithinMeleeRange(m_creature->getVictim())) + DoCast(target,SPELL_HURTFUL_STRIKE); + else + DoCast(m_creature->getVictim(),SPELL_HURTFUL_STRIKE); + + m_uiHurtfulStrike_Timer= 8000; + } + else + m_uiHurtfulStrike_Timer -= uiDiff; + + // Reverberation + if (m_uiReverberation_Timer < uiDiff) + { + DoCast(m_creature->getVictim(), SPELL_REVERBERATION, true); + m_uiReverberation_Timer = 15000 + rand()%10000; + } + else + m_uiReverberation_Timer -= uiDiff; + + // Cave In + if (m_uiCaveIn_Timer < uiDiff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_CAVE_IN); + + if (m_uiCaveIn_StaticTimer >= 4000) + m_uiCaveIn_StaticTimer -= 2000; + + m_uiCaveIn_Timer = m_uiCaveIn_StaticTimer; + } + else + m_uiCaveIn_Timer -= uiDiff; + + // Ground Slam, Gronn Lord's Grasp, Stoned, Shatter + if (m_uiGroundSlamTimer < uiDiff) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + + m_bPerformingGroundSlam= true; + m_uiGroundSlamTimer = 10000; + + DoCast(m_creature, SPELL_GROUND_SLAM); + } + else + m_uiGroundSlamTimer -= uiDiff; + + DoMeleeAttackIfReady(); + } + } +}; + +CreatureAI* GetAI_boss_gruul(Creature* pCreature) +{ + return new boss_gruulAI (pCreature); +} + +void AddSC_boss_gruul() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_gruul"; + newscript->GetAI = &GetAI_boss_gruul; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp b/src/bindings/scripts/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp new file mode 100644 index 00000000000..6918feaabba --- /dev/null +++ b/src/bindings/scripts/scripts/outland/gruuls_lair/boss_high_king_maulgar.cpp @@ -0,0 +1,793 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_High_King_Maulgar +SD%Complete: 90 +SDComment: Correct timers, after whirlwind melee attack bug, prayer of healing +SDCategory: Gruul's Lair +EndScriptData */ + +#include "precompiled.h" +#include "def_gruuls_lair.h" + +#define SAY_AGGRO -1565000 +#define SAY_ENRAGE -1565001 +#define SAY_OGRE_DEATH1 -1565002 +#define SAY_OGRE_DEATH2 -1565003 +#define SAY_OGRE_DEATH3 -1565004 +#define SAY_OGRE_DEATH4 -1565005 +#define SAY_SLAY1 -1565006 +#define SAY_SLAY2 -1565007 +#define SAY_SLAY3 -1565008 +#define SAY_DEATH -1565009 + +// High King Maulgar +#define SPELL_ARCING_SMASH 39144 +#define SPELL_MIGHTY_BLOW 33230 +#define SPELL_WHIRLWIND 33238 +#define SPELL_BERSERKER_C 26561 +#define SPELL_ROAR 16508 +#define SPELL_FLURRY 33232 +#define SPELL_DUAL_WIELD 29651 //used in phase + +// Olm the Summoner +#define SPELL_DARK_DECAY 33129 +#define SPELL_DEATH_COIL 33130 +#define SPELL_SUMMON_WFH 33131 + +//Kiggler the Craed +#define SPELL_GREATER_POLYMORPH 33173 +#define SPELL_LIGHTNING_BOLT 36152 +#define SPELL_ARCANE_SHOCK 33175 +#define SPELL_ARCANE_EXPLOSION 33237 + +//Blindeye the Seer +#define SPELL_GREATER_PW_SHIELD 33147 +#define SPELL_HEAL 33144 +#define SPELL_PRAYER_OH 33152 + +//Krosh Firehand +#define SPELL_GREATER_FIREBALL 33051 +#define SPELL_SPELLSHIELD 33054 +#define SPELL_BLAST_WAVE 33061 + +bool CheckAllBossDied(ScriptedInstance* pInstance, Creature* m_creature) +{ + if (!pInstance || !m_creature) + return false; + + uint64 MaulgarGUID = 0; + uint64 KigglerGUID = 0; + uint64 BlindeyeGUID = 0; + uint64 OlmGUID = 0; + uint64 KroshGUID = 0; + + Creature* Maulgar = NULL; + Creature* Kiggler = NULL; + Creature* Blindeye = NULL; + Creature* Olm = NULL; + Creature* Krosh = NULL; + + MaulgarGUID = pInstance->GetData64(DATA_MAULGAR); + KigglerGUID = pInstance->GetData64(DATA_KIGGLERTHECRAZED); + BlindeyeGUID = pInstance->GetData64(DATA_BLINDEYETHESEER); + OlmGUID = pInstance->GetData64(DATA_OLMTHESUMMONER); + KroshGUID = pInstance->GetData64(DATA_KROSHFIREHAND); + + Maulgar = (Unit::GetCreature((*m_creature), MaulgarGUID)); + Kiggler = (Unit::GetCreature((*m_creature), KigglerGUID)); + Blindeye = (Unit::GetCreature((*m_creature), BlindeyeGUID)); + Olm = (Unit::GetCreature((*m_creature), OlmGUID)); + Krosh = (Unit::GetCreature((*m_creature), KroshGUID)); + + if (!Maulgar || !Kiggler || !Blindeye || !Olm || !Krosh) + return false; + + if (!Maulgar->isAlive() && !Kiggler->isAlive() && !Blindeye->isAlive() && !Olm->isAlive() && !Krosh->isAlive()) + return true; + + return false; +} + +//High King Maulgar AI +struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI +{ + boss_high_king_maulgarAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + for(uint8 i = 0; i < 4; ++i) + Council[i] = 0; + } + + ScriptedInstance* pInstance; + + uint32 ArcingSmash_Timer; + uint32 MightyBlow_Timer; + uint32 Whirlwind_Timer; + uint32 Charging_Timer; + uint32 Roar_Timer; + + bool Phase2; + + uint64 Council[4]; + + void Reset() + { + ArcingSmash_Timer = 10000; + MightyBlow_Timer = 40000; + Whirlwind_Timer = 30000; + Charging_Timer = 0; + Roar_Timer = 0; + + m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, false); + + Phase2 = false; + + Creature *pCreature = NULL; + for(uint8 i = 0; i < 4; ++i) + { + if (Council[i]) + { + pCreature = (Unit::GetCreature((*m_creature), Council[i])); + if (pCreature && !pCreature->isAlive()) + { + pCreature->Respawn(); + pCreature->AI()->EnterEvadeMode(); + } + } + } + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void KilledUnit() + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (CheckAllBossDied(pInstance, m_creature)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + + void AddDeath() + { + switch(rand()%4) + { + case 0: DoScriptText(SAY_OGRE_DEATH1, m_creature);break; + case 1: DoScriptText(SAY_OGRE_DEATH2, m_creature);break; + case 2: DoScriptText(SAY_OGRE_DEATH3, m_creature);break; + case 3: DoScriptText(SAY_OGRE_DEATH4, m_creature);break; + } + } + + + void EnterCombat(Unit *who) + { + StartEvent(who); + } + + void GetCouncil() + { + //get council member's guid to respawn them if needed + Council[0] = pInstance->GetData64(DATA_KIGGLERTHECRAZED); + Council[1] = pInstance->GetData64(DATA_BLINDEYETHESEER); + Council[2] = pInstance->GetData64(DATA_OLMTHESUMMONER); + Council[3] = pInstance->GetData64(DATA_KROSHFIREHAND); + } + + void StartEvent(Unit *who) + { + if (!pInstance) + return; + + GetCouncil(); + + DoScriptText(SAY_AGGRO, m_creature); + + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + + DoZoneInCombat(); + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (target) + { + AttackStart(target); + GetCouncil(); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //ArcingSmash_Timer + if (ArcingSmash_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH); + ArcingSmash_Timer = 10000; + }else ArcingSmash_Timer -= diff; + + //Whirlwind_Timer + if (Whirlwind_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_WHIRLWIND); + Whirlwind_Timer = 55000; + }else Whirlwind_Timer -= diff; + + //MightyBlow_Timer + if (MightyBlow_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_MIGHTY_BLOW); + MightyBlow_Timer = 30000+rand()%10000; + }else MightyBlow_Timer -= diff; + + //Entering Phase 2 + if (!Phase2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) + { + Phase2 = true; + DoScriptText(SAY_ENRAGE, m_creature); + + m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); + m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); + } + + if (Phase2) + { + //Charging_Timer + if (Charging_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + { + AttackStart(target); + DoCast(target, SPELL_BERSERKER_C); + } + Charging_Timer = 20000; + }else Charging_Timer -= diff; + + //Intimidating Roar + if (Roar_Timer < diff) + { + DoCast(m_creature, SPELL_ROAR); + Roar_Timer = 40000+(rand()%10000); + }else Roar_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +//Olm The Summoner AI +struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI +{ + boss_olm_the_summonerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 DarkDecay_Timer; + uint32 Summon_Timer; + uint32 DeathCoil_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + DarkDecay_Timer = 10000; + Summon_Timer = 15000; + DeathCoil_Timer = 20000; + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho, 0.0f); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, 30.0f); + } + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + Creature *Maulgar = NULL; + Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); + + if (Maulgar) + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); + + if (CheckAllBossDied(pInstance, m_creature)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (target) + { + AttackStart(target); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //DarkDecay_Timer + if (DarkDecay_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_DARK_DECAY); + DarkDecay_Timer = 20000; + }else DarkDecay_Timer -= diff; + + //Summon_Timer + if (Summon_Timer < diff) + { + DoCast(m_creature, SPELL_SUMMON_WFH); + Summon_Timer = 30000; + }else Summon_Timer -= diff; + + //DeathCoil Timer /need correct timer + if (DeathCoil_Timer < diff) + { + Unit* target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + DoCast(target, SPELL_DEATH_COIL); + DeathCoil_Timer = 20000; + }else DeathCoil_Timer -= diff; + + + DoMeleeAttackIfReady(); + } +}; + +//Kiggler The Crazed AI +struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI +{ + boss_kiggler_the_crazedAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 GreaterPolymorph_Timer; + uint32 LightningBolt_Timer; + uint32 ArcaneShock_Timer; + uint32 ArcaneExplosion_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + GreaterPolymorph_Timer = 5000; + LightningBolt_Timer = 10000; + ArcaneShock_Timer = 20000; + ArcaneExplosion_Timer = 30000; + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + Creature *Maulgar = NULL; + Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); + + if (Maulgar) + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); + + if (CheckAllBossDied(pInstance, m_creature)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (target) + { + AttackStart(target); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //GreaterPolymorph_Timer + if (GreaterPolymorph_Timer < diff) + { + Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + DoCast(target, SPELL_GREATER_POLYMORPH); + + GreaterPolymorph_Timer = 15000 + rand()%5000; + }else GreaterPolymorph_Timer -= diff; + + //LightningBolt_Timer + if (LightningBolt_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT); + LightningBolt_Timer = 15000; + }else LightningBolt_Timer -= diff; + + //ArcaneShock_Timer + if (ArcaneShock_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_SHOCK); + ArcaneShock_Timer = 20000; + }else ArcaneShock_Timer -= diff; + + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); + ArcaneExplosion_Timer = 30000; + }else ArcaneExplosion_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Blindeye The Seer AI +struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI +{ + boss_blindeye_the_seerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 GreaterPowerWordShield_Timer; + uint32 Heal_Timer; + uint32 PrayerofHealing_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + GreaterPowerWordShield_Timer = 5000; + Heal_Timer = 25000 + rand()%15000; + PrayerofHealing_Timer = 45000 + rand()%10000; + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + Creature *Maulgar = NULL; + Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); + + if (Maulgar) + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); + + if (CheckAllBossDied(pInstance, m_creature)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (target) + { + AttackStart(target); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //GreaterPowerWordShield_Timer + if (GreaterPowerWordShield_Timer < diff) + { + DoCast(m_creature, SPELL_GREATER_PW_SHIELD); + GreaterPowerWordShield_Timer = 40000; + }else GreaterPowerWordShield_Timer -= diff; + + //Heal_Timer + if (Heal_Timer < diff) + { + DoCast(m_creature, SPELL_HEAL); + Heal_Timer = 15000 + rand()%25000; + }else Heal_Timer -= diff; + + //PrayerofHealing_Timer + if (PrayerofHealing_Timer < diff) + { + DoCast(m_creature, SPELL_PRAYER_OH); + PrayerofHealing_Timer = 35000 + rand()%15000; + }else PrayerofHealing_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Krosh Firehand AI +struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI +{ + boss_krosh_firehandAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + uint32 GreaterFireball_Timer; + uint32 SpellShield_Timer; + uint32 BlastWave_Timer; + + ScriptedInstance* pInstance; + + void Reset() + { + GreaterFireball_Timer = 1000; + SpellShield_Timer = 5000; + BlastWave_Timer = 20000; + + //reset encounter + if (pInstance) + pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + { + pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); + pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); + } + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + Creature *Maulgar = NULL; + Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); + + if (Maulgar) + CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); + + if (CheckAllBossDied(pInstance, m_creature)) + pInstance->SetData(DATA_MAULGAREVENT, DONE); + } + } + + void UpdateAI(const uint32 diff) + { + //Only if not incombat check if the event is started + if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) + { + Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); + + if (target) + { + AttackStart(target); + } + } + + //Return since we have no target + if (!UpdateVictim()) + return; + + //someone evaded! + if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) + { + EnterEvadeMode(); + return; + } + + //GreaterFireball_Timer + if (GreaterFireball_Timer < diff || m_creature->IsWithinDist(m_creature->getVictim(), 30)) + { + DoCast(m_creature->getVictim(), SPELL_GREATER_FIREBALL); + GreaterFireball_Timer = 2000; + }else GreaterFireball_Timer -= diff; + + //SpellShield_Timer + if (SpellShield_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature->getVictim(), SPELL_SPELLSHIELD); + SpellShield_Timer = 30000; + }else SpellShield_Timer -= diff; + + //BlastWave_Timer + if (BlastWave_Timer < diff) + { + Unit *target; + std::list t_list = m_creature->getThreatManager().getThreatList(); + std::vector target_list; + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + //15 yard radius minimum + if (target && target->IsWithinDist(m_creature, 15,false)) + target_list.push_back(target); + target = NULL; + } + if (target_list.size()) + target = *(target_list.begin()+rand()%target_list.size()); + + m_creature->InterruptNonMeleeSpells(false); + DoCast(target, SPELL_BLAST_WAVE); + BlastWave_Timer = 60000; + }else BlastWave_Timer -= diff; + } +}; + +CreatureAI* GetAI_boss_high_king_maulgar(Creature* pCreature) +{ + return new boss_high_king_maulgarAI (pCreature); +} + +CreatureAI* GetAI_boss_olm_the_summoner(Creature* pCreature) +{ + return new boss_olm_the_summonerAI (pCreature); +} + +CreatureAI *GetAI_boss_kiggler_the_crazed(Creature* pCreature) +{ + return new boss_kiggler_the_crazedAI (pCreature); +} + +CreatureAI *GetAI_boss_blindeye_the_seer(Creature* pCreature) +{ + return new boss_blindeye_the_seerAI (pCreature); +} + +CreatureAI *GetAI_boss_krosh_firehand(Creature* pCreature) +{ + return new boss_krosh_firehandAI (pCreature); +} + +void AddSC_boss_high_king_maulgar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_high_king_maulgar"; + newscript->GetAI = &GetAI_boss_high_king_maulgar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_kiggler_the_crazed"; + newscript->GetAI = &GetAI_boss_kiggler_the_crazed; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_blindeye_the_seer"; + newscript->GetAI = &GetAI_boss_blindeye_the_seer; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_olm_the_summoner"; + newscript->GetAI = &GetAI_boss_olm_the_summoner; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_krosh_firehand"; + newscript->GetAI = &GetAI_boss_krosh_firehand; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/gruuls_lair/def_gruuls_lair.h b/src/bindings/scripts/scripts/outland/gruuls_lair/def_gruuls_lair.h new file mode 100644 index 00000000000..7003dcb1e26 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/gruuls_lair/def_gruuls_lair.h @@ -0,0 +1,21 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_GRUULS_LAIR_H +#define DEF_GRUULS_LAIR_H + +#define DATA_BLINDEYETHESEER 1 +#define DATA_GRUULEVENT 2 +#define DATA_KIGGLERTHECRAZED 3 +#define DATA_KROSHFIREHAND 4 +#define DATA_MAULGAREVENT 5 +#define DATA_MAULGAREVENT_TANK 6 +#define DATA_OLMTHESUMMONER 7 +#define DATA_MAULGARDOOR 8 +#define DATA_GRUULDOOR 9 +#define DATA_MAULGAR 10 + +#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Gruul's Lair instance (map 565). Encounters will be buggy." +#endif + diff --git a/src/bindings/scripts/scripts/outland/gruuls_lair/instance_gruuls_lair.cpp b/src/bindings/scripts/scripts/outland/gruuls_lair/instance_gruuls_lair.cpp new file mode 100644 index 00000000000..0ac5cbcaf7a --- /dev/null +++ b/src/bindings/scripts/scripts/outland/gruuls_lair/instance_gruuls_lair.cpp @@ -0,0 +1,193 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Gruuls_Lair +SD%Complete: 100 +SDComment: +SDCategory: Gruul's Lair +EndScriptData */ + +#include "precompiled.h" +#include "def_gruuls_lair.h" + +#define MAX_ENCOUNTER 2 + +/* Gruuls Lair encounters: +1 - High King Maulgar event +2 - Gruul event +*/ + +struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance +{ + instance_gruuls_lair(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 MaulgarEvent_Tank; + uint64 KigglerTheCrazed; + uint64 BlindeyeTheSeer; + uint64 OlmTheSummoner; + uint64 KroshFirehand; + uint64 Maulgar; + + uint64 MaulgarDoor; + uint64 GruulDoor; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + MaulgarEvent_Tank = 0; + KigglerTheCrazed = 0; + BlindeyeTheSeer = 0; + OlmTheSummoner = 0; + KroshFirehand = 0; + Maulgar = 0; + + MaulgarDoor = 0; + GruulDoor = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 18835: KigglerTheCrazed = pCreature->GetGUID(); break; + case 18836: BlindeyeTheSeer = pCreature->GetGUID(); break; + case 18834: OlmTheSummoner = pCreature->GetGUID(); break; + case 18832: KroshFirehand = pCreature->GetGUID(); break; + case 18831: Maulgar = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 184468: + MaulgarDoor = pGo->GetGUID(); + if (m_auiEncounter[0] == DONE) HandleGameObject(NULL, true, pGo); + break; + case 184662: GruulDoor = pGo->GetGUID(); break; + } + } + + void SetData64(uint32 type, uint64 data) + { + if (type == DATA_MAULGAREVENT_TANK) + MaulgarEvent_Tank = data; + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_MAULGAREVENT_TANK: return MaulgarEvent_Tank; + case DATA_KIGGLERTHECRAZED: return KigglerTheCrazed; + case DATA_BLINDEYETHESEER: return BlindeyeTheSeer; + case DATA_OLMTHESUMMONER: return OlmTheSummoner; + case DATA_KROSHFIREHAND: return KroshFirehand; + case DATA_MAULGARDOOR: return MaulgarDoor; + case DATA_GRUULDOOR: return GruulDoor; + case DATA_MAULGAR: return Maulgar; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_MAULGAREVENT: + if (data == DONE) HandleGameObject(MaulgarDoor, true); + m_auiEncounter[0] = data; break; + case DATA_GRUULEVENT: + if (data == IN_PROGRESS) HandleGameObject(GruulDoor, false); + else HandleGameObject(GruulDoor, true); + m_auiEncounter[1] = data; break; + } + + if (data == DONE) + SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_MAULGAREVENT: return m_auiEncounter[0]; + case DATA_GRUULEVENT: return m_auiEncounter[1]; + } + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << m_auiEncounter[0] << " " << m_auiEncounter[1]; + char* out = new char[stream.str().length() + 1]; + strcpy(out, stream.str().c_str()); + if (out) + { + OUT_SAVE_INST_DATA_COMPLETE; + return out; + } + + return NULL; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + std::istringstream stream(in); + stream >> m_auiEncounter[0] >> m_auiEncounter[1]; + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + m_auiEncounter[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_gruuls_lair(Map* pMap) +{ + return new instance_gruuls_lair(pMap); +} + +void AddSC_instance_gruuls_lair() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_gruuls_lair"; + newscript->GetInstanceData = &GetInstanceData_instance_gruuls_lair; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp new file mode 100644 index 00000000000..6c877602426 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_broggok.cpp @@ -0,0 +1,131 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Broggok +SD%Complete: 70 +SDComment: pre-event not made +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +#include "precompiled.h" +#include "def_blood_furnace.h" + +enum +{ + SAY_AGGRO = -1542008, + + SPELL_SLIME_SPRAY = 30913, + SPELL_POISON_CLOUD = 30916, + SPELL_POISON_BOLT = 30917, + + SPELL_POISON = 30914 +}; + +struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI +{ + boss_broggokAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 AcidSpray_Timer; + uint32 PoisonSpawn_Timer; + uint32 PoisonBolt_Timer; + + void Reset() + { + AcidSpray_Timer = 10000; + PoisonSpawn_Timer = 5000; + PoisonBolt_Timer = 7000; + if (pInstance) + { + pInstance->SetData(TYPE_BROGGOK_EVENT, NOT_STARTED); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), true); + } + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + if (pInstance) + { + pInstance->SetData(TYPE_BROGGOK_EVENT, IN_PROGRESS); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), false); + } + } + + void JustSummoned(Creature *summoned) + { + summoned->setFaction(16); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + summoned->CastSpell(summoned,SPELL_POISON,false,0,0,m_creature->GetGUID()); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (AcidSpray_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SLIME_SPRAY); + AcidSpray_Timer = 4000+rand()%8000; + }else AcidSpray_Timer -=diff; + + if (PoisonBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_POISON_BOLT); + PoisonBolt_Timer = 4000+rand()%8000; + }else PoisonBolt_Timer -=diff; + + if (PoisonSpawn_Timer < diff) + { + DoCast(m_creature,SPELL_POISON_CLOUD); + PoisonSpawn_Timer = 20000; + }else PoisonSpawn_Timer -=diff; + + DoMeleeAttackIfReady(); + } + + void JustDied(Unit* who) + { + if (pInstance) + { + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), true); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR5), true); + pInstance->SetData(TYPE_BROGGOK_EVENT, DONE); + } + } + +}; + +CreatureAI* GetAI_boss_broggok(Creature* pCreature) +{ + return new boss_broggokAI (pCreature); +} + +void AddSC_boss_broggok() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_broggok"; + newscript->GetAI = &GetAI_boss_broggok; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp new file mode 100644 index 00000000000..097a1f21a0d --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp @@ -0,0 +1,378 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kelidan_The_Breaker +SD%Complete: 100 +SDComment: +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +/* ContentData +boss_kelidan_the_breaker +mob_shadowmoon_channeler +EndContentData */ + +#include "precompiled.h" +#include "def_blood_furnace.h" + +enum +{ + SAY_WAKE = -1542000, + SAY_ADD_AGGRO_1 = -1542001, + SAY_ADD_AGGRO_2 = -1542002, + SAY_ADD_AGGRO_3 = -1542003, + SAY_KILL_1 = -1542004, + SAY_KILL_2 = -1542005, + SAY_NOVA = -1542006, + SAY_DIE = -1542007, + + SPELL_CORRUPTION = 30938, + SPELL_EVOCATION = 30935, + + SPELL_FIRE_NOVA = 33132, + H_SPELL_FIRE_NOVA = 37371, + + SPELL_SHADOW_BOLT_VOLLEY = 28599, + H_SPELL_SHADOW_BOLT_VOLLEY = 40070, + + SPELL_BURNING_NOVA = 30940, + SPELL_VORTEX = 37370, + + ENTRY_KELIDAN = 17377, + ENTRY_CHANNELER = 17653 +}; + +const float ShadowmoonChannelers[5][4]= +{ + {302,-87,-24.4,0.157}, + {321,-63.5,-24.6,4.887}, + {346,-74.5,-24.6,3.595}, + {344,-103.5,-24.5,2.356}, + {316,-109,-24.6,1.257} +}; + +struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI +{ + boss_kelidan_the_breakerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + for(uint8 i=0; i<5; ++i) + Channelers[i] = 0; + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint32 ShadowVolley_Timer; + uint32 BurningNova_Timer; + uint32 Firenova_Timer; + uint32 Corruption_Timer; + uint32 check_Timer; + bool Firenova; + bool addYell; + uint64 Channelers[5]; + + void Reset() + { + ShadowVolley_Timer = 1000; + BurningNova_Timer = 15000; + Corruption_Timer = 5000; + check_Timer = 0; + Firenova = false; + addYell = false; + SummonChannelers(); + if (pInstance) + pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_WAKE, m_creature); + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + DoStartMovement(who); + if (pInstance) + pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, IN_PROGRESS); + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void ChannelerEngaged(Unit* who) + { + if (who && !addYell) + { + addYell = true; + switch(rand()%3) + { + case 0: DoScriptText(SAY_ADD_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_ADD_AGGRO_2, m_creature); break; + default: DoScriptText(SAY_ADD_AGGRO_3, m_creature); break; + } + } + for(uint8 i=0; i<5; ++i) + { + Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); + if (who && channeler && !channeler->isInCombat()) + channeler->AI()->AttackStart(who); + } + } + + void ChannelerDied(Unit* killer) + { + for(uint8 i=0; i<5; ++i) + { + Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); + if (channeler && channeler->isAlive()) + return; + } + + if (killer) + m_creature->AI()->AttackStart(killer); + } + + uint64 GetChanneled(Creature *channeler1) + { + SummonChannelers(); + if (!channeler1) return NULL; + uint8 i; + for(i=0; i<5; ++i) + { + Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); + if (channeler && channeler->GetGUID() == channeler1->GetGUID()) + break; + } + return Channelers[(i+2)%5]; + } + + void SummonChannelers() + { + for(uint8 i=0; i<5; ++i) + { + Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); + if (!channeler || channeler->isDead()) + channeler = m_creature->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000); + if (channeler) + Channelers[i] = channeler->GetGUID(); + else + Channelers[i] = 0; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DIE, m_creature); + + if (!pInstance) + return; + + pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR1), true); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR6), true); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (check_Timer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + DoCast(m_creature,SPELL_EVOCATION); + check_Timer = 5000; + }else check_Timer -= diff; + return; + } + + if (Firenova) + { + if (Firenova_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_FIRE_NOVA : SPELL_FIRE_NOVA,true); + Firenova = false; + ShadowVolley_Timer = 2000; + }else Firenova_Timer -=diff; + + return; + } + + if (ShadowVolley_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_SHADOW_BOLT_VOLLEY : SPELL_SHADOW_BOLT_VOLLEY); + ShadowVolley_Timer = 5000+rand()%8000; + }else ShadowVolley_Timer -=diff; + + if (Corruption_Timer < diff) + { + DoCast(m_creature,SPELL_CORRUPTION); + Corruption_Timer = 30000+rand()%20000; + }else Corruption_Timer -=diff; + + if (BurningNova_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(SAY_NOVA, m_creature); + + if (SpellEntry *nova = GET_SPELL(SPELL_BURNING_NOVA)) + { + uint8 eff_mask=0; + for (int i=0; i<3; ++i) + { + if (!nova->Effect[i]) + continue; + eff_mask|=1<AddAura(new Aura(nova, eff_mask, NULL, m_creature, m_creature)); + } + + if (HeroicMode) + DoTeleportAll(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation()); + + BurningNova_Timer = 20000+rand()%8000; + Firenova_Timer= 5000; + Firenova = true; + }else BurningNova_Timer -=diff; + + DoMeleeAttackIfReady(); + } + +}; + +CreatureAI* GetAI_boss_kelidan_the_breaker(Creature* pCreature) +{ + return new boss_kelidan_the_breakerAI (pCreature); +} + +/*###### +## mob_shadowmoon_channeler +######*/ + +enum +{ + SPELL_SHADOW_BOLT = 12739, + H_SPELL_SHADOW_BOLT = 15472, + + SPELL_MARK_OF_SHADOW = 30937, + SPELL_CHANNELING = 39123 +}; + +struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI +{ + mob_shadowmoon_channelerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = c->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint32 ShadowBolt_Timer; + uint32 MarkOfShadow_Timer; + uint32 check_Timer; + + void Reset() + { + ShadowBolt_Timer = 1000+rand()%1000; + MarkOfShadow_Timer = 5000+rand()%2000; + check_Timer = 0; + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + } + + void EnterCombat(Unit* who) + { + if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) + CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerEngaged(who); + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + DoStartMovement(who); + } + + void JustDied(Unit* Killer) + { + if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) + CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerDied(Killer); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (check_Timer < diff) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) + { + uint64 channeler = CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(m_creature); + if (Unit *channeled = Unit::GetUnit(*m_creature, channeler)) + DoCast(channeled,SPELL_CHANNELING); + } + check_Timer = 5000; + }else check_Timer -= diff; + return; + } + + if (MarkOfShadow_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target,SPELL_MARK_OF_SHADOW); + MarkOfShadow_Timer = 15000+rand()%5000; + }else MarkOfShadow_Timer -=diff; + + if (ShadowBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT); + ShadowBolt_Timer = 5000+rand()%1000; + }else ShadowBolt_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_shadowmoon_channeler(Creature* pCreature) +{ + return new mob_shadowmoon_channelerAI (pCreature); +} + +void AddSC_boss_kelidan_the_breaker() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_kelidan_the_breaker"; + newscript->GetAI = &GetAI_boss_kelidan_the_breaker; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_shadowmoon_channeler"; + newscript->GetAI = &GetAI_mob_shadowmoon_channeler; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp new file mode 100644 index 00000000000..9902c505b6b --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/boss_the_maker.cpp @@ -0,0 +1,162 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_The_Maker +SD%Complete: 80 +SDComment: Mind control no support +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +#include "precompiled.h" +#include "def_blood_furnace.h" + +enum +{ + SAY_AGGRO_1 = -1542009, + SAY_AGGRO_2 = -1542010, + SAY_AGGRO_3 = -1542011, + SAY_KILL_1 = -1542012, + SAY_KILL_2 = -1542013, + SAY_DIE = -1542014, + + SPELL_ACID_SPRAY = 38153, // heroic 38973 ??? 38153 + SPELL_EXPLODING_BREAKER = 30925, + SPELL_KNOCKDOWN = 20276, + SPELL_DOMINATION = 25772 // ??? +}; + +struct TRINITY_DLL_DECL boss_the_makerAI : public ScriptedAI +{ + boss_the_makerAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 AcidSpray_Timer; + uint32 ExplodingBreaker_Timer; + uint32 Domination_Timer; + uint32 Knockdown_Timer; + + void Reset() + { + AcidSpray_Timer = 15000; + ExplodingBreaker_Timer = 6000; + Domination_Timer = 120000; + Knockdown_Timer = 10000; + + if (!pInstance) + return; + + pInstance->SetData(TYPE_THE_MAKER_EVENT, NOT_STARTED); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), true); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + if (!pInstance) + return; + + pInstance->SetData(TYPE_THE_MAKER_EVENT, IN_PROGRESS); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), false); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DIE, m_creature); + + if (!pInstance) + return; + + pInstance->SetData(TYPE_THE_MAKER_EVENT, DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), true); + pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR3), true); + + + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (AcidSpray_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ACID_SPRAY); + AcidSpray_Timer = 15000+rand()%8000; + }else AcidSpray_Timer -=diff; + + if (ExplodingBreaker_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_EXPLODING_BREAKER); + ExplodingBreaker_Timer = 4000+rand()%8000; + }else ExplodingBreaker_Timer -=diff; + + /* // Disabled until Core Support for mind control + if (domination_timer_timer < diff) + { + Unit* target; + target = SelectUnit(SELECT_TARGET_RANDOM,0); + + DoCast(target,SPELL_DOMINATION); + + domination_timer = 120000; + }else domination_timer -=diff; + */ + + if (Knockdown_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN); + Knockdown_Timer = 4000+rand()%8000; + }else Knockdown_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_the_makerAI(Creature* pCreature) +{ + return new boss_the_makerAI (pCreature); +} + +void AddSC_boss_the_maker() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_the_maker"; + newscript->GetAI = &GetAI_boss_the_makerAI; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/def_blood_furnace.h b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/def_blood_furnace.h new file mode 100644 index 00000000000..b845c66823f --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/def_blood_furnace.h @@ -0,0 +1,29 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_BLOOD_FURNACE_H +#define DEF_BLOOD_FURNACE_H + +#define DATA_THE_MAKER 1 +#define DATA_BROGGOK 2 +#define DATA_KELIDAN_THE_MAKER 3 +#define TYPE_THE_MAKER_EVENT 4 +#define TYPE_BROGGOK_EVENT 5 +#define TYPE_KELIDAN_THE_BREAKER_EVENT 6 +#define DATA_DOOR1 7 +#define DATA_DOOR2 8 +#define DATA_DOOR3 9 +#define DATA_DOOR4 10 +#define DATA_DOOR5 11 +#define DATA_DOOR6 12 +#define DATA_PRISON_CELL1 13 +#define DATA_PRISON_CELL2 14 +#define DATA_PRISON_CELL3 15 +#define DATA_PRISON_CELL4 16 +#define DATA_PRISON_CELL5 17 +#define DATA_PRISON_CELL6 18 +#define DATA_PRISON_CELL7 19 +#define DATA_PRISON_CELL8 20 +#endif + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp new file mode 100644 index 00000000000..5a18ded0c08 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp @@ -0,0 +1,234 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Blood_Furnace +SD%Complete: 85 +SDComment: +SDCategory: Hellfire Citadel, Blood Furnace +EndScriptData */ + +#include "precompiled.h" +#include "def_blood_furnace.h" + +#define ENTRY_SEWER1 181823 +#define ENTRY_SEWER2 181766 +#define MAX_ENCOUNTER 3 + +struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance +{ + instance_blood_furnace(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 The_MakerGUID; + uint64 BroggokGUID; + uint64 Kelidan_The_BreakerGUID; + + uint64 Door1GUID; + uint64 Door2GUID; + uint64 Door3GUID; + uint64 Door4GUID; + uint64 Door5GUID; + uint64 Door6GUID; + + uint64 PrisonCell1GUID; + uint64 PrisonCell2GUID; + uint64 PrisonCell3GUID; + uint64 PrisonCell4GUID; + uint64 PrisonCell5GUID; + uint64 PrisonCell6GUID; + uint64 PrisonCell7GUID; + uint64 PrisonCell8GUID; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + The_MakerGUID = 0; + BroggokGUID = 0; + Kelidan_The_BreakerGUID = 0; + + Door1GUID = 0; + Door2GUID = 0; + Door3GUID = 0; + Door4GUID = 0; + Door5GUID = 0; + Door6GUID = 0; + + PrisonCell1GUID = 0; + PrisonCell2GUID = 0; + PrisonCell3GUID = 0; + PrisonCell4GUID = 0; + PrisonCell5GUID = 0; + PrisonCell6GUID = 0; + PrisonCell7GUID = 0; + PrisonCell8GUID = 0; + } + + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (!add) + return; + + switch(pCreature->GetEntry()) + { + case 17381: The_MakerGUID = pCreature->GetGUID(); break; + case 17380: BroggokGUID = pCreature->GetGUID(); break; + case 17377: Kelidan_The_BreakerGUID = pCreature->GetGUID(); break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + if (!add) + return; + + if (pGo->GetEntry() == 181766) //Final exit door + Door1GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181811) //The Maker Front door + Door2GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181812) //The Maker Rear door + Door3GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181822) //Broggok Front door + Door4GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181819) //Broggok Rear door + Door5GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181823) //Kelidan exit door + Door6GUID = pGo->GetGUID(); + + if (pGo->GetEntry() == 181813) //The Maker prison cell front right + PrisonCell1GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181814) //The Maker prison cell back right + PrisonCell2GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181816) //The Maker prison cell front left + PrisonCell3GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181815) //The Maker prison cell back left + PrisonCell4GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181821) //Broggok prison cell front right + PrisonCell5GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181818) //Broggok prison cell back right + PrisonCell6GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181820) //Broggok prison cell front left + PrisonCell7GUID = pGo->GetGUID(); + if (pGo->GetEntry() == 181817) //Broggok prison cell back left + PrisonCell8GUID = pGo->GetGUID(); + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_THE_MAKER: return The_MakerGUID; + case DATA_BROGGOK: return BroggokGUID; + case DATA_KELIDAN_THE_MAKER: return Kelidan_The_BreakerGUID; + case DATA_DOOR1: return Door1GUID; + case DATA_DOOR2: return Door2GUID; + case DATA_DOOR3: return Door3GUID; + case DATA_DOOR4: return Door4GUID; + case DATA_DOOR5: return Door5GUID; + case DATA_DOOR6: return Door6GUID; + case DATA_PRISON_CELL1: return PrisonCell1GUID; + case DATA_PRISON_CELL2: return PrisonCell2GUID; + case DATA_PRISON_CELL3: return PrisonCell3GUID; + case DATA_PRISON_CELL4: return PrisonCell4GUID; + case DATA_PRISON_CELL5: return PrisonCell5GUID; + case DATA_PRISON_CELL6: return PrisonCell6GUID; + case DATA_PRISON_CELL7: return PrisonCell7GUID; + case DATA_PRISON_CELL8: return PrisonCell8GUID; + } + + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(data) + { + case TYPE_THE_MAKER_EVENT: m_auiEncounter[0] = data; break; + case TYPE_BROGGOK_EVENT: m_auiEncounter[1] = data; break; + case TYPE_KELIDAN_THE_BREAKER_EVENT: m_auiEncounter[2] = data; break; + } + + if (data == DONE) + { + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 data) + { + switch(data) + { + case TYPE_THE_MAKER_EVENT: return m_auiEncounter[0]; + case TYPE_BROGGOK_EVENT: return m_auiEncounter[1]; + case TYPE_KELIDAN_THE_BREAKER_EVENT: return m_auiEncounter[2]; + } + + return 0; + } + + const char* Save() + { + return str_data.c_str(); + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS || m_auiEncounter[i] == FAIL) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + + +InstanceData* GetInstanceData_instance_blood_furnace(Map* pMap) +{ + return new instance_blood_furnace(pMap); +} + +void AddSC_instance_blood_furnace() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_blood_furnace"; + newscript->GetInstanceData = &GetInstanceData_instance_blood_furnace; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp new file mode 100644 index 00000000000..e7411187e86 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp @@ -0,0 +1,214 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Omar_The_Unscarred +SD%Complete: 90 +SDComment: Temporary solution for orbital/shadow whip-ability. Needs more core support before making it more proper. +SDCategory: Hellfire Citadel, Hellfire Ramparts +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO_1 -1543009 +#define SAY_AGGRO_2 -1543010 +#define SAY_AGGRO_3 -1543011 +#define SAY_SUMMON -1543012 +#define SAY_CURSE -1543013 +#define SAY_KILL_1 -1543014 +#define SAY_DIE -1543015 +#define SAY_WIPE -1543016 + +#define SPELL_ORBITAL_STRIKE 30637 +#define SPELL_SHADOW_WHIP 30638 +#define SPELL_TREACHEROUS_AURA 30695 +#define H_SPELL_BANE_OF_TREACHERY 37566 +#define SPELL_DEMONIC_SHIELD 31901 +#define SPELL_SHADOW_BOLT 30686 +#define H_SPELL_SHADOW_BOLT 39297 +#define SPELL_SUMMON_FIENDISH_HOUND 30707 + +struct TRINITY_DLL_DECL boss_omor_the_unscarredAI : public ScriptedAI +{ + boss_omor_the_unscarredAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + + uint32 OrbitalStrike_Timer; + uint32 ShadowWhip_Timer; + uint32 Aura_Timer; + uint32 DemonicShield_Timer; + uint32 Shadowbolt_Timer; + uint32 Summon_Timer; + uint32 SummonedCount; + uint64 PlayerGUID; + bool CanPullBack; + + void Reset() + { + DoScriptText(SAY_WIPE, m_creature); + + OrbitalStrike_Timer = 25000; + ShadowWhip_Timer = 2000; + Aura_Timer = 10000; + DemonicShield_Timer = 1000; + Shadowbolt_Timer = 2000; + Summon_Timer = 10000; + SummonedCount = 0; + PlayerGUID = 0; + CanPullBack = false; + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + DoScriptText(SAY_KILL_1, m_creature); + } + + void JustSummoned(Creature* summoned) + { + DoScriptText(SAY_SUMMON, m_creature); + + if (Unit* random = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(random); + + ++SummonedCount; + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DIE, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //only two may be wrong, perhaps increase timer and spawn periodically instead. + if (SummonedCount < 2) + { + if (Summon_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature,SPELL_SUMMON_FIENDISH_HOUND); + Summon_Timer = 15000+rand()%15000; + }else Summon_Timer -= diff; + } + + if (CanPullBack) + { + if (ShadowWhip_Timer < diff) + { + if (Player* temp = Unit::GetPlayer(PlayerGUID)) + { + //if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted) + if (temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING)) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(temp,SPELL_SHADOW_WHIP); + } + } + PlayerGUID = 0; + ShadowWhip_Timer = 2000; + CanPullBack = false; + }else ShadowWhip_Timer -= diff; + } + else if (OrbitalStrike_Timer < diff) + { + Unit* temp = NULL; + if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) + temp = m_creature->getVictim(); + else temp = SelectUnit(SELECT_TARGET_RANDOM,0); + + if (temp && temp->GetTypeId() == TYPEID_PLAYER) + { + DoCast(temp,SPELL_ORBITAL_STRIKE); + OrbitalStrike_Timer = 14000+rand()%2000; + PlayerGUID = temp->GetGUID(); + + if (PlayerGUID) + CanPullBack = true; + } + }else OrbitalStrike_Timer -= diff; + + if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20) + { + if (DemonicShield_Timer < diff) + { + DoCast(m_creature,SPELL_DEMONIC_SHIELD); + DemonicShield_Timer = 15000; + }else DemonicShield_Timer -= diff; + } + + if (Aura_Timer < diff) + { + DoScriptText(SAY_CURSE, m_creature); + + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoCast(target,HeroicMode ? H_SPELL_BANE_OF_TREACHERY : SPELL_TREACHEROUS_AURA); + Aura_Timer = 8000+rand()%8000; + } + }else Aura_Timer -= diff; + + if (Shadowbolt_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (target) + target = m_creature->getVictim(); + + DoCast(target,HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT); + Shadowbolt_Timer = 4000+rand()%2500; + } + }else Shadowbolt_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_omor_the_unscarredAI(Creature* pCreature) +{ + return new boss_omor_the_unscarredAI (pCreature); +} + +void AddSC_boss_omor_the_unscarred() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_omor_the_unscarred"; + newscript->GetAI = &GetAI_boss_omor_the_unscarredAI; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp new file mode 100644 index 00000000000..98aa4627be2 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp @@ -0,0 +1,490 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +Name: Boss_Vazruden_the_Herald +%Complete: 90 +Comment: +Category: Hellfire Citadel, Hellfire Ramparts +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_FIREBALL (HeroicMode?36920:34653) +#define SPELL_CONE_OF_FIRE (HeroicMode?36921:30926) +#define SPELL_SUMMON_LIQUID_FIRE (HeroicMode?30928:23971) +#define SPELL_BELLOWING_ROAR 39427 +#define SPELL_REVENGE (HeroicMode?40392:19130) +#define SPELL_KIDNEY_SHOT 30621 +#define SPELL_FIRE_NOVA_VISUAL 19823 + +#define ENTRY_HELLFIRE_SENTRY 17517 +#define ENTRY_VAZRUDEN_HERALD 17307 +#define ENTRY_VAZRUDEN 17537 +#define ENTRY_NAZAN 17536 +#define ENTRY_LIQUID_FIRE 22515 +#define ENTRY_REINFORCED_FEL_IRON_CHEST (HeroicMode?185169:185168) + +#define SAY_INTRO -1543017 +#define SAY_WIPE -1543018 +#define SAY_AGGRO_1 -1543019 +#define SAY_AGGRO_2 -1543020 +#define SAY_AGGRO_3 -1543021 +#define SAY_KILL_1 -1543022 +#define SAY_KILL_2 -1543023 +#define SAY_DIE -1543024 +#define EMOTE -1543025 + +#define PATH_ENTRY 2081 + +const float VazrudenMiddle[3] = {-1406.5, 1746.5, 81.2}; +const float VazrudenRing[2][3] = +{ + {-1430, 1705, 112}, + {-1377, 1760, 112} +}; + +struct TRINITY_DLL_DECL boss_nazanAI : public ScriptedAI +{ + boss_nazanAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + VazrudenGUID = 0; + flight = true; + } + + uint32 Fireball_Timer; + uint32 ConeOfFire_Timer; + uint32 BellowingRoar_Timer; + uint32 Fly_Timer; + uint32 Turn_Timer; + uint32 UnsummonCheck; + bool flight; + uint64 VazrudenGUID; + bool HeroicMode; + SpellEntry *liquid_fire; + + void Reset() + { + Fireball_Timer = 4000; + Fly_Timer = 45000; + Turn_Timer = 0; + UnsummonCheck = 5000; + } + + void EnterCombat(Unit* who) {} + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == ENTRY_LIQUID_FIRE) + { + summoned->SetLevel(m_creature->getLevel()); + summoned->setFaction(m_creature->getFaction()); + summoned->CastSpell(summoned,SPELL_SUMMON_LIQUID_FIRE,true); + summoned->CastSpell(summoned,SPELL_FIRE_NOVA_VISUAL,true); + } + } + + void SpellHitTarget(Unit* target, const SpellEntry* entry) + { + if (target && entry->Id == SPELL_FIREBALL) + m_creature->SummonCreature(ENTRY_LIQUID_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),target->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,30000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (UnsummonCheck < diff && m_creature->isAlive()) + { + m_creature->SetLootRecipient(NULL); + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + }else UnsummonCheck -= diff; + return; + } + + if (Fireball_Timer < diff) + { + if (Unit *victim = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(victim, SPELL_FIREBALL,true); + Fireball_Timer = 4000+rand()%3000; + }else Fireball_Timer -= diff; + + if (flight) // phase 1 - the flight + { + Creature *Vazruden = Unit::GetCreature(*m_creature,VazrudenGUID); + if (Fly_Timer < diff || !(Vazruden && Vazruden->isAlive() && (Vazruden->GetHealth()*5 > Vazruden->GetMaxHealth()))) + { + flight = false; + BellowingRoar_Timer = 6000; + ConeOfFire_Timer = 12000; + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->GetMotionMaster()->Clear(); + if (Unit *victim = SelectUnit(SELECT_TARGET_NEAREST,0)) + m_creature->AI()->AttackStart(victim); + DoStartMovement(m_creature->getVictim()); + DoScriptText(EMOTE, m_creature); + return; + }else Fly_Timer -= diff; + + if (Turn_Timer < diff) + { + uint32 waypoint = (Fly_Timer/10000)%2; + if (m_creature->IsWithinDist3d(VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2], 5)) + m_creature->GetMotionMaster()->MovePoint(0,VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2]); + Turn_Timer = 10000; + }else Turn_Timer -= diff; + } + else // phase 2 - land fight + { + if (ConeOfFire_Timer < diff) + { + DoCast(m_creature, SPELL_CONE_OF_FIRE); + ConeOfFire_Timer = 12000; + Fireball_Timer = 4000; + }else ConeOfFire_Timer -= diff; + + if (HeroicMode && BellowingRoar_Timer < diff) + { + DoCast(m_creature, SPELL_BELLOWING_ROAR); + BellowingRoar_Timer = 45000; + }else BellowingRoar_Timer -= diff; + + DoMeleeAttackIfReady(); + } + } +}; + +struct TRINITY_DLL_DECL boss_vazrudenAI : public ScriptedAI +{ + boss_vazrudenAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 Revenge_Timer; + bool HeroicMode; + bool WipeSaid; + uint32 UnsummonCheck; + + void Reset() + { + Revenge_Timer = 4000; + UnsummonCheck = 2000; + WipeSaid = false; + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + default: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void KilledUnit(Unit* who) + { + if (who && who->GetEntry()!=ENTRY_VAZRUDEN) + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + default: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void JustDied(Unit* who) + { + if (who && who != m_creature) + DoScriptText(SAY_DIE, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (UnsummonCheck < diff && m_creature->isAlive()) + { + if (!WipeSaid) + { + DoScriptText(SAY_WIPE, m_creature); + WipeSaid = true; + } + m_creature->SetLootRecipient(NULL); + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + m_creature->RemoveCorpse(); + }else UnsummonCheck -= diff; + return; + } + + if (Revenge_Timer < diff) + { + if (Unit *victim = m_creature->getVictim()) + DoCast(victim, SPELL_REVENGE); + Revenge_Timer = 5000; + }else Revenge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI +{ + boss_vazruden_the_heraldAI(Creature *c) : ScriptedAI(c) + { + summoned = false; + sentryDown = false; + NazanGUID = 0; + VazrudenGUID = 0; + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 phase; + uint32 waypoint; + uint32 check; + bool sentryDown; + uint64 NazanGUID; + uint64 VazrudenGUID; + bool summoned; + bool HeroicMode; + + void Reset() + { + phase = 0; + waypoint = 0; + check = 0; + UnsummonAdds(); + m_creature->GetMotionMaster()->MovePath(PATH_ENTRY, true); + } + + void UnsummonAdds() + { + if (summoned) + { + Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID); + Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID); + if (Nazan || (Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000))) + { + Nazan->SetLootRecipient(NULL); + Nazan->SetVisibility(VISIBILITY_OFF); + Nazan->DealDamage(Nazan, Nazan->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + Nazan->RemoveCorpse(); + NazanGUID = 0; + } + if (Vazruden || (Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000))) + { + Vazruden->SetLootRecipient(NULL); + Vazruden->SetVisibility(VISIBILITY_OFF); + Vazruden->DealDamage(Vazruden, Vazruden->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + Vazruden->RemoveCorpse(); + VazrudenGUID = 0; + } + summoned = false; + m_creature->clearUnitState(UNIT_STAT_ROOT); + m_creature->SetVisibility(VISIBILITY_ON); + } + } + + void SummonAdds() + { + if (!summoned) + { + Creature* Vazruden = m_creature->SummonCreature(ENTRY_VAZRUDEN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000); + if (Vazruden) + VazrudenGUID = Vazruden->GetGUID(); + Creature* Nazan = m_creature->SummonCreature(ENTRY_NAZAN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000); + if (Nazan) + NazanGUID = Nazan->GetGUID(); + summoned = true; + m_creature->SetVisibility(VISIBILITY_OFF); + m_creature->addUnitState(UNIT_STAT_ROOT); + } + } + + void EnterCombat(Unit *who) + { + if (phase==0) + { + phase = 1; + check = 0; + DoScriptText(SAY_INTRO, m_creature); + } + } + + void JustSummoned(Creature *summoned) + { + if (!summoned) return; + Unit *victim = m_creature->getVictim(); + if (summoned->GetEntry() == ENTRY_NAZAN) + { + CAST_AI(boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID; + summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); + summoned->SetSpeed(MOVE_FLIGHT, 2.5); + if (victim) + AttackStartNoMove(victim); + } + else if (victim) + summoned->AI()->AttackStart(victim); + } + + void SentryDownBy(Unit* killer) + { + if (sentryDown) + { + AttackStartNoMove(killer); + sentryDown = false; + } + else + sentryDown = true; + } + + void UpdateAI(const uint32 diff) + { + switch(phase) + { + case 0: // circle around the platform + return; + break; + case 1: // go to the middle and begin the fight + if (check < diff) + { + if (!m_creature->IsWithinDist3d(VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],5)) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MovePoint(0,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2]); + check = 1000; + } + else + { + SummonAdds(); + phase = 2; + return; + } + }else check -= diff; + break; + default: // adds do the job now + if (check < diff) + { + Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID); + Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID); + if (Nazan && Nazan->isAlive() || Vazruden && Vazruden->isAlive()) + { + if (Nazan && Nazan->getVictim() || Vazruden && Vazruden->getVictim()) + return; + else + { + UnsummonAdds(); + EnterEvadeMode(); + return; + } + }else + { + m_creature->SummonGameObject(ENTRY_REINFORCED_FEL_IRON_CHEST,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,0,0,0,0,0); + m_creature->SetLootRecipient(NULL); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + check = 2000; + }else check -= diff; + break; + } + } +}; + +struct TRINITY_DLL_DECL mob_hellfire_sentryAI : public ScriptedAI +{ + mob_hellfire_sentryAI(Creature *c) : ScriptedAI(c) {} + + uint32 KidneyShot_Timer; + + void Reset() + { + KidneyShot_Timer = 3000+rand()%4000; + } + + void EnterCombat(Unit* who) {} + + void JustDied(Unit* who) + { + if (Creature *herald = me->FindNearestCreature(ENTRY_VAZRUDEN_HERALD,150)) + CAST_AI(boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(who); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (KidneyShot_Timer < diff) + { + if (Unit *victim = m_creature->getVictim()) + DoCast(victim, SPELL_KIDNEY_SHOT); + KidneyShot_Timer = 20000; + }else KidneyShot_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_vazruden_the_herald(Creature* pCreature) +{ + return new boss_vazruden_the_heraldAI (pCreature); +} + +CreatureAI* GetAI_boss_vazruden(Creature* pCreature) +{ + return new boss_vazrudenAI (pCreature); +} + + +CreatureAI* GetAI_boss_nazan(Creature* pCreature) +{ + return new boss_nazanAI (pCreature); +} + +CreatureAI* GetAI_mob_hellfire_sentry(Creature* pCreature) +{ + return new mob_hellfire_sentryAI (pCreature); +} + +void AddSC_boss_vazruden_the_herald() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_vazruden_the_herald"; + newscript->GetAI = &GetAI_boss_vazruden_the_herald; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_vazruden"; + newscript->GetAI = &GetAI_boss_vazruden; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_nazan"; + newscript->GetAI = &GetAI_boss_nazan; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_hellfire_sentry"; + newscript->GetAI = &GetAI_mob_hellfire_sentry; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp new file mode 100644 index 00000000000..13059c55ff2 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp @@ -0,0 +1,168 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Watchkeeper_Gargolmar +SD%Complete: 80 +SDComment: Missing adds to heal him. Surge should be used on target furthest away, not random. +SDCategory: Hellfire Citadel, Hellfire Ramparts +EndScriptData */ + +#include "precompiled.h" + +#define SAY_TAUNT -1543000 +#define SAY_HEAL -1543001 +#define SAY_SURGE -1543002 +#define SAY_AGGRO_1 -1543003 +#define SAY_AGGRO_2 -1543004 +#define SAY_AGGRO_3 -1543005 +#define SAY_KILL_1 -1543006 +#define SAY_KILL_2 -1543007 +#define SAY_DIE -1543008 + +#define SPELL_MORTAL_WOUND 30641 +#define H_SPELL_MORTAL_WOUND 36814 +#define SPELL_SURGE 34645 +#define SPELL_RETALIATION 22857 + +struct TRINITY_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI +{ + boss_watchkeeper_gargolmarAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + + uint32 Surge_Timer; + uint32 MortalWound_Timer; + uint32 Retaliation_Timer; + + bool HasTaunted; + bool YelledForHeal; + + void Reset() + { + Surge_Timer = 5000; + MortalWound_Timer = 4000; + Retaliation_Timer = 0; + + HasTaunted = false; + YelledForHeal = false; + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void MoveInLineOfSight(Unit* who) + { + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) + { + if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + { + //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f)) + { + DoScriptText(SAY_TAUNT, m_creature); + HasTaunted = true; + } + } + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DIE, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (MortalWound_Timer < diff) + { + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_MORTAL_WOUND : SPELL_MORTAL_WOUND); + MortalWound_Timer = 5000+rand()%8000; + }else MortalWound_Timer -= diff; + + if (Surge_Timer < diff) + { + DoScriptText(SAY_SURGE, m_creature); + + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SURGE); + + Surge_Timer = 5000+rand()%8000; + }else Surge_Timer -= diff; + + if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20) + { + if (Retaliation_Timer < diff) + { + DoCast(m_creature,SPELL_RETALIATION); + Retaliation_Timer = 30000; + }else Retaliation_Timer -= diff; + } + + if (!YelledForHeal) + { + if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 40) + { + DoScriptText(SAY_HEAL, m_creature); + YelledForHeal = true; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_watchkeeper_gargolmarAI(Creature* pCreature) +{ + return new boss_watchkeeper_gargolmarAI (pCreature); +} + +void AddSC_boss_watchkeeper_gargolmar() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_watchkeeper_gargolmar"; + newscript->GetAI = &GetAI_boss_watchkeeper_gargolmarAI; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h new file mode 100644 index 00000000000..4adf140b0ca --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h @@ -0,0 +1,16 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_RAMPARTS_H +#define DEF_RAMPARTS_H + +#define MAX_ENCOUNTER 2 + +enum +{ + TYPE_VAZRUDEN = 1, + TYPE_NAZAN = 2 +}; + +#endif diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp new file mode 100644 index 00000000000..5942f0142ef --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp @@ -0,0 +1,84 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Hellfire_Ramparts +SD%Complete: 50 +SDComment: +SDCategory: Hellfire Ramparts +EndScriptData */ + +#include "precompiled.h" +#include "def_hellfire_ramparts.h" + +struct TRINITY_DLL_DECL instance_ramparts : public ScriptedInstance +{ + instance_ramparts(Map* pMap) : ScriptedInstance(pMap) {Initialize();} + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint64 m_uiChestNGUID; + uint64 m_uiChestHGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiChestNGUID = 0; + m_uiChestHGUID = 0; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 185168: m_uiChestNGUID = pGo->GetGUID(); break; + case 185169: m_uiChestHGUID = pGo->GetGUID(); break; + } + } + + void SetData(uint32 uiType, uint32 uiData) + { + debug_log("TSCR: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData); + + switch(uiType) + { + case TYPE_VAZRUDEN: + if (uiData == DONE && m_auiEncounter[1] == DONE) + DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILISECONDS); + m_auiEncounter[0] = uiData; + break; + case TYPE_NAZAN: + if (uiData == DONE && m_auiEncounter[0] == DONE) + DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILISECONDS); + m_auiEncounter[1] = uiData; + break; + } + } +}; + +InstanceData* GetInstanceData_instance_ramparts(Map* pMap) +{ + return new instance_ramparts(pMap); +} + +void AddSC_instance_ramparts() +{ + Script* pNewScript; + pNewScript = new Script; + pNewScript->Name = "instance_ramparts"; + pNewScript->GetInstanceData = &GetInstanceData_instance_ramparts; + pNewScript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp new file mode 100644 index 00000000000..8f7c076a701 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp @@ -0,0 +1,562 @@ +/* Copyright(C) 2006 - 2008 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +*(at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Magtheridon +SD%Complete: 60 +SDComment: In Development +SDCategory: Hellfire Citadel, Magtheridon's lair +EndScriptData */ + +#include "precompiled.h" +#include "def_magtheridons_lair.h" + +struct Yell +{ + int32 id; +}; + +static Yell RandomTaunt[]= +{ + {-1544000}, + {-1544001}, + {-1544002}, + {-1544003}, + {-1544004}, + {-1544005}, +}; + +#define SAY_FREED -1544006 +#define SAY_AGGRO -1544007 +#define SAY_BANISH -1544008 +#define SAY_CHAMBER_DESTROY -1544009 +#define SAY_PLAYER_KILLED -1544010 +#define SAY_DEATH -1544011 + +#define EMOTE_BERSERK -1544012 +#define EMOTE_BLASTNOVA -1544013 +#define EMOTE_BEGIN -1544014 + +#define MOB_MAGTHERIDON 17257 +#define MOB_ROOM 17516 +#define MOB_CHANNELLER 17256 +#define MOB_ABYSSAL 17454 + +#define SPELL_BLASTNOVA 30616 +#define SPELL_CLEAVE 30619 +#define SPELL_QUAKE_TRIGGER 30657 // must be cast with 30561 as the proc spell +#define SPELL_QUAKE_KNOCKBACK 30571 +#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7 +#define SPELL_BLAZE_TRAP 30542 +#define SPELL_DEBRIS_KNOCKDOWN 36449 +#define SPELL_DEBRIS_VISUAL 30632 +#define SPELL_DEBRIS_DAMAGE 30631 // core bug, does not support target 8 +#define SPELL_CAMERA_SHAKE 36455 +#define SPELL_BERSERK 27680 + +#define SPELL_SHADOW_CAGE 30168 +#define SPELL_SHADOW_GRASP 30410 +#define SPELL_SHADOW_GRASP_VISUAL 30166 +#define SPELL_MIND_EXHAUSTION 44032 //Casted by the cubes when channeling ends + +#define SPELL_SHADOW_CAGE_C 30205 +#define SPELL_SHADOW_GRASP_C 30207 + +#define SPELL_SHADOW_BOLT_VOLLEY 30510 +#define SPELL_DARK_MENDING 30528 +#define SPELL_FEAR 30530 //39176 +#define SPELL_BURNING_ABYSSAL 30511 +#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 + +#define SPELL_FIRE_BLAST 37110 + +// count of clickers needed to interrupt blast nova +#define CLICKERS_COUNT 5 + +typedef std::map CubeMap; + +struct TRINITY_DLL_DECL mob_abyssalAI : public ScriptedAI +{ + mob_abyssalAI(Creature *c) : ScriptedAI(c) + { + trigger = 0; + Despawn_Timer = 60000; + } + + uint32 FireBlast_Timer; + uint32 Despawn_Timer; + uint32 trigger; + + void Reset() + { + FireBlast_Timer = 6000; + } + + void SpellHit(Unit*, const SpellEntry *spell) + { + if (trigger == 2 && spell->Id == SPELL_BLAZE_TARGET) + { + m_creature->CastSpell(m_creature, SPELL_BLAZE_TRAP, true); + m_creature->SetVisibility(VISIBILITY_OFF); + Despawn_Timer = 130000; + } + } + + void SetTrigger(uint32 _trigger) + { + trigger = _trigger; + m_creature->SetDisplayId(11686); + if (trigger == 1) //debris + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->CastSpell(m_creature, SPELL_DEBRIS_VISUAL, true); + FireBlast_Timer = 5000; + Despawn_Timer = 10000; + } + } + + void EnterCombat(Unit* who) {DoZoneInCombat();} + void AttackStart(Unit *who) {if (!trigger) ScriptedAI::AttackStart(who);} + void MoveInLineOfSight(Unit *who) {if (!trigger) ScriptedAI::MoveInLineOfSight(who);} + + void UpdateAI(const uint32 diff) + { + if (trigger) + { + if (trigger == 1) + { + if (FireBlast_Timer < diff) + { + m_creature->CastSpell(m_creature, SPELL_DEBRIS_DAMAGE, true); + trigger = 3; + }else FireBlast_Timer -= diff; + } + return; + } + + if (Despawn_Timer < diff) + { + m_creature->ForcedDespawn(); + }else Despawn_Timer -= diff; + + if (!UpdateVictim()) + return; + + if (FireBlast_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_FIRE_BLAST); + FireBlast_Timer = 5000+rand()%10000; + }else FireBlast_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI +{ + boss_magtheridonAI(Creature *c) : ScriptedAI(c) + { + pInstance =m_creature->GetInstanceData(); + m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); + m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); + + // target 7, random target with certain entry spell, need core fix + SpellEntry *TempSpell; + TempSpell = GET_SPELL(SPELL_BLAZE_TARGET); + if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 6) + { + TempSpell->EffectImplicitTargetA[0] = 6; + TempSpell->EffectImplicitTargetB[0] = 0; + } + TempSpell = GET_SPELL(SPELL_QUAKE_TRIGGER); + if (TempSpell && TempSpell->EffectTriggerSpell[0] != SPELL_QUAKE_KNOCKBACK) + { + TempSpell->EffectTriggerSpell[0] = SPELL_QUAKE_KNOCKBACK; + } + } + + CubeMap Cube; + + ScriptedInstance* pInstance; + + uint32 Berserk_Timer; + uint32 Quake_Timer; + uint32 Cleave_Timer; + uint32 BlastNova_Timer; + uint32 Blaze_Timer; + uint32 Debris_Timer; + uint32 RandChat_Timer; + + bool Phase3; + bool NeedCheckCube; + + void Reset() + { + if (pInstance) + { + pInstance->SetData(DATA_MAGTHERIDON_EVENT, NOT_STARTED); + pInstance->SetData(DATA_COLLAPSE, false); + } + + Berserk_Timer = 1320000; + Quake_Timer = 40000; + Debris_Timer = 10000; + Blaze_Timer = 10000+rand()%20000; + BlastNova_Timer = 60000; + Cleave_Timer = 15000; + RandChat_Timer = 90000; + + Phase3 = false; + NeedCheckCube = false; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->addUnitState(UNIT_STAT_STUNNED); + m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE_C, true); + } + + void SetClicker(uint64 cubeGUID, uint64 clickerGUID) + { + // to avoid multiclicks from 1 cube + if (uint64 guid = Cube[cubeGUID]) + DebuffClicker(Unit::GetUnit(*m_creature, guid)); + Cube[cubeGUID] = clickerGUID; + NeedCheckCube = true; + } + + //function to interrupt channeling and debuff clicker with mind exh(used if second person clicks with same cube or after dispeling/ending shadow grasp DoT) + void DebuffClicker(Unit *clicker) + { + if (!clicker || !clicker->isAlive()) + return; + + clicker->RemoveAurasDueToSpell(SPELL_SHADOW_GRASP); // cannot interrupt triggered spells + clicker->InterruptNonMeleeSpells(false); + clicker->CastSpell(clicker, SPELL_MIND_EXHAUSTION, true); + } + + void NeedCheckCubeStatus() + { + uint32 ClickerNum = 0; + // now checking if every clicker has debuff from manticron(it is dispelable atm rev 6110 : S) + // if not - apply mind exhaustion and delete from clicker's list + for(CubeMap::iterator i = Cube.begin(); i != Cube.end(); ++i) + { + Unit *clicker = Unit::GetUnit(*m_creature, (*i).second); + if (!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP)) + { + DebuffClicker(clicker); + (*i).second = 0; + }else ClickerNum++; + } + + // if 5 clickers from other cubes apply shadow cage + if (ClickerNum >= CLICKERS_COUNT && !m_creature->HasAura(SPELL_SHADOW_CAGE)) + { + DoScriptText(SAY_BANISH, m_creature); + m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE, true); + } + else if (ClickerNum < CLICKERS_COUNT && m_creature->HasAura(SPELL_SHADOW_CAGE)) + m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE); + + if (!ClickerNum) NeedCheckCube = false; + } + + void KilledUnit(Unit* victim) + { + DoScriptText(SAY_PLAYER_KILLED, m_creature); + } + + void JustDied(Unit* Killer) + { + if (pInstance) + pInstance->SetData(DATA_MAGTHERIDON_EVENT, DONE); + + DoScriptText(SAY_DEATH, m_creature); + } + + void MoveInLineOfSight(Unit* who) {} + + void AttackStart(Unit *who) + { + if (!m_creature->hasUnitState(UNIT_STAT_STUNNED)) + ScriptedAI::AttackStart(who); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_MAGTHERIDON_EVENT, IN_PROGRESS); + DoZoneInCombat(); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE_C); + + DoScriptText(SAY_FREED, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->isInCombat()) + { + if (RandChat_Timer < diff) + { + DoScriptText(RandomTaunt[rand()%6].id, m_creature); + RandChat_Timer = 90000; + }else RandChat_Timer -= diff; + } + + if (!UpdateVictim()) + return; + + if (NeedCheckCube) NeedCheckCubeStatus(); + + if (Berserk_Timer < diff) + { + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + DoScriptText(EMOTE_BERSERK, m_creature); + Berserk_Timer = 60000; + }else Berserk_Timer -= diff; + + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CLEAVE); + Cleave_Timer = 10000; + }else Cleave_Timer -= diff; + + if (BlastNova_Timer < diff) + { + // to avoid earthquake interruption + if (!m_creature->hasUnitState(UNIT_STAT_STUNNED)) + { + DoScriptText(EMOTE_BLASTNOVA, m_creature); + DoCast(m_creature, SPELL_BLASTNOVA); + BlastNova_Timer = 60000; + } + }else BlastNova_Timer -= diff; + + if (Quake_Timer < diff) + { + // to avoid blastnova interruption + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + m_creature->CastSpell(m_creature, SPELL_QUAKE_TRIGGER, true); + Quake_Timer = 50000; + } + }else Quake_Timer -= diff; + + if (Blaze_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + float x, y, z; + target->GetPosition(x, y, z); + Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (summon) + { + CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(2); + m_creature->CastSpell(summon, SPELL_BLAZE_TARGET, true); + summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + } + } + Blaze_Timer = 20000 + rand()%20000; + }else Blaze_Timer -= diff; + + if (!Phase3 && m_creature->GetHealth()*10 < m_creature->GetMaxHealth()*3 + && !m_creature->IsNonMeleeSpellCasted(false) // blast nova + && !m_creature->hasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake + { + Phase3 = true; + DoScriptText(SAY_CHAMBER_DESTROY, m_creature); + m_creature->CastSpell(m_creature, SPELL_CAMERA_SHAKE, true); + m_creature->CastSpell(m_creature, SPELL_DEBRIS_KNOCKDOWN, true); + + if (pInstance) + pInstance->SetData(DATA_COLLAPSE, true); + } + + if (Phase3) + { + if (Debris_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + float x, y, z; + target->GetPosition(x, y, z); + Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); + if (summon) CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(1); + } + Debris_Timer = 10000; + }else Debris_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI +{ + mob_hellfire_channelerAI(Creature *c) : ScriptedAI(c) + { + pInstance =m_creature->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 ShadowBoltVolley_Timer; + uint32 DarkMending_Timer; + uint32 Fear_Timer; + uint32 Infernal_Timer; + + uint32 Check_Timer; + + void Reset() + { + ShadowBoltVolley_Timer = 8000 + rand()%2000; + DarkMending_Timer = 10000; + Fear_Timer = 15000 + rand()%5000; + Infernal_Timer = 10000 + rand()%40000; + + Check_Timer = 5000; + + if (pInstance) + pInstance->SetData(DATA_CHANNELER_EVENT, NOT_STARTED); + + m_creature->CastSpell(m_creature, SPELL_SHADOW_GRASP_C, false); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_CHANNELER_EVENT, IN_PROGRESS); + + m_creature->InterruptNonMeleeSpells(false); + DoZoneInCombat(); + } + + void JustSummoned(Creature *summon) {summon->AI()->AttackStart(m_creature->getVictim());} + + void MoveInLineOfSight(Unit* who) {} + + void DamageTaken(Unit*, uint32 &damage) + { + if (damage >= m_creature->GetHealth()) + m_creature->CastSpell(m_creature, SPELL_SOUL_TRANSFER, true); + } + + void JustDied(Unit* who) + { + if (pInstance) + pInstance->SetData(DATA_CHANNELER_EVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ShadowBoltVolley_Timer < diff) + { + DoCast(m_creature, SPELL_SHADOW_BOLT_VOLLEY); + ShadowBoltVolley_Timer = 10000 + rand()%10000; + }else ShadowBoltVolley_Timer -= diff; + + if (DarkMending_Timer < diff) + { + if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) + DoCast(m_creature, SPELL_DARK_MENDING); + DarkMending_Timer = 10000 +(rand() % 10000); + }else DarkMending_Timer -= diff; + + if (Fear_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1)) + DoCast(target, SPELL_FEAR); + Fear_Timer = 25000 + rand()%15000; + }else Fear_Timer -= diff; + + if (Infernal_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + m_creature->CastSpell(target, SPELL_BURNING_ABYSSAL, true); + Infernal_Timer = 30000 + rand()%10000; + }else Infernal_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Manticron Cube +bool GOHello_go_Manticron_Cube(Player* pPlayer, GameObject* pGo) +{ + ScriptedInstance* pInstance = pGo->GetInstanceData(); + if (!pInstance) return true; + if (pInstance->GetData(DATA_MAGTHERIDON_EVENT) != IN_PROGRESS) return true; + Creature *Magtheridon =Unit::GetCreature(*pGo, pInstance->GetData64(DATA_MAGTHERIDON)); + if (!Magtheridon || !Magtheridon->isAlive()) return true; + + // if exhausted or already channeling return + if (pPlayer->HasAura(SPELL_MIND_EXHAUSTION) || pPlayer->HasAura(SPELL_SHADOW_GRASP)) + return true; + + pPlayer->InterruptNonMeleeSpells(false); + pPlayer->CastSpell(pPlayer, SPELL_SHADOW_GRASP, true); + pPlayer->CastSpell(pPlayer, SPELL_SHADOW_GRASP_VISUAL, false); + CAST_AI(boss_magtheridonAI, Magtheridon->AI())->SetClicker(pGo->GetGUID(), pPlayer->GetGUID()); + return true; +} + +CreatureAI* GetAI_boss_magtheridon(Creature* pCreature) +{ + return new boss_magtheridonAI(pCreature); +} + +CreatureAI* GetAI_mob_hellfire_channeler(Creature* pCreature) +{ + return new mob_hellfire_channelerAI(pCreature); +} + +CreatureAI* GetAI_mob_abyssalAI(Creature* pCreature) +{ + return new mob_abyssalAI(pCreature); +} + +void AddSC_boss_magtheridon() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_magtheridon"; + newscript->GetAI = &GetAI_boss_magtheridon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_hellfire_channeler"; + newscript->GetAI = &GetAI_mob_hellfire_channeler; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="go_manticron_cube"; + newscript->pGOHello = &GOHello_go_Manticron_Cube; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_abyssal"; + newscript->GetAI = &GetAI_mob_abyssalAI; + newscript->RegisterSelf(); + +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h new file mode 100644 index 00000000000..c5469acaea0 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h @@ -0,0 +1,14 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_MAGTHERIDONS_LAIR_H +#define DEF_MAGTHERIDONS_LAIR_H + +#define DATA_MAGTHERIDON_EVENT 1 +#define DATA_MAGTHERIDON 3 +#define DATA_CHANNELER_EVENT 2 +#define DATA_COLLAPSE 6 +#define DATA_CHANNELER 9 +#endif + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp new file mode 100644 index 00000000000..eb8e9b1a961 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp @@ -0,0 +1,249 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Magtheridons_Lair +SD%Complete: 100 +SDComment: +SDCategory: Hellfire Citadel, Magtheridon's lair +EndScriptData */ + +#include "precompiled.h" +#include "def_magtheridons_lair.h" + +#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 +#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7 + +#define CHAMBER_CENTER_X -15.14 +#define CHAMBER_CENTER_Y 1.8 +#define CHAMBER_CENTER_Z -0.4 + +#define MAX_ENCOUNTER 2 + +struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance +{ + instance_magtheridons_lair(Map* pMap) : ScriptedInstance(pMap) + { + Initialize(); + } + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + uint64 MagtheridonGUID; + std::set ChannelerGUID; + uint64 DoorGUID; + std::set ColumnGUID; + + uint32 CageTimer; + uint32 RespawnTimer; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + MagtheridonGUID = 0; + ChannelerGUID.clear(); + DoorGUID = 0; + ColumnGUID.clear(); + + CageTimer = 0; + RespawnTimer = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + return false; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 17257: + MagtheridonGUID = pCreature->GetGUID(); + break; + case 17256: + ChannelerGUID.insert(pCreature->GetGUID()); + break; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case 181713: + pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 0); + break; + case 183847: + DoorGUID = pGo->GetGUID(); + break; + case 184653: // hall + case 184634: // six columns + case 184635: + case 184636: + case 184637: + case 184638: + case 184639: + ColumnGUID.insert(pGo->GetGUID()); + break; + } + } + + uint64 GetData64(uint32 type) + { + switch(type) + { + case DATA_MAGTHERIDON: + return MagtheridonGUID; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_MAGTHERIDON_EVENT: + m_auiEncounter[0] = data; + if (data == NOT_STARTED) + RespawnTimer = 10000; + if (data != IN_PROGRESS) + HandleGameObject(DoorGUID, true); + break; + case DATA_CHANNELER_EVENT: + switch(data) + { + case NOT_STARTED: // Reset all channelers once one is reset. + if (m_auiEncounter[1] != NOT_STARTED) + { + m_auiEncounter[1] = NOT_STARTED; + for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + if (Creature *Channeler = instance->GetCreature(*i)) + { + if (Channeler->isAlive()) + Channeler->AI()->EnterEvadeMode(); + else + Channeler->Respawn(); + } + } + CageTimer = 0; + HandleGameObject(DoorGUID, true); + }break; + case IN_PROGRESS: // Event start. + if (m_auiEncounter[1] != IN_PROGRESS) + { + m_auiEncounter[1] = IN_PROGRESS; + // Let all five channelers aggro. + for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + Creature *Channeler = instance->GetCreature(*i); + if (Channeler && Channeler->isAlive()) + Channeler->AI()->AttackStart(Channeler->SelectNearestTarget(999)); + } + // Release Magtheridon after two minutes. + Creature *Magtheridon = instance->GetCreature(MagtheridonGUID); + if (Magtheridon && Magtheridon->isAlive()) + { + Magtheridon->MonsterTextEmote("'s bonds begin to weaken!", 0); + CageTimer = 120000; + } + HandleGameObject(DoorGUID, false); + }break; + case DONE: // Add buff and check if all channelers are dead. + for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + Creature *Channeler = instance->GetCreature(*i); + if (Channeler && Channeler->isAlive()) + { + //Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true); + data = IN_PROGRESS; + break; + } + }break; + } + m_auiEncounter[1] = data; + break; + case DATA_COLLAPSE: + // true - collapse / false - reset + for(std::set::iterator i = ColumnGUID.begin(); i != ColumnGUID.end(); ++i) + DoUseDoorOrButton(*i); + break; + default: + break; + } + } + + uint32 GetData(uint32 type) + { + if (type == DATA_MAGTHERIDON_EVENT) + return m_auiEncounter[0]; + return 0; + } + + void Update(uint32 diff) + { + if (CageTimer) + { + if (CageTimer <= diff) + { + Creature *Magtheridon = instance->GetCreature(MagtheridonGUID); + if (Magtheridon && Magtheridon->isAlive()) + { + Magtheridon->clearUnitState(UNIT_STAT_STUNNED); + Magtheridon->AI()->AttackStart(Magtheridon->SelectNearestTarget(999)); + } + CageTimer = 0; + }else CageTimer -= diff; + } + + if (RespawnTimer) + { + if (RespawnTimer <= diff) + { + for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) + { + if (Creature *Channeler = instance->GetCreature(*i)) + { + if (Channeler->isAlive()) + Channeler->AI()->EnterEvadeMode(); + else + Channeler->Respawn(); + } + } + RespawnTimer = 0; + }else RespawnTimer -= diff; + } + } +}; + +InstanceData* GetInstanceData_instance_magtheridons_lair(Map* pMap) +{ + return new instance_magtheridons_lair(pMap); +} + +void AddSC_instance_magtheridons_lair() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_magtheridons_lair"; + newscript->GetInstanceData = &GetInstanceData_instance_magtheridons_lair; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp new file mode 100644 index 00000000000..721d1efd03c --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_nethekurse.cpp @@ -0,0 +1,412 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Grand_Warlock_Nethekurse +SD%Complete: 75 +SDComment: encounter not fully completed. missing part where boss kill minions. +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +/* ContentData +boss_grand_warlock_nethekurse +mob_fel_orc_convert +mob_lesser_shadow_fissure +EndContentData */ + +#include "precompiled.h" +#include "def_shattered_halls.h" + +struct Say +{ + int32 id; +}; + +static Say PeonAttacked[]= +{ + {-1540001}, + {-1540002}, + {-1540003}, + {-1540004}, +}; +static Say PeonDies[]= +{ + {-1540005}, + {-1540006}, + {-1540007}, + {-1540008}, +}; + +#define SAY_INTRO -1540000 +#define SAY_TAUNT_1 -1540009 +#define SAY_TAUNT_2 -1540010 +#define SAY_TAUNT_3 -1540011 +#define SAY_AGGRO_1 -1540012 +#define SAY_AGGRO_2 -1540013 +#define SAY_AGGRO_3 -1540014 +#define SAY_SLAY_1 -1540015 +#define SAY_SLAY_2 -1540016 +#define SAY_DIE -1540017 + +#define SPELL_DEATH_COIL 30500 +#define SPELL_DARK_SPIN 30502 // core bug spell attack caster :D +#define SPELL_SHADOW_FISSURE 30496 // Summon the ShadowFissure NPC + +#define SPELL_SHADOW_CLEAVE 30495 +#define H_SPELL_SHADOW_SLAM 35953 + +#define SPELL_HEMORRHAGE 30478 + +#define SPELL_CONSUMPTION 30497 +#define SPELL_TEMPORARY_VISUAL 39312 // this is wrong, a temporary solution. spell consumption already has the purple visual, but doesn't display as it should + +struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI +{ + boss_grand_warlock_nethekurseAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + bool IntroOnce; + bool IsIntroEvent; + bool IsMainEvent; + bool SpinOnce; + //bool HasTaunted; + bool Phase; + + uint32 PeonEngagedCount; + uint32 PeonKilledCount; + + uint32 IntroEvent_Timer; + uint32 DeathCoil_Timer; + uint32 ShadowFissure_Timer; + uint32 Cleave_Timer; + + void Reset() + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + IsIntroEvent = false; + IntroOnce = false; + IsMainEvent = false; + //HasTaunted = false; + SpinOnce = false; + Phase = false; + + PeonEngagedCount = 0; + PeonKilledCount = 0; + + IntroEvent_Timer = 90000; //how long before getting bored and kills his minions? + DeathCoil_Timer = 20000; + ShadowFissure_Timer = 8000; + Cleave_Timer = 5000; + } + + void DoYellForPeonAggro() + { + if (PeonEngagedCount >= 4) + return; + + DoScriptText(PeonAttacked[PeonEngagedCount].id, m_creature); + ++PeonEngagedCount; + } + + void DoYellForPeonDeath() + { + if (PeonKilledCount >= 4) + return; + + DoScriptText(PeonDies[PeonKilledCount].id, m_creature); + ++PeonKilledCount; + + if (PeonKilledCount == 4) + { + IsIntroEvent = false; + IsMainEvent = true; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + } + + void DoTauntPeons() + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_TAUNT_1, m_creature); break; + case 1: DoScriptText(SAY_TAUNT_2, m_creature); break; + case 2: DoScriptText(SAY_TAUNT_3, m_creature); break; + } + + //TODO: kill the peons first + IsIntroEvent = false; + PeonEngagedCount = 4; + PeonKilledCount = 4; + IsMainEvent = true; + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + void AttackStart(Unit* who) + { + if (IsIntroEvent || !IsMainEvent) + return; + + if (m_creature->Attack(who, true)) + { + if (Phase) DoStartNoMovement(who); + else DoStartMovement(who); + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!IntroOnce && m_creature->IsWithinDistInMap(who, 50.0f)) + { + if (who->GetTypeId() != TYPEID_PLAYER) + return; + + DoScriptText(SAY_INTRO, m_creature); + IntroOnce = true; + IsIntroEvent = true; + + if (pInstance) + pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); + } + + if (IsIntroEvent || !IsMainEvent) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + summoned->setFaction(16); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + //triggered spell of consumption does not properly show it's SpellVisual, wrong spellid? + summoned->CastSpell(summoned,SPELL_TEMPORARY_VISUAL,true); + summoned->CastSpell(summoned,SPELL_CONSUMPTION,false,0,0,m_creature->GetGUID()); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DIE, m_creature); + + if (!pInstance) + return; + + pInstance->SetData(TYPE_NETHEKURSE,DONE); + pInstance->HandleGameObject(pInstance->GetData64(DATA_NETHEKURSE_DOOR), true); + } + + void UpdateAI(const uint32 diff) + { + if (IsIntroEvent) + { + if (!pInstance) + return; + + if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) + { + if (IntroEvent_Timer < diff) + { + DoTauntPeons(); + }else IntroEvent_Timer -= diff; + } + } + + if (!UpdateVictim()) + return; + + if (!IsMainEvent) + return; + + if (Phase) + { + if (!SpinOnce) + { + DoCast(m_creature->getVictim(),SPELL_DARK_SPIN); + SpinOnce = true; + } + + if (Cleave_Timer < diff) + { + DoCast(m_creature->getVictim(),(HeroicMode ? H_SPELL_SHADOW_SLAM : SPELL_SHADOW_CLEAVE)); + Cleave_Timer = 6000+rand()%2500; + }else Cleave_Timer -= diff; + } + else + { + if (ShadowFissure_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_FISSURE); + ShadowFissure_Timer = 7500+rand()%7500; + }else ShadowFissure_Timer -= diff; + + if (DeathCoil_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_DEATH_COIL); + DeathCoil_Timer = 15000+rand()%5000; + }else DeathCoil_Timer -= diff; + + if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20) + Phase = true; + + DoMeleeAttackIfReady(); + } + } +}; + +struct TRINITY_DLL_DECL mob_fel_orc_convertAI : public ScriptedAI +{ + mob_fel_orc_convertAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + uint32 Hemorrhage_Timer; + + void Reset() + { + m_creature->SetNoCallAssistance(true); //we don't want any assistance (WE R HEROZ!) + Hemorrhage_Timer = 3000; + } + + void MoveInLineOfSight(Unit *who) + { + } + + void EnterCombat(Unit* who) + { + if (pInstance) + { + if (pInstance->GetData64(DATA_NETHEKURSE)) + { + Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE)); + if (pKurse && m_creature->IsWithinDist(pKurse, 45.0f)) + { + CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonAggro(); + + if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) + return; + else pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); + } + } + } + } + + void JustDied(Unit* Killer) + { + if (pInstance) + { + if (pInstance->GetData(TYPE_NETHEKURSE) != IN_PROGRESS) + return; + if (pInstance->GetData64(DATA_NETHEKURSE)) + { + Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE)); + if (pKurse) + CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonDeath(); + } + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Hemorrhage_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_HEMORRHAGE); + Hemorrhage_Timer = 15000; + }else Hemorrhage_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//NOTE: this Creature are also summoned by other spells, for different creatures +struct TRINITY_DLL_DECL mob_lesser_shadow_fissureAI : public ScriptedAI +{ + mob_lesser_shadow_fissureAI(Creature *c) : ScriptedAI(c) {} + + void Reset() { } + void MoveInLineOfSight(Unit *who) { } + void AttackStart(Unit* who) { } + void EnterCombat(Unit* who) { } +}; + +CreatureAI* GetAI_boss_grand_warlock_nethekurse(Creature* pCreature) +{ + return new boss_grand_warlock_nethekurseAI (pCreature); +} + +CreatureAI* GetAI_mob_fel_orc_convert(Creature* pCreature) +{ + return new mob_fel_orc_convertAI (pCreature); +} + +CreatureAI* GetAI_mob_lesser_shadow_fissure(Creature* pCreature) +{ + return new mob_lesser_shadow_fissureAI (pCreature); +} + +void AddSC_boss_grand_warlock_nethekurse() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_grand_warlock_nethekurse"; + newscript->GetAI = &GetAI_boss_grand_warlock_nethekurse; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_fel_orc_convert"; + newscript->GetAI = &GetAI_mob_fel_orc_convert; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_lesser_shadow_fissure"; + newscript->GetAI = &GetAI_mob_lesser_shadow_fissure; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp new file mode 100644 index 00000000000..0681e94e2b0 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp @@ -0,0 +1,408 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warbringer_Omrogg +SD%Complete: 85 +SDComment: Heroic enabled. Spell timing may need additional tweaks +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +/* ContentData +mob_omrogg_heads +boss_warbringer_omrogg +EndContentData */ + +#include "precompiled.h" +#include "def_shattered_halls.h" + +enum +{ + YELL_DIE_L = -1540039, + YELL_DIE_R = -1540040, + EMOTE_ENRAGE = -1540041, + + SPELL_BLAST_WAVE = 30600, + SPELL_FEAR = 30584, + SPELL_THUNDERCLAP = 30633, + + SPELL_BURNING_MAUL = 30598, + H_SPELL_BURNING_MAUL = 36056, + + NPC_LEFT_HEAD = 19523, + NPC_RIGHT_HEAD = 19524 +}; + +struct Yell +{ + int32 id; + uint32 creature; +}; + +static Yell GoCombat[]= +{ + {-1540018, NPC_LEFT_HEAD}, + {-1540019, NPC_LEFT_HEAD}, + {-1540020, NPC_LEFT_HEAD}, +}; +static Yell GoCombatDelay[]= +{ + {-1540021, NPC_RIGHT_HEAD}, + {-1540022, NPC_RIGHT_HEAD}, + {-1540023, NPC_RIGHT_HEAD}, +}; + +static Yell Threat[]= +{ + {-1540024, NPC_LEFT_HEAD}, + {-1540025, NPC_RIGHT_HEAD}, + {-1540026, NPC_LEFT_HEAD}, + {-1540027, NPC_LEFT_HEAD}, +}; +static Yell ThreatDelay1[]= +{ + {-1540028, NPC_RIGHT_HEAD}, + {-1540029, NPC_LEFT_HEAD}, + {-1540030, NPC_RIGHT_HEAD}, + {-1540031, NPC_RIGHT_HEAD}, +}; +static Yell ThreatDelay2[]= +{ + {-1540032, NPC_LEFT_HEAD}, + {-1540033, NPC_RIGHT_HEAD}, + {-1540034, NPC_LEFT_HEAD}, + {-1540035, NPC_LEFT_HEAD}, +}; + +static Yell Killing[]= +{ + {-1540036, NPC_LEFT_HEAD}, + {-1540037, NPC_RIGHT_HEAD}, +}; +static Yell KillingDelay[]= +{ + {-1540038, NPC_RIGHT_HEAD}, + {-1000000, NPC_LEFT_HEAD}, +}; + +struct TRINITY_DLL_DECL mob_omrogg_headsAI : public ScriptedAI +{ + mob_omrogg_headsAI(Creature *c) : ScriptedAI(c) {} + + bool DeathYell; + uint32 Death_Timer; + + void Reset() + { + Death_Timer = 4000; + DeathYell = false; + } + void EnterCombat(Unit* who) { } + + void DoDeathYell() + { + DeathYell = true; + } + + void UpdateAI(const uint32 diff) + { + if (!DeathYell) + return; + + if (Death_Timer < diff) + { + DoScriptText(YELL_DIE_R, m_creature); + Death_Timer = false; + m_creature->setDeathState(JUST_DIED); + }else Death_Timer -= diff; + } +}; + +struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI +{ + boss_warbringer_omroggAI(Creature *c) : ScriptedAI(c) + { + LeftHeadGUID = 0; + RightHeadGUID = 0; + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + uint64 LeftHeadGUID; + uint64 RightHeadGUID; + int iaggro; + int ithreat; + int ikilling; + + bool AggroYell; + bool ThreatYell; + bool ThreatYell2; + bool KillingYell; + + uint32 Delay_Timer; + uint32 BlastWave_Timer; + uint32 BlastCount; + uint32 Fear_Timer; + uint32 BurningMaul_Timer; + uint32 ThunderClap_Timer; + uint32 ResetThreat_Timer; + + void Reset() + { + if (Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID)) + { + pLeftHead->setDeathState(JUST_DIED); + LeftHeadGUID = 0; + } + + if (Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID)) + { + pRightHead->setDeathState(JUST_DIED); + RightHeadGUID = 0; + } + + + AggroYell = false; + ThreatYell = false; + ThreatYell2 = false; + KillingYell = false; + + Delay_Timer = 4000; + BlastWave_Timer = 0; + BlastCount = 0; + Fear_Timer = 8000; + BurningMaul_Timer = 25000; + ThunderClap_Timer = 15000; + ResetThreat_Timer = 30000; + + if (pInstance) + pInstance->SetData(TYPE_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid. + } + + void DoYellForThreat() + { + Unit *pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); + Unit *pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); + + if (!pLeftHead || !pRightHead) + return; + + ithreat = rand()%4; + + Unit *source = (pLeftHead->GetEntry() == Threat[ithreat].creature ? pLeftHead : pRightHead); + + DoScriptText(Threat[ithreat].id, source); + + Delay_Timer = 3500; + ThreatYell = true; + } + + void EnterCombat(Unit *who) + { + m_creature->SummonCreature(NPC_LEFT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); + m_creature->SummonCreature(NPC_RIGHT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); + + if (Unit *pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID)) + { + iaggro = rand()%3; + + DoScriptText(GoCombat[iaggro].id, pLeftHead); + + Delay_Timer = 3500; + AggroYell = true; + } + + if (pInstance) + pInstance->SetData(TYPE_OMROGG, IN_PROGRESS); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == NPC_LEFT_HEAD) + LeftHeadGUID = summoned->GetGUID(); + + if (summoned->GetEntry() == NPC_RIGHT_HEAD) + RightHeadGUID = summoned->GetGUID(); + + //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + summoned->SetVisibility(VISIBILITY_OFF); + } + + void KilledUnit(Unit* victim) + { + Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); + Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); + + + if (!pLeftHead || !pRightHead) + return; + + ikilling = rand()%2; + + Unit *source = (pLeftHead->GetEntry() == Killing[ikilling].creature ? pLeftHead : pRightHead); + + switch(ikilling) + { + case 0: + DoScriptText(Killing[ikilling].id, source); + Delay_Timer = 3500; + KillingYell = true; + break; + case 1: + DoScriptText(Killing[ikilling].id, source); + KillingYell = false; + break; + } + } + + void JustDied(Unit* Killer) + { + Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); + Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); + + if (!pLeftHead || !pRightHead) + return; + + DoScriptText(YELL_DIE_L, pLeftHead); + + CAST_AI(mob_omrogg_headsAI, CAST_CRE(pRightHead)->AI())->DoDeathYell(); + + if (pInstance) + pInstance->SetData(TYPE_OMROGG, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (Delay_Timer < diff) + { + Delay_Timer = 3500; + + Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); + Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); + + if (!pLeftHead || !pRightHead) + return; + + if (AggroYell) + { + DoScriptText(GoCombatDelay[iaggro].id, pRightHead); + AggroYell = false; + } + + if (ThreatYell2) + { + Unit *source = (pLeftHead->GetEntry() == ThreatDelay2[ithreat].creature ? pLeftHead : pRightHead); + + DoScriptText(ThreatDelay2[ithreat].id, source); + ThreatYell2 = false; + } + + if (ThreatYell) + { + Unit *source = (pLeftHead->GetEntry() == ThreatDelay1[ithreat].creature ? pLeftHead : pRightHead); + + DoScriptText(ThreatDelay1[ithreat].id, source); + ThreatYell = false; + ThreatYell2 = true; + } + + if (KillingYell) + { + Unit *source = (pLeftHead->GetEntry() == KillingDelay[ikilling].creature ? pLeftHead : pRightHead); + + DoScriptText(KillingDelay[ikilling].id, source); + KillingYell = false; + } + }else Delay_Timer -= diff; + + if (!UpdateVictim()) + return; + + if (BlastCount && BlastWave_Timer <= diff) + { + DoCast(m_creature,SPELL_BLAST_WAVE); + BlastWave_Timer = 5000; + ++BlastCount; + + if (BlastCount == 3) + BlastCount = 0; + }else BlastWave_Timer -= diff; + + if (BurningMaul_Timer < diff) + { + DoScriptText(EMOTE_ENRAGE, m_creature); + DoCast(m_creature,HeroicMode ? H_SPELL_BURNING_MAUL : SPELL_BURNING_MAUL); + BurningMaul_Timer = 40000; + BlastWave_Timer = 16000; + BlastCount = 1; + }else BurningMaul_Timer -= diff; + + if (ResetThreat_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + DoYellForThreat(); + DoResetThreat(); + m_creature->AddThreat(target, 0.0f); + } + ResetThreat_Timer = 25000+rand()%15000; + }else ResetThreat_Timer -= diff; + + if (Fear_Timer < diff) + { + DoCast(m_creature,SPELL_FEAR); + Fear_Timer = 15000+rand()%20000; + }else Fear_Timer -= diff; + + if (ThunderClap_Timer < diff) + { + DoCast(m_creature,SPELL_THUNDERCLAP); + ThunderClap_Timer = 15000+rand()%15000; + }else ThunderClap_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_warbringer_omrogg(Creature* pCreature) +{ + return new boss_warbringer_omroggAI (pCreature); +} + +CreatureAI* GetAI_mob_omrogg_heads(Creature* pCreature) +{ + return new mob_omrogg_headsAI (pCreature); +} + +void AddSC_boss_warbringer_omrogg() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_warbringer_omrogg"; + newscript->GetAI = &GetAI_boss_warbringer_omrogg; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_omrogg_heads"; + newscript->GetAI = &GetAI_mob_omrogg_heads; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp new file mode 100644 index 00000000000..4fa673f3560 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp @@ -0,0 +1,303 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Warchief_Kargath_Bladefist +SD%Complete: 90 +SDComment: +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +/* ContentData +boss_warchief_kargath_bladefist +EndContentData */ + +#include "precompiled.h" + +#define SAY_AGGRO1 -1540042 +#define SAY_AGGRO2 -1540043 +#define SAY_AGGRO3 -1540044 +#define SAY_SLAY1 -1540045 +#define SAY_SLAY2 -1540046 +#define SAY_DEATH -1540047 + +#define SPELL_BLADE_DANCE 30739 +#define H_SPELL_CHARGE 25821 + +#define TARGET_NUM 5 + +#define MOB_SHATTERED_ASSASSIN 17695 +#define MOB_HEARTHEN_GUARD 17621 +#define MOB_SHARPSHOOTER_GUARD 17622 +#define MOB_REAVER_GUARD 17623 + +float AssassEntrance[3] = {275.136,-84.29,2.3}; // y -8 +float AssassExit[3] = {184.233,-84.29,2.3}; // y -8 +float AddsEntrance[3] = {306.036,-84.29,1.93}; + +struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI +{ + boss_warchief_kargath_bladefistAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance* pInstance; + bool HeroicMode; + + std::vector adds; + std::vector assassins; + + uint32 Charge_timer; + uint32 Blade_Dance_Timer; + uint32 Summon_Assistant_Timer; + uint32 resetcheck_timer; + uint32 Wait_Timer; + + uint32 Assassins_Timer; + + uint32 summoned; + bool InBlade; + + uint32 target_num; + + void Reset() + { + removeAdds(); + + m_creature->SetSpeed(MOVE_RUN,2); + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + + summoned = 2; + InBlade = false; + Wait_Timer = 0; + + Charge_timer = 0; + Blade_Dance_Timer = 45000; + Summon_Assistant_Timer = 30000; + Assassins_Timer = 5000; + resetcheck_timer = 5000; + } + + void EnterCombat(Unit *who) + { + switch (rand()%3) + { + case 0:DoScriptText(SAY_AGGRO1, m_creature);break; + case 1:DoScriptText(SAY_AGGRO2, m_creature);break; + case 2:DoScriptText(SAY_AGGRO3, m_creature);break; + } + } + + void JustSummoned(Creature *summoned) + { + switch(summoned->GetEntry()) + { + case MOB_HEARTHEN_GUARD: + case MOB_SHARPSHOOTER_GUARD: + case MOB_REAVER_GUARD: + summoned->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM,0)); + adds.push_back(summoned->GetGUID()); + break; + case MOB_SHATTERED_ASSASSIN: + assassins.push_back(summoned->GetGUID()); + break; + } + } + + void KilledUnit(Unit *victim) + { + if (victim->GetTypeId() == TYPEID_PLAYER) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + removeAdds(); + } + + void MovementInform(uint32 type, uint32 id) + { + if (InBlade) + { + if (type != POINT_MOTION_TYPE) + return; + + if (id != 1) + return; + + if (target_num > 0) // to prevent loops + { + Wait_Timer = 1; + DoCast(m_creature,SPELL_BLADE_DANCE,true); + target_num--; + } + } + } + + void removeAdds() + { + for(std::vector::iterator itr = adds.begin(); itr!= adds.end(); ++itr) + { + Unit* temp = Unit::GetUnit((*m_creature),*itr); + if (temp && temp->isAlive()) + { + (*temp).GetMotionMaster()->Clear(true); + m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + CAST_CRE(temp)->RemoveCorpse(); + } + } + adds.clear(); + + for(std::vector::iterator itr = assassins.begin(); itr!= assassins.end(); ++itr) + { + Unit* temp = Unit::GetUnit((*m_creature),*itr); + if (temp && temp->isAlive()) + { + (*temp).GetMotionMaster()->Clear(true); + m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + CAST_CRE(temp)->RemoveCorpse(); + } + } + assassins.clear(); + } + void SpawnAssassin() + { + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Assassins_Timer) + if (Assassins_Timer < diff) + { + SpawnAssassin(); + Assassins_Timer = 0; + }else Assassins_Timer -= diff; + + if (InBlade) + { + if (Wait_Timer) + if (Wait_Timer < diff) + { + if (target_num <= 0) + { + // stop bladedance + InBlade = false; + m_creature->SetSpeed(MOVE_RUN,2); + (*m_creature).GetMotionMaster()->MoveChase(m_creature->getVictim()); + Blade_Dance_Timer = 30000; + Wait_Timer = 0; + if (HeroicMode) + Charge_timer = 5000; + } + else + { + //move in bladedance + float x,y,randx,randy; + randx = (rand()%40); + randy = (rand()%40); + x = 210+ randx ; + y = -60- randy ; + (*m_creature).GetMotionMaster()->MovePoint(1,x,y,m_creature->GetPositionZ()); + Wait_Timer = 0; + } + }else Wait_Timer -= diff; + } + else + { + if (Blade_Dance_Timer) + if (Blade_Dance_Timer < diff) + { + target_num = TARGET_NUM; + Wait_Timer = 1; + InBlade = true; + Blade_Dance_Timer = 0; + m_creature->SetSpeed(MOVE_RUN,4); + return; + }else Blade_Dance_Timer -= diff; + + if (Charge_timer) + if (Charge_timer < diff) + { + DoCast(SelectUnit(SELECT_TARGET_RANDOM,0),H_SPELL_CHARGE); + Charge_timer = 0; + }else Charge_timer -= diff; + + if (Summon_Assistant_Timer < diff) + { + Unit* target = NULL; + + for(uint8 i = 0; i < summoned; ++i) + { + switch(rand()%3) + { + case 0: m_creature->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 1: m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + case 2: m_creature->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; + } + } + if (rand()%100 < 20) summoned++; + Summon_Assistant_Timer = 25000 + (rand()%10000) ; + }else Summon_Assistant_Timer -= diff; + + DoMeleeAttackIfReady(); + } + + if (resetcheck_timer < diff) + { + uint32 tempx,tempy; + tempx = uint32(m_creature->GetPositionX()); + tempy = uint32(m_creature->GetPositionY()); + if (tempx > 255 || tempx < 205) + { + EnterEvadeMode(); + return; + } + resetcheck_timer = 5000; + }else resetcheck_timer -= diff; + } +}; + +CreatureAI* GetAI_boss_warchief_kargath_bladefist(Creature* pCreature) +{ + return new boss_warchief_kargath_bladefistAI (pCreature); +} + +void AddSC_boss_warchief_kargath_bladefist() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_warchief_kargath_bladefist"; + newscript->GetAI = &GetAI_boss_warchief_kargath_bladefist; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/def_shattered_halls.h b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/def_shattered_halls.h new file mode 100644 index 00000000000..cbfa23ec4e0 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/def_shattered_halls.h @@ -0,0 +1,14 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SHATTERED_H +#define DEF_SHATTERED_H + +#define TYPE_NETHEKURSE 1 +#define DATA_NETHEKURSE 2 +#define DATA_NETHEKURSE_DOOR 3 + +#define TYPE_OMROGG 4 +#endif + diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp new file mode 100644 index 00000000000..864a49a84ba --- /dev/null +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp @@ -0,0 +1,114 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Shattered_Halls +SD%Complete: 50 +SDComment: currently missing info about door. instance not complete +SDCategory: Hellfire Citadel, Shattered Halls +EndScriptData */ + +#include "precompiled.h" +#include "def_shattered_halls.h" + +#define MAX_ENCOUNTER 2 + +#define DOOR_NETHEKURSE 1 + +struct TRINITY_DLL_DECL instance_shattered_halls : public ScriptedInstance +{ + instance_shattered_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + uint64 nethekurseGUID; + uint64 nethekurseDoorGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + nethekurseGUID = 0; + nethekurseDoorGUID = 0; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case DOOR_NETHEKURSE: nethekurseDoorGUID = pGo->GetGUID(); break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 16807: nethekurseGUID = pCreature->GetGUID(); break; + } + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_NETHEKURSE: + m_auiEncounter[0] = data; + break; + case TYPE_OMROGG: + m_auiEncounter[1] = data; + break; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_NETHEKURSE: + return m_auiEncounter[0]; + case TYPE_OMROGG: + return m_auiEncounter[1]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_NETHEKURSE: + return nethekurseGUID; + case DATA_NETHEKURSE_DOOR: + return nethekurseDoorGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_shattered_halls(Map* pMap) +{ + return new instance_shattered_halls(pMap); +} + +void AddSC_instance_shattered_halls() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_shattered_halls"; + newscript->GetInstanceData = &GetInstanceData_instance_shattered_halls; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp new file mode 100644 index 00000000000..fc855b74bd9 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/arcatraz.cpp @@ -0,0 +1,521 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Arcatraz +SD%Complete: 60 +SDComment: Warden Mellichar, event controller for Skyriss event. Millhouse Manastorm. TODO: make better combatAI for Millhouse. +SDCategory: Tempest Keep, The Arcatraz +EndScriptData */ + +/* ContentData +npc_millhouse_manastorm +npc_warden_mellichar +mob_zerekethvoidzone +EndContentData */ + +#include "precompiled.h" +#include "def_arcatraz.h" + +/*##### +# npc_millhouse_manastorm +#####*/ + +#define SAY_INTRO_1 -1552010 +#define SAY_INTRO_2 -1552011 +#define SAY_WATER -1552012 +#define SAY_BUFFS -1552013 +#define SAY_DRINK -1552014 +#define SAY_READY -1552015 +#define SAY_KILL_1 -1552016 +#define SAY_KILL_2 -1552017 +#define SAY_PYRO -1552018 +#define SAY_ICEBLOCK -1552019 +#define SAY_LOWHP -1552020 +#define SAY_DEATH -1552021 +#define SAY_COMPLETE -1552022 + +#define SPELL_CONJURE_WATER 36879 +#define SPELL_ARCANE_INTELLECT 36880 +#define SPELL_ICE_ARMOR 36881 + +#define SPELL_ARCANE_MISSILES 33833 +#define SPELL_CONE_OF_COLD 12611 +#define SPELL_FIRE_BLAST 13341 +#define SPELL_FIREBALL 14034 +#define SPELL_FROSTBOLT 15497 +#define SPELL_PYROBLAST 33975 + +struct TRINITY_DLL_DECL npc_millhouse_manastormAI : public ScriptedAI +{ + npc_millhouse_manastormAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 EventProgress_Timer; + uint32 Phase; + bool Init; + bool LowHp; + + uint32 Pyroblast_Timer; + uint32 Fireball_Timer; + + void Reset() + { + EventProgress_Timer = 2000; + LowHp = false; + Init = false; + Phase = 1; + + Pyroblast_Timer = 1000; + Fireball_Timer = 2500; + + if (pInstance) + { + if (pInstance->GetData(TYPE_WARDEN_2) == DONE) + Init = true; + + if (pInstance->GetData(TYPE_HARBINGERSKYRISS) == DONE) + { + DoScriptText(SAY_COMPLETE, m_creature); + } + } + } + + void AttackStart(Unit* pWho) + { + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho, 0.0f); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(pWho, 25.0f); + } + } + + void EnterCombat(Unit *who) + { + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + /*for questId 10886 (heroic mode only) + if (pInstance && pInstance->GetData(TYPE_HARBINGERSKYRISS) != DONE) + ->FailQuest();*/ + } + + void UpdateAI(const uint32 diff) + { + if (!Init) + { + if (EventProgress_Timer < diff) + { + if (Phase < 8) + { + switch(Phase) + { + case 1: + DoScriptText(SAY_INTRO_1, m_creature); + EventProgress_Timer = 18000; + break; + case 2: + DoScriptText(SAY_INTRO_2, m_creature); + EventProgress_Timer = 18000; + break; + case 3: + DoScriptText(SAY_WATER, m_creature); + DoCast(m_creature,SPELL_CONJURE_WATER); + EventProgress_Timer = 7000; + break; + case 4: + DoScriptText(SAY_BUFFS, m_creature); + DoCast(m_creature,SPELL_ICE_ARMOR); + EventProgress_Timer = 7000; + break; + case 5: + DoScriptText(SAY_DRINK, m_creature); + DoCast(m_creature,SPELL_ARCANE_INTELLECT); + EventProgress_Timer = 7000; + break; + case 6: + DoScriptText(SAY_READY, m_creature); + EventProgress_Timer = 6000; + break; + case 7: + if (pInstance) + pInstance->SetData(TYPE_WARDEN_2,DONE); + Init = true; + break; + } + ++Phase; + } + } else EventProgress_Timer -= diff; + } + + if (!UpdateVictim()) + return; + + if (!LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)) + { + DoScriptText(SAY_LOWHP, m_creature); + LowHp = true; + } + + if (Pyroblast_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + DoScriptText(SAY_PYRO, m_creature); + + DoCast(m_creature->getVictim(),SPELL_PYROBLAST); + Pyroblast_Timer = 40000; + }else Pyroblast_Timer -=diff; + + if (Fireball_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FIREBALL); + Fireball_Timer = 4000; + }else Fireball_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_npc_millhouse_manastorm(Creature* pCreature) +{ + return new npc_millhouse_manastormAI (pCreature); +} + +/*##### +# npc_warden_mellichar +#####*/ + +#define YELL_INTRO1 -1552023 +#define YELL_INTRO2 -1552024 +#define YELL_RELEASE1 -1552025 +#define YELL_RELEASE2A -1552026 +#define YELL_RELEASE2B -1552027 +#define YELL_RELEASE3 -1552028 +#define YELL_RELEASE4 -1552029 +#define YELL_WELCOME -1552030 + +//phase 2(acid mobs) +#define ENTRY_TRICKSTER 20905 +#define ENTRY_PH_HUNTER 20906 +//phase 3 +#define ENTRY_MILLHOUSE 20977 +//phase 4(acid mobs) +#define ENTRY_AKKIRIS 20908 +#define ENTRY_SULFURON 20909 +//phase 5(acid mobs) +#define ENTRY_TW_DRAK 20910 +#define ENTRY_BL_DRAK 20911 +//phase 6 +#define ENTRY_SKYRISS 20912 + +//TARGET_SCRIPT +#define SPELL_TARGET_ALPHA 36856 +#define SPELL_TARGET_BETA 36854 +#define SPELL_TARGET_DELTA 36857 +#define SPELL_TARGET_GAMMA 36858 +#define SPELL_TARGET_OMEGA 36852 +#define SPELL_BUBBLE_VISUAL 36849 + +struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI +{ + npc_warden_mellicharAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + bool IsRunning; + bool CanSpawn; + + uint32 EventProgress_Timer; + uint32 Phase; + + void Reset() + { + IsRunning = false; + CanSpawn = false; + + EventProgress_Timer = 22000; + Phase = 1; + + m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); + DoCast(m_creature,SPELL_TARGET_OMEGA); + + if (pInstance) + pInstance->SetData(TYPE_HARBINGERSKYRISS,NOT_STARTED); + } + + void AttackStart(Unit* who) { } + + void MoveInLineOfSight(Unit *who) + { + if (IsRunning) + return; + + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) + { + if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + if (who->GetTypeId() != TYPEID_PLAYER) + return; + + float attackRadius = m_creature->GetAttackDistance(who)/10; + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + EnterCombat(who); + } + } + + void EnterCombat(Unit *who) + { + DoScriptText(YELL_INTRO1, m_creature); + DoCast(m_creature,SPELL_BUBBLE_VISUAL); + + if (pInstance) + { + pInstance->SetData(TYPE_HARBINGERSKYRISS,IN_PROGRESS); + pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), false); + IsRunning = true; + } + } + + bool CanProgress() + { + if (pInstance) + { + if (Phase == 7 && pInstance->GetData(TYPE_WARDEN_4) == DONE) + return true; + if (Phase == 6 && pInstance->GetData(TYPE_WARDEN_3) == DONE) + return true; + if (Phase == 5 && pInstance->GetData(TYPE_WARDEN_2) == DONE) + return true; + if (Phase == 4) + return true; + if (Phase == 3 && pInstance->GetData(TYPE_WARDEN_1) == DONE) + return true; + if (Phase == 2 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS) + return true; + if (Phase == 1 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS) + return true; + return false; + } + return false; + } + + void DoPrepareForPhase() + { + if (pInstance) + { + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAurasByType(SPELL_AURA_DUMMY); + + switch(Phase) + { + case 2: + DoCast(m_creature,SPELL_TARGET_ALPHA); + pInstance->SetData(TYPE_WARDEN_1,IN_PROGRESS); + pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), false); + break; + case 3: + DoCast(m_creature,SPELL_TARGET_BETA); + pInstance->SetData(TYPE_WARDEN_2,IN_PROGRESS); + break; + case 5: + DoCast(m_creature,SPELL_TARGET_DELTA); + pInstance->SetData(TYPE_WARDEN_3,IN_PROGRESS); + break; + case 6: + DoCast(m_creature,SPELL_TARGET_GAMMA); + pInstance->SetData(TYPE_WARDEN_4,IN_PROGRESS); + break; + case 7: + pInstance->SetData(TYPE_WARDEN_5,IN_PROGRESS); + break; + } + CanSpawn = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!IsRunning) + return; + + if (EventProgress_Timer < diff) + { + if (pInstance) + { + if (pInstance->GetData(TYPE_HARBINGERSKYRISS) == FAIL) + Reset(); + } + + if (CanSpawn) + { + //continue beam omega pod, unless we are about to summon skyriss + if (Phase != 7) + DoCast(m_creature,SPELL_TARGET_OMEGA); + + switch(Phase) + { + case 2: + switch(rand()%2) + { + case 0: m_creature->SummonCreature(ENTRY_TRICKSTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + case 1: m_creature->SummonCreature(ENTRY_PH_HUNTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + } + break; + case 3: + m_creature->SummonCreature(ENTRY_MILLHOUSE,413.292,-148.378,42.56,6.27,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + break; + case 4: + DoScriptText(YELL_RELEASE2B, m_creature); + break; + case 5: + switch(rand()%2) + { + case 0: m_creature->SummonCreature(ENTRY_AKKIRIS,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + case 1: m_creature->SummonCreature(ENTRY_SULFURON,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + } + break; + case 6: + switch(rand()%2) + { + case 0: m_creature->SummonCreature(ENTRY_TW_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + case 1: m_creature->SummonCreature(ENTRY_BL_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; + } + break; + case 7: + m_creature->SummonCreature(ENTRY_SKYRISS,445.763,-191.639,44.64,1.60,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); + DoScriptText(YELL_WELCOME, m_creature); + break; + } + CanSpawn = false; + ++Phase; + } + if (CanProgress()) + { + switch(Phase) + { + case 1: + DoScriptText(YELL_INTRO2, m_creature); + EventProgress_Timer = 10000; + ++Phase; + break; + case 2: + DoScriptText(YELL_RELEASE1, m_creature); + DoPrepareForPhase(); + EventProgress_Timer = 7000; + break; + case 3: + DoScriptText(YELL_RELEASE2A, m_creature); + DoPrepareForPhase(); + EventProgress_Timer = 10000; + break; + case 4: + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + case 5: + DoScriptText(YELL_RELEASE3, m_creature); + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + case 6: + DoScriptText(YELL_RELEASE4, m_creature); + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + case 7: + DoPrepareForPhase(); + EventProgress_Timer = 15000; + break; + } + } + } else EventProgress_Timer -= diff; + } +}; +CreatureAI* GetAI_npc_warden_mellichar(Creature* pCreature) +{ + return new npc_warden_mellicharAI (pCreature); +} + +/*##### +# mob_zerekethvoidzone (this script probably not needed in future -> `creature_template_addon`.`auras`='36120 0') +#####*/ + +#define SPELL_VOID_ZONE_DAMAGE 36120 + +struct TRINITY_DLL_DECL mob_zerekethvoidzoneAI : public ScriptedAI +{ + mob_zerekethvoidzoneAI(Creature *c) : ScriptedAI(c) {} + + void Reset() + { + m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0); + m_creature->setFaction(16); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + DoCast(m_creature,SPELL_VOID_ZONE_DAMAGE); + } + + void EnterCombat(Unit* who) {} +}; +CreatureAI* GetAI_mob_zerekethvoidzoneAI(Creature* pCreature) +{ + return new mob_zerekethvoidzoneAI (pCreature); +} + +void AddSC_arcatraz() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_millhouse_manastorm"; + newscript->GetAI = &GetAI_npc_millhouse_manastorm; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_warden_mellichar"; + newscript->GetAI = &GetAI_npc_warden_mellichar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_zerekethvoidzone"; + newscript->GetAI = &GetAI_mob_zerekethvoidzoneAI; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp new file mode 100644 index 00000000000..bcab1a6257f --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp @@ -0,0 +1,312 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Harbinger_Skyriss +SD%Complete: 45 +SDComment: CombatAI not fully implemented. Timers will need adjustments. Need more docs on how event fully work. Reset all event and force start over if fail at one point? +SDCategory: Tempest Keep, The Arcatraz +EndScriptData */ + +/* ContentData +boss_harbinger_skyriss +boss_harbinger_skyriss_illusion +EndContentData */ + +#include "precompiled.h" +#include "def_arcatraz.h" + +#define SAY_INTRO -1552000 +#define SAY_AGGRO -1552001 +#define SAY_KILL_1 -1552002 +#define SAY_KILL_2 -1552003 +#define SAY_MIND_1 -1552004 +#define SAY_MIND_2 -1552005 +#define SAY_FEAR_1 -1552006 +#define SAY_FEAR_2 -1552007 +#define SAY_IMAGE -1552008 +#define SAY_DEATH -1552009 + +#define SPELL_FEAR 39415 + +#define SPELL_MIND_REND 36924 +#define H_SPELL_MIND_REND 39017 + +#define SPELL_DOMINATION 37162 +#define H_SPELL_DOMINATION 39019 + +#define H_SPELL_MANA_BURN 39020 + +#define SPELL_66_ILLUSION 36931 //entry 21466 +#define SPELL_33_ILLUSION 36932 //entry 21467 + +struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI +{ + boss_harbinger_skyrissAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + Intro = false; + } + + ScriptedInstance *pInstance; + bool HeroicMode; + + bool Intro; + bool IsImage33; + bool IsImage66; + + uint32 Intro_Phase; + uint32 Intro_Timer; + uint32 MindRend_Timer; + uint32 Fear_Timer; + uint32 Domination_Timer; + uint32 ManaBurn_Timer; + + void Reset() + { + if (!Intro) + m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); + + IsImage33 = false; + IsImage66 = false; + + Intro_Phase = 1; + Intro_Timer = 5000; + MindRend_Timer = 3000; + Fear_Timer = 15000; + Domination_Timer = 30000; + ManaBurn_Timer = 25000; + } + + void MoveInLineOfSight(Unit *who) + { + if (!Intro) + { + return; + } + ScriptedAI::MoveInLineOfSight(who); + } + + void EnterCombat(Unit *who) {} + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + if (pInstance) + pInstance->SetData(TYPE_HARBINGERSKYRISS,DONE); + } + + void JustSummoned(Creature *summon) + { + if (!summon) + return; + if (IsImage66) + summon->SetHealth((summon->GetMaxHealth()*33)/100); + else + summon->SetHealth((summon->GetMaxHealth()*66)/100); + if (m_creature->getVictim()) + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + summon->AI()->AttackStart(target); + } + + void KilledUnit(Unit* victim) + { + //won't yell killing pet/other unit + if (victim->GetEntry() == 21436) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void DoSplit(uint32 val) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoScriptText(SAY_IMAGE, m_creature); + + if (val == 66) + DoCast(m_creature, SPELL_66_ILLUSION); + else + DoCast(m_creature, SPELL_33_ILLUSION); + } + + void UpdateAI(const uint32 diff) + { + if (!Intro) + { + if (!pInstance) + return; + + if (Intro_Timer < diff) + { + switch(Intro_Phase) + { + case 1: + DoScriptText(SAY_INTRO, m_creature); + pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), true); + ++Intro_Phase; + Intro_Timer = 25000; + break; + case 2: + DoScriptText(SAY_AGGRO, m_creature); + if (Unit *mellic = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MELLICHAR))) + { + //should have a better way to do this. possibly spell exist. + mellic->setDeathState(JUST_DIED); + mellic->SetHealth(0); + pInstance->SetData(TYPE_SHIELD_OPEN,IN_PROGRESS); + } + ++Intro_Phase; + Intro_Timer = 3000; + break; + case 3: + m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); + Intro = true; + break; + } + }else Intro_Timer -=diff; + } + + if (!UpdateVictim()) + return; + + if (!IsImage66 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 66)) + { + DoSplit(66); + IsImage66 = true; + } + if (!IsImage33 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 33)) + { + DoSplit(33); + IsImage33 = true; + } + + if (MindRend_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,HeroicMode ? H_SPELL_MIND_REND : SPELL_MIND_REND); + else + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_MIND_REND : SPELL_MIND_REND); + + MindRend_Timer = 8000; + }else MindRend_Timer -=diff; + + if (Fear_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_FEAR_1, m_creature); break; + case 1: DoScriptText(SAY_FEAR_2, m_creature); break; + } + + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,SPELL_FEAR); + else + DoCast(m_creature->getVictim(),SPELL_FEAR); + + Fear_Timer = 25000; + }else Fear_Timer -=diff; + + if (Domination_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_MIND_1, m_creature); break; + case 1: DoScriptText(SAY_MIND_2, m_creature); break; + } + + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,HeroicMode ? H_SPELL_DOMINATION : SPELL_DOMINATION); + else + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_DOMINATION : SPELL_DOMINATION); + + Domination_Timer = 16000+rand()%16000; + }else Domination_Timer -=diff; + + if (HeroicMode) + { + if (ManaBurn_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + return; + + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,H_SPELL_MANA_BURN); + + ManaBurn_Timer = 16000+rand()%16000; + }else ManaBurn_Timer -=diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_harbinger_skyriss(Creature* pCreature) +{ + return new boss_harbinger_skyrissAI (pCreature); +} + +#define SPELL_MIND_REND_IMAGE 36929 +#define H_SPELL_MIND_REND_IMAGE 39021 + +struct TRINITY_DLL_DECL boss_harbinger_skyriss_illusionAI : public ScriptedAI +{ + boss_harbinger_skyriss_illusionAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + bool HeroicMode; + + void Reset() { } + + void EnterCombat(Unit *who) { } +}; + +CreatureAI* GetAI_boss_harbinger_skyriss_illusion(Creature* pCreature) +{ + return new boss_harbinger_skyriss_illusionAI (pCreature); +} + +void AddSC_boss_harbinger_skyriss() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_harbinger_skyriss"; + newscript->GetAI = &GetAI_boss_harbinger_skyriss; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="boss_harbinger_skyriss_illusion"; + newscript->GetAI = &GetAI_boss_harbinger_skyriss_illusion; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/def_arcatraz.h b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/def_arcatraz.h new file mode 100644 index 00000000000..3f8dee8bbd0 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/def_arcatraz.h @@ -0,0 +1,21 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_ARCATRAZ_H +#define DEF_ARCATRAZ_H + +#define TYPE_ZEREKETH 1 +#define TYPE_DALLIAH 2 +#define TYPE_SOCCOTHRATES 3 +#define TYPE_HARBINGERSKYRISS 4 +#define TYPE_WARDEN_1 5 +#define TYPE_WARDEN_2 6 +#define TYPE_WARDEN_3 7 +#define TYPE_WARDEN_4 8 +#define TYPE_WARDEN_5 9 +#define DATA_MELLICHAR 10 +#define TYPE_SHIELD_OPEN 11 +#define DATA_SPHERE_SHIELD 12 +#endif + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp new file mode 100644 index 00000000000..081c80c56e5 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp @@ -0,0 +1,238 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Arcatraz +SD%Complete: 80 +SDComment: Mainly Harbringer Skyriss event +SDCategory: Tempest Keep, The Arcatraz +EndScriptData */ + +#include "precompiled.h" +#include "def_arcatraz.h" + +#define MAX_ENCOUNTER 9 + +#define CONTAINMENT_CORE_SECURITY_FIELD_ALPHA 184318 //door opened when Wrath-Scryer Soccothrates dies +#define CONTAINMENT_CORE_SECURITY_FIELD_BETA 184319 //door opened when Dalliah the Doomsayer dies +#define POD_ALPHA 183961 //pod first boss wave +#define POD_BETA 183963 //pod second boss wave +#define POD_DELTA 183964 //pod third boss wave +#define POD_GAMMA 183962 //pod fourth boss wave +#define POD_OMEGA 183965 //pod fifth boss wave +#define WARDENS_SHIELD 184802 // warden shield +#define SEAL_SPHERE 184802 //shield 'protecting' mellichar + +#define MELLICHAR 20904 //skyriss will kill this unit + + +/* Arcatraz encounters: +1 - Zereketh the Unbound event +2 - Dalliah the Doomsayer event +3 - Wrath-Scryer Soccothrates event +4 - Harbinger Skyriss event, 5 sub-events +*/ + +struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance +{ + instance_arcatraz(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + GameObject *Containment_Core_Security_Field_Alpha; + GameObject *Containment_Core_Security_Field_Beta; + GameObject *Pod_Alpha; + GameObject *Pod_Gamma; + GameObject *Pod_Beta; + GameObject *Pod_Delta; + GameObject *Pod_Omega; + GameObject *Wardens_Shield; + + uint64 GoSphereGUID; + uint64 MellicharGUID; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + Containment_Core_Security_Field_Alpha = NULL; + Containment_Core_Security_Field_Beta = NULL; + Pod_Alpha = NULL; + Pod_Beta = NULL; + Pod_Delta = NULL; + Pod_Gamma = NULL; + Pod_Omega = NULL; + Wardens_Shield = NULL; + + GoSphereGUID = 0; + MellicharGUID = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case CONTAINMENT_CORE_SECURITY_FIELD_ALPHA: Containment_Core_Security_Field_Alpha = pGo; break; + case CONTAINMENT_CORE_SECURITY_FIELD_BETA: Containment_Core_Security_Field_Beta = pGo; break; + case SEAL_SPHERE: GoSphereGUID = pGo->GetGUID(); break; + case POD_ALPHA: Pod_Alpha = pGo; break; + case POD_BETA: Pod_Beta = pGo; break; + case POD_DELTA: Pod_Delta = pGo; break; + case POD_GAMMA: Pod_Gamma = pGo; break; + case POD_OMEGA: Pod_Omega = pGo; break; + //case WARDENS_SHIELD: Wardens_Shield = pGo; break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == MELLICHAR) + MellicharGUID = pCreature->GetGUID(); + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case TYPE_ZEREKETH: + m_auiEncounter[0] = data; + break; + + case TYPE_DALLIAH: + if (data == DONE) + if (Containment_Core_Security_Field_Beta) + Containment_Core_Security_Field_Beta->UseDoorOrButton(); + m_auiEncounter[1] = data; + break; + + case TYPE_SOCCOTHRATES: + if (data == DONE) + if (Containment_Core_Security_Field_Alpha) + Containment_Core_Security_Field_Alpha->UseDoorOrButton(); + m_auiEncounter[2] = data; + break; + + case TYPE_HARBINGERSKYRISS: + if (data == NOT_STARTED || data == FAIL) + { + m_auiEncounter[4] = NOT_STARTED; + m_auiEncounter[5] = NOT_STARTED; + m_auiEncounter[6] = NOT_STARTED; + m_auiEncounter[7] = NOT_STARTED; + m_auiEncounter[8] = NOT_STARTED; + } + m_auiEncounter[3] = data; + break; + + case TYPE_WARDEN_1: + if (data == IN_PROGRESS) + if (Pod_Alpha) + Pod_Alpha->UseDoorOrButton(); + m_auiEncounter[4] = data; + break; + + case TYPE_WARDEN_2: + if (data == IN_PROGRESS) + if (Pod_Beta) + Pod_Beta->UseDoorOrButton(); + m_auiEncounter[5] = data; + break; + + case TYPE_WARDEN_3: + if (data == IN_PROGRESS) + if (Pod_Delta) + Pod_Delta->UseDoorOrButton(); + m_auiEncounter[6] = data; + break; + + case TYPE_WARDEN_4: + if (data == IN_PROGRESS) + if (Pod_Gamma) + Pod_Gamma->UseDoorOrButton(); + m_auiEncounter[7] = data; + break; + + case TYPE_WARDEN_5: + if (data == IN_PROGRESS) + if (Pod_Omega) + Pod_Omega->UseDoorOrButton(); + m_auiEncounter[8] = data; + break; + + case TYPE_SHIELD_OPEN: + if (data == IN_PROGRESS) + if (Wardens_Shield) + Wardens_Shield->UseDoorOrButton(); + break; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_HARBINGERSKYRISS: + return m_auiEncounter[3]; + case TYPE_WARDEN_1: + return m_auiEncounter[4]; + case TYPE_WARDEN_2: + return m_auiEncounter[5]; + case TYPE_WARDEN_3: + return m_auiEncounter[6]; + case TYPE_WARDEN_4: + return m_auiEncounter[7]; + case TYPE_WARDEN_5: + return m_auiEncounter[8]; + } + return 0; + } + + uint64 GetData64(uint32 data) + { + switch(data) + { + case DATA_MELLICHAR: + return MellicharGUID; + case DATA_SPHERE_SHIELD: + return GoSphereGUID; + } + return 0; + } +}; + +InstanceData* GetInstanceData_instance_arcatraz(Map* pMap) +{ + return new instance_arcatraz(pMap); +} + +void AddSC_instance_arcatraz() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_arcatraz"; + newscript->GetInstanceData = &GetInstanceData_instance_arcatraz; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.cpp new file mode 100644 index 00000000000..c63fb1b8d58 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_high_botanist_freywinn.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_High_Botanist_Freywinn +SD%Complete: 90 +SDComment: some strange visual related to tree form(if aura lost before normal duration end). possible make summon&transform -process smoother(transform after delay) +SDCategory: Tempest Keep, The Botanica +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1553000 +#define SAY_KILL_1 -1553001 +#define SAY_KILL_2 -1553002 +#define SAY_TREE_1 -1553003 +#define SAY_TREE_2 -1553004 +#define SAY_DEATH -1553005 + +#define SPELL_TRANQUILITY 34550 +#define SPELL_TREE_FORM 34551 + +#define SPELL_SUMMON_FRAYER 34557 +#define ENTRY_FRAYER 19953 + +#define SPELL_PLANT_WHITE 34759 +#define SPELL_PLANT_GREEN 34761 +#define SPELL_PLANT_BLUE 34762 +#define SPELL_PLANT_RED 34763 + +struct TRINITY_DLL_DECL boss_high_botanist_freywinnAI : public ScriptedAI +{ + boss_high_botanist_freywinnAI(Creature *c) : ScriptedAI(c) {} + + std::list Adds_List; + + uint32 SummonSeedling_Timer; + uint32 TreeForm_Timer; + uint32 MoveCheck_Timer; + uint32 DeadAddsCount; + bool MoveFree; + + void Reset() + { + Adds_List.clear(); + + SummonSeedling_Timer = 6000; + TreeForm_Timer = 30000; + MoveCheck_Timer = 1000; + DeadAddsCount = 0; + MoveFree = true; + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == ENTRY_FRAYER) + Adds_List.push_back(summoned->GetGUID()); + } + + void DoSummonSeedling() + { + switch(rand()%4) + { + case 0: DoCast(m_creature,SPELL_PLANT_WHITE); break; + case 1: DoCast(m_creature,SPELL_PLANT_GREEN); break; + case 2: DoCast(m_creature,SPELL_PLANT_BLUE); break; + case 3: DoCast(m_creature,SPELL_PLANT_RED); break; + } + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (TreeForm_Timer < diff) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_TREE_1, m_creature); break; + case 1: DoScriptText(SAY_TREE_2, m_creature); break; + } + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + m_creature->RemoveAllAuras(); + + DoCast(m_creature,SPELL_SUMMON_FRAYER,true); + DoCast(m_creature,SPELL_TRANQUILITY,true); + DoCast(m_creature,SPELL_TREE_FORM,true); + + m_creature->GetMotionMaster()->MoveIdle(); + MoveFree = false; + + TreeForm_Timer = 75000; + }else TreeForm_Timer -= diff; + + if (!MoveFree) + { + if (MoveCheck_Timer < diff) + { + if (!Adds_List.empty()) + { + for(std::list::iterator itr = Adds_List.begin(); itr != Adds_List.end(); ++itr) + { + if (Unit *temp = Unit::GetUnit(*m_creature,*itr)) + { + if (!temp->isAlive()) + { + Adds_List.erase(itr); + ++DeadAddsCount; + break; + } + } + } + } + + if (DeadAddsCount < 3 && TreeForm_Timer-30000 < diff) + DeadAddsCount = 3; + + if (DeadAddsCount >= 3) + { + Adds_List.clear(); + DeadAddsCount = 0; + + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); + MoveFree = true; + } + MoveCheck_Timer = 500; + } + else MoveCheck_Timer -= diff; + + return; + } + + /*if (m_creature->HasAura(SPELL_TREE_FORM,0) || m_creature->HasAura(SPELL_TRANQUILITY,0)) + return;*/ + + //one random seedling every 5 secs, but not in tree form + if (SummonSeedling_Timer < diff) + { + DoSummonSeedling(); + SummonSeedling_Timer = 6000; + }else SummonSeedling_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_high_botanist_freywinn(Creature* pCreature) +{ + return new boss_high_botanist_freywinnAI (pCreature); +} + +void AddSC_boss_high_botanist_freywinn() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_high_botanist_freywinn"; + newscript->GetAI = &GetAI_boss_high_botanist_freywinn; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_laj.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_laj.cpp new file mode 100644 index 00000000000..ddd5745f93c --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_laj.cpp @@ -0,0 +1,205 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Laj +SD%Complete: 90 +SDComment: Immunities are wrong, must be adjusted to use resistance from creature_templates. Most spells require database support. +SDCategory: Tempest Keep, The Botanica +EndScriptData */ + +#include "precompiled.h" + +#define EMOTE_SUMMON -1553006 + +#define SPELL_ALLERGIC_REACTION 34697 +#define SPELL_TELEPORT_SELF 34673 + +#define SPELL_SUMMON_LASHER_1 34681 +#define SPELL_SUMMON_FLAYER_1 34682 +#define SPELL_SUMMON_LASHER_2 34684 +#define SPELL_SUMMON_FLAYER_2 34685 +#define SPELL_SUMMON_LASHER_3 34686 +#define SPELL_SUMMON_FLAYER_4 34687 +#define SPELL_SUMMON_LASHER_4 34688 +#define SPELL_SUMMON_FLAYER_3 34690 + +#define MODEL_DEFAULT 13109 +#define MODEL_ARCANE 14213 +#define MODEL_FIRE 13110 +#define MODEL_FROST 14112 +#define MODEL_NATURE 14214 + +struct TRINITY_DLL_DECL boss_lajAI : public ScriptedAI +{ + boss_lajAI(Creature *c) : ScriptedAI(c) {} + + bool CanSummon; + uint32 Teleport_Timer; + uint32 Summon_Timer; + uint32 Transform_Timer; + uint32 Allergic_Timer; + + void Reset() + { + m_creature->SetDisplayId(MODEL_DEFAULT); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + + CanSummon = false; + Teleport_Timer = 20000; + Summon_Timer = 2500; + Transform_Timer = 30000; + Allergic_Timer = 5000; + } + + void DoTransform() + { + switch(rand()%5) + { + case 0: + m_creature->SetDisplayId(MODEL_DEFAULT); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 1: + m_creature->SetDisplayId(MODEL_ARCANE); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 2: + m_creature->SetDisplayId(MODEL_FIRE); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 3: + m_creature->SetDisplayId(MODEL_FROST); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); + break; + case 4: + m_creature->SetDisplayId(MODEL_NATURE); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); + break; + } + } + + void DoSummons() + { + switch(rand()%4) + { + case 0: + DoCast(m_creature,SPELL_SUMMON_LASHER_1,true); + DoCast(m_creature,SPELL_SUMMON_FLAYER_1,true); + break; + case 1: + DoCast(m_creature,SPELL_SUMMON_LASHER_2,true); + DoCast(m_creature,SPELL_SUMMON_FLAYER_2,true); + break; + case 2: + DoCast(m_creature,SPELL_SUMMON_LASHER_3,true); + DoCast(m_creature,SPELL_SUMMON_FLAYER_3,true); + break; + case 3: + DoCast(m_creature,SPELL_SUMMON_LASHER_4,true); + DoCast(m_creature,SPELL_SUMMON_FLAYER_4,true); + break; + } + CanSummon = false; + } + + void EnterCombat(Unit *who) + { + } + + void JustSummoned(Creature *summon) + { + if (summon && m_creature->getVictim()) + summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (CanSummon) + { + if (Summon_Timer < diff) + { + DoScriptText(EMOTE_SUMMON, m_creature); + DoSummons(); + Summon_Timer = 2500; + }else Summon_Timer -= diff; + } + + if (Allergic_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ALLERGIC_REACTION); + Allergic_Timer = 25000+rand()%15000; + }else Allergic_Timer -= diff; + + if (Teleport_Timer < diff) + { + DoCast(m_creature,SPELL_TELEPORT_SELF); + Teleport_Timer = 30000+rand()%10000; + CanSummon = true; + }else Teleport_Timer -= diff; + + if (Transform_Timer < diff) + { + DoTransform(); + Transform_Timer = 25000+rand()%15000; + }else Transform_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_laj(Creature* pCreature) +{ + return new boss_lajAI (pCreature); +} + +void AddSC_boss_laj() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_laj"; + newscript->GetAI = &GetAI_boss_laj; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_warp_splinter.cpp new file mode 100644 index 00000000000..a9b111be839 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/botanica/boss_warp_splinter.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_Warp_Splinter +SD%Complete: 80 +SDComment: Includes Sapling (need some better control with these). +SDCategory: Tempest Keep, The Botanica +EndScriptData */ + +#include "precompiled.h" + +/*##### +# mob_treant (Sapling) +#####*/ + +#define SPELL_HEAL_FATHER 6262 + +struct TRINITY_DLL_DECL mob_treantAI : public ScriptedAI +{ + mob_treantAI (Creature *c) : ScriptedAI(c) + { + WarpGuid = 0; + } + + uint64 WarpGuid; + uint32 check_Timer; + + void Reset() + { + check_Timer = 0; + } + + void EnterCombat(Unit *who) {} + + void MoveInLineOfSight(Unit* who) {} + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + { + if (WarpGuid && check_Timer < diff) + { + if (Unit *Warp = Unit::GetUnit(*m_creature, WarpGuid)) + { + if (m_creature->IsWithinMeleeRange(Warp,2.5f)) + { + int32 CurrentHP_Treant = (int32)m_creature->GetHealth(); + Warp->CastCustomSpell(Warp,SPELL_HEAL_FATHER,&CurrentHP_Treant, 0, 0, true,0 ,0, m_creature->GetGUID()); + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + m_creature->GetMotionMaster()->MoveFollow(Warp,0,0); + } + check_Timer = 1000; + }else check_Timer -= diff; + return; + } + + if (m_creature->getVictim()->GetGUID() != WarpGuid) + DoMeleeAttackIfReady(); + } +}; + +/*##### +# boss_warp_splinter +#####*/ + +#define SAY_AGGRO -1553007 +#define SAY_SLAY_1 -1553008 +#define SAY_SLAY_2 -1553009 +#define SAY_SUMMON_1 -1553010 +#define SAY_SUMMON_2 -1553011 +#define SAY_DEATH -1553012 + +#define WAR_STOMP 34716 +#define SUMMON_TREANTS 34727 // DBC: 34727, 34731, 34733, 34734, 34736, 34739, 34741 (with Ancestral Life spell 34742) // won't work (guardian summon) +#define ARCANE_VOLLEY (HeroicMode?39133:36705) + +#define CREATURE_TREANT 19949 + +#define TREANT_SPAWN_DIST 50 //50 yards from Warp Splinter's spawn point + +float treant_pos[6][3] = +{ + {24.301233, 427.221100, -27.060635}, + {16.795492, 359.678802, -27.355425}, + {53.493484, 345.381470, -26.196192}, + {61.867096, 439.362732, -25.921030}, + {109.861877, 423.201630, -27.356019}, + {106.780159, 355.582581, -27.593357} +}; + +struct TRINITY_DLL_DECL boss_warp_splinterAI : public ScriptedAI +{ + boss_warp_splinterAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = c->GetMap()->IsHeroic(); + Treant_Spawn_Pos_X = c->GetPositionX(); + Treant_Spawn_Pos_Y = c->GetPositionY(); + } + + uint32 War_Stomp_Timer; + uint32 Summon_Treants_Timer; + uint32 Arcane_Volley_Timer; + bool HeroicMode; + + float Treant_Spawn_Pos_X; + float Treant_Spawn_Pos_Y; + + void Reset() + { + War_Stomp_Timer = 25000 + rand()%15000; + Summon_Treants_Timer = 45000; + Arcane_Volley_Timer = 8000 + rand()%12000; + + m_creature->SetSpeed(MOVE_RUN, 0.7f, true); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void SummonTreants() + { + for(uint8 i = 0; i < 6; ++i) + { + float angle = (M_PI / 3) * i; + + float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * cos(angle); + float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * sin(angle); + float O = - m_creature->GetAngle(X,Y); + + if (Creature *pTreant = m_creature->SummonCreature(CREATURE_TREANT,treant_pos[i][0],treant_pos[i][1],treant_pos[i][2],O,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000)) + CAST_AI(mob_treantAI, pTreant->AI())->WarpGuid = m_creature->GetGUID(); + } + switch(rand()%2) + { + case 0: DoScriptText(SAY_SUMMON_1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON_2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Check for War Stomp + if (War_Stomp_Timer < diff) + { + DoCast(m_creature->getVictim(),WAR_STOMP); + War_Stomp_Timer = 25000 + rand()%15000; + }else War_Stomp_Timer -= diff; + + //Check for Arcane Volley + if (Arcane_Volley_Timer < diff) + { + DoCast(m_creature->getVictim(),ARCANE_VOLLEY); + Arcane_Volley_Timer = 20000 + rand()%15000; + }else Arcane_Volley_Timer -= diff; + + //Check for Summon Treants + if (Summon_Treants_Timer < diff) + { + SummonTreants(); + Summon_Treants_Timer = 45000; + }else Summon_Treants_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_warp_splinter(Creature* pCreature) +{ + return new boss_warp_splinterAI (pCreature); +} + +CreatureAI* GetAI_mob_treant(Creature* pCreature) +{ + return new mob_treantAI (pCreature); +} + +void AddSC_boss_warp_splinter() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_warp_splinter"; + newscript->GetAI = &GetAI_boss_warp_splinter; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_warp_splinter_treant"; + newscript->GetAI = &GetAI_mob_treant; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_alar.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_alar.cpp new file mode 100644 index 00000000000..e57f3294a55 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_alar.cpp @@ -0,0 +1,525 @@ +/* Copyright(C) 2006 - 2008 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +*(at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: boss_alar +SD%Complete: 95 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "def_the_eye.h" + +#define SPELL_FLAME_BUFFET 34121 // Flame Buffet - every 1,5 secs in phase 1 if there is no victim in melee range and after Dive Bomb in phase 2 with same conditions +#define SPELL_FLAME_QUILLS 34229 // Randomly after changing position in phase after watching tonns of movies, set probability 20% +#define SPELL_REBIRTH 34342 // Rebirth - beginning of second phase(after loose all health in phase 1) +#define SPELL_REBIRTH_2 35369 // Rebirth(another, without healing to full HP) - after Dive Bomb in phase 2 +#define SPELL_MELT_ARMOR 35410 // Melt Armor - every 60 sec in phase 2 +#define SPELL_CHARGE 35412 // Charge - 30 sec cooldown +#define SPELL_DIVE_BOMB_VISUAL 35367 // Bosskillers says 30 sec cooldown, wowwiki says 30 sec colldown, DBM and BigWigs addons says ~47 sec +#define SPELL_DIVE_BOMB 35181 // after watching tonns of movies, set cooldown to 40+rand()%5. +#define SPELL_BERSERK 45078 // 10 minutes after phase 2 starts(id is wrong, but proper id is unknown) + +#define CREATURE_EMBER_OF_ALAR 19551 // Al'ar summons one Ember of Al'ar every position change in phase 1 and two after Dive Bomb. Also in phase 2 when Ember of Al'ar dies, boss loose 3% health. +#define SPELL_EMBER_BLAST 34133 // When Ember of Al'ar dies, it casts Ember Blast + +#define CREATURE_FLAME_PATCH_ALAR 20602 // Flame Patch - every 30 sec in phase 2 +#define SPELL_FLAME_PATCH 35380 // + +static float waypoint[6][3] = +{ + {340.15, 58.65, 17.71}, + {388.09, 31.54, 20.18}, + {388.18, -32.85, 20.18}, + {340.29, -60.19, 17.72}, + {332, 0.01, 39}, // better not use the same xy coord + {331, 0.01, -2.39} +}; + +enum WaitEventType +{ + WE_NONE = 0, + WE_DUMMY = 1, + WE_PLATFORM = 2, + WE_QUILL = 3, + WE_DIE = 4, + WE_REVIVE = 5, + WE_CHARGE = 6, + WE_METEOR = 7, + WE_DIVE = 8, + WE_LAND = 9, + WE_SUMMON = 10 +}; + +struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI +{ + boss_alarAI(Creature *c) : ScriptedAI(c) + { + pInstance =c->GetInstanceData(); + DefaultMoveSpeedRate = m_creature->GetSpeedRate(MOVE_RUN); + } + + ScriptedInstance *pInstance; + + WaitEventType WaitEvent; + uint32 WaitTimer; + + bool AfterMoving; + + uint32 Platforms_Move_Timer; + uint32 DiveBomb_Timer; + uint32 MeltArmor_Timer; + uint32 Charge_Timer; + uint32 FlamePatch_Timer; + uint32 Berserk_Timer; + + float DefaultMoveSpeedRate; + + bool Phase1; + bool ForceMove; + uint32 ForceTimer; + + int8 cur_wp; + + void Reset() + { + if (pInstance) + pInstance->SetData(DATA_ALAREVENT, NOT_STARTED); + + Berserk_Timer = 1200000; + Platforms_Move_Timer = 0; + + Phase1 = true; + WaitEvent = WE_NONE; + WaitTimer = 0; + AfterMoving = false; + ForceMove = false; + ForceTimer = 5000; + + cur_wp = 4; + + m_creature->SetDisplayId(m_creature->GetNativeDisplayId()); + m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate); + //m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); + //m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->setActive(false); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_ALAREVENT, IN_PROGRESS); + + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement + DoZoneInCombat(); + m_creature->setActive(true); + } + + void JustDied(Unit *victim) + { + if (pInstance) + pInstance->SetData(DATA_ALAREVENT, DONE); + } + + void JustSummoned(Creature *summon) + { + if (summon->GetEntry() == CREATURE_EMBER_OF_ALAR) + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + summon->AI()->AttackStart(target); + } + + void MoveInLineOfSight(Unit *who) {} + + void AttackStart(Unit* who) + { + if (Phase1) + AttackStartNoMove(who); + else + ScriptedAI::AttackStart(who); + } + + void DamageTaken(Unit* pKiller, uint32 &damage) + { + if (damage >= m_creature->GetHealth() && Phase1) + { + damage = 0; + if (!WaitEvent) + { + WaitEvent = WE_DIE; + WaitTimer = 0; + m_creature->SetHealth(0); + m_creature->InterruptNonMeleeSpells(true); + m_creature->RemoveAllAuras(); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->AttackStop(); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); + m_creature->SetSpeed(MOVE_RUN, 5.0f); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]); + } + } + } + + void SpellHit(Unit*, const SpellEntry *spell) + { + if (spell->Id == SPELL_DIVE_BOMB_VISUAL) + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + m_creature->SetDisplayId(11686); + //m_creature->SendUpdateObjectToAllExcept(NULL); + } + } + + void MovementInform(uint32 type, uint32 id) + { + if (type == POINT_MOTION_TYPE) + { + WaitTimer = 1; + AfterMoving = true; + ForceMove = false; + } + } + + void UpdateAI(const uint32 diff) + { + if (!m_creature->isInCombat()) // sometimes isincombat but !incombat, faction bug? + return; + + if (Berserk_Timer < diff) + { + m_creature->CastSpell(m_creature, SPELL_BERSERK, true); + Berserk_Timer = 60000; + }else Berserk_Timer -= diff; + + if (ForceMove) + { + if (ForceTimer < diff) + { + m_creature->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]); + ForceTimer = 5000; + }else ForceTimer -= diff; + + } + if (WaitEvent) + { + if (WaitTimer) + { + if (WaitTimer <= diff) + { + if (AfterMoving) + { + m_creature->GetMotionMaster()->MoveIdle(); + AfterMoving = false; + } + + switch(WaitEvent) + { + case WE_PLATFORM: + Platforms_Move_Timer = 30000+rand()%5000; + break; + case WE_QUILL: + m_creature->CastSpell(m_creature, SPELL_FLAME_QUILLS, true); + Platforms_Move_Timer = 1; + WaitTimer = 10000; + WaitEvent = WE_DUMMY; + return; + case WE_DIE: + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); + WaitTimer = 5000; + WaitEvent = WE_REVIVE; + return; + case WE_REVIVE: + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + DoResetThreat(); + DoZoneInCombat(); + m_creature->CastSpell(m_creature, SPELL_REBIRTH, true); + MeltArmor_Timer = 60000; + Charge_Timer = 7000; + DiveBomb_Timer = 40000+rand()%5000; + FlamePatch_Timer = 30000; + Phase1 = false; + break; + case WE_METEOR: + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); + m_creature->CastSpell(m_creature, SPELL_DIVE_BOMB_VISUAL, false); + WaitEvent = WE_DIVE; + WaitTimer = 4000; + return; + case WE_DIVE: + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + m_creature->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL); + m_creature->CastSpell(target, SPELL_DIVE_BOMB, true); + float dist; + if (m_creature->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f)) dist = 5.0f; + WaitTimer = 1000 + floor(dist / 80 * 1000.0f); + m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0.0f); + m_creature->StopMoving(); + WaitEvent = WE_LAND; + } + else + { + EnterEvadeMode(); + return; + } + case WE_LAND: + WaitEvent = WE_SUMMON; + WaitTimer = 2000; + return; + case WE_SUMMON: + for(uint8 i = 0; i < 2; ++i) + DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetDisplayId(m_creature->GetNativeDisplayId()); + m_creature->CastSpell(m_creature, SPELL_REBIRTH_2, true); + break; + case WE_DUMMY: + default: + break; + } + + WaitEvent = WE_NONE; + WaitTimer = 0; + }else WaitTimer -= diff; + } + return; + } + + if (Phase1) + { + if (m_creature->getThreatManager().getThreatList().empty()) + { + EnterEvadeMode(); + return; + } + + if (Platforms_Move_Timer < diff) + { + if (cur_wp == 4) + { + cur_wp = 0; + WaitEvent = WE_PLATFORM; + } + else + { + if (rand()%5) // next platform + { + DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (cur_wp == 3) + cur_wp = 0; + else + cur_wp++; + WaitEvent = WE_PLATFORM; + } + else // flame quill + { + cur_wp = 4; + WaitEvent = WE_QUILL; + } + } + ForceMove = true; + ForceTimer = 5000; + m_creature->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]); + WaitTimer = 0; + return; + }else Platforms_Move_Timer -= diff; + } + else + { + if (!UpdateVictim()) + return; + + if (Charge_Timer < diff) + { + Unit *target= SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); + if (target) + DoCast(target, SPELL_CHARGE); + Charge_Timer = 30000; + }else Charge_Timer -= diff; + + if (MeltArmor_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_MELT_ARMOR); + MeltArmor_Timer = 60000; + }else MeltArmor_Timer -= diff; + + if (DiveBomb_Timer < diff) + { + m_creature->AttackStop(); + m_creature->GetMotionMaster()->MovePoint(6, waypoint[4][0], waypoint[4][1], waypoint[4][2]); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 50); + WaitEvent = WE_METEOR; + WaitTimer = 0; + DiveBomb_Timer = 40000+rand()%5000; + return; + }else DiveBomb_Timer -= diff; + + if (FlamePatch_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + Creature* Summoned = m_creature->SummonCreature(CREATURE_FLAME_PATCH_ALAR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000); + if (Summoned) + { + Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Summoned->SetFloatValue(OBJECT_FIELD_SCALE_X, Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f); + Summoned->SetDisplayId(11686); + Summoned->setFaction(m_creature->getFaction()); + Summoned->SetLevel(m_creature->getLevel()); + Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false); + } + } + FlamePatch_Timer = 30000; + }else FlamePatch_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } + + void DoMeleeAttackIfReady() + { + if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) + { + if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + m_creature->AttackerStateUpdate(m_creature->getVictim()); + m_creature->resetAttackTimer(); + } + else + { + Unit *target = NULL; + target = m_creature->SelectNearestTarget(5); + if (Phase1 && target) + m_creature->AI()->AttackStart(target); + else + { + m_creature->CastSpell(m_creature, SPELL_FLAME_BUFFET, true); + m_creature->setAttackTimer(BASE_ATTACK, 1500); + } + } + } + } +}; + +CreatureAI* GetAI_boss_alar(Creature* pCreature) +{ + return new boss_alarAI(pCreature); +} + +struct TRINITY_DLL_DECL mob_ember_of_alarAI : public ScriptedAI +{ + mob_ember_of_alarAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + } + + ScriptedInstance *pInstance; + bool toDie; + + void Reset() {toDie = false;} + void EnterCombat(Unit *who) {DoZoneInCombat();} + void EnterEvadeMode() {m_creature->setDeathState(JUST_DIED);} + + void DamageTaken(Unit* pKiller, uint32 &damage) + { + if (damage >= m_creature->GetHealth() && pKiller != m_creature && !toDie) + { + damage = 0; + m_creature->CastSpell(m_creature, SPELL_EMBER_BLAST, true); + m_creature->SetDisplayId(11686); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + if (pInstance && pInstance->GetData(DATA_ALAREVENT) == 2) + { + if (Unit* Alar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ALAR))) + { + int AlarHealth = Alar->GetHealth() - Alar->GetMaxHealth()*0.03; + if (AlarHealth > 0) + Alar->SetHealth(AlarHealth); + else + Alar->SetHealth(1); + } + } + toDie = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (toDie) + { + m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + //m_creature->SetVisibility(VISIBILITY_OFF); + } + + DoMeleeAttackIfReady(); + } + +}; + +CreatureAI* GetAI_mob_ember_of_alar(Creature* pCreature) +{ + return new mob_ember_of_alarAI(pCreature); +} + +struct TRINITY_DLL_DECL mob_flame_patch_alarAI : public ScriptedAI +{ + mob_flame_patch_alarAI(Creature *c) : ScriptedAI(c) {} + void Reset() {} + void EnterCombat(Unit *who) {} + void AttackStart(Unit* who) {} + void MoveInLineOfSight(Unit* who) {} + void UpdateAI(const uint32 diff) {} +}; + +CreatureAI* GetAI_mob_flame_patch_alar(Creature* pCreature) +{ + return new mob_flame_patch_alarAI(pCreature); +} + +void AddSC_boss_alar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_alar"; + newscript->GetAI = &GetAI_boss_alar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ember_of_alar"; + newscript->GetAI = &GetAI_mob_ember_of_alar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_flame_patch_alar"; + newscript->GetAI = &GetAI_mob_flame_patch_alar; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp new file mode 100644 index 00000000000..81f3c619bac --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_astromancer.cpp @@ -0,0 +1,474 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Astromancer +SD%Complete: 80 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "def_the_eye.h" + +enum +{ + SAY_AGGRO = -1550007, + SAY_SUMMON1 = -1550008, + SAY_SUMMON2 = -1550009, + SAY_KILL1 = -1550010, + SAY_KILL2 = -1550011, + SAY_KILL3 = -1550012, + SAY_DEATH = -1550013, + SAY_VOIDA = -1550014, + SAY_VOIDB = -1550015, + + SPELL_ARCANE_MISSILES = 33031, + SPELL_WRATH_OF_THE_ASTROMANCER = 42783, + SPELL_BLINDING_LIGHT = 33009, + SPELL_FEAR = 34322, + SPELL_VOID_BOLT = 39329, + + SPELL_SPOTLIGHT = 25824, + NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT = 18928, + + NPC_SOLARIUM_AGENT = 18925, + NPC_SOLARIUM_PRIEST = 18806, + + MODEL_HUMAN = 18239, + MODEL_VOIDWALKER = 18988, + + SPELL_SOLARIUM_GREAT_HEAL = 33387, + SPELL_SOLARIUM_HOLY_SMITE = 25054, + SPELL_SOLARIUM_ARCANE_TORRENT = 33390, + + WV_ARMOR = 31000 +}; + +const float CENTER_X = 432.909f; +const float CENTER_Y = -373.424f; +const float CENTER_Z = 17.9608f; +const float CENTER_O = 1.06421f; +const float SMALL_PORTAL_RADIUS = 12.6f; +const float LARGE_PORTAL_RADIUS = 26.0f; +const float PORTAL_Z = 17.005f; + + // x, y, z, o +static float SolarianPos[4] = {432.909, -373.424, 17.9608, 1.06421}; + +struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI +{ + boss_high_astromancer_solarianAI(Creature *c) : ScriptedAI(c), Summons(m_creature) + { + pInstance = c->GetInstanceData(); + + defaultarmor = m_creature->GetArmor(); + defaultsize = m_creature->GetFloatValue(OBJECT_FIELD_SCALE_X); + } + + ScriptedInstance *pInstance; + SummonList Summons; + + uint8 Phase; + + uint32 ArcaneMissiles_Timer; + uint32 m_uiWrathOfTheAstromancer_Timer; + uint32 BlindingLight_Timer; + uint32 Fear_Timer; + uint32 VoidBolt_Timer; + uint32 Phase1_Timer; + uint32 Phase2_Timer; + uint32 Phase3_Timer; + uint32 AppearDelay_Timer; + uint32 defaultarmor; + uint32 Wrath_Timer; + + float defaultsize; + float Portals[3][3]; + + bool AppearDelay; + bool BlindingLight; + + void Reset() + { + ArcaneMissiles_Timer = 2000; + m_uiWrathOfTheAstromancer_Timer = 15000; + BlindingLight_Timer = 41000; + Fear_Timer = 20000; + VoidBolt_Timer = 10000; + Phase1_Timer = 50000; + Phase2_Timer = 10000; + Phase3_Timer = 15000; + AppearDelay_Timer = 2000; + BlindingLight = false; + AppearDelay = false; + Wrath_Timer = 20000+rand()%5000;//twice in phase one + Phase = 1; + Wrath_Timer = 20000+rand()%5000;//twice in phase one + + if (pInstance) + pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED); + + m_creature->SetArmor(defaultarmor); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); + m_creature->SetDisplayId(MODEL_HUMAN); + + Summons.DespawnAll(); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_KILL1, m_creature); break; + case 1: DoScriptText(SAY_KILL2, m_creature); break; + case 2: DoScriptText(SAY_KILL3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); + m_creature->SetDisplayId(MODEL_HUMAN); + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, DONE); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + DoZoneInCombat(); + + if (pInstance) + pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS); + } + + void SummonMinion(uint32 entry, float x, float y, float z) + { + Creature* Summoned = m_creature->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); + if (Summoned) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + Summoned->AI()->AttackStart(target); + + Summons.Summon(Summoned); + } + } + + float Portal_X(float radius) + { + if ((rand()%2)==1) + radius = -radius; + + return (radius * (float)(rand()%100)/100.0f + CENTER_X); + } + + float Portal_Y(float x, float radius) + { + float z = 0.0f; + + switch(rand()%2) + { + case 0: z = 1; break; + case 1: z = -1; break; + } + return (z*sqrt(radius*radius - (x - CENTER_X)*(x - CENTER_X)) + CENTER_Y); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (AppearDelay) + { + m_creature->StopMoving(); + m_creature->AttackStop(); + if (AppearDelay_Timer < diff) + { + AppearDelay = false; + if (Phase == 2) + { + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_OFF); + } + AppearDelay_Timer = 2000; + }else AppearDelay_Timer -= diff; + } + + if (Phase == 1) + { + if (BlindingLight_Timer < diff){ + BlindingLight = true; + BlindingLight_Timer = 45000; + }else BlindingLight_Timer -= diff; + + if (Wrath_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,100,true), SPELL_WRATH_OF_THE_ASTROMANCER, true); + Wrath_Timer = 20000+rand()%5000; + }else Wrath_Timer -= diff; + + if (ArcaneMissiles_Timer < diff) + { + if (BlindingLight) + { + DoCast(m_creature->getVictim(), SPELL_BLINDING_LIGHT); + BlindingLight = false; + }else{ + Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (!m_creature->HasInArc(2.5f, target)) + target = m_creature->getVictim(); + + if (target) + DoCast(target, SPELL_ARCANE_MISSILES); + } + ArcaneMissiles_Timer = 3000; + }else ArcaneMissiles_Timer -= diff; + + if (m_uiWrathOfTheAstromancer_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + + //Target the tank ? + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) + if (pTarget->GetTypeId() == TYPEID_PLAYER) + { + DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER); + m_uiWrathOfTheAstromancer_Timer = 25000; + } + else + m_uiWrathOfTheAstromancer_Timer = 1000; + }else m_uiWrathOfTheAstromancer_Timer -= diff; + + //Phase1_Timer + if (Phase1_Timer < diff) + { + Phase = 2; + Phase1_Timer = 50000; + //After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind. + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMap()->CreatureRelocation(m_creature, CENTER_X, CENTER_Y, CENTER_Z, CENTER_O); + for(uint8 i=0; i<=2; ++i) + { + if (!i) + { + Portals[i][0] = Portal_X(SMALL_PORTAL_RADIUS); + Portals[i][1] = Portal_Y(Portals[i][0], SMALL_PORTAL_RADIUS); + Portals[i][2] = CENTER_Z; + } + else + { + Portals[i][0] = Portal_X(LARGE_PORTAL_RADIUS); + Portals[i][1] = Portal_Y(Portals[i][0], LARGE_PORTAL_RADIUS); + Portals[i][2] = PORTAL_Z; + } + } + if ((abs(Portals[2][0] - Portals[1][0]) < 7) && (abs(Portals[2][1] - Portals[1][1]) < 7)) + { + int i=1; + if (abs(CENTER_X + 26.0f - Portals[2][0]) < 7) + i = -1; + Portals[2][0] = Portals[2][0]+7*i; + Portals[2][1] = Portal_Y(Portals[2][0], LARGE_PORTAL_RADIUS); + } + for (int i=0; i<=2; ++i) + { + if (Creature* Summoned = m_creature->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700)) + { + Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false); + } + } + AppearDelay = true; + }else Phase1_Timer-=diff; + } + else if (Phase == 2) + { + //10 seconds after Solarian disappears, 12 mobs spawn out of the three portals. + m_creature->AttackStop(); + m_creature->StopMoving(); + if (Phase2_Timer < diff) + { + Phase = 3; + for (int i=0; i<=2; ++i) + for (int j=1; j<=4; j++) + SummonMinion(NPC_SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]); + + DoScriptText(SAY_SUMMON1, m_creature); + Phase2_Timer = 10000; + } else Phase2_Timer -= diff; + } + else if (Phase == 3) + { + m_creature->AttackStop(); + m_creature->StopMoving(); + + //Check Phase3_Timer + if (Phase3_Timer < diff) + { + Phase = 1; + + //15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals. + int i = rand()%3; + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMap()->CreatureRelocation(m_creature, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O); + + for (int j=0; j<=2; j++) + if (j!=i) + SummonMinion(NPC_SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + + DoScriptText(SAY_SUMMON2, m_creature); + AppearDelay = true; + Phase3_Timer = 15000; + }else Phase3_Timer -= diff; + } + else if (Phase == 4) + { + //Fear_Timer + if (Fear_Timer < diff) + { + DoCast(m_creature, SPELL_FEAR); + Fear_Timer = 20000; + }else Fear_Timer -= diff; + + //VoidBolt_Timer + if (VoidBolt_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_VOID_BOLT); + VoidBolt_Timer = 10000; + }else VoidBolt_Timer -= diff; + } + + //When Solarian reaches 20% she will transform into a huge void walker. + if (Phase != 4 && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth())<20)) + { + Phase = 4; + + //To make sure she wont be invisible or not selecatble + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetVisibility(VISIBILITY_ON); + DoScriptText(SAY_VOIDA, m_creature); + DoScriptText(SAY_VOIDB, m_creature); + m_creature->SetArmor(WV_ARMOR); + m_creature->SetDisplayId(MODEL_VOIDWALKER); + m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f); + } + + DoMeleeAttackIfReady(); + } +}; + +struct TRINITY_DLL_DECL mob_solarium_priestAI : public ScriptedAI +{ + mob_solarium_priestAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + uint32 healTimer; + uint32 holysmiteTimer; + uint32 aoesilenceTimer; + + void Reset() + { + healTimer = 9000; + holysmiteTimer = 1; + aoesilenceTimer = 15000; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (healTimer < diff) + { + Unit* target = NULL; + + switch(rand()%2) + { + case 0: + if (pInstance) + target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ASTROMANCER)); + break; + case 1: + target = m_creature; + break; + } + + if (target) + { + DoCast(target,SPELL_SOLARIUM_GREAT_HEAL); + healTimer = 9000; + } + } else healTimer -= diff; + + if (holysmiteTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SOLARIUM_HOLY_SMITE); + holysmiteTimer = 4000; + } else holysmiteTimer -= diff; + + if (aoesilenceTimer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SOLARIUM_ARCANE_TORRENT); + aoesilenceTimer = 13000; + } else aoesilenceTimer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_solarium_priest(Creature* pCreature) +{ + return new mob_solarium_priestAI (pCreature); +} + +CreatureAI* GetAI_boss_high_astromancer_solarian(Creature* pCreature) +{ + return new boss_high_astromancer_solarianAI (pCreature); +} + +void AddSC_boss_high_astromancer_solarian() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_high_astromancer_solarian"; + newscript->GetAI = &GetAI_boss_high_astromancer_solarian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_solarium_priest"; + newscript->GetAI = &GetAI_mob_solarium_priest; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp new file mode 100644 index 00000000000..d341e52ae06 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_kaelthas.cpp @@ -0,0 +1,1515 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Kaelthas +SD%Complete: 60 +SDComment: SQL, weapon scripts, mind control, need correct spells(interruptible/uninterruptible), phoenix spawn location & animation, phoenix behaviour & spawn during gravity lapse +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "def_the_eye.h" +#include "WorldPacket.h" + +enum +{ + //kael'thas Speech + SAY_INTRO = -1550016, + SAY_INTRO_CAPERNIAN = -1550017, + SAY_INTRO_TELONICUS = -1550018, + SAY_INTRO_THALADRED = -1550019, + SAY_INTRO_SANGUINAR = -1550020, + SAY_PHASE2_WEAPON = -1550021, + SAY_PHASE3_ADVANCE = -1550022, + SAY_PHASE4_INTRO2 = -1550023, + SAY_PHASE5_NUTS = -1550024, + SAY_SLAY1 = -1550025, + SAY_SLAY2 = -1550026, + SAY_SLAY3 = -1550027, + SAY_MINDCONTROL1 = -1550028, + SAY_MINDCONTROL2 = -1550029, + SAY_GRAVITYLAPSE1 = -1550030, + SAY_GRAVITYLAPSE2 = -1550031, + SAY_SUMMON_PHOENIX1 = -1550032, + SAY_SUMMON_PHOENIX2 = -1550033, + SAY_DEATH = -1550034, + + //Thaladred the Darkener speech + SAY_THALADRED_AGGRO = -1550035, + SAY_THALADRED_DEATH = -1550036, + EMOTE_THALADRED_GAZE = -1550037, + + //Lord Sanguinar speech + SAY_SANGUINAR_AGGRO = -1550038, + SAY_SANGUINAR_DEATH = -1550039, + + //Grand Astromancer Capernian speech + SAY_CAPERNIAN_AGGRO = -1550040, + SAY_CAPERNIAN_DEATH = -1550041, + + //Master Engineer Telonicus speech + SAY_TELONICUS_AGGRO = -1550042, + SAY_TELONICUS_DEATH = -1550043, + + //Phase 2 spells + SPELL_SUMMON_WEAPONS = 36976, + SPELL_SUMMON_WEAPONA = 36958, + SPELL_SUMMON_WEAPONB = 36959, + SPELL_SUMMON_WEAPONC = 36960, + SPELL_SUMMON_WEAPOND = 36961, + SPELL_SUMMON_WEAPONE = 36962, + SPELL_SUMMON_WEAPONF = 36963, + SPELL_SUMMON_WEAPONG = 36964, + SPELL_RES_VISUAL = 24171, + + //Phase 4 spells + SPELL_FIREBALL = 22088, //wrong but works with CastCustomSpell + SPELL_PYROBLAST = 36819, + SPELL_FLAME_STRIKE = 36735, + SPELL_FLAME_STRIKE_VIS = 36730, + SPELL_FLAME_STRIKE_DMG = 36731, + SPELL_ARCANE_DISRUPTION = 36834, + SPELL_SHOCK_BARRIER = 36815, + SPELL_PHOENIX_ANIMATION = 36723, + SPELL_MIND_CONTROL = 32830, + + //Phase 5 spells + SPELL_EXPLODE = 36092, + SPELL_FULLPOWER = 36187, + SPELL_KNOCKBACK = 11027, + SPELL_GRAVITY_LAPSE = 34480, + SPELL_GRAVITY_LAPSE_AURA = 39432, + SPELL_NETHER_BEAM = 35873, + + //Thaladred the Darkener spells + SPELL_PSYCHIC_BLOW = 10689, + SPELL_SILENCE = 30225, + //Lord Sanguinar spells + SPELL_BELLOWING_ROAR = 40636, + //Grand Astromancer Capernian spells + + SPELL_CAPERNIAN_FIREBALL = 36971, + SPELL_CONFLAGRATION = 37018, + SPELL_ARCANE_EXPLOSION = 36970, + //Master Engineer Telonicus spells + SPELL_BOMB = 37036, + SPELL_REMOTE_TOY = 37027, + //Nether Vapor spell + SPELL_NETHER_VAPOR = 35859, + //Phoenix spell + SPELL_BURN = 36720, + SPELL_EMBER_BLAST = 34341, + SPELL_REBIRTH = 41587, + + //Creature IDs + NPC_PHOENIX = 21362, + NPC_PHOENIX_EGG = 21364, + + //Phoenix egg and phoenix model + MODEL_ID_PHOENIX = 19682, + MODEL_ID_PHOENIX_EGG = 20245, + + MAX_ADVISORS = 4 +}; + +uint32 m_auiSpellSummonWeapon[]= +{ + SPELL_SUMMON_WEAPONA, SPELL_SUMMON_WEAPONB, SPELL_SUMMON_WEAPONC, SPELL_SUMMON_WEAPOND, + SPELL_SUMMON_WEAPONE, SPELL_SUMMON_WEAPONF, SPELL_SUMMON_WEAPONG +}; + +const float CAPERNIAN_DISTANCE = 20.0f; //she casts away from the target +const float KAEL_VISIBLE_RANGE = 50.0f; + +const float afGravityPos[3] = {795.0f, 0.0f, 70.0f}; + +#define TIME_PHASE_2_3 120000 +#define TIME_PHASE_3_4 180000 + +//Base AI for Advisors +struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI +{ + advisorbase_ai(Creature* pCreature) : ScriptedAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + m_bDoubled_Health = false; + } + + ScriptedInstance* m_pInstance; + bool FakeDeath; + bool m_bDoubled_Health; + uint32 DelayRes_Timer; + uint64 DelayRes_Target; + + void Reset() + { + if (m_bDoubled_Health) + { + m_creature->SetMaxHealth(m_creature->GetMaxHealth() / 2); + m_bDoubled_Health = false; + } + + FakeDeath = false; + DelayRes_Timer = 0; + DelayRes_Target = 0; + + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + + //reset encounter + if (m_pInstance && (m_pInstance->GetData(DATA_KAELTHASEVENT) == 1 || m_pInstance->GetData(DATA_KAELTHASEVENT) == 3)) + { + if (Creature *Kaelthas = Unit::GetCreature((*m_creature), m_pInstance->GetData64(DATA_KAELTHAS))) + Kaelthas->AI()->EnterEvadeMode(); + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::MoveInLineOfSight(who); + } + + void AttackStart(Unit* who) + { + if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + ScriptedAI::AttackStart(who); + } + + void Revive(Unit* Target) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + // double health for phase 3 + m_creature->SetMaxHealth(m_creature->GetMaxHealth() * 2); + m_bDoubled_Health = true; + m_creature->SetHealth(m_creature->GetMaxHealth()); + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + DoCast(m_creature, SPELL_RES_VISUAL, false); + DelayRes_Timer = 2000; + } + + void DamageTaken(Unit* pKiller, uint32 &damage) + { + if (damage < m_creature->GetHealth()) + return; + + //Prevent glitch if in fake death + if (FakeDeath && m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) != 0) + { + damage = 0; + return; + } + + //Don't really die in phase 1 & 3, only die after that + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) != 0) + { + //prevent death + damage = 0; + FakeDeath = true; + + m_creature->InterruptNonMeleeSpells(false); + m_creature->SetHealth(0); + m_creature->StopMoving(); + m_creature->ClearComboPointHolders(); + m_creature->RemoveAllAurasOnDeath(); + m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); + m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->ClearAllReactives(); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + JustDied(pKiller); + } + } + + void UpdateAI(const uint32 diff) + { + if (DelayRes_Timer) + { + if (DelayRes_Timer <= diff) + { + DelayRes_Timer = 0; + FakeDeath = false; + + Unit* Target = Unit::GetUnit((*m_creature), DelayRes_Target); + if (!Target) + Target = m_creature->getVictim(); + + DoResetThreat(); + AttackStart(Target); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveChase(Target); + m_creature->AddThreat(Target, 0.0f); + }else DelayRes_Timer -= diff; + } + } + +}; + +//Kael'thas AI +struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI +{ + boss_kaelthasAI(Creature* pCreature) : ScriptedAI(pCreature), summons(m_creature) + { + m_pInstance = pCreature->GetInstanceData(); + memset(&m_auiAdvisorGuid, 0, sizeof(m_auiAdvisorGuid)); + } + + ScriptedInstance* m_pInstance; + + uint32 Fireball_Timer; + uint32 ArcaneDisruption_Timer; + uint32 Phoenix_Timer; + uint32 ShockBarrier_Timer; + uint32 GravityLapse_Timer; + uint32 GravityLapse_Phase; + uint32 NetherBeam_Timer; + uint32 NetherVapor_Timer; + uint32 FlameStrike_Timer; + uint32 MindControl_Timer; + uint32 Phase; + uint32 PhaseSubphase; //generic + uint32 Phase_Timer; //generic timer + uint32 PyrosCasted; + + bool InGravityLapse; + bool IsCastingFireball; + bool ChainPyros; + + SummonList summons; + + uint64 m_auiAdvisorGuid[MAX_ADVISORS]; + + void Reset() + { + Fireball_Timer = 5000+rand()%10000; + ArcaneDisruption_Timer = 45000; + MindControl_Timer = 40000; + Phoenix_Timer = 50000; + ShockBarrier_Timer = 60000; + FlameStrike_Timer = 30000; + GravityLapse_Timer = 20000; + GravityLapse_Phase = 0; + NetherBeam_Timer = 8000; + NetherVapor_Timer = 10000; + PyrosCasted = 0; + Phase = 0; + InGravityLapse = false; + IsCastingFireball = false; + ChainPyros = false; + + if (m_creature->isInCombat()) + PrepareAdvisors(); + + summons.DespawnAll(); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (m_pInstance) + m_pInstance->SetData(DATA_KAELTHASEVENT, 0); + } + + void PrepareAdvisors() + { + for(uint8 i = 0; i < MAX_ADVISORS; ++i) + { + if (Creature *pCreature = Unit::GetCreature((*m_creature), m_auiAdvisorGuid[i])) + { + pCreature->Respawn(); + pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + pCreature->setFaction(m_creature->getFaction()); + pCreature->AI()->EnterEvadeMode(); + } + } + } + + void StartEvent() + { + if (!m_pInstance) + return; + + m_auiAdvisorGuid[0] = m_pInstance->GetData64(DATA_THALADREDTHEDARKENER); + m_auiAdvisorGuid[1] = m_pInstance->GetData64(DATA_LORDSANGUINAR); + m_auiAdvisorGuid[2] = m_pInstance->GetData64(DATA_GRANDASTROMANCERCAPERNIAN); + m_auiAdvisorGuid[3] = m_pInstance->GetData64(DATA_MASTERENGINEERTELONICUS); + + if (!m_auiAdvisorGuid[0] || !m_auiAdvisorGuid[1] || !m_auiAdvisorGuid[2] || !m_auiAdvisorGuid[3]) + { + error_log("TSCR: Kael'Thas One or more advisors missing, Skipping Phases 1-3"); + + DoScriptText(SAY_PHASE4_INTRO2, m_creature); + + Phase = 4; + + m_pInstance->SetData(DATA_KAELTHASEVENT, 4); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + AttackStart(target); + + } + else + { + PrepareAdvisors(); + + DoScriptText(SAY_INTRO, m_creature); + + m_pInstance->SetData(DATA_KAELTHASEVENT, 1); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + PhaseSubphase = 0; + Phase_Timer = 23000; + Phase = 1; + } + } + + void MoveInLineOfSight(Unit *who) + { + if (!m_creature->hasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && + m_creature->IsHostileTo(who) && who->isInAccessiblePlaceFor(m_creature)) + { + if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + { + if (!m_creature->getVictim() && Phase >= 4) + { + who->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + else if (m_creature->GetMap()->IsDungeon()) + { + if (m_pInstance && !m_pInstance->GetData(DATA_KAELTHASEVENT) && !Phase) + StartEvent(); + + who->SetInCombatWith(m_creature); + m_creature->AddThreat(who, 0.0f); + } + } + } + } + + void Aggro(Unit *who) + { + if (m_pInstance && !m_pInstance->GetData(DATA_KAELTHASEVENT) && !Phase) + StartEvent(); + } + + void KilledUnit() + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustSummoned(Creature* pSummoned) + { + // if not phoenix, then it's one of the 7 weapons + if (pSummoned->GetEntry() != NPC_PHOENIX) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + pSummoned->AI()->AttackStart(pTarget); + + summons.Summon(pSummoned); + } + } + + void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} + + void JustDied(Unit* Killer) + { + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + DoScriptText(SAY_DEATH, m_creature); + + summons.DespawnAll(); + + if (m_pInstance) + m_pInstance->SetData(DATA_KAELTHASEVENT, 0); + + for(uint8 i = 0; i < MAX_ADVISORS; ++i) + { + if (Unit* pAdvisor = Unit::GetUnit((*m_creature), m_auiAdvisorGuid[i])) + pAdvisor->DealDamage(pAdvisor, pAdvisor->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } + + void UpdateAI(const uint32 diff) + { + //Phase 1 + switch (Phase) + { + case 1: + { + Unit *target = NULL; + Creature* Advisor = NULL; + + //Subphase switch + switch(PhaseSubphase) + { + //Subphase 1 - Start + case 0: + if (Phase_Timer < diff) + { + DoScriptText(SAY_INTRO_THALADRED, m_creature); + + //start advisor within 7 seconds + Phase_Timer = 7000; + PhaseSubphase++; + }else Phase_Timer -= diff; + break; + + //Subphase 1 - Unlock advisor + case 1: + if (Phase_Timer < diff) + { + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[0])); + + if (Advisor) + { + Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Advisor->setFaction(m_creature->getFaction()); + + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + Advisor->AI()->AttackStart(target); + } + + PhaseSubphase++; + }else Phase_Timer -= diff; + break; + + //Subphase 2 - Start + case 2: + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[0])); + + if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_SANGUINAR, m_creature); + + //start advisor within 12.5 seconds + Phase_Timer = 12500; + PhaseSubphase++; + } + break; + + //Subphase 2 - Unlock advisor + case 3: + if (Phase_Timer < diff) + { + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[1])); + + if (Advisor) + { + Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Advisor->setFaction(m_creature->getFaction()); + + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + Advisor->AI()->AttackStart(target); + } + + PhaseSubphase++; + }else Phase_Timer -= diff; + break; + + //Subphase 3 - Start + case 4: + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[1])); + + if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_CAPERNIAN, m_creature); + + //start advisor within 7 seconds + Phase_Timer = 7000; + PhaseSubphase++; + } + break; + + //Subphase 3 - Unlock advisor + case 5: + if (Phase_Timer < diff) + { + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[2])); + + if (Advisor) + { + Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Advisor->setFaction(m_creature->getFaction()); + + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + Advisor->AI()->AttackStart(target); + } + + PhaseSubphase++; + }else Phase_Timer -= diff; + break; + + //Subphase 4 - Start + case 6: + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[2])); + + if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + DoScriptText(SAY_INTRO_TELONICUS, m_creature); + + //start advisor within 8.4 seconds + Phase_Timer = 8400; + PhaseSubphase++; + } + break; + + //Subphase 4 - Unlock advisor + case 7: + if (Phase_Timer < diff) + { + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[3])); + + if (Advisor) + { + Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Advisor->setFaction(m_creature->getFaction()); + + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + if (target) + Advisor->AI()->AttackStart(target); + } + + Phase_Timer = 3000; + PhaseSubphase++; + }else Phase_Timer -= diff; + break; + + //End of phase 1 + case 8: + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[3])); + + if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) + { + Phase = 2; + m_pInstance->SetData(DATA_KAELTHASEVENT, 2); + + DoScriptText(SAY_PHASE2_WEAPON, m_creature); + + PhaseSubphase = 0; + Phase_Timer = 3500; + DoCast(m_creature, SPELL_SUMMON_WEAPONS); + } + break; + } + }break; + + case 2: + { + if (PhaseSubphase == 0) + { + if (Phase_Timer < diff) + { + PhaseSubphase = 1; + }else Phase_Timer -= diff; + } + + //Spawn weapons + if (PhaseSubphase == 1) + { + m_creature->CastSpell(m_creature, SPELL_SUMMON_WEAPONS, false); + + uint8 uiMaxWeapon = sizeof(m_auiSpellSummonWeapon)/sizeof(uint32); + + for (uint32 i = 0; i < uiMaxWeapon; ++i) + m_creature->CastSpell(m_creature,m_auiSpellSummonWeapon[i],true); + + PhaseSubphase = 2; + Phase_Timer = TIME_PHASE_2_3; + } + + if (PhaseSubphase == 2) + { + if (Phase_Timer < diff) + { + DoScriptText(SAY_PHASE3_ADVANCE, m_creature); + m_pInstance->SetData(DATA_KAELTHASEVENT, 3); + Phase = 3; + PhaseSubphase = 0; + }else Phase_Timer -= diff; + } + }break; + + case 3: + { + if (PhaseSubphase == 0) + { + //Respawn advisors + Unit* Target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + Creature* Advisor; + for (uint32 i = 0; i < MAX_ADVISORS; ++i) + { + Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[i])); + + if (!Advisor) + error_log("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i); + else + CAST_AI(advisorbase_ai, Advisor->AI())->Revive(Target); + } + + PhaseSubphase = 1; + Phase_Timer = TIME_PHASE_3_4; + } + + if (Phase_Timer < diff) + { + DoScriptText(SAY_PHASE4_INTRO2, m_creature); + Phase = 4; + + m_pInstance->SetData(DATA_KAELTHASEVENT, 4); + + // Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael. + DoResetThreat(); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + AttackStart(target); + + Phase_Timer = 30000; + }else Phase_Timer -= diff; + } + break; + + case 4: + case 5: + case 6: + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Fireball_Timer + if (!InGravityLapse && !ChainPyros && Phase != 5) + { + if (Fireball_Timer < diff) + { + if (!IsCastingFireball) + { + if (!m_creature->IsNonMeleeSpellCasted(false)) + { + //interruptable + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); + int32 dmg = 20000+rand()%5000; + m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_FIREBALL, &dmg, 0, 0, false); + IsCastingFireball = true; + Fireball_Timer = 2500; + } + } + else + { + //apply resistance + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); + IsCastingFireball = false; + Fireball_Timer = 5000+rand()%10000; + } + }else Fireball_Timer -= diff; + + //ArcaneDisruption_Timer + if (ArcaneDisruption_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_DISRUPTION, true); + ArcaneDisruption_Timer = 60000; + }else ArcaneDisruption_Timer -= diff; + + if (FlameStrike_Timer < diff) + { + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_FLAME_STRIKE); + + FlameStrike_Timer = 30000; + }FlameStrike_Timer -= diff; + + if (MindControl_Timer < diff) + { + if (m_creature->getThreatManager().getThreatList().size() >= 2) + for (uint32 i = 0; i < 3; ++i) + { + debug_log("SD2: Kael'Thas mind control not supported."); + //DoCast(pUnit, SPELL_MIND_CONTROL); + } + + MindControl_Timer = 60000; + }MindControl_Timer -= diff; + } + + //Phoenix_Timer + if (Phoenix_Timer < diff) + { + DoCast(m_creature, SPELL_PHOENIX_ANIMATION); + + if (Creature* pPhoenix = m_creature->SummonCreature(NPC_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000)) + { + if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) + pPhoenix->AI()->AttackStart(pTarget); + } + else + error_log("SD2: Kael'Thas Phoenix could not be spawned"); + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SUMMON_PHOENIX1, m_creature); break; + case 1: DoScriptText(SAY_SUMMON_PHOENIX2, m_creature); break; + } + + Phoenix_Timer = 60000; + }else Phoenix_Timer -= diff; + + //Phase 4 specific spells + if (Phase == 4) + { + if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) + { + m_pInstance->SetData(DATA_KAELTHASEVENT, 4); + Phase = 5; + Phase_Timer = 10000; + + DoScriptText(SAY_PHASE5_NUTS, m_creature); + + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->GetMap()->CreatureRelocation(m_creature, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); + m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0); + + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, SPELL_FULLPOWER); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + } + + //ShockBarrier_Timer + if (ShockBarrier_Timer < diff) + { + DoCast(m_creature, SPELL_SHOCK_BARRIER); + ChainPyros = true; + PyrosCasted = 0; + ShockBarrier_Timer = 60000; + }else ShockBarrier_Timer -= diff; + + //Chain Pyros (3 of them max) + if (ChainPyros && !m_creature->IsNonMeleeSpellCasted(false)) + { + if (PyrosCasted < 3) + { + DoCast(m_creature->getVictim(), SPELL_PYROBLAST); + PyrosCasted++; + + } + else + { + ChainPyros = false; + Fireball_Timer = 2500; + ArcaneDisruption_Timer = 60000; + } + } + } + + if (Phase == 5) + { + if (Phase_Timer < diff) + { + m_creature->InterruptNonMeleeSpells(false); + m_creature->RemoveAurasDueToSpell(SPELL_FULLPOWER); + + DoCast(m_creature, SPELL_EXPLODE); + + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + Phase = 6; + AttackStart(m_creature->getVictim()); + }else Phase_Timer -= diff; + } + + //Phase 5 + if (Phase == 6) + { + + //GravityLapse_Timer + if (GravityLapse_Timer < diff) + { + std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); + switch(GravityLapse_Phase) + { + case 0: + m_creature->StopMoving(); + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + m_creature->GetMap()->CreatureRelocation(m_creature, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); + m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, MOVEMENTFLAG_NONE, 0); + + // 1) Kael'thas will portal the whole raid right into his body + for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) + { + //Use work around packet to prevent player from being dropped from combat + DoTeleportPlayer(pUnit, afGravityPos[0], afGravityPos[1], afGravityPos[2], pUnit->GetOrientation()); + } + } + + GravityLapse_Timer = 500; + ++GravityLapse_Phase; + InGravityLapse = true; + ShockBarrier_Timer = 1000; + NetherBeam_Timer = 5000; + break; + + case 1: + switch(rand()%2) + { + case 0: DoScriptText(SAY_GRAVITYLAPSE1, m_creature); break; + case 1: DoScriptText(SAY_GRAVITYLAPSE2, m_creature); break; + } + + // 2) At that point he will put a Gravity Lapse debuff on everyone + for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) + { + if (Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid())) + { + m_creature->CastSpell(pUnit, SPELL_KNOCKBACK, true); + //Gravity lapse - needs an exception in Spell system to work + + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE, true, 0, 0, m_creature->GetGUID()); + pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, m_creature->GetGUID()); + + //Using packet workaround + WorldPacket data(12); + data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); + data.append(pUnit->GetPackGUID()); + data << uint32(0); + pUnit->SendMessageToSet(&data, true); + } + } + GravityLapse_Timer = 10000; + GravityLapse_Phase++; + break; + + case 2: + //Cast nether vapor aura on self + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, SPELL_NETHER_VAPOR); + + GravityLapse_Timer = 20000; + GravityLapse_Phase++; + break; + + case 3: + //Remove flight + for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) + { + if (Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid())) + { + //Using packet workaround + WorldPacket data(12); + data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); + data.append(pUnit->GetPackGUID()); + data << uint32(0); + pUnit->SendMessageToSet(&data, true); + } + } + + m_creature->RemoveAurasDueToSpell(SPELL_NETHER_VAPOR); + InGravityLapse = false; + GravityLapse_Timer = 60000; + GravityLapse_Phase = 0; + AttackStart(m_creature->getVictim()); + break; + } + }else GravityLapse_Timer -= diff; + + if (InGravityLapse) + { + //ShockBarrier_Timer + if (ShockBarrier_Timer < diff) + { + DoCast(m_creature, SPELL_SHOCK_BARRIER); + ShockBarrier_Timer = 20000; + }else ShockBarrier_Timer -= diff; + + //NetherBeam_Timer + if (NetherBeam_Timer < diff) + { + if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(pUnit, SPELL_NETHER_BEAM); + + NetherBeam_Timer = 4000; + }else NetherBeam_Timer -= diff; + } + } + + if (!InGravityLapse) + DoMeleeAttackIfReady(); + } + } + } +}; + +//Thaladred the Darkener AI +struct TRINITY_DLL_DECL boss_thaladred_the_darkenerAI : public advisorbase_ai +{ + boss_thaladred_the_darkenerAI(Creature* pCreature) : advisorbase_ai(pCreature) {} + + uint32 Gaze_Timer; + uint32 Silence_Timer; + uint32 PsychicBlow_Timer; + + void Reset() + { + Gaze_Timer = 100; + Silence_Timer = 20000; + PsychicBlow_Timer = 10000; + + advisorbase_ai::Reset(); + } + + void Aggro(Unit *who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!who || FakeDeath) + return; + + DoScriptText(SAY_THALADRED_AGGRO, m_creature); + m_creature->AddThreat(who, 5000000.0f); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) + DoScriptText(SAY_THALADRED_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + advisorbase_ai::UpdateAI(diff); + + //Faking death, don't do anything + if (FakeDeath) + return; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Gaze_Timer + if (Gaze_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoResetThreat(); + m_creature->AddThreat(target, 5000000.0f); + DoScriptText(EMOTE_THALADRED_GAZE, m_creature, target); + Gaze_Timer = 8500; + } + }else Gaze_Timer -= diff; + + //Silence_Timer + if (Silence_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_SILENCE); + Silence_Timer = 20000; + }else Silence_Timer -= diff; + + //PsychicBlow_Timer + if (PsychicBlow_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_PSYCHIC_BLOW); + PsychicBlow_Timer = 20000+rand()%5000; + }else PsychicBlow_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Lord Sanguinar AI +struct TRINITY_DLL_DECL boss_lord_sanguinarAI : public advisorbase_ai +{ + boss_lord_sanguinarAI(Creature* pCreature) : advisorbase_ai(pCreature) {} + + uint32 Fear_Timer; + + void Reset() + { + Fear_Timer = 20000; + advisorbase_ai::Reset(); + } + + void Aggro(Unit *who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!who || FakeDeath) + return; + + DoScriptText(SAY_SANGUINAR_AGGRO, m_creature); + } + + void JustDied(Unit* Killer) + { + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) + DoScriptText(SAY_SANGUINAR_DEATH, m_creature); + } + + void UpdateAI(const uint32 diff) + { + advisorbase_ai::UpdateAI(diff); + + //Faking death, don't do anything + if (FakeDeath) + return; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Fear_Timer + if (Fear_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BELLOWING_ROAR); + Fear_Timer = 25000+rand()%10000; //approximately every 30 seconds + }else Fear_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Grand Astromancer Capernian AI +struct TRINITY_DLL_DECL boss_grand_astromancer_capernianAI : public advisorbase_ai +{ + boss_grand_astromancer_capernianAI(Creature* pCreature) : advisorbase_ai(pCreature) {} + + uint32 Fireball_Timer; + uint32 Conflagration_Timer; + uint32 ArcaneExplosion_Timer; + uint32 Yell_Timer; + bool Yell; + + void Reset() + { + Fireball_Timer = 2000; + Conflagration_Timer = 20000; + ArcaneExplosion_Timer = 5000; + Yell_Timer = 2000; + Yell = false; + + advisorbase_ai::Reset(); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) + DoScriptText(SAY_CAPERNIAN_DEATH, m_creature); + } + + void AttackStart(Unit* who) + { + if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (m_creature->Attack(who, true)) + { + m_creature->AddThreat(who, 0.0f); + m_creature->SetInCombatWith(who); + who->SetInCombatWith(m_creature); + + m_creature->GetMotionMaster()->MoveChase(who, CAPERNIAN_DISTANCE); + } + } + + void Aggro(Unit *who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!who || FakeDeath) + return; + } + + void UpdateAI(const uint32 diff) + { + advisorbase_ai::UpdateAI(diff); + + //Faking Death, don't do anything + if (FakeDeath) + return; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Yell_Timer + if (!Yell) + { + if (Yell_Timer < diff) + { + DoScriptText(SAY_CAPERNIAN_AGGRO, m_creature); + Yell = true; + }else Yell_Timer -= diff; + } + + //Fireball_Timer + if (Fireball_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_CAPERNIAN_FIREBALL); + Fireball_Timer = 4000; + }else Fireball_Timer -= diff; + + //Conflagration_Timer + if (Conflagration_Timer < diff) + { + Unit *target = NULL; + target = SelectUnit(SELECT_TARGET_RANDOM, 0); + + if (target && m_creature->IsWithinDistInMap(target, 30)) + DoCast(target, SPELL_CONFLAGRATION); + else + DoCast(m_creature->getVictim(), SPELL_CONFLAGRATION); + + Conflagration_Timer = 10000+rand()%5000; + }else Conflagration_Timer -= diff; + + //ArcaneExplosion_Timer + if (ArcaneExplosion_Timer < diff) + { + bool InMeleeRange = false; + Unit *target = NULL; + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + for (std::list::iterator i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) + { + Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); + //if in melee range + if (pUnit && pUnit->IsWithinDistInMap(m_creature, 5)) + { + InMeleeRange = true; + target = pUnit; + break; + } + } + + if (InMeleeRange) + DoCast(target, SPELL_ARCANE_EXPLOSION); + + ArcaneExplosion_Timer = 4000+rand()%2000; + }else ArcaneExplosion_Timer -= diff; + + //Do NOT deal any melee damage. + } +}; + +//Master Engineer Telonicus AI +struct TRINITY_DLL_DECL boss_master_engineer_telonicusAI : public advisorbase_ai +{ + boss_master_engineer_telonicusAI(Creature* pCreature) : advisorbase_ai(pCreature) {} + + uint32 Bomb_Timer; + uint32 RemoteToy_Timer; + + void Reset() + { + Bomb_Timer = 10000; + RemoteToy_Timer = 5000; + + advisorbase_ai::Reset(); + } + + void JustDied(Unit* pKiller) + { + if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) + DoScriptText(SAY_TELONICUS_DEATH, m_creature); + } + + void Aggro(Unit *who) + { + if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) + return; + + if (!who || FakeDeath) + return; + + DoScriptText(SAY_TELONICUS_AGGRO, m_creature); + } + + void UpdateAI(const uint32 diff) + { + advisorbase_ai::UpdateAI(diff); + + //Faking Death, do nothing + if (FakeDeath) + return; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Bomb_Timer + if (Bomb_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_BOMB); + Bomb_Timer = 25000; + }else Bomb_Timer -= diff; + + //RemoteToy_Timer + if (RemoteToy_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_REMOTE_TOY); + + RemoteToy_Timer = 10000+rand()%5000; + }else RemoteToy_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Flame Strike AI +struct TRINITY_DLL_DECL mob_kael_flamestrikeAI : public ScriptedAI +{ + mob_kael_flamestrikeAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + uint32 Timer; + bool Casting; + bool KillSelf; + + void Reset() + { + Timer = 5000; + Casting = false; + KillSelf = false; + + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + m_creature->setFaction(14); + } + + void MoveInLineOfSight(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!Casting) + { + DoCast(m_creature, SPELL_FLAME_STRIKE_VIS); + Casting = true; + } + + //Timer + if (Timer < diff) + { + if (!KillSelf) + { + m_creature->InterruptNonMeleeSpells(false); + DoCast(m_creature, SPELL_FLAME_STRIKE_DMG); + }else m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + + KillSelf = true; + Timer = 1000; + }else Timer -= diff; + } +}; + +//Phoenix AI +struct TRINITY_DLL_DECL mob_phoenix_tkAI : public ScriptedAI +{ + mob_phoenix_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + uint32 Cycle_Timer; + + void Reset() + { + Cycle_Timer = 2000; + m_creature->CastSpell(m_creature,SPELL_BURN,true); + } + + void JustDied(Unit* killer) + { + //is this spell in use anylonger? + //m_creature->CastSpell(m_creature,SPELL_EMBER_BLAST,true); + m_creature->SummonCreature(NPC_PHOENIX_EGG,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,16000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Cycle_Timer < diff) + { + //spell Burn should possible do this, but it doesn't, so do this for now. + uint32 dmg = urand(4500,5500); + if (m_creature->GetHealth() > dmg) + m_creature->SetHealth(uint32(m_creature->GetHealth()-dmg)); + Cycle_Timer = 2000; + }else Cycle_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +//Phoenix Egg AI +struct TRINITY_DLL_DECL mob_phoenix_egg_tkAI : public ScriptedAI +{ + mob_phoenix_egg_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {} + + uint32 Rebirth_Timer; + + void Reset() + { + Rebirth_Timer = 15000; + } + + //ignore any + void MoveInLineOfSight(Unit* who) { return; } + + void AttackStart(Unit* who) + { + if (m_creature->Attack(who, false)) + { + m_creature->SetInCombatWith(who); + who->SetInCombatWith(m_creature); + + DoStartNoMovement(who); + } + } + + void JustSummoned(Creature* summoned) + { + summoned->AddThreat(m_creature->getVictim(), 0.0f); + summoned->CastSpell(summoned,SPELL_REBIRTH,false); + } + + void UpdateAI(const uint32 diff) + { + if (!Rebirth_Timer) + return; + + if (Rebirth_Timer <= diff) + { + m_creature->SummonCreature(NPC_PHOENIX,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_CORPSE_DESPAWN,5000); + Rebirth_Timer = 0; + }else Rebirth_Timer -= diff; + } +}; + +CreatureAI* GetAI_boss_kaelthas(Creature* pCreature) +{ + return new boss_kaelthasAI(pCreature); +} + +CreatureAI* GetAI_boss_thaladred_the_darkener(Creature* pCreature) +{ + return new boss_thaladred_the_darkenerAI(pCreature); +} + +CreatureAI* GetAI_boss_lord_sanguinar(Creature* pCreature) +{ + return new boss_lord_sanguinarAI(pCreature); +} + +CreatureAI* GetAI_boss_grand_astromancer_capernian(Creature* pCreature) +{ + return new boss_grand_astromancer_capernianAI(pCreature); +} + +CreatureAI* GetAI_boss_master_engineer_telonicus(Creature* pCreature) +{ + return new boss_master_engineer_telonicusAI(pCreature); +} + +CreatureAI* GetAI_mob_kael_flamestrike(Creature* pCreature) +{ + return new mob_kael_flamestrikeAI(pCreature); +} + +CreatureAI* GetAI_mob_phoenix_tk(Creature* pCreature) +{ + return new mob_phoenix_tkAI(pCreature); +} + +CreatureAI* GetAI_mob_phoenix_egg_tk(Creature* pCreature) +{ + return new mob_phoenix_egg_tkAI(pCreature); +} + +void AddSC_boss_kaelthas() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "boss_kaelthas"; + newscript->GetAI = &GetAI_boss_kaelthas; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_thaladred_the_darkener"; + newscript->GetAI = &GetAI_boss_thaladred_the_darkener; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_lord_sanguinar"; + newscript->GetAI = &GetAI_boss_lord_sanguinar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_grand_astromancer_capernian"; + newscript->GetAI = &GetAI_boss_grand_astromancer_capernian; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "boss_master_engineer_telonicus"; + newscript->GetAI = &GetAI_boss_master_engineer_telonicus; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name= "mob_kael_flamestrike"; + newscript->GetAI = &GetAI_mob_kael_flamestrike; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_phoenix_tk"; + newscript->GetAI = &GetAI_mob_phoenix_tk; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "mob_phoenix_egg_tk"; + newscript->GetAI = &GetAI_mob_phoenix_egg_tk; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp new file mode 100644 index 00000000000..60cfaf1609d --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/boss_void_reaver.cpp @@ -0,0 +1,185 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Void_Reaver +SD%Complete: 90 +SDComment: Should reset if raid are out of room. +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "def_the_eye.h" + +enum +{ + SAY_AGGRO = -1550000, + SAY_SLAY1 = -1550001, + SAY_SLAY2 = -1550002, + SAY_SLAY3 = -1550003, + SAY_DEATH = -1550004, + SAY_POUNDING1 = -1550005, + SAY_POUNDING2 = -1550006, + + SPELL_POUNDING = 34162, + SPELL_ARCANE_ORB = 34172, + SPELL_KNOCK_AWAY = 25778, + SPELL_BERSERK = 27680 +}; + +struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI +{ + boss_void_reaverAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + uint32 Pounding_Timer; + uint32 ArcaneOrb_Timer; + uint32 KnockAway_Timer; + uint32 Berserk_Timer; + + bool Enraged; + + void Reset() + { + Pounding_Timer = 15000; + ArcaneOrb_Timer = 3000; + KnockAway_Timer = 30000; + Berserk_Timer = 600000; + + Enraged = false; + + if (pInstance && m_creature->isAlive()) + pInstance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + case 2: DoScriptText(SAY_SLAY3, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + DoZoneInCombat(); + + if (pInstance) + pInstance->SetData(DATA_VOIDREAVEREVENT, DONE); + } + + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + + if (pInstance) + pInstance->SetData(DATA_VOIDREAVEREVENT, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + // Pounding + if (Pounding_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_POUNDING); + + switch(rand()%2) + { + case 0: DoScriptText(SAY_POUNDING1, m_creature); break; + case 1: DoScriptText(SAY_POUNDING2, m_creature); break; + } + Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000) + }else Pounding_Timer -= diff; + + // Arcane Orb + if (ArcaneOrb_Timer < diff) + { + Unit *target = NULL; + std::list t_list = m_creature->getThreatManager().getThreatList(); + std::vector target_list; + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + // exclude pets & totems + if (target->GetTypeId() != TYPEID_PLAYER) + continue; + + //18 yard radius minimum + if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive() && !target->IsWithinDist(m_creature, 18, false)) + target_list.push_back(target); + target = NULL; + } + + if (target_list.size()) + target = *(target_list.begin()+rand()%target_list.size()); + else + target = m_creature->getVictim(); + + if (target) + m_creature->CastSpell(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, NULL, target); + + ArcaneOrb_Timer = 3000; + }else ArcaneOrb_Timer -= diff; + + // Single Target knock back, reduces aggro + if (KnockAway_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KNOCK_AWAY); + + //Drop 25% aggro + if (DoGetThreat(m_creature->getVictim())) + DoModifyThreatPercent(m_creature->getVictim(),-25); + + KnockAway_Timer = 30000; + }else KnockAway_Timer -= diff; + + //Berserk + if (Berserk_Timer < diff && !Enraged) + { + DoCast(m_creature,SPELL_BERSERK); + Enraged = true; + }else Berserk_Timer -= diff; + + DoMeleeAttackIfReady(); + + EnterEvadeIfOutOfCombatArea(diff); + } +}; + +CreatureAI* GetAI_boss_void_reaver(Creature* pCreature) +{ + return new boss_void_reaverAI (pCreature); +} + +void AddSC_boss_void_reaver() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_void_reaver"; + newscript->GetAI = &GetAI_boss_void_reaver; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/def_the_eye.h b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/def_the_eye.h new file mode 100644 index 00000000000..d0d3ea09061 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/def_the_eye.h @@ -0,0 +1,20 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_THE_EYE_H +#define DEF_THE_EYE_H + +#define DATA_ALAREVENT 1 +#define DATA_ASTROMANCER 2 +#define DATA_GRANDASTROMANCERCAPERNIAN 3 +#define DATA_HIGHASTROMANCERSOLARIANEVENT 4 +#define DATA_KAELTHAS 5 +#define DATA_KAELTHASEVENT 6 +#define DATA_LORDSANGUINAR 7 +#define DATA_MASTERENGINEERTELONICUS 8 +#define DATA_THALADREDTHEDARKENER 10 +#define DATA_VOIDREAVEREVENT 11 +#define DATA_ALAR 12 +#endif + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/instance_the_eye.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/instance_the_eye.cpp new file mode 100644 index 00000000000..f973f96c1ff --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/instance_the_eye.cpp @@ -0,0 +1,176 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_The_Eye +SD%Complete: 100 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +#include "precompiled.h" +#include "def_the_eye.h" + +#define MAX_ENCOUNTER 5 + +/* The Eye encounters: +0 - Kael'thas event +1 - Al' ar event +2 - Solarian Event +3 - Void Reaver event +*/ + +struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance +{ + instance_the_eye(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint64 ThaladredTheDarkener; + uint64 LordSanguinar; + uint64 GrandAstromancerCapernian; + uint64 MasterEngineerTelonicus; + uint64 Kaelthas; + uint64 Astromancer; + uint64 Alar; + + uint8 KaelthasEventPhase; + uint8 AlarEventPhase; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + ThaladredTheDarkener = 0; + LordSanguinar = 0; + GrandAstromancerCapernian = 0; + MasterEngineerTelonicus = 0; + Kaelthas = 0; + Astromancer = 0; + Alar = 0; + + KaelthasEventPhase = 0; + AlarEventPhase = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 20064: ThaladredTheDarkener = pCreature->GetGUID(); break; + case 20063: MasterEngineerTelonicus = pCreature->GetGUID(); break; + case 20062: GrandAstromancerCapernian = pCreature->GetGUID(); break; + case 20060: LordSanguinar = pCreature->GetGUID(); break; + case 19622: Kaelthas = pCreature->GetGUID(); break; + case 18805: Astromancer = pCreature->GetGUID(); break; + case 19514: Alar = pCreature->GetGUID(); break; + } + } + + uint64 GetData64(uint32 identifier) + { + switch(identifier) + { + case DATA_THALADREDTHEDARKENER: return ThaladredTheDarkener; + case DATA_LORDSANGUINAR: return LordSanguinar; + case DATA_GRANDASTROMANCERCAPERNIAN: return GrandAstromancerCapernian; + case DATA_MASTERENGINEERTELONICUS: return MasterEngineerTelonicus; + case DATA_KAELTHAS: return Kaelthas; + case DATA_ASTROMANCER: return Astromancer; + case DATA_ALAR: return Alar; + } + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_ALAREVENT: AlarEventPhase = data; m_auiEncounter[0] = data; break; + case DATA_HIGHASTROMANCERSOLARIANEVENT: m_auiEncounter[1] = data; break; + case DATA_VOIDREAVEREVENT: m_auiEncounter[2] = data; break; + case DATA_KAELTHASEVENT: KaelthasEventPhase = data; m_auiEncounter[3] = data; break; + } + if (data == DONE) + SaveToDB(); + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_ALAREVENT: return AlarEventPhase; + case DATA_HIGHASTROMANCERSOLARIANEVENT: return m_auiEncounter[1]; + case DATA_VOIDREAVEREVENT: return m_auiEncounter[2]; + case DATA_KAELTHASEVENT: return KaelthasEventPhase; + } + return 0; + } + + std::string GetSaveData() + { + OUT_SAVE_INST_DATA; + std::ostringstream stream; + stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; + char* out = new char[stream.str().length() + 1]; + strcpy(out, stream.str().c_str()); + if (out) + { + OUT_SAVE_INST_DATA_COMPLETE; + return out; + } + return NULL; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + OUT_LOAD_INST_DATA(in); + std::istringstream stream(in); + stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. + m_auiEncounter[i] = NOT_STARTED; + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_the_eye(Map* pMap) +{ + return new instance_the_eye(pMap); +} + +void AddSC_instance_the_eye() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_the_eye"; + newscript->GetInstanceData = &GetInstanceData_instance_the_eye; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/the_eye.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/the_eye.cpp new file mode 100644 index 00000000000..2dfff45796f --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_eye/the_eye.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: The_Eye +SD%Complete: 100 +SDComment: +SDCategory: Tempest Keep, The Eye +EndScriptData */ + +/* ContentData +mob_crystalcore_devastator +EndContentData */ + +#include "precompiled.h" +#include "def_the_eye.h" + +#define SPELL_COUNTERCHARGE 35035 +#define SPELL_KNOCKAWAY 22893 + +struct TRINITY_DLL_DECL mob_crystalcore_devastatorAI : public ScriptedAI +{ + mob_crystalcore_devastatorAI(Creature *c) : ScriptedAI(c) {} + + uint32 Knockaway_Timer; + uint32 Countercharge_Timer; + + void Reset() + { + Countercharge_Timer = 9000; + Knockaway_Timer = 25000; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + //Check if we have a current target + //Knockaway_Timer + if (Knockaway_Timer < diff) + { + m_creature->CastSpell(m_creature->getVictim(),SPELL_KNOCKAWAY, true); + + // current aggro target is knocked away pick new target + Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); + + if (!Target || Target == m_creature->getVictim()) + Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); + + if (Target) + m_creature->TauntApply(Target); + + Knockaway_Timer = 23000; + } + else Knockaway_Timer -= diff; + + //Countercharge_Timer + if (Countercharge_Timer < diff) + { + DoCast(this->m_creature,SPELL_COUNTERCHARGE); + Countercharge_Timer = 45000; + }else Countercharge_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_crystalcore_devastator(Creature* pCreature) +{ + return new mob_crystalcore_devastatorAI (pCreature); +} + +void AddSC_the_eye() +{ + Script *newscript; + newscript = new Script; + newscript->Name="mob_crystalcore_devastator"; + newscript->GetAI = &GetAI_mob_crystalcore_devastator; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp new file mode 100644 index 00000000000..268cfeb2918 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp @@ -0,0 +1,38 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Gatewatcher_Gyrokill +SD%Complete: 0 +SDComment: Place Holder +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1554000 +#define SAY_SAW_ATTACK1 -1554001 +#define SAY_SAW_ATTACK2 -1554002 +#define SAY_SLAY1 -1554003 +#define SAY_SLAY2 -1554004 +#define SAY_DEATH -1554005 + +#define SPELL_STREAM_OF_MACHINE_FLUID 35311 +#define SPELL_SAW_BLADE 35318 +#define H_SPELL_SAW_BLADE 39192 +#define SPELL_SHADOW_POWER 35322 +#define H_SPELL_SHADOW_POWER 39193 + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp new file mode 100644 index 00000000000..a1ca31c3e5e --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp @@ -0,0 +1,148 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Gatewatcher_Ironhand +SD%Complete: 75 +SDComment: +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO_1 -1554006 +#define SAY_HAMMER_1 -1554007 +#define SAY_HAMMER_2 -1554008 +#define SAY_SLAY_1 -1554009 +#define SAY_SLAY_2 -1554010 +#define SAY_DEATH_1 -1554011 +#define EMOTE_HAMMER -1554012 + +// Spells to be casted +#define SPELL_SHADOW_POWER 35322 +#define H_SPELL_SHADOW_POWER 39193 +#define SPELL_HAMMER_PUNCH 35326 +#define SPELL_JACKHAMMER 35327 +#define H_SPELL_JACKHAMMER 39194 +#define SPELL_STREAM_OF_MACHINE_FLUID 35311 + +// Gatewatcher Iron-Hand AI +struct TRINITY_DLL_DECL boss_gatewatcher_iron_handAI : public ScriptedAI +{ + boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + + bool HeroicMode; + + uint32 Shadow_Power_Timer; + uint32 Jackhammer_Timer; + uint32 Stream_of_Machine_Fluid_Timer; + + void Reset() + { + Shadow_Power_Timer = 25000; + Jackhammer_Timer = 45000; + Stream_of_Machine_Fluid_Timer = 55000; + + } + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO_1, m_creature); + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH_1, m_creature); + + if (!pInstance) + return; + + //TODO: Add door check/open code + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Shadow Power + if (Shadow_Power_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_SHADOW_POWER : SPELL_SHADOW_POWER); + Shadow_Power_Timer = 20000 + rand()%8000; + }else Shadow_Power_Timer -= diff; + + //Jack Hammer + if (Jackhammer_Timer < diff) + { + //TODO: expect cast this about 5 times in a row (?), announce it by emote only once + DoScriptText(EMOTE_HAMMER, m_creature); + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_JACKHAMMER : SPELL_JACKHAMMER); + + //chance to yell, but not same time as emote (after spell in fact casted) + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_HAMMER_1, m_creature); break; + case 1: DoScriptText(SAY_HAMMER_2, m_creature); break; + } + Jackhammer_Timer = 30000; + }else Jackhammer_Timer -= diff; + + //Stream of Machine Fluid + if (Stream_of_Machine_Fluid_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_STREAM_OF_MACHINE_FLUID); + Stream_of_Machine_Fluid_Timer = 35000 + rand()%15000; + }else Stream_of_Machine_Fluid_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_gatewatcher_iron_hand(Creature* pCreature) +{ + return new boss_gatewatcher_iron_handAI (pCreature); +} + +void AddSC_boss_gatewatcher_iron_hand() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_gatewatcher_iron_hand"; + newscript->GetAI = &GetAI_boss_gatewatcher_iron_hand; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp new file mode 100644 index 00000000000..da6c613d794 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp @@ -0,0 +1,258 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss_Nethermancer_Sepethrea +SD%Complete: 90 +SDComment: Need adjustments to initial summons +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" +#include "def_mechanar.h" + +#define SAY_AGGRO -1554013 +#define SAY_SUMMON -1554014 +#define SAY_DRAGONS_BREATH_1 -1554015 +#define SAY_DRAGONS_BREATH_2 -1554016 +#define SAY_SLAY1 -1554017 +#define SAY_SLAY2 -1554018 +#define SAY_DEATH -1554019 + +#define SPELL_SUMMON_RAGIN_FLAMES 35275 +#define H_SPELL_SUMMON_RAGIN_FLAMES 39084 + +#define SPELL_FROST_ATTACK 35263 +#define SPELL_ARCANE_BLAST 35314 +#define SPELL_DRAGONS_BREATH 35250 +#define SPELL_KNOCKBACK 37317 +#define SPELL_SOLARBURN 35267 + +struct TRINITY_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI +{ + boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + + bool HeroicMode; + + uint32 frost_attack_Timer; + uint32 arcane_blast_Timer; + uint32 dragons_breath_Timer; + uint32 knockback_Timer; + uint32 solarburn_Timer; + + void Reset() + { + frost_attack_Timer = 7000 + rand()%3000; + arcane_blast_Timer = 12000 + rand()%6000; + dragons_breath_Timer = 18000 + rand()%4000; + knockback_Timer = 22000 + rand()%6000; + solarburn_Timer = 30000; + + if (pInstance) + pInstance->SetData(DATA_NETHERMANCER_EVENT, NOT_STARTED); + } + + void EnterCombat(Unit *who) + { + if (pInstance) + pInstance->SetData(DATA_NETHERMANCER_EVENT, IN_PROGRESS); + + DoScriptText(SAY_AGGRO, m_creature); + DoCast(who, HeroicMode ? H_SPELL_SUMMON_RAGIN_FLAMES : SPELL_SUMMON_RAGIN_FLAMES); + DoScriptText(SAY_SUMMON, m_creature); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_NETHERMANCER_EVENT, DONE); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //Frost Attack + if (frost_attack_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FROST_ATTACK); + frost_attack_Timer = 7000 + rand()%3000; + }else frost_attack_Timer -= diff; + + //Arcane Blast + if (arcane_blast_Timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_ARCANE_BLAST); + arcane_blast_Timer = 15000; + }else arcane_blast_Timer -= diff; + + //Dragons Breath + if (dragons_breath_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_DRAGONS_BREATH); + { + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_DRAGONS_BREATH_1, m_creature); break; + case 1: DoScriptText(SAY_DRAGONS_BREATH_2, m_creature); break; + } + } + dragons_breath_Timer = 12000 + rand()%10000; + }else dragons_breath_Timer -= diff; + + //Knockback + if (knockback_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_KNOCKBACK); + knockback_Timer = 15000 + rand()%10000; + }else knockback_Timer -= diff; + + //Solarburn + if (solarburn_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_SOLARBURN); + solarburn_Timer = 30000; + }else solarburn_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nethermancer_sepethrea(Creature* pCreature) +{ + return new boss_nethermancer_sepethreaAI (pCreature); +} + +#define SPELL_INFERNO 35268 +#define H_SPELL_INFERNO 39346 +#define SPELL_FIRE_TAIL 35278 + +struct TRINITY_DLL_DECL mob_ragin_flamesAI : public ScriptedAI +{ + mob_ragin_flamesAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + ScriptedInstance *pInstance; + + bool HeroicMode; + + uint32 inferno_Timer; + uint32 flame_timer; + uint32 Check_Timer; + + bool onlyonce; + + void Reset() + { + inferno_Timer = 10000; + flame_timer = 500; + Check_Timer = 2000; + onlyonce = false; + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); + m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); + m_creature->SetSpeed(MOVE_RUN, HeroicMode ? 0.7f : 0.5f); + } + + void EnterCombat(Unit* who) + { + } + + void UpdateAI(const uint32 diff) + { + //Check_Timer + if (Check_Timer < diff) + { + if (pInstance) + { + if (pInstance->GetData(DATA_NETHERMANCER_EVENT) != IN_PROGRESS) + { + //remove + m_creature->setDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + } + } + Check_Timer = 1000; + }else Check_Timer -= diff; + + if (!UpdateVictim()) + return; + + if (!onlyonce) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + m_creature->GetMotionMaster()->MoveChase(target); + onlyonce = true; + } + + if (inferno_Timer < diff) + { + DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_INFERNO : SPELL_INFERNO); + m_creature->TauntApply(m_creature->getVictim()); + inferno_Timer = 10000; + }else inferno_Timer -= diff; + + if (flame_timer < diff) + { + DoCast(m_creature,SPELL_FIRE_TAIL); + flame_timer = 500; + }else flame_timer -=diff; + + DoMeleeAttackIfReady(); + } + +}; +CreatureAI* GetAI_mob_ragin_flames(Creature* pCreature) +{ + return new mob_ragin_flamesAI (pCreature); +} +void AddSC_boss_nethermancer_sepethrea() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_nethermancer_sepethrea"; + newscript->GetAI = &GetAI_boss_nethermancer_sepethrea; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ragin_flames"; + newscript->GetAI = &GetAI_mob_ragin_flames; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp new file mode 100644 index 00000000000..1e06232c9b6 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp @@ -0,0 +1,257 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation; either version 2 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program; if not, write to the Free Software +* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +/* ScriptData +SDName: Boss Pathaleon the Calculator +SD%Complete: 50 +SDComment: Event missing. Script for himself 99% blizzlike. +SDCategory: Tempest Keep, The Mechanar +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO -1554020 +#define SAY_DOMINATION_1 -1554021 +#define SAY_DOMINATION_2 -1554022 +#define SAY_SUMMON -1554023 +#define SAY_ENRAGE -1554024 +#define SAY_SLAY_1 -1554025 +#define SAY_SLAY_2 -1554026 +#define SAY_DEATH -1554027 + +// Spells to be casted +#define SPELL_MANA_TAP 36021 +#define SPELL_ARCANE_TORRENT 36022 +#define SPELL_DOMINATION 35280 +#define H_SPELL_ARCANE_EXPLOSION 15453 +#define SPELL_FRENZY 36992 + +#define SPELL_SUMMON_NETHER_WRAITH_1 35285 //Spells work, but not implemented +#define SPELL_SUMMON_NETHER_WRAITH_2 35286 +#define SPELL_SUMMON_NETHER_WRAITH_3 35287 +#define SPELL_SUMMON_NETHER_WRAITH_4 35288 + +// Add Spells +#define SPELL_DETONATION 35058 +#define SPELL_ARCANE_MISSILES 35034 + +struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI +{ + boss_pathaleon_the_calculatorAI(Creature *c) : ScriptedAI(c), summons(m_creature) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 Summon_Timer; + SummonList summons; + uint32 ManaTap_Timer; + uint32 ArcaneTorrent_Timer; + uint32 Domination_Timer; + uint32 ArcaneExplosion_Timer; + bool HeroicMode; + bool Enraged; + + uint32 Counter; + + void Reset() + { + Summon_Timer = 30000; + ManaTap_Timer = 12000 + rand()%8000; + ArcaneTorrent_Timer = 16000 + rand()%9000; + Domination_Timer = 25000 + rand()%15000; + ArcaneExplosion_Timer = 8000 + rand()%5000; + + Enraged = false; + + Counter = 0; + summons.DespawnAll(); + } + void EnterCombat(Unit *who) + { + DoScriptText(SAY_AGGRO, m_creature); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + summons.DespawnAll(); + } + + void JustSummoned(Creature *summon) {summons.Summon(summon);} + void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (Summon_Timer < diff) + { + for(uint8 i = 0; i < 3; ++i) + { + Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); + Creature* Wraith = m_creature->SummonCreature(21062,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); + if (target && Wraith) + Wraith->AI()->AttackStart(target); + } + DoScriptText(SAY_SUMMON, m_creature); + Summon_Timer = 30000 + rand()%15000; + }else Summon_Timer -= diff; + + if (ManaTap_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_MANA_TAP); + ManaTap_Timer = 14000 + rand()%8000; + }else ManaTap_Timer -= diff; + + if (ArcaneTorrent_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ARCANE_TORRENT); + ArcaneTorrent_Timer = 12000 + rand()%6000; + }else ArcaneTorrent_Timer -= diff; + + if (Domination_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_DOMINATION_1, m_creature); break; + case 1: DoScriptText(SAY_DOMINATION_2, m_creature); break; + } + + DoCast(target,SPELL_DOMINATION); + } + Domination_Timer = 25000 + rand()%5000; + }else Domination_Timer -= diff; + + //Only casting if Heroic Mode is used + if (HeroicMode) + { + if (ArcaneExplosion_Timer < diff) + { + DoCast(m_creature->getVictim(),H_SPELL_ARCANE_EXPLOSION); + ArcaneExplosion_Timer = 10000 + rand()%4000; + }else ArcaneExplosion_Timer -= diff; + } + + if (!Enraged && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21) + { + DoCast(m_creature, SPELL_FRENZY); + DoScriptText(SAY_ENRAGE, m_creature); + Enraged = true; + + } + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_pathaleon_the_calculator(Creature* pCreature) +{ + return new boss_pathaleon_the_calculatorAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_nether_wraithAI : public ScriptedAI +{ + mob_nether_wraithAI(Creature *c) : ScriptedAI(c) {} + + ScriptedInstance *pInstance; + + uint32 ArcaneMissiles_Timer; + uint32 Detonation_Timer; + uint32 Die_Timer; + bool Detonation; + + void Reset() + { + ArcaneMissiles_Timer = 1000 + rand()%3000; + Detonation_Timer = 20000; + Die_Timer = 2200; + Detonation = false; + + } + + void EnterCombat(Unit* who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ArcaneMissiles_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) + DoCast(target,SPELL_ARCANE_MISSILES); + else + DoCast(m_creature->getVictim(),SPELL_ARCANE_MISSILES); + + ArcaneMissiles_Timer = 5000 + rand()%5000; + }else ArcaneMissiles_Timer -=diff; + + if (!Detonation) + { + if (Detonation_Timer < diff) + { + DoCast(m_creature,SPELL_DETONATION); + Detonation = true; + }else Detonation_Timer -= diff; + } + + if (Detonation) + { + if (Die_Timer < diff) + { + m_creature->setDeathState(JUST_DIED); + m_creature->RemoveCorpse(); + }else Die_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } + +}; +CreatureAI* GetAI_mob_nether_wraith(Creature* pCreature) +{ + return new mob_nether_wraithAI (pCreature); +} + +void AddSC_boss_pathaleon_the_calculator() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_pathaleon_the_calculator"; + newscript->GetAI = &GetAI_boss_pathaleon_the_calculator; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_nether_wraith"; + newscript->GetAI = &GetAI_mob_nether_wraith; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/def_mechanar.h b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/def_mechanar.h new file mode 100644 index 00000000000..d1b53eebf53 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/def_mechanar.h @@ -0,0 +1,6 @@ +#ifndef DEF_MECHANAR_H +#define DEF_MECHANAR_H + +#define DATA_NETHERMANCER_EVENT 1 +#endif + diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/instance_mechanar.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/instance_mechanar.cpp new file mode 100644 index 00000000000..e43190620d9 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/tempest_keep/the_mechanar/instance_mechanar.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: Instance_Mechanar +SD%Complete: 100 +SDComment: +SDCategory: Mechanar +EndScriptData */ + +#include "precompiled.h" +#include "def_mechanar.h" + +#define MAX_ENCOUNTER 1 + +struct TRINITY_DLL_DECL instance_mechanar : public ScriptedInstance +{ + instance_mechanar(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + return true; + + return false; + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case DATA_NETHERMANCER_EVENT: return m_auiEncounter[0]; + } + + return false; + } + + uint64 GetData64 (uint32 identifier) + { + return 0; + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_NETHERMANCER_EVENT: m_auiEncounter[0] = data; break; + } + } +}; + +InstanceData* GetInstanceData_instance_mechanar(Map* pMap) +{ + return new instance_mechanar(pMap); +} + +void AddSC_instance_mechanar() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_mechanar"; + newscript->GetInstanceData = &GetInstanceData_instance_mechanar; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp deleted file mode 100644 index 414804a6576..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Exarch_Maladaar -SD%Complete: 95 -SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player. -SDCategory: Auchindoun, Auchenai Crypts -EndScriptData */ - -/* ContentData -mob_stolen_soul -boss_exarch_maladaar -mob_avatar_of_martyred -EndContentData */ - -#include "precompiled.h" - -#define SPELL_MOONFIRE 37328 -#define SPELL_FIREBALL 37329 -#define SPELL_MIND_FLAY 37330 -#define SPELL_HEMORRHAGE 37331 -#define SPELL_FROSTSHOCK 37332 -#define SPELL_CURSE_OF_AGONY 37334 -#define SPELL_MORTAL_STRIKE 37335 -#define SPELL_FREEZING_TRAP 37368 -#define SPELL_HAMMER_OF_JUSTICE 37369 - -struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI -{ - mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {} - - uint8 myClass; - uint32 Class_Timer; - - void Reset() - { - Class_Timer = 1000; - } - - void EnterCombat(Unit *who) - { } - - void SetMyClass(uint8 myclass) - { - myClass = myclass; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Class_Timer < diff) - { - switch (myClass) - { - case CLASS_WARRIOR: - DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); - Class_Timer = 6000; - break; - case CLASS_PALADIN: - DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); - Class_Timer = 6000; - break; - case CLASS_HUNTER: - DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP); - Class_Timer = 20000; - break; - case CLASS_ROGUE: - DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE); - Class_Timer = 10000; - break; - case CLASS_PRIEST: - DoCast(m_creature->getVictim(), SPELL_MIND_FLAY); - Class_Timer = 5000; - break; - case CLASS_SHAMAN: - DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK); - Class_Timer = 8000; - break; - case CLASS_MAGE: - DoCast(m_creature->getVictim(), SPELL_FIREBALL); - Class_Timer = 5000; - break; - case CLASS_WARLOCK: - DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY); - Class_Timer = 20000; - break; - case CLASS_DRUID: - DoCast(m_creature->getVictim(), SPELL_MOONFIRE); - Class_Timer = 10000; - break; - } - } else Class_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature) -{ - return new mob_stolen_soulAI (pCreature); -} - -#define SAY_INTRO -1558000 -#define SAY_SUMMON -1558001 - -#define SAY_AGGRO_1 -1558002 -#define SAY_AGGRO_2 -1558003 -#define SAY_AGGRO_3 -1558004 - -#define SAY_ROAR -1558005 -#define SAY_SOUL_CLEAVE -1558006 - -#define SAY_SLAY_1 -1558007 -#define SAY_SLAY_2 -1558008 - -#define SAY_DEATH -1558009 - -#define SPELL_RIBBON_OF_SOULS 32422 -#define SPELL_SOUL_SCREAM 32421 - -#define SPELL_STOLEN_SOUL 32346 -#define SPELL_STOLEN_SOUL_VISUAL 32395 - -#define SPELL_SUMMON_AVATAR 32424 - -#define ENTRY_STOLEN_SOUL 18441 - -struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI -{ - boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) - { - HasTaunted = false; - } - - uint32 soulmodel; - uint64 soulholder; - uint8 soulclass; - - uint32 Fear_timer; - uint32 Ribbon_of_Souls_timer; - uint32 StolenSoul_Timer; - - bool HasTaunted; - bool Avatar_summoned; - - void Reset() - { - soulmodel = 0; - soulholder = 0; - soulclass = 0; - - Fear_timer = 15000 + rand()% 5000; - Ribbon_of_Souls_timer = 5000; - StolenSoul_Timer = 25000 + rand()% 10000; - - Avatar_summoned = false; - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) - { - DoScriptText(SAY_INTRO, m_creature); - HasTaunted = true; - } - - ScriptedAI::MoveInLineOfSight(who); - } - - - void EnterCombat(Unit *who) - { - switch (rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == ENTRY_STOLEN_SOUL) - { - //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell. - summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); - summoned->SetDisplayId(soulmodel); - summoned->setFaction(m_creature->getFaction()); - - if (Unit *target = Unit::GetUnit(*m_creature,soulholder)) - { - - CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); - summoned->AI()->AttackStart(target); - } - } - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch (rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - //When Exarch Maladar is defeated D'ore appear. - m_creature->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25)) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoScriptText(SAY_SUMMON, m_creature); - - DoCast(m_creature, SPELL_SUMMON_AVATAR); - Avatar_summoned = true; - StolenSoul_Timer = 15000 + rand()% 15000; - } - - if (StolenSoul_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (target->GetTypeId() == TYPEID_PLAYER) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - uint32 i = urand(1,2); - if (i == 1) - DoScriptText(SAY_ROAR, m_creature); - else - DoScriptText(SAY_SOUL_CLEAVE, m_creature); - - soulmodel = target->GetDisplayId(); - soulholder = target->GetGUID(); - soulclass = target->getClass(); - - DoCast(target,SPELL_STOLEN_SOUL); - m_creature->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - - StolenSoul_Timer = 20000 + rand()% 10000; - } else StolenSoul_Timer = 1000; - } - }else StolenSoul_Timer -= diff; - - if (Ribbon_of_Souls_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_RIBBON_OF_SOULS); - - Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000); - }else Ribbon_of_Souls_timer -= diff; - - if (Fear_timer < diff) - { - DoCast(m_creature,SPELL_SOUL_SCREAM); - Fear_timer = 15000 + rand()% 15000; - }else Fear_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) -{ - return new boss_exarch_maladaarAI (pCreature); -} - -#define SPELL_AV_MORTAL_STRIKE 16856 -#define SPELL_AV_SUNDER_ARMOR 16145 - -struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI -{ - mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {} - - uint32 Mortal_Strike_timer; - - void Reset() - { - Mortal_Strike_timer = 10000; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Mortal_Strike_timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE); - Mortal_Strike_timer = 10000 + rand()%20 * 1000; - } else Mortal_Strike_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) -{ - return new mob_avatar_of_martyredAI (pCreature); -} - -void AddSC_boss_exarch_maladaar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_exarch_maladaar"; - newscript->GetAI = &GetAI_boss_exarch_maladaar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_avatar_of_martyred"; - newscript->GetAI = &GetAI_mob_avatar_of_martyred; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_stolen_soul"; - newscript->GetAI = &GetAI_mob_stolen_soul; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp deleted file mode 100644 index 4dfdd407731..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -Name: Boss_Shirrak_the_dead_watcher -%Complete: 80 -Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented -Category: Auchindoun, Auchenai Crypts -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_INHIBITMAGIC 32264 -#define SPELL_ATTRACTMAGIC 32265 -#define N_SPELL_CARNIVOROUSBITE 36383 -#define H_SPELL_CARNIVOROUSBITE 39382 -#define SPELL_CARNIVOROUSBITE (HeroicMode?H_SPELL_CARNIVOROUSBITE:N_SPELL_CARNIVOROUSBITE) - -#define ENTRY_FOCUS_FIRE 18374 - -#define N_SPELL_FIERY_BLAST 32302 -#define H_SPELL_FIERY_BLAST 38382 -#define SPELL_FIERY_BLAST (HeroicMode?H_SPELL_FIERY_BLAST:N_SPELL_FIERY_BLAST) -#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual - -struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI -{ - boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 Inhibitmagic_Timer; - uint32 Attractmagic_Timer; - uint32 Carnivorousbite_Timer; - uint32 FocusFire_Timer; - bool HeroicMode; - Unit *focusedTarget; - - void Reset() - { - Inhibitmagic_Timer = 0; - Attractmagic_Timer = 28000; - Carnivorousbite_Timer = 10000; - FocusFire_Timer = 17000; - focusedTarget = NULL; - } - - void EnterCombat(Unit *who) - { } - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE) - { - summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false); - summoned->setFaction(m_creature->getFaction()); - summoned->SetLevel(m_creature->getLevel()); - summoned->addUnitState(UNIT_STAT_ROOT); - - if (focusedTarget) - summoned->AI()->AttackStart(focusedTarget); - } - } - - void UpdateAI(const uint32 diff) - { - //Inhibitmagic_Timer - if (Inhibitmagic_Timer < diff) - { - float dist; - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(m_creature, 45))) - { - i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC); - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 35) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 25) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 15) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - } - Inhibitmagic_Timer = 3000+(rand()%1000); - }else Inhibitmagic_Timer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Attractmagic_Timer - if (Attractmagic_Timer < diff) - { - DoCast(m_creature,SPELL_ATTRACTMAGIC); - Attractmagic_Timer = 30000; - Carnivorousbite_Timer = 1500; - }else Attractmagic_Timer -= diff; - - //Carnivorousbite_Timer - if (Carnivorousbite_Timer < diff) - { - DoCast(m_creature,SPELL_CARNIVOROUSBITE); - Carnivorousbite_Timer = 10000; - }else Carnivorousbite_Timer -= diff; - - //FocusFire_Timer - if (FocusFire_Timer < diff) - { - // Summon Focus Fire & Emote - Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) - { - focusedTarget = target; - m_creature->SummonCreature(ENTRY_FOCUS_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500); - - // TODO: Find better way to handle emote - // Emote - std::string *emote = new std::string("focuses on "); - emote->append(target->GetName()); - emote->append("!"); - const char* text = emote->c_str(); - m_creature->MonsterTextEmote(text, 0, true); - delete emote; - } - FocusFire_Timer = 15000+(rand()%5000); - }else FocusFire_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature) -{ - return new boss_shirrak_the_dead_watcherAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI -{ - mob_focus_fireAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 FieryBlast_Timer; - bool fiery1, fiery2; - - void Reset() - { - FieryBlast_Timer = 3000+(rand()%1000); - fiery1 = fiery2 = true; - } - - void EnterCombat(Unit *who) - { } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //FieryBlast_Timer - if (fiery2 && FieryBlast_Timer < diff) - { - DoCast(m_creature,SPELL_FIERY_BLAST); - - if (fiery1) fiery1 = false; - else if (fiery2) fiery2 = false; - - FieryBlast_Timer = 1000; - }else FieryBlast_Timer -= diff; - - //DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_focus_fire(Creature* pCreature) -{ - return new mob_focus_fireAI (pCreature); -} - -void AddSC_boss_shirrak_the_dead_watcher() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_shirrak_the_dead_watcher"; - newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_focus_fire"; - newscript->GetAI = &GetAI_mob_focus_fire; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp deleted file mode 100644 index dcaaefee8c2..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_NexusPrince_Shaffar -SD%Complete: 80 -SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro. -SDCategory: Auchindoun, Mana Tombs -EndScriptData */ - -/* ContentData -boss_nexusprince_shaffar -mob_ethereal_beacon -EndContentData */ - -#include "precompiled.h" - -enum -{ - SAY_INTRO = -1557000, - SAY_AGGRO_1 = -1557001, - SAY_AGGRO_2 = -1557002, - SAY_AGGRO_3 = -1557003, - SAY_SLAY_1 = -1557004, - SAY_SLAY_2 = -1557005, - SAY_SUMMON = -1557006, - SAY_DEAD = -1557007, - - SPELL_BLINK = 34605, - SPELL_FROSTBOLT = 32364, - SPELL_FIREBALL = 32363, - SPELL_FROSTNOVA = 32365, - - SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON - SPELL_ETHEREAL_BEACON_VISUAL = 32368, - - NPC_BEACON = 18431, - NPC_SHAFFAR = 18344, - - NR_INITIAL_BEACONS = 3 -}; - -struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI -{ - boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; } - - uint32 Blink_Timer; - uint32 Beacon_Timer; - uint32 FireBall_Timer; - uint32 Frostbolt_Timer; - uint32 FrostNova_Timer; - - SummonList summons; - - bool HasTaunted; - bool CanBlink; - - void Reset() - { - Blink_Timer = 1500; - Beacon_Timer = 10000; - FireBall_Timer = 8000; - Frostbolt_Timer = 4000; - FrostNova_Timer = 15000; - - CanBlink = false; - - float dist = 8.0f; - float posX, posY, posZ, angle; - m_creature->GetHomePosition(posX, posY, posZ, angle); - - m_creature->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - m_creature->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - m_creature->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - } - - void EnterEvadeMode() - { - summons.DespawnAll(); - ScriptedAI::EnterEvadeMode(); - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 100.0f)) - { - DoScriptText(SAY_INTRO, m_creature); - HasTaunted = true; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - DoZoneInCombat(); - summons.DoZoneInCombat(); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == NPC_BEACON) - { - summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); - - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(target); - } - - summons.Summon(summoned); - } - - void SummonedCreatureDespawn(Creature *summon) - { - summons.Despawn(summon); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEAD, m_creature); - summons.DespawnAll(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (FrostNova_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoCast(m_creature,SPELL_FROSTNOVA); - FrostNova_Timer = 17500 + rand()%7500; - CanBlink = true; - }else FrostNova_Timer -= diff; - - if (Frostbolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); - Frostbolt_Timer = 4500 + rand()%1500; - }else Frostbolt_Timer -= diff; - - if (FireBall_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FIREBALL); - FireBall_Timer = 4500 + rand()%1500; - }else FireBall_Timer -= diff; - - if (CanBlink) - { - if (Blink_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - //expire movement, will prevent from running right back to victim after cast - //(but should MoveChase be used again at a certain time or should he not move?) - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - m_creature->GetMotionMaster()->MovementExpired(); - - DoCast(m_creature,SPELL_BLINK); - Blink_Timer = 1000 + rand()%1500; - CanBlink = false; - }else Blink_Timer -= diff; - } - - if (Beacon_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - if (!urand(0,3)) - DoScriptText(SAY_SUMMON, m_creature); - - DoCast(m_creature,SPELL_ETHEREAL_BEACON, true); - - Beacon_Timer = 10000; - }else Beacon_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) -{ - return new boss_nexusprince_shaffarAI (pCreature); -} - -enum -{ - SPELL_ARCANE_BOLT = 15254, - SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430 -}; - -struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI -{ - mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 Apprentice_Timer; - uint32 ArcaneBolt_Timer; - uint32 Check_Timer; - - void KillSelf() - { - m_creature->Kill(m_creature); - } - - void Reset() - { - Apprentice_Timer = (HeroicMode ? 10000 : 20000); - ArcaneBolt_Timer = 1000; - Check_Timer = 1000; - } - - void EnterCombat(Unit *who) - { - // Send Shaffar to fight - Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); - if (!Shaffar || Shaffar->isDead()) - { - KillSelf(); - return; - } - if (!Shaffar->isInCombat()) - Shaffar->AI()->AttackStart(who); - } - - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature->getVictim()); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Check_Timer < diff) - { - Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); - if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) - { - KillSelf(); - return; - } - Check_Timer = 1000; - }else Check_Timer -= diff; - - if (ArcaneBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT); - ArcaneBolt_Timer = 2000 + rand()%2500; - }else ArcaneBolt_Timer -= diff; - - if (Apprentice_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true); - m_creature->ForcedDespawn(); - return; - }else Apprentice_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) -{ - return new mob_ethereal_beaconAI (pCreature); -} - -enum -{ - SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, - SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 -}; - -struct TRINITY_DLL_DECL mob_ethereal_apprenticeAI : public ScriptedAI -{ - mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {} - - uint32 Cast_Timer; - - bool isFireboltTurn; - - void Reset() - { - Cast_Timer = 3000; - isFireboltTurn = true; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Cast_Timer < diff) - { - if (isFireboltTurn) - { - m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true); - isFireboltTurn = false; - }else{ - m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true); - isFireboltTurn = true; - } - Cast_Timer = 3000; - }else Cast_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature) -{ - return new mob_ethereal_apprenticeAI (pCreature); -} - -void AddSC_boss_nexusprince_shaffar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_nexusprince_shaffar"; - newscript->GetAI = &GetAI_boss_nexusprince_shaffar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ethereal_beacon"; - newscript->GetAI = &GetAI_mob_ethereal_beacon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ethereal_apprentice"; - newscript->GetAI = &GetAI_mob_ethereal_apprentice; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.cpp deleted file mode 100644 index 77e1c535340..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/mana_tombs/boss_pandemonius.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_Pandemonius -SD%Complete: 75 -SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged. -SDCategory: Auchindoun, Mana Tombs -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO_1 -1557008 -#define SAY_AGGRO_2 -1557009 -#define SAY_AGGRO_3 -1557010 - -#define SAY_KILL_1 -1557011 -#define SAY_KILL_2 -1557012 - -#define SAY_DEATH -1557013 - -#define EMOTE_DARK_SHELL -1557014 - -#define SPELL_VOID_BLAST 32325 -#define H_SPELL_VOID_BLAST 38760 -#define SPELL_DARK_SHELL 32358 -#define H_SPELL_DARK_SHELL 38759 - -struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI -{ - boss_pandemoniusAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 VoidBlast_Timer; - uint32 DarkShell_Timer; - uint32 VoidBlast_Counter; - - void Reset() - { - VoidBlast_Timer = 8000+rand()%15000; - DarkShell_Timer = 20000; - VoidBlast_Counter = 0; - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (VoidBlast_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target,HeroicMode ? H_SPELL_VOID_BLAST : SPELL_VOID_BLAST); - VoidBlast_Timer = 500; - ++VoidBlast_Counter; - } - - if (VoidBlast_Counter == 5) - { - VoidBlast_Timer = 15000+rand()%10000; - VoidBlast_Counter = 0; - } - }else VoidBlast_Timer -= diff; - - if (!VoidBlast_Counter) - { - if (DarkShell_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoScriptText(EMOTE_DARK_SHELL, m_creature); - - DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL); - DarkShell_Timer = 20000; - }else DarkShell_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) -{ - return new boss_pandemoniusAI (pCreature); -} - -void AddSC_boss_pandemonius() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_pandemonius"; - newscript->GetAI = &GetAI_boss_pandemonius; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp deleted file mode 100644 index 00e43fa257d..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Darkweaver_Syth -SD%Complete: 85 -SDComment: Shock spells/times need more work. Heroic partly implemented. -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" - -#define SAY_SUMMON -1556000 - -#define SAY_AGGRO_1 -1556001 -#define SAY_AGGRO_2 -1556002 -#define SAY_AGGRO_3 -1556003 - -#define SAY_SLAY_1 -1556004 -#define SAY_SLAY_2 -1556005 - -#define SAY_DEATH -1556006 - -#define SPELL_FROST_SHOCK 21401 //37865 -#define SPELL_FLAME_SHOCK 34354 -#define SPELL_SHADOW_SHOCK 30138 -#define SPELL_ARCANE_SHOCK 37132 - -#define SPELL_CHAIN_LIGHTNING 15659 //15305 - -#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203 -#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205 -#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204 -#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206 - -#define SPELL_FLAME_BUFFET (HeroicMode?38141:33526) -#define SPELL_ARCANE_BUFFET (HeroicMode?38138:33527) -#define SPELL_FROST_BUFFET (HeroicMode?38142:33528) -#define SPELL_SHADOW_BUFFET (HeroicMode?38143:33529) - -struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI -{ - boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 flameshock_timer; - uint32 arcaneshock_timer; - uint32 frostshock_timer; - uint32 shadowshock_timer; - uint32 chainlightning_timer; - - bool summon90; - bool summon50; - bool summon10; - bool HeroicMode; - - void Reset() - { - flameshock_timer = 2000; - arcaneshock_timer = 4000; - frostshock_timer = 6000; - shadowshock_timer = 8000; - chainlightning_timer = 15000; - - summon90 = false; - summon50 = false; - summon10 = false; - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustSummoned(Creature *summoned) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(target); - } - - void SythSummoning() - { - DoScriptText(SAY_SUMMON, m_creature); - - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - DoCast(m_creature,SPELL_SUMMON_SYTH_ARCANE,true); //front - DoCast(m_creature,SPELL_SUMMON_SYTH_FIRE,true); //back - DoCast(m_creature,SPELL_SUMMON_SYTH_FROST,true); //left - DoCast(m_creature,SPELL_SUMMON_SYTH_SHADOW,true); //right - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90) - { - SythSummoning(); - summon90 = true; - } - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50) - { - SythSummoning(); - summon50 = true; - } - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10) - { - SythSummoning(); - summon10 = true; - } - - if (flameshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_SHOCK); - - flameshock_timer = 10000 + rand()%5000; - } else flameshock_timer -= diff; - - if (arcaneshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_SHOCK); - - arcaneshock_timer = 10000 + rand()%5000; - } else arcaneshock_timer -= diff; - - if (frostshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_SHOCK); - - frostshock_timer = 10000 + rand()%5000; - } else frostshock_timer -= diff; - - if (shadowshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_SHOCK); - - shadowshock_timer = 10000 + rand()%5000; - } else shadowshock_timer -= diff; - - if (chainlightning_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_CHAIN_LIGHTNING); - - chainlightning_timer = 25000; - } else chainlightning_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature) -{ - return new boss_darkweaver_sythAI (pCreature); -} - -/* ELEMENTALS */ - -struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI -{ - mob_syth_fireAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 flameshock_timer; - uint32 flamebuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - flameshock_timer = 2500; - flamebuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (flameshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_SHOCK); - - flameshock_timer = 5000; - }else flameshock_timer -= diff; - - if (flamebuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_BUFFET); - - flamebuffet_timer = 5000; - }else flamebuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_fire(Creature* pCreature) -{ - return new mob_syth_fireAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI -{ - mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 arcaneshock_timer; - uint32 arcanebuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); - arcaneshock_timer = 2500; - arcanebuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (arcaneshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_SHOCK); - - arcaneshock_timer = 5000; - }else arcaneshock_timer -= diff; - - if (arcanebuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_BUFFET); - - arcanebuffet_timer = 5000; - }else arcanebuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature) -{ - return new mob_syth_arcaneAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI -{ - mob_syth_frostAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 frostshock_timer; - uint32 frostbuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - frostshock_timer = 2500; - frostbuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (frostshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_SHOCK); - - frostshock_timer = 5000; - }else frostshock_timer -= diff; - - if (frostbuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_BUFFET); - - frostbuffet_timer = 5000; - }else frostbuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_frost(Creature* pCreature) -{ - return new mob_syth_frostAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI -{ - mob_syth_shadowAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 shadowshock_timer; - uint32 shadowbuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); - shadowshock_timer = 2500; - shadowbuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (shadowshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_SHOCK); - - shadowshock_timer = 5000; - }else shadowshock_timer -= diff; - - if (shadowbuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_BUFFET); - - shadowbuffet_timer = 5000; - }else shadowbuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature) -{ - return new mob_syth_shadowAI (pCreature); -} - -void AddSC_boss_darkweaver_syth() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_darkweaver_syth"; - newscript->GetAI = &GetAI_boss_darkweaver_syth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_fire"; - newscript->GetAI = &GetAI_mob_syth_arcane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_arcane"; - newscript->GetAI = &GetAI_mob_syth_arcane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_frost"; - newscript->GetAI = &GetAI_mob_syth_frost; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_shadow"; - newscript->GetAI = &GetAI_mob_syth_shadow; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp deleted file mode 100644 index 7830fc10645..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Talon_King_Ikiss -SD%Complete: 80 -SDComment: Heroic supported. Some details missing, but most are spell related. -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" -#include "def_sethekk_halls.h" - -#define SAY_INTRO -1556007 - -#define SAY_AGGRO_1 -1556008 -#define SAY_AGGRO_2 -1556009 -#define SAY_AGGRO_3 -1556010 - -#define SAY_SLAY_1 -1556011 -#define SAY_SLAY_2 -1556012 -#define SAY_DEATH -1556013 -#define EMOTE_ARCANE_EXP -1556015 - -#define SPELL_BLINK 38194 -#define SPELL_BLINK_TELEPORT 38203 -#define SPELL_MANA_SHIELD 38151 -#define SPELL_ARCANE_BUBBLE 9438 -#define H_SPELL_SLOW 35032 - -#define SPELL_POLYMORPH 38245 -#define H_SPELL_POLYMORPH 43309 - -#define SPELL_ARCANE_VOLLEY 35059 -#define H_SPELL_ARCANE_VOLLEY 40424 - -#define SPELL_ARCANE_EXPLOSION 38197 -#define H_SPELL_ARCANE_EXPLOSION 40425 - -struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI -{ - boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - bool HeroicMode; - - uint32 ArcaneVolley_Timer; - uint32 Sheep_Timer; - uint32 Blink_Timer; - uint32 Slow_Timer; - - bool ManaShield; - bool Blink; - bool Intro; - - void Reset() - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - - ArcaneVolley_Timer = 5000; - Sheep_Timer = 8000; - Blink_Timer = 35000; - Slow_Timer = 15000+rand()%15000; - Blink = false; - Intro = false; - ManaShield = false; - } - - void MoveInLineOfSight(Unit *who) - { - if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) - { - if (!Intro && m_creature->IsWithinDistInMap(who, 100)) - { - Intro = true; - DoScriptText(SAY_INTRO, m_creature); - } - - if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - { - //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_IKISSDOOREVENT, DONE); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Blink) - { - DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION); - m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true); - Blink = false; - } - - if (ArcaneVolley_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY); - ArcaneVolley_Timer = 7000+rand()%5000; - }else ArcaneVolley_Timer -= diff; - - if (Sheep_Timer < diff) - { - //second top aggro target in normal, random target in heroic correct? - Unit *target = NULL; - target = HeroicMode ? SelectUnit(SELECT_TARGET_RANDOM,0) : SelectUnit(SELECT_TARGET_TOPAGGRO,1); - if (target) - DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH); - Sheep_Timer = 15000+rand()%2500; - }else Sheep_Timer -= diff; - - //may not be correct time to cast - if (!ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20)) - { - DoCast(m_creature,SPELL_MANA_SHIELD); - ManaShield = true; - } - - if (HeroicMode) - { - if (Slow_Timer < diff) - { - DoCast(m_creature,H_SPELL_SLOW); - Slow_Timer = 15000+rand()%25000; - }else Slow_Timer -= diff; - } - - if (Blink_Timer < diff) - { - DoScriptText(EMOTE_ARCANE_EXP, m_creature); - - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - //Spell doesn't work, but we use for visual effect at least - DoCast(target,SPELL_BLINK); - - float X = target->GetPositionX(); - float Y = target->GetPositionY(); - float Z = target->GetPositionZ(); - - DoTeleportTo(X,Y,Z); - - DoCast(target,SPELL_BLINK_TELEPORT); - Blink = true; - } - Blink_Timer = 35000+rand()%5000; - }else Blink_Timer -= diff; - - if (!Blink) - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature) -{ - return new boss_talon_king_ikissAI (pCreature); -} - -void AddSC_boss_talon_king_ikiss() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_talon_king_ikiss"; - newscript->GetAI = &GetAI_boss_talon_king_ikiss; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h deleted file mode 100644 index 6156f354d84..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/def_sethekk_halls.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SETHEKK_HALLS_H -#define DEF_SETHEKK_HALLS_H - -enum -{ - DATA_IKISSDOOREVENT = 1, - TYPE_ANZU_ENCOUNTER = 2, -}; -#endif - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp deleted file mode 100644 index 060e09a1325..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance - Sethekk Halls -SD%Complete: 50 -SDComment: Instance Data for Sethekk Halls instance -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" -#include "def_sethekk_halls.h" - -enum -{ - NPC_ANZU = 23035, - IKISS_DOOR = 177203, -}; - -struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance -{ - instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 AnzuEncounter; - uint64 m_uiIkissDoorGUID; - - void Initialize() - { - AnzuEncounter = NOT_STARTED; - m_uiIkissDoorGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (pCreature->GetEntry() == NPC_ANZU && AnzuEncounter >= IN_PROGRESS) - { - pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - pCreature->RemoveCorpse(); - } else { - AnzuEncounter = IN_PROGRESS; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - if (pGo->GetEntry() == IKISS_DOOR) - m_uiIkissDoorGUID = pGo->GetGUID(); - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_IKISSDOOREVENT: - if (data == DONE) - DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); - break; - case TYPE_ANZU_ENCOUNTER: - AnzuEncounter = data; - break; - } - } -}; - -InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) -{ - return new instance_sethekk_halls(pMap); -} - -void AddSC_instance_sethekk_halls() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_sethekk_halls"; - newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp deleted file mode 100644 index f9961e10174..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.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_Ambassador_Hellmaw -SD%Complete: 80 -SDComment: Enrage spell missing/not known -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "escortAI.h" -#include "def_shadow_labyrinth.h" - -enum -{ - SAY_INTRO = -1555000, - SAY_AGGRO1 = -1555001, - SAY_AGGRO2 = -1555002, - SAY_AGGRO3 = -1555003, - SAY_HELP = -1555004, - SAY_SLAY1 = -1555005, - SAY_SLAY2 = -1555006, - SAY_DEATH = -1555007, - - SPELL_BANISH = 30231, - SPELL_CORROSIVE_ACID = 33551, - SPELL_FEAR = 33547, - SPELL_ENRAGE = 34970 -}; - -struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI -{ - boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - HeroicMode = pCreature->GetMap()->IsHeroic(); - } - - ScriptedInstance* m_pInstance; - bool HeroicMode; - - uint32 EventCheck_Timer; - uint32 CorrosiveAcid_Timer; - uint32 Fear_Timer; - uint32 Enrage_Timer; - bool Intro; - bool IsBanished; - bool Enraged; - - void Reset() - { - EventCheck_Timer = 5000; - CorrosiveAcid_Timer = 5000 + rand()%5000; - Fear_Timer = 25000 + rand()%5000; - Enrage_Timer = 180000; - Intro = false; - IsBanished = true; - Enraged = false; - - if (m_pInstance && m_creature->isAlive()) - { - if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) - m_creature->CastSpell(m_creature, SPELL_BANISH, true); - } - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_HELLMAW, FAIL); - } - - void MoveInLineOfSight(Unit* pWho) - { - if (m_creature->HasAura(SPELL_BANISH)) - return; - - npc_escortAI::MoveInLineOfSight(pWho); - } - - void WaypointReached(uint32 i) - { - } - - void DoIntro() - { - if (m_creature->HasAura(SPELL_BANISH)) - m_creature->RemoveAurasDueToSpell(SPELL_BANISH); - - IsBanished = false; - Intro = true; - - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) - { - DoScriptText(SAY_INTRO, m_creature); - Start(true, false, 0, NULL, false, true); - } - - m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_HELLMAW, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!Intro && !IsBeingEscorted) - { - if (EventCheck_Timer < diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) - { - DoIntro(); - return; - } - } - EventCheck_Timer = 5000; - return; - } - else - { - EventCheck_Timer -= diff; - return; - } - } - - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - if (m_creature->HasAura(SPELL_BANISH, 0)) - { - EnterEvadeMode(); - return; - } - - if (CorrosiveAcid_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CORROSIVE_ACID); - CorrosiveAcid_Timer = 15000 + rand()%10000; - }else CorrosiveAcid_Timer -= diff; - - if (Fear_Timer < diff) - { - DoCast(m_creature,SPELL_FEAR); - Fear_Timer = 20000 + rand()%15000; - }else Fear_Timer -= diff; - - if (HeroicMode) - { - if (!Enraged && Enrage_Timer < diff) - { - DoCast(m_creature,SPELL_ENRAGE); - Enraged = true; - }else Enrage_Timer -= diff; - } - } -}; - -CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) -{ - return new boss_ambassador_hellmawAI(pCreature); -} - -void AddSC_boss_ambassador_hellmaw() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_ambassador_hellmaw"; - newscript->GetAI = &GetAI_boss_ambassador_hellmaw; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp deleted file mode 100644 index 73374c08f8c..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Blackheart_the_Inciter -SD%Complete: 75 -SDComment: Incite Chaos not functional since core lacks Mind Control support -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define SPELL_INCITE_CHAOS 33676 -#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party -#define SPELL_CHARGE 33709 -#define SPELL_WAR_STOMP 33707 - -#define SAY_INTRO1 -1555008 -#define SAY_INTRO2 -1555009 -#define SAY_INTRO3 -1555010 -#define SAY_AGGRO1 -1555011 -#define SAY_AGGRO2 -1555012 -#define SAY_AGGRO3 -1555013 -#define SAY_SLAY1 -1555014 -#define SAY_SLAY2 -1555015 -#define SAY_HELP -1555016 -#define SAY_DEATH -1555017 - -#define SAY2_INTRO1 -1555018 -#define SAY2_INTRO2 -1555019 -#define SAY2_INTRO3 -1555020 -#define SAY2_AGGRO1 -1555021 -#define SAY2_AGGRO2 -1555022 -#define SAY2_AGGRO3 -1555023 -#define SAY2_SLAY1 -1555024 -#define SAY2_SLAY2 -1555025 -#define SAY2_HELP -1555026 -#define SAY2_DEATH -1555027 - -struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI -{ - boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - bool InciteChaos; - uint32 InciteChaos_Timer; - uint32 InciteChaosWait_Timer; - uint32 Charge_Timer; - uint32 Knockback_Timer; - - void Reset() - { - InciteChaos = false; - InciteChaos_Timer = 20000; - InciteChaosWait_Timer = 15000; - Charge_Timer = 5000; - Knockback_Timer = 15000; - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (InciteChaos) - { - if (InciteChaosWait_Timer < diff) - { - InciteChaos = false; - InciteChaosWait_Timer = 15000; - }else InciteChaosWait_Timer -= diff; - - return; - } - - if (InciteChaos_Timer < diff) - { - DoCast(m_creature, SPELL_INCITE_CHAOS); - - std::list t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (target && target->GetTypeId() == TYPEID_PLAYER) - target->CastSpell(target,SPELL_INCITE_CHAOS_B,true); - } - - DoResetThreat(); - InciteChaos = true; - InciteChaos_Timer = 40000; - return; - }else InciteChaos_Timer -= diff; - - //Charge_Timer - if (Charge_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CHARGE); - Charge_Timer = 15000 + rand()%10000; - }else Charge_Timer -= diff; - - //Knockback_Timer - if (Knockback_Timer < diff) - { - DoCast(m_creature, SPELL_WAR_STOMP); - Knockback_Timer = 18000 + rand()%6000; - }else Knockback_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) -{ - return new boss_blackheart_the_inciterAI (pCreature); -} - -void AddSC_boss_blackheart_the_inciter() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_blackheart_the_inciter"; - newscript->GetAI = &GetAI_boss_blackheart_the_inciter; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp deleted file mode 100644 index 0cc6255f3cf..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp +++ /dev/null @@ -1,321 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Grandmaster_Vorpil -SD%Complete: 100 -SDComment: -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define SAY_INTRO -1555028 -#define SAY_AGGRO1 -1555029 -#define SAY_AGGRO2 -1555030 -#define SAY_AGGRO3 -1555031 -#define SAY_HELP -1555032 -#define SAY_SLAY1 -1555033 -#define SAY_SLAY2 -1555034 -#define SAY_DEATH -1555035 - -#define SPELL_RAIN_OF_FIRE 33617 -#define H_SPELL_RAIN_OF_FIRE 39363 - -#define SPELL_DRAW_SHADOWS 33563 -#define SPELL_SHADOWBOLT_VOLLEY 33841 -#define SPELL_BANISH 38791 - -#define MOB_VOID_TRAVELER 19226 -#define SPELL_SACRIFICE 33587 -#define SPELL_SHADOW_NOVA 33846 -#define SPELL_EMPOWERING_SHADOWS 33783 -#define H_SPELL_EMPOWERING_SHADOWS 39364 - -#define MOB_VOID_PORTAL 19224 -#define SPELL_VOID_PORTAL_VISUAL 33569 - -float VorpilPosition[3] = {-252.8820,-264.3030,17.1}; - -float VoidPortalCoords[5][3] = -{ - {-283.5894, -239.5718, 12.7}, - {-306.5853, -258.4539, 12.7}, - {-295.8789, -269.0899, 12.7}, - {-209.3401, -262.7564, 17.1}, - {-261.4533, -297.3298, 17.1} -}; - -struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI -{ - mob_voidtravelerAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - Unit *Vorpil; - uint32 move; - bool sacrificed; - - void Reset() - { - Vorpil = NULL; - move = 0; - sacrificed = false; - } - - void EnterCombat(Unit *who){} - - void UpdateAI(const uint32 diff) - { - if (!Vorpil) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - if (move < diff) - { - if (sacrificed) - { - SpellEntry *spell = GET_SPELL(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS); - if (spell) - Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature)); - Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25); - DoCast(m_creature, SPELL_SHADOW_NOVA, true); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - m_creature->GetMotionMaster()->MoveFollow(Vorpil,0,0); - if (m_creature->IsWithinDist(Vorpil, 3)) - { - DoCast(m_creature, SPELL_SACRIFICE, false); - sacrificed = true; - move = 500; - return; - } - if (!Vorpil->isInCombat() || Vorpil->isDead()) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - move = 1000; - }else move -= diff; - } -}; -CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature) -{ - return new mob_voidtravelerAI (pCreature); -} - -struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI -{ - boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - Intro = false; - } - - ScriptedInstance *pInstance; - bool Intro, HelpYell; - bool sumportals; - bool HeroicMode; - - uint32 ShadowBoltVolley_Timer; - uint32 DrawShadows_Timer; - uint32 summonTraveler_Timer; - uint32 banish_Timer; - uint64 PortalsGuid[5]; - - void Reset() - { - ShadowBoltVolley_Timer = 7000 + rand()%7000; - DrawShadows_Timer = 45000; - summonTraveler_Timer = 90000; - banish_Timer = 17000; - HelpYell = false; - destroyPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); - } - - void summonPortals() - { - if (!sumportals) - { - for (int i = 0;i<5; ++i) - { - Creature *Portal = NULL; - Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000); - if (Portal) - { - PortalsGuid[i] = Portal->GetGUID(); - Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); - } - } - sumportals = true; - summonTraveler_Timer = 5000; - } - } - - void destroyPortals() - { - if (sumportals) - { - for (int i = 0;i < 5; i ++) - { - Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]); - if (Portal && Portal->isAlive()) - Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - PortalsGuid[i] = 0; - } - sumportals = false; - } - } - - void spawnVoidTraveler() - { - int pos = rand()%5; - m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000); - if (!HelpYell) - { - DoScriptText(SAY_HELP, m_creature); - HelpYell = true; - } - } - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) - CAST_AI(mob_voidtravelerAI, summoned->AI())->Vorpil = m_creature; - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - destroyPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - summonPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); - } - - void MoveInLineOfSight(Unit *who) - { - ScriptedAI::MoveInLineOfSight(who); - - if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who)) - { - DoScriptText(SAY_INTRO, m_creature); - Intro = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ShadowBoltVolley_Timer < diff) - { - DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY); - ShadowBoltVolley_Timer = 15000 + rand()%15000;; - }else ShadowBoltVolley_Timer -= diff; - - if (HeroicMode && banish_Timer < diff) - { - Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); - if (target) - { - DoCast(target,SPELL_BANISH); - banish_Timer = 16000; - } - }else banish_Timer -= diff; - - if (DrawShadows_Timer < diff) - { - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) - i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); - - m_creature->GetMap()->CreatureRelocation(m_creature, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f); - DoCast(m_creature,SPELL_DRAW_SHADOWS,true); - - DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE); - - ShadowBoltVolley_Timer = 6000; - DrawShadows_Timer = 30000; - }else DrawShadows_Timer -= diff; - - if (summonTraveler_Timer < diff) - { - spawnVoidTraveler(); - summonTraveler_Timer = 10000; - //enrage at 20% - if ((m_creature->GetHealth()*5) < m_creature->GetMaxHealth()) - summonTraveler_Timer = 5000; - }else summonTraveler_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) -{ - return new boss_grandmaster_vorpilAI (pCreature); -} - -void AddSC_boss_grandmaster_vorpil() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_grandmaster_vorpil"; - newscript->GetAI = &GetAI_boss_grandmaster_vorpil; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_voidtraveler"; - newscript->GetAI = &GetAI_mob_voidtraveler; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp deleted file mode 100644 index 259f6091af6..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/boss_murmur.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Murmur -SD%Complete: 90 -SDComment: Timers may be incorrect -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define EMOTE_SONIC_BOOM -1555036 - -#define SPELL_SONIC_BOOM_CAST (HeroicMode?38796:33923) -#define SPELL_SONIC_BOOM_EFFECT (HeroicMode?38795:33666) -#define SPELL_RESONANCE 33657 -#define SPELL_MURMURS_TOUCH (HeroicMode?38794:33711) -#define SPELL_MAGNETIC_PULL 33689 -#define SPELL_SONIC_SHOCK 38797 -#define SPELL_THUNDERING_STORM 39365 - -struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI -{ - boss_murmurAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 SonicBoom_Timer; - uint32 MurmursTouch_Timer; - uint32 Resonance_Timer; - uint32 MagneticPull_Timer; - uint32 SonicShock_Timer; - uint32 ThunderingStorm_Timer; - bool HeroicMode; - bool SonicBoom; - - void Reset() - { - SonicBoom_Timer = 30000; - MurmursTouch_Timer = 8000 + rand()%12000; - Resonance_Timer = 5000; - MagneticPull_Timer = 15000 + rand()%15000; - ThunderingStorm_Timer = 15000; - SonicShock_Timer = 10000; - SonicBoom = false; - - //database should have `RegenHealth`=0 to prevent regen - uint32 hp = (m_creature->GetMaxHealth()*40)/100; - if (hp) m_creature->SetHealth(hp); - m_creature->ResetPlayerDamageReq(); - } - - void SonicBoomEffect() - { - std::list t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (target && target->GetTypeId() == TYPEID_PLAYER) - { - //Not do anything without aura, spell can be resisted! - if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f)) - { - //This will be wrong calculation. Also, comments suggest it must deal damage - target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8)); - } - } - } - } - - void EnterCombat(Unit *who) { } - - // Sonic Boom instant damage (needs core fix instead of this) - void SpellHitTarget(Unit *target, const SpellEntry *spell) - { - if (target && target->isAlive() && spell && spell->Id == SPELL_SONIC_BOOM_EFFECT) - m_creature->DealDamage(target,(target->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target or casting - if (!UpdateVictim() || m_creature->IsNonMeleeSpellCasted(false)) - return; - - // Sonic Boom - if (SonicBoom) - { - DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true); - SonicBoomEffect(); - - SonicBoom = false; - Resonance_Timer = 1500; - } - if (SonicBoom_Timer < diff) - { - DoScriptText(EMOTE_SONIC_BOOM, m_creature); - DoCast(m_creature, SPELL_SONIC_BOOM_CAST); - SonicBoom_Timer = 30000; - SonicBoom = true; - return; - }else SonicBoom_Timer -= diff; - - // Murmur's Touch - if (MurmursTouch_Timer < diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) - DoCast(target, SPELL_MURMURS_TOUCH); - MurmursTouch_Timer = 25000 + rand()%10000; - }else MurmursTouch_Timer -= diff; - - // Resonance - if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim()))) - { - if (Resonance_Timer < diff) - { - DoCast(m_creature, SPELL_RESONANCE); - Resonance_Timer = 5000; - }else Resonance_Timer -= diff; - } - - // Magnetic Pull - if (MagneticPull_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) - { - DoCast(target, SPELL_MAGNETIC_PULL); - MagneticPull_Timer = 15000+rand()%15000; - return; - } - MagneticPull_Timer = 500; - }else MagneticPull_Timer -= diff; - - if (HeroicMode) - { - // Thundering Storm - if (ThunderingStorm_Timer < diff) - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) - if (target->isAlive() && !m_creature->IsWithinDist(target, 35, false)) - DoCast(target, SPELL_THUNDERING_STORM, true); - ThunderingStorm_Timer = 15000; - }else ThunderingStorm_Timer -= diff; - - // Sonic Shock - if (SonicShock_Timer < diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) - if (target->isAlive()) - DoCast(target, SPELL_SONIC_SHOCK); - SonicShock_Timer = 10000+rand()%10000; - }else SonicShock_Timer -= diff; - } - - // Select nearest most aggro target if top aggro too far - if (!m_creature->isAttackReady()) - return; - if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) - if (target->isAlive() && m_creature->IsWithinMeleeRange(target)) - { - m_creature->TauntApply(target); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_murmur(Creature* pCreature) -{ - return new boss_murmurAI (pCreature); -} - -void AddSC_boss_murmur() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_murmur"; - newscript->GetAI = &GetAI_boss_murmur; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h deleted file mode 100644 index a78955368bf..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SHADOW_LABYRINTH_H -#define DEF_SHADOW_LABYRINTH_H - -#define TYPE_HELLMAW 1 -#define TYPE_OVERSEER 2 -#define DATA_BLACKHEARTTHEINCITEREVENT 3 -#define DATA_GRANDMASTERVORPILEVENT 4 -#define DATA_MURMUREVENT 5 -#define DATA_GRANDMASTERVORPIL 6 -#endif - diff --git a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp deleted file mode 100644 index f8f3b73bffa..00000000000 --- a/src/bindings/scripts/scripts/zone/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Shadow_Labyrinth -SD%Complete: 85 -SDComment: Some cleanup left along with save -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define MAX_ENCOUNTER 5 - -#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies -#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies - -/* Shadow Labyrinth encounters: -1 - Ambassador Hellmaw event -2 - Blackheart the Inciter event -3 - Grandmaster Vorpil event -4 - Murmur event -*/ - -struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance -{ - instance_shadow_labyrinth(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - uint64 m_uiRefectoryDoorGUID; - uint64 m_uiScreamingHallDoorGUID; - - uint64 m_uiGrandmasterVorpil; - uint32 m_uiFelOverseerCount; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiRefectoryDoorGUID = 0; - m_uiScreamingHallDoorGUID = 0; - - m_uiGrandmasterVorpil = 0; - m_uiFelOverseerCount = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case REFECTORY_DOOR: - m_uiRefectoryDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[2] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case SCREAMING_HALL_DOOR: - m_uiScreamingHallDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 18732: - m_uiGrandmasterVorpil = pCreature->GetGUID(); - break; - case 18796: - if (pCreature->isAlive()) - { - ++m_uiFelOverseerCount; - debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); - } - break; - } - } - - void SetData(uint32 type, uint32 uiData) - { - switch(type) - { - case TYPE_HELLMAW: - m_auiEncounter[0] = uiData; - break; - - case TYPE_OVERSEER: - if (uiData != DONE) - { - error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); - return; - } - if (m_uiFelOverseerCount) - { - --m_uiFelOverseerCount; - - if (m_uiFelOverseerCount) - debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); - else - { - m_auiEncounter[1] = DONE; - debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); - } - } - break; - - case DATA_BLACKHEARTTHEINCITEREVENT: - if (uiData == DONE) - DoUseDoorOrButton(m_uiRefectoryDoorGUID); - m_auiEncounter[2] = uiData; - break; - - case DATA_GRANDMASTERVORPILEVENT: - if (uiData == DONE) - DoUseDoorOrButton(m_uiScreamingHallDoorGUID); - m_auiEncounter[3] = uiData; - break; - - case DATA_MURMUREVENT: - m_auiEncounter[4] = uiData; - break; - } - - if (uiData == DONE) - { - if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0) - return; - - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_HELLMAW: return m_auiEncounter[0]; - case TYPE_OVERSEER: return m_auiEncounter[1]; - case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3]; - case DATA_MURMUREVENT: return m_auiEncounter[4]; - } - return false; - } - - uint64 GetData64(uint32 identifier) - { - if (identifier == DATA_GRANDMASTERVORPIL) - return m_uiGrandmasterVorpil; - - return 0; - } - - std::string GetSaveData() - { - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) -{ - return new instance_shadow_labyrinth(pMap); -} - -void AddSC_instance_shadow_labyrinth() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_shadow_labyrinth"; - newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp deleted file mode 100644 index 3538aee0c5b..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_amanitar.cpp +++ /dev/null @@ -1,79 +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 - */ - -/* Script Data Start -SDName: boss_amanitar -SDAuthor: LordVanMartin -SD%Complete: 0 -SDComment: Only appears in heroic mode -SDCategory: Ahn'kahet -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_amanitar' where entry = ''; -*** SQL END ***/ - -#include "precompiled.h" -#include "def_ahnkahet.h" - -#define SPELL_BASH 57094 -#define SPELL_ENTANGLING_ROOTS 57095 -#define SPELL_MINI 57055 -#define SPELL_VENOM_BOLT_VOLLEY 57088 - -struct TRINITY_DLL_DECL boss_amanitarAI : public ScriptedAI -{ - boss_amanitarAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* killer) {} - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - } -}; - -CreatureAI* GetAI_boss_amanitar(Creature* pCreature) -{ - return new boss_amanitarAI (pCreature); -} - -void AddSC_boss_amanitar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_amanitar"; - newscript->GetAI = &GetAI_boss_amanitar; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp deleted file mode 100644 index 129f7b34db6..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_elder_nadox.cpp +++ /dev/null @@ -1,274 +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_elder_nadox -SD%Complete: 100 -SDComment: -SDCategory: Ahn'kahet -EndScriptData */ - -#include "precompiled.h" -#include "def_ahnkahet.h" - -bool DeadAhnkaharGuardian; // needed for achievement: Respect Your Elders(2038) - -#define ACHIEVEMENT_RESPECT_YOUR_ELDERS 2038 - -#define SAY_AGGRO -1619014 -#define SAY_SLAY_1 -1619015 -#define SAY_SLAY_2 -1619016 -#define SAY_SLAY_3 -1619017 -#define SAY_DEATH -1619018 -#define SAY_EGG_SAC_1 -1619019 -#define SAY_EGG_SAC_2 -1619020 - -#define SPELL_BROOD_PLAGUE 56130 -#define H_SPELL_BROOD_PLAGUE 59467 -#define H_SPELL_BROOD_RAGE 59465 -#define SPELL_ENRAGE 26662// Enraged if too far away from home - -#define MOB_AHNKAHAR_SWARMER 30178 -#define SPELL_SUMMON_SWARMERS 56119//2x 30178 -- 2x every 10secs - -#define MOB_AHNKAHAR_GUARDIAN_ENTRY 30176 -#define SPELL_SUMMON_SWARM_GUARD 56120//1x 30176 -- every 25secs -#define SPELL_GUARDIAN_AURA 56151 - -struct TRINITY_DLL_DECL boss_elder_nadoxAI : public ScriptedAI -{ - boss_elder_nadoxAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 plague_Timer; - uint32 rage_Timer; - - uint32 swarmer_spawn_Timer; - uint32 guard_spawn_Timer; - uint32 enrage_Timer; - - - ScriptedInstance *pInstance; - - void Reset() - { - plague_Timer = 13000; - rage_Timer = 20000; - - swarmer_spawn_Timer = 10000; - guard_spawn_Timer = 25000; - - enrage_Timer = 5000; - - DeadAhnkaharGuardian = false; - - if (pInstance) - pInstance->SetData(DATA_ELDER_NADOX_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_DEATH,m_creature); - - if (pInstance) - pInstance->SetData(DATA_ELDER_NADOX_EVENT, IN_PROGRESS); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1,m_creature); break; - case 1: DoScriptText(SAY_SLAY_2,m_creature); break; - case 2: DoScriptText(SAY_SLAY_3,m_creature); break; - } - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_SLAY_3,m_creature); - - if (HeroicMode && !DeadAhnkaharGuardian) - { - AchievementEntry const *AchievRespectYourElders = GetAchievementStore()->LookupEntry(ACHIEVEMENT_RESPECT_YOUR_ELDERS); - if (AchievRespectYourElders) - { - Map* pMap = m_creature->GetMap(); - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &players = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - itr->getSource()->CompletedAchievement(AchievRespectYourElders); - } - } - } - - if (pInstance) - pInstance->SetData(DATA_ELDER_NADOX_EVENT, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (plague_Timer < diff) - { - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_BROOD_PLAGUE : SPELL_BROOD_PLAGUE); - plague_Timer = 15000; - }else plague_Timer -= diff; - - if (HeroicMode) - if (rage_Timer < diff) - { - Unit* Swarmer = m_creature->FindNearestCreature(MOB_AHNKAHAR_SWARMER, 35); - - if (Swarmer) - { - DoCast(Swarmer,H_SPELL_BROOD_RAGE,true); - rage_Timer = 15000; - } - }else rage_Timer -= diff; - - if (swarmer_spawn_Timer < diff) - { - DoCast(m_creature,SPELL_SUMMON_SWARMERS,true); - DoCast(m_creature,SPELL_SUMMON_SWARMERS); - if (rand()%3 == 0) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_EGG_SAC_1,m_creature); break; - case 1: DoScriptText(SAY_EGG_SAC_2,m_creature); break; - } - } - swarmer_spawn_Timer = 10000; - }else swarmer_spawn_Timer -= diff; - - if (guard_spawn_Timer < diff) - { - m_creature->MonsterTextEmote("An Ahn'kahar Guardian hatches!",m_creature->GetGUID(),true); - DoCast(m_creature,SPELL_SUMMON_SWARM_GUARD); - guard_spawn_Timer = 25000; - }else guard_spawn_Timer -= diff; - - if (enrage_Timer < diff) - { - if (m_creature->HasAura(SPELL_ENRAGE,0)) - return; - - float x, y, z, o; - m_creature->GetHomePosition(x, y, z, o); - if (z < 24) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(m_creature,SPELL_ENRAGE,true); - } - } - enrage_Timer = 5000; - }else enrage_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_elder_nadox(Creature* pCreature) -{ - return new boss_elder_nadoxAI(pCreature); -} - -#define SPELL_SPRINT 56354 - -struct TRINITY_DLL_DECL mob_ahnkahar_nerubianAI : public ScriptedAI -{ - mob_ahnkahar_nerubianAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - uint32 sprint_Timer; - - void Reset() - { - if (m_creature->GetEntry() == 30176) - DoCast(m_creature,SPELL_GUARDIAN_AURA,true); - sprint_Timer = 10000; - } - - void JustDied(Unit *killer) - { - if (m_creature->GetEntry() == MOB_AHNKAHAR_GUARDIAN_ENTRY) - DeadAhnkaharGuardian = true; - } - - void EnterCombat(Unit *who){} - - void UpdateAI(const uint32 diff) - { - if (m_creature->GetEntry() == 30176) - m_creature->RemoveAurasDueToSpell(SPELL_GUARDIAN_AURA); - - if (pInstance) - { - if (pInstance->GetData(DATA_ELDER_NADOX_EVENT) != IN_PROGRESS) - { - m_creature->DealDamage(m_creature,m_creature->GetHealth()); - m_creature->RemoveCorpse(); - } - } - - if (!UpdateVictim()) - return; - - if (sprint_Timer < diff) - { - DoCast(m_creature,SPELL_SPRINT); - sprint_Timer = 25000; - }else sprint_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_ahnkahar_nerubian(Creature* pCreature) -{ - return new mob_ahnkahar_nerubianAI(pCreature); -} - -void AddSC_boss_elder_nadox() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_elder_nadox"; - newscript->GetAI = &GetAI_boss_elder_nadox; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ahnkahar_nerubian"; - newscript->GetAI = &GetAI_mob_ahnkahar_nerubian; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp deleted file mode 100644 index 820c260801e..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_herald_volazj.cpp +++ /dev/null @@ -1,111 +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_herald_volazj -SDAuthor: LordVanMartin -SD%Complete: 0 -SDComment: -SDCategory: Ahn'kahet -EndScriptData */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_volazj' where entry = ''; -*** SQL END ***/ - -#include "precompiled.h" -#include "def_ahnkahet.h" - -//Spells -#define SPELL_INSANITY 57496 //Dummy -#define INSANITY_VISUAL 57561 -#define SPELL_MIND_FLAY_N 57941 -#define SPELL_MIND_FLAY_H 59974 -#define SPELL_SHADOW_BOLT_VOLLEY_1 57942 -#define SPELL_SHADOW_BOLT_VOLLEY_2 59975 -#define SPELL_SHIVER_N 57949 -#define SPELL_SHIVER_H 59978 - -//Yell -#define SAY_AGGRO -1619030 -#define SAY_SLAY_1 -1619031 -#define SAY_SLAY_2 -1619032 -#define SAY_SLAY_3 -1619033 -#define SAY_DEATH_1 -1619034 -#define SAY_DEATH_2 -1619035 -#define SAY_PHASE -1619036 - -struct TRINITY_DLL_DECL boss_volazjAI : public ScriptedAI -{ - boss_volazjAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase; - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - phase =1; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - if (phase == 1) - DoScriptText(SAY_DEATH_1, m_creature); - else - DoScriptText(SAY_DEATH_2, m_creature); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_volazj(Creature* pCreature) -{ - return new boss_volazjAI (pCreature); -} - -void AddSC_boss_volazj() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_volazj"; - newscript->GetAI = &GetAI_boss_volazj; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp deleted file mode 100644 index 47a7d79e87b..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_jedoga_shadowseeker.cpp +++ /dev/null @@ -1,109 +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_jedoga_shadowseeker -SDAuthor: LordVanMartin -SD%Complete: 0 -SDComment: -SDCategory: Ahn'kahet -EndScriptData */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_jedoga' where entry = ''; -*** SQL END ***/ - -#include "precompiled.h" -#include "def_ahnkahet.h" - -#define SPELL_CYCLONE_STRIKE 56855 -#define H_SPELL_CYCLONE_STRIKE 60030//kein unterschied zu 56855 außer das 60030 1,5sec cast ist -#define SPELL_LIGHTNING_BOLT 56891 -#define H_SPELL_LIGHTNING_BOLT 60032 -#define SPELL_THUNDERSHOCK 56926//AOE works -#define H_SPELL_THUNDERSHOCK 60029//AOE works -#define SPELL_GIFT_OF_THE_HERALD 56219//triggert if sucessfull sacreficed - -#define SAY_AGGRO -1619000 -#define SAY_C_SACRIFICE_1 -1619001 -#define SAY_C_SACRIFICE_2 -1619002 -#define SAY_SACRIFICE_1 -1619003 -#define SAY_SACRIFICE_2 -1619004 -#define SAY_SLAY_1 -1619005 -#define SAY_SLAY_2 -1619006 -#define SAY_SLAY_3 -1619007 -#define SAY_DEATH -1619008 -#define SAY_PREACHING_1 -1619009 -#define SAY_PREACHING_2 -1619010 -#define SAY_PREACHING_3 -1619011 -#define SAY_PREACHING_4 -1619012 -#define SAY_PREACHING_5 -1619013 - -struct TRINITY_DLL_DECL boss_jedogaAI : public ScriptedAI -{ - boss_jedogaAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_jedoga(Creature* pCreature) -{ - return new boss_jedogaAI (pCreature); -} - -void AddSC_boss_jedoga() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_jedoga"; - newscript->GetAI = &GetAI_boss_jedoga; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp deleted file mode 100644 index cb34d8919d7..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/boss_prince_taldaram.cpp +++ /dev/null @@ -1,109 +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_prince_taldaram -SDAuthor: LordVanMartin -SD%Complete: 0 -SDComment: -SDCategory: Ahn'kahet -EndScriptData */ - -#include "precompiled.h" -#include "def_ahnkahet.h" - -#define SPELL_BLOODTHIRST 55968 //Trigger Spell + add aura -#define SPELL_CONJURE_FLAME_SPHERE 55931 - -#define SPELL_FLAME_SPHERE_SUMMON_1 55895// 1x 30106 -#define H_SPELL_FLAME_SPHERE_SUMMON_1 59511// 1x 31686 -#define H_SPELL_FLAME_SPHERE_SUMMON_2 59512// 1x 31687 -#define SPELL_FLAME_SPHERE_SPAWN_EFFEKT 55891 -#define SPELL_FLAME_SPHERE_VISUAL 55928 -#define SPELL_FLAME_SPHERE_PERIODIC 55926 -#define H_SPELL_FLAME_SPHERE_PERIODIC 59508 -#define SPELL_FLAME_SPHERE_DEATH_EFFEKT 55947 - -#define SPELL_EMBRACE_OF_THE_VAMPYR 55959 -#define H_SPELL_EMBRACE_OF_THE_VAMPYR 59513 - -#define SPELL_VANISH 55964 - -//Yell -#define SAY_AGGRO -1619021 -#define SAY_SLAY_1 -1619022 -#define SAY_SLAY_2 -1619023 -#define SAY_SLAY_3 -1619024 -#define SAY_DEATH -1619025 -#define SAY_FEED_1 -1619026 -#define SAY_FEED_2 -1619027 -#define SAY_VANISH_1 -1619028 -#define SAY_VANISH_2 -1619029 - -struct TRINITY_DLL_DECL boss_taldaramAI : public ScriptedAI -{ - boss_taldaramAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_taldaram(Creature* pCreature) -{ - return new boss_taldaramAI (pCreature); -} - -void AddSC_boss_taldaram() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_taldaram"; - newscript->GetAI = &GetAI_boss_taldaram; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h deleted file mode 100644 index 97c0db55d72..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/def_ahnkahet.h +++ /dev/null @@ -1,33 +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 - */ - -#ifndef DEF_AHNKAHET_H -#define DEF_AHNKAHET_H - -#define DATA_ELDER_NADOX 1 -#define DATA_PRINCE_TALDARAM 2 -#define DATA_JEDOGA_SHADOWSEEKER 3 -#define DATA_HERALD_VOLAZJ 4 -#define DATA_AMANITAR 5 - -#define DATA_ELDER_NADOX_EVENT 6 -#define DATA_PRINCE_TALDARAM_EVENT 7 -#define DATA_JEDOGA_SHADOWSEEKER_EVENT 8 -#define DATA_HERALD_VOLAZJ_EVENT 9 -#define DATA_AMANITAR_EVENT 10 -#endif diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp deleted file mode 100644 index db9befd65cf..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/ahnkahet/instance_ahnkahet.cpp +++ /dev/null @@ -1,194 +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: Instance_Azjol_Nerub -SD%Complete: 0 -SDComment: -SDCategory: Azjol Nerub -EndScriptData */ - -#include "precompiled.h" -#include "def_ahnkahet.h" - -#define MAX_ENCOUNTER 5 - -/* Ahn'kahet encounters: -0 - Elder Nadox -1 - Prince Taldaram -2 - Jedoga Shadowseeker -3 - Herald Volazj -4 - Amanitar (Heroic only) -*/ - -struct TRINITY_DLL_DECL instance_ahnkahet : public ScriptedInstance -{ - instance_ahnkahet(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 Elder_Nadox; - uint64 Prince_Taldaram; - uint64 Jedoga_Shadowseeker; - uint64 Herald_Volazj; - uint64 Amanitar; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - Elder_Nadox =0; - Prince_Taldaram =0; - Jedoga_Shadowseeker =0; - Herald_Volazj =0; - Amanitar =0; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - m_auiEncounter[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 29309: Elder_Nadox = pCreature->GetGUID(); break; - case 29308: Prince_Taldaram = pCreature->GetGUID(); break; - case 29310: Jedoga_Shadowseeker = pCreature->GetGUID(); break; - case 29311: Herald_Volazj = pCreature->GetGUID(); break; - case 30258: Amanitar = pCreature->GetGUID(); break; - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_ELDER_NADOX: return Elder_Nadox; - case DATA_PRINCE_TALDARAM: return Prince_Taldaram; - case DATA_JEDOGA_SHADOWSEEKER: return Jedoga_Shadowseeker; - case DATA_HERALD_VOLAZJ: return Herald_Volazj; - case DATA_AMANITAR: return Amanitar; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_ELDER_NADOX_EVENT: - m_auiEncounter[0] = data;break; - case DATA_PRINCE_TALDARAM_EVENT: - m_auiEncounter[1] = data; break; - case DATA_JEDOGA_SHADOWSEEKER_EVENT: - m_auiEncounter[2] = data; break; - case DATA_HERALD_VOLAZJ: - m_auiEncounter[3] = data; break; - case DATA_AMANITAR: - m_auiEncounter[4] = data; break; - } - - if (data == DONE) - { - SaveToDB(); - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_ELDER_NADOX_EVENT: return m_auiEncounter[0]; - case DATA_PRINCE_TALDARAM_EVENT: return m_auiEncounter[1]; - case DATA_JEDOGA_SHADOWSEEKER_EVENT: return m_auiEncounter[2]; - case DATA_HERALD_VOLAZJ: return m_auiEncounter[3]; - case DATA_AMANITAR: return m_auiEncounter[4]; - } - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - - std::string str_data; - - std::ostringstream saveStream; - saveStream << "A K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << m_auiEncounter[3] << m_auiEncounter[4]; - - str_data = saveStream.str(); - - OUT_SAVE_INST_DATA_COMPLETE; - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - char dataHead1, dataHead2; - uint16 data0,data1,data2,data3,data4; - - std::istringstream loadStream(in); - loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2 >> data3 >> data4; - - if (dataHead1 == 'A' && dataHead2 == 'K') - { - m_auiEncounter[0] = data0; - m_auiEncounter[1] = data1; - m_auiEncounter[2] = data2; - m_auiEncounter[3] = data3; - m_auiEncounter[4] = data4; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - }else OUT_LOAD_INST_DATA_FAIL; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_ahnkahet(Map* pMap) -{ - return new instance_ahnkahet(pMap); -} - -void AddSC_instance_ahnkahet() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_ahnkahet"; - newscript->GetInstanceData = &GetInstanceData_instance_ahnkahet; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp deleted file mode 100644 index b4717824443..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_anubarak.cpp +++ /dev/null @@ -1,112 +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_anubarak -SDAuthor: LordVanMartin -SD%Complete: 0 -SDComment: -SDCategory: Azjol Nerub -EndScriptData */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_anub_arak' where entry = ''; -*** SQL END ***/ - -#include "precompiled.h" -#include "def_azjol_nerub.h" - -//Spells -#define SPELL_CARRION_BEETLES 53520 -#define SPELL_LOCUST_SWARM 53467 -#define SPELL_IMPALE 53454 -#define SPELL_POUND 53472 - -//Yell -#define SAY_INTRO -1601010 -#define SAY_AGGRO -1601000 -#define SAY_SLAY_1 -1601001 -#define SAY_SLAY_2 -1601002 -#define SAY_SLAY_3 -1601003 -#define SAY_LOCUST_1 -1601005 -#define SAY_LOCUST_2 -1601006 -#define SAY_LOCUST_3 -1601007 -#define SAY_SUBMERGE_1 -1601008 -#define SAY_SUBMERGE_2 -1601009 -#define SAY_DEATH -1601004 - -struct TRINITY_DLL_DECL boss_anub_arakAI : public ScriptedAI -{ - boss_anub_arakAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase; - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - phase =1; - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 33) - phase = 2; - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) == 15) - phase = 3; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_anub_arak(Creature* pCreature) -{ - return new boss_anub_arakAI (pCreature); -} - -void AddSC_boss_anub_arak() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_anub_arak"; - newscript->GetAI = &GetAI_boss_anub_arak; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp deleted file mode 100644 index fa85563a2e7..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_hadronox.cpp +++ /dev/null @@ -1,114 +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_hadronox -SD%Complete: 0 -SDComment: Placeholder -SDCategory: Azjol Nerub -EndScriptData */ - -#include "precompiled.h" -#include "def_azjol_nerub.h" - -#define SPELL_WEB_FRONT_DOORS 53177//dummy - -#define SPELL_ACID_CLOUD 53400 -#define H_SPELL_ACID_CLOUD 59419 -#define SPELL_LEECH_POISON 53030 -#define H_SPELL_LEECH_POISON 59417 -#define SPELL_LEECH_POISON_DEADTRIGGER 53800//heal 10% heroic und normal -#define SPELL_PIECE_ARMOR 53418 -#define SPELL_WEB_GRAB 53406 -#define H_SPELL_WEB_GRAB 59420 - -/* Script Data Start -SDName: Boss hadronox -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_hadronox' where entry = ''; -*** SQL END ***/ - -//Spells -#define SPELL_LEECH_POISON 53030 -#define SPELL_ACID_CLOUD 53400 -#define SPELL_PIERCE_ARMOR 53418 //Source SUN++ -#define SPELL_WEB_GRAB 53406 - -//Phase 0 => Gauntlet Event described below -//Phase 1 => Boss Encounter - -/*When your group enters the main room (the one after the bridge), you will notice a group of 3 Nerubians. -When you engage them, 2 more groups like this one spawn behind the first one - it is important to pull the first group back, -so you don't aggro all 3. Hadronox will be under you, fighting Nerubians. - -This is the timed gauntlet - waves of non-elite spiders - will spawn from the 3 doors located a little above the main room, and will then head down to fight Hadronox. After clearing the - main room, it is recommended to just stay in it, kill the occasional non-elites that will attack you instead of the boss, and wait for - Hadronox to make his way to you. When Hadronox enters the main room, she will web the doors, and no more non-elites will spawn.*/ - -struct TRINITY_DLL_DECL boss_hadronoxAI : public ScriptedAI -{ - boss_hadronoxAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase; - - void Reset() {} - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - phase =1; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - //when Hadronox kills any enemy (that includes a party member) she will regain 10% of her HP if the target had Leech Poison on - } -}; - -CreatureAI* GetAI_boss_hadronox(Creature* pCreature) -{ - return new boss_hadronoxAI (pCreature); -} - -void AddSC_boss_hadronox() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_hadronox"; - newscript->GetAI = &GetAI_boss_hadronox; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp deleted file mode 100644 index 3e0d3e97a51..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/boss_krikthir_the_gatewatcher.cpp +++ /dev/null @@ -1,116 +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_krikthir_the_gatewatcher -SDAuthor: LordVanMartin -SD%Complete: 0 -SDComment: Placeholder -SDCategory: Azjol Nerub -EndScriptData */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_krik_thir' where entry = ''; -*** SQL END ***/ - -#include "precompiled.h" -#include "def_azjol_nerub.h" - -#define SPELL_MIND_FLAY 52586 -#define H_SPELL_MIND_FLAY 59367 -#define SPELL_CURSE_OF_FATIGUE 52592 -#define H_SPELL_CURSE_OF_FATIGUE 59368 -#define SPELL_FRENZY 28747 // maybe 53361 - -#define MOB_SKITTERING_SWARMER 28735 -#define MOB_SKITTERING_SWARMER_CONTROLLER 32593 - -#define SPELL_SUMMON_SKITTERING_SWARMER 52438//AOE Effekt 140, maybe 52439 -#define SPELL_SUMMON_SKITTERING_SWARMER 52439//Summon 3x 28735 - -//Yell -#define SAY_AGGRO -1601011 -#define SAY_SLAY_1 -1601012 -#define SAY_SLAY_2 -1601013 -#define SAY_SLAY_3 -1601014 -#define SAY_DEATH -1601015 -#define SAY_SEND_GROUP_1 -1601018 -#define SAY_SEND_GROUP_2 -1601019 -#define SAY_SEND_GROUP_3 -1601020 -#define SAY_SWARM_1 -1601016 -#define SAY_SWARM_2 -1601017 -#define SAY_PREFIGHT_1 -1601021 -#define SAY_PREFIGHT_2 -1601022 -#define SAY_PREFIGHT_3 -1601023 - -struct TRINITY_DLL_DECL boss_krik_thirAI : public ScriptedAI -{ - boss_krik_thirAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) >= 10) - { - //Frenzy - } - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_krik_thir(Creature* pCreature) -{ - return new boss_krik_thirAI (pCreature); -} - -void AddSC_boss_krik_thir() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_krik_thir"; - newscript->GetAI = &GetAI_boss_krik_thir; - newscript->RegisterSelf(); - -} diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h deleted file mode 100644 index 9e319e8fde0..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/def_azjol_nerub.h +++ /dev/null @@ -1,29 +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 - */ - -#ifndef DEF_AZJOL_NERUB_H -#define DEF_AZJOL_NERUB_H - -#define DATA_KRIKTHIR_THE_GATEWATCHER 1 -#define DATA_HADRONOX 2 -#define DATA_ANUBARAK 3 - -#define DATA_KRIKTHIR_THE_GATEWATCHER_EVENT 4 -#define DATA_HADRONOX_EVENT 5 -#define DATA_ANUBARAK_EVENT 6 -#endif diff --git a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp b/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp deleted file mode 100644 index bac772acc6f..00000000000 --- a/src/bindings/scripts/scripts/zone/azjol_nerub/azjol_nerub/instance_azjol_nerub.cpp +++ /dev/null @@ -1,178 +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: Instance_Azjol_Nerub -SD%Complete: 0 -SDComment: Placeholder -SDCategory: Azjol Nerub -EndScriptData */ - -#include "precompiled.h" -#include "def_azjol_nerub.h" - -#define MAX_ENCOUNTER 3 - -/* Azjol Nerub encounters: -0 - Krik'thir the Gatewatcher -1 - Hadronox -2 - Anub'arak -*/ - -struct TRINITY_DLL_DECL instance_azjol_nerub : public ScriptedInstance -{ - instance_azjol_nerub(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 m_uiKrikthir; - uint64 m_uiHadronox; - uint64 m_uiAnubarak; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiKrikthir = 0; - m_uiHadronox = 0; - m_uiAnubarak =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 28684: m_uiKrikthir = pCreature->GetGUID(); break; - case 28921: m_uiHadronox = pCreature->GetGUID(); break; - case 29120: m_uiAnubarak = pCreature->GetGUID(); break; - - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_KRIKTHIR_THE_GATEWATCHER: return m_uiKrikthir; - case DATA_HADRONOX: return m_uiHadronox; - case DATA_ANUBARAK: return m_uiAnubarak; - } - - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: - m_auiEncounter[0] = data;break; - case DATA_HADRONOX_EVENT: - m_auiEncounter[1] = data; break; - case DATA_ANUBARAK_EVENT: - m_auiEncounter[2] = data; break; - } - - if (data == DONE) - { - SaveToDB(); - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_KRIKTHIR_THE_GATEWATCHER_EVENT: return m_auiEncounter[0]; - case DATA_HADRONOX_EVENT: return m_auiEncounter[1]; - case DATA_ANUBARAK_EVENT: return m_auiEncounter[2]; - } - - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - - std::string str_data; - - std::ostringstream saveStream; - saveStream << "A N " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2]; - - str_data = saveStream.str(); - - OUT_SAVE_INST_DATA_COMPLETE; - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - char dataHead1, dataHead2; - uint16 data0,data1,data2; - - std::istringstream loadStream(in); - loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2; - - if (dataHead1 == 'A' && dataHead2 == 'N') - { - m_auiEncounter[0] = data0; - m_auiEncounter[1] = data1; - m_auiEncounter[2] = data2; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - }else OUT_LOAD_INST_DATA_FAIL; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_azjol_nerub(Map* pMap) -{ - return new instance_azjol_nerub(pMap); -} - -void AddSC_instance_azjol_nerub() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_azjol_nerub"; - newscript->GetInstanceData = &GetInstanceData_instance_azjol_nerub; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu b/src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu deleted file mode 100644 index 43646746505..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/.instance_black_temple.cpp-s8inyu +++ /dev/null @@ -1,347 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Instance_Black_Temple -SD%Complete: 100 -SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -#define ENCOUNTERS 9 - -/* Black Temple encounters: -0 - High Warlord Naj'entus event -1 - Supremus Event -2 - Shade of Akama Event -3 - Teron Gorefiend Event -4 - Gurtogg Bloodboil Event -5 - Reliquary Of Souls Event -6 - Mother Shahraz Event -7 - Illidari Council Event -8 - Illidan Stormrage Event -*/ - -struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance -{ - instance_black_temple(Map *map) : ScriptedInstance(map) {Initialize();}; - - uint32 Encounters[ENCOUNTERS]; - std::string str_data; - - uint64 Najentus; - uint64 Akama; // This is the Akama that starts the Illidan encounter. - uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter. - uint64 ShadeOfAkama; - uint64 Supremus; - uint64 LadyMalande; - uint64 GathiosTheShatterer; - uint64 HighNethermancerZerevor; - uint64 VerasDarkshadow; - uint64 IllidariCouncil; - uint64 BloodElfCouncilVoice; - uint64 IllidanStormrage; - - uint64 NajentusGate; - uint64 MainTempleDoors; - uint64 ShadeOfAkamaDoor; - uint64 CommonDoor;//Teron - uint64 TeronDoor; - uint64 GuurtogDoor; - uint64 MotherDoor; - uint64 TempleDoor;//Befor mother - uint64 CouncilDoor; - uint64 SimpleDoor;//council - uint64 IllidanGate; - uint64 IllidanDoor[2]; - - void Initialize() - { - Najentus = 0; - Akama = 0; - Akama_Shade = 0; - ShadeOfAkama = 0; - Supremus = 0; - LadyMalande = 0; - GathiosTheShatterer = 0; - HighNethermancerZerevor = 0; - VerasDarkshadow = 0; - IllidariCouncil = 0; - BloodElfCouncilVoice = 0; - IllidanStormrage = 0; - - NajentusGate = 0; - MainTempleDoors = 0; - ShadeOfAkamaDoor= 0; - CommonDoor = 0;//teron - TeronDoor = 0; - GuurtogDoor = 0; - MotherDoor = 0; - TempleDoor = 0; - SimpleDoor = 0;//Bycouncil - CouncilDoor = 0; - IllidanGate = 0; - IllidanDoor[0] = 0; - IllidanDoor[1] = 0; - - for(uint8 i = 0; i < ENCOUNTERS; ++i) - Encounters[i] = NOT_STARTED; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < ENCOUNTERS; ++i) - if(Encounters[i] == IN_PROGRESS) return true; - - return false; - } - - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void OnCreatureCreate(Creature *creature, uint32 creature_entry) - { - switch(creature->GetEntry()) - { - case 22887: Najentus = creature->GetGUID(); break; - case 23089: Akama = creature->GetGUID(); break; - case 22990: Akama_Shade = creature->GetGUID(); break; - case 22841: ShadeOfAkama = creature->GetGUID(); break; - case 22898: Supremus = creature->GetGUID(); break; - case 22917: IllidanStormrage = creature->GetGUID(); break; - case 22949: GathiosTheShatterer = creature->GetGUID(); break; - case 22950: HighNethermancerZerevor = creature->GetGUID(); break; - case 22951: LadyMalande = creature->GetGUID(); break; - case 22952: VerasDarkshadow = creature->GetGUID(); break; - case 23426: IllidariCouncil = creature->GetGUID(); break; - case 23499: BloodElfCouncilVoice = creature->GetGUID(); break; - } - } - - void OnObjectCreate(GameObject* go) - { - switch(go->GetEntry()) - { - case 185483: NajentusGate = go->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards) - if(Encounters[0] == DONE)HandleGameObject(NULL,true,go);break; - case 185882: MainTempleDoors = go->GetGUID();// Main Temple Doors - right past Supermoose (Supremus) - if(Encounters[1] == DONE)HandleGameObject(NULL,true,go);break; - case 185478: ShadeOfAkamaDoor = go->GetGUID();break; - case 185480: CommonDoor = go->GetGUID(); - if(Encounters[3] == DONE)HandleGameObject(NULL,true,go);;break; - case 186153: TeronDoor = go->GetGUID(); - if(Encounters[3] == DONE)HandleGameObject(NULL,true,go);;break; - case 185892: GuurtogDoor = go->GetGUID(); - if(Encounters[4] == DONE)HandleGameObject(NULL,true,go);break; - case 185479: TempleDoor = go->GetGUID(); - if(Encounters[5] == DONE)HandleGameObject(NULL,true,go);break; - case 185482: MotherDoor = go->GetGUID(); - if(Encounters[6] == DONE)HandleGameObject(NULL,true,go);break; - case 185481: CouncilDoor = go->GetGUID(); - if(Encounters[7] == DONE)HandleGameObject(NULL,true,go);break; - case 186152: SimpleDoor = go->GetGUID(); - if(Encounters[7] == DONE)HandleGameObject(NULL,true,go);break; - case 185905: IllidanGate = go->GetGUID(); break; // Gate leading to Temple Summit - case 186261: IllidanDoor[0] = go->GetGUID(); break; // Right door at Temple Summit - case 186262: IllidanDoor[1] = go->GetGUID(); break; // Left door at Temple Summit - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_HIGHWARLORDNAJENTUS: return Najentus; - case DATA_AKAMA: return Akama; - case DATA_AKAMA_SHADE: return Akama_Shade; - case DATA_SHADEOFAKAMA: return ShadeOfAkama; - case DATA_SUPREMUS: return Supremus; - case DATA_ILLIDANSTORMRAGE: return IllidanStormrage; - case DATA_GATHIOSTHESHATTERER: return GathiosTheShatterer; - case DATA_HIGHNETHERMANCERZEREVOR: return HighNethermancerZerevor; - case DATA_LADYMALANDE: return LadyMalande; - case DATA_VERASDARKSHADOW: return VerasDarkshadow; - case DATA_ILLIDARICOUNCIL: return IllidariCouncil; - case DATA_GAMEOBJECT_NAJENTUS_GATE: return NajentusGate; - case DATA_GAMEOBJECT_ILLIDAN_GATE: return IllidanGate; - case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return IllidanDoor[0]; - case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return IllidanDoor[1]; - case DATA_GAMEOBJECT_SUPREMUS_DOORS: return MainTempleDoors; - case DATA_BLOOD_ELF_COUNCIL_VOICE: return BloodElfCouncilVoice; - } - - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_HIGHWARLORDNAJENTUSEVENT: - if(data == DONE) - { - HandleGameObject(NajentusGate, true); - } - Encounters[0] = data;break; - case DATA_SUPREMUSEVENT: - if(data == DONE) - { - HandleGameObject(NajentusGate, true); - } - Encounters[1] = data; break; - case DATA_SHADEOFAKAMAEVENT: - if(data == IN_PROGRESS) - { - HandleGameObject(ShadeOfAkamaDoor, false); - }else HandleGameObject(ShadeOfAkamaDoor, true); - Encounters[2] = data; break; - case DATA_TERONGOREFIENDEVENT: - if(data == IN_PROGRESS) - { - HandleGameObject(TeronDoor, false); - HandleGameObject(CommonDoor, false); - }else - { - HandleGameObject(TeronDoor, true); - HandleGameObject(CommonDoor, true); - } - Encounters[3] = data; break; - case DATA_GURTOGGBLOODBOILEVENT: - if(data == DONE) - { - HandleGameObject(GuurtogDoor, true); - } - Encounters[4] = data; break; - case DATA_RELIQUARYOFSOULSEVENT: - if(data == DONE) - { - HandleGameObject(TempleDoor, true); - } - Encounters[5] = data; break; - case DATA_MOTHERSHAHRAZEVENT: - if(data == DONE) - { - HandleGameObject(MotherDoor, true); - } - Encounters[6] = data; break; - case DATA_ILLIDARICOUNCILEVENT: - if(data == IN_PROGRESS) - { - HandleGameObject(CouncilDoor, false); - HandleGameObject(SimpleDoor, false); - }else - { - HandleGameObject(CouncilDoor, true); - HandleGameObject(SimpleDoor, true); - } - Encounters[7] = data; break; - case DATA_ILLIDANSTORMRAGEEVENT: Encounters[8] = data; break; - } - - if (data == DONE) - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << Encounters[0] << " " << Encounters[1] << " " - << Encounters[2] << " " << Encounters[3] << " " << Encounters[4] - << " " << Encounters[5] << " " << Encounters[6] << " " << Encounters[7] - << " " << Encounters[8]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_HIGHWARLORDNAJENTUSEVENT: return Encounters[0]; - case DATA_SUPREMUSEVENT: return Encounters[1]; - case DATA_SHADEOFAKAMAEVENT: return Encounters[2]; - case DATA_TERONGOREFIENDEVENT: return Encounters[3]; - case DATA_GURTOGGBLOODBOILEVENT: return Encounters[4]; - case DATA_RELIQUARYOFSOULSEVENT: return Encounters[5]; - case DATA_MOTHERSHAHRAZEVENT: return Encounters[6]; - case DATA_ILLIDARICOUNCILEVENT: return Encounters[7]; - case DATA_ILLIDANSTORMRAGEEVENT: return Encounters[8]; - } - - return 0; - } - - const char* Save() - { - return str_data.c_str(); - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> Encounters[0] >> Encounters[1] >> Encounters[2] - >> Encounters[3] >> Encounters[4] >> Encounters[5] >> Encounters[6] - >> Encounters[7] >> Encounters[8]; - - for(uint8 i = 0; i < ENCOUNTERS; ++i) - if (Encounters[i] == IN_PROGRESS) - Encounters[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_black_temple(Map* map) -{ - return new instance_black_temple(map); -} - -void AddSC_instance_black_temple() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_black_temple"; - newscript->GetInstanceData = &GetInstanceData_instance_black_temple; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp b/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp deleted file mode 100644 index 7f0f1e570ba..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/black_temple.cpp +++ /dev/null @@ -1,69 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Black_Temple -SD%Complete: 95 -SDComment: Spirit of Olum: Player Teleporter to Seer Kanai Teleport after defeating Naj'entus and Supremus. TODO: Find proper gossip. -SDCategory: Black Temple -EndScriptData */ - -/* ContentData -npc_spirit_of_olum -EndContentData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -/*### -# npc_spirit_of_olum -####*/ - -#define SPELL_TELEPORT 41566 // s41566 - Teleport to Ashtongue NPC's -#define GOSSIP_OLUM1 "Teleport me to the other Ashtongue Deathsworn" - -bool GossipHello_npc_spirit_of_olum(Player* pPlayer, Creature* pCreature) -{ - ScriptedInstance* pInstance = (pCreature->GetInstanceData()); - - if (pInstance && (pInstance->GetData(DATA_SUPREMUSEVENT) >= DONE) && (pInstance->GetData(DATA_HIGHWARLORDNAJENTUSEVENT) >= DONE)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_OLUM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_spirit_of_olum(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) - pPlayer->CLOSE_GOSSIP_MENU(); - - pPlayer->InterruptNonMeleeSpells(false); - pPlayer->CastSpell(pPlayer, SPELL_TELEPORT, false); - return true; -} - -void AddSC_black_temple() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_spirit_of_olum"; - newscript->pGossipHello = &GossipHello_npc_spirit_of_olum; - newscript->pGossipSelect = &GossipSelect_npc_spirit_of_olum; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp deleted file mode 100644 index 12c3d445018..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_bloodboil.cpp +++ /dev/null @@ -1,344 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Bloodboil -SD%Complete: 80 -SDComment: Bloodboil not working correctly, missing enrage -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -//Speech'n'Sound -#define SAY_AGGRO -1564029 -#define SAY_SLAY1 -1564030 -#define SAY_SLAY2 -1564031 -#define SAY_SPECIAL1 -1564032 -#define SAY_SPECIAL2 -1564033 -#define SAY_ENRAGE1 -1564034 -#define SAY_ENRAGE2 -1564035 -#define SAY_DEATH -1564036 - -//Spells -#define SPELL_ACID_GEYSER 40630 -#define SPELL_ACIDIC_WOUND 40481 -#define SPELL_ARCING_SMASH 40599 -#define SPELL_BLOODBOIL 42005 // This spell is AoE whereas it shouldn't be -#define SPELL_FEL_ACID 40508 -#define SPELL_FEL_RAGE_SELF 40594 -#define SPELL_FEL_RAGE_TARGET 40604 -#define SPELL_FEL_RAGE_2 40616 -#define SPELL_FEL_RAGE_3 41625 -#define SPELL_BEWILDERING_STRIKE 40491 -#define SPELL_EJECT1 40486 // 1000 Physical damage + knockback + script effect (should handle threat reduction I think) -#define SPELL_EJECT2 40597 // 1000 Physical damage + Stun (used in phase 2?) -#define SPELL_TAUNT_GURTOGG 40603 -#define SPELL_INSIGNIFIGANCE 40618 -#define SPELL_BERSERK 45078 - -//This is used to sort the players by distance in preparation for the Bloodboil cast. - -struct TRINITY_DLL_DECL boss_gurtogg_bloodboilAI : public ScriptedAI -{ - boss_gurtogg_bloodboilAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint64 TargetGUID; - - float TargetThreat; - - uint32 BloodboilTimer; - uint32 BloodboilCount; - uint32 AcidGeyserTimer; - uint32 AcidicWoundTimer; - uint32 ArcingSmashTimer; - uint32 EnrageTimer; - uint32 FelAcidTimer; - uint32 EjectTimer; - uint32 BewilderingStrikeTimer; - uint32 PhaseChangeTimer; - - bool Phase1; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, NOT_STARTED); - - TargetGUID = 0; - - TargetThreat = 0; - - BloodboilTimer = 10000; - BloodboilCount = 0; - AcidGeyserTimer = 1000; - AcidicWoundTimer = 6000; - ArcingSmashTimer = 19000; - EnrageTimer = 600000; - FelAcidTimer = 25000; - EjectTimer = 10000; - BewilderingStrikeTimer = 15000; - PhaseChangeTimer = 60000; - - Phase1 = true; - - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - DoScriptText(SAY_AGGRO, m_creature); - if (pInstance) - pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, IN_PROGRESS); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - if (pInstance) - pInstance->SetData(DATA_GURTOGGBLOODBOILEVENT, DONE); - - DoScriptText(SAY_DEATH, m_creature); - } - - // Note: This seems like a very complicated fix. The fix needs to be handled by the core, as implementation of limited-target AoE spells are still not limited. - void CastBloodboil() - { - // Get the Threat List - std::list m_threatlist = m_creature->getThreatManager().getThreatList(); - - if (!m_threatlist.size()) // He doesn't have anyone in his threatlist, useless to continue - return; - - std::list targets; - std::list::iterator itr = m_threatlist.begin(); - for(; itr!= m_threatlist.end(); ++itr) //store the threat list in a different container - { - Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - //only on alive players - if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) - targets.push_back(target); - } - - //Sort the list of players - targets.sort(ObjectDistanceOrderReversed(m_creature)); - //Resize so we only get top 5 - targets.resize(5); - - //Aura each player in the targets list with Bloodboil. Aura code copied+pasted from Aura command in Level3.cpp - /*SpellEntry const *spellInfo = GetSpellStore()->LookupEntry(SPELL_BLOODBOIL); - if (spellInfo) - { - for(std::list::iterator itr = targets.begin(); itr != targets.end(); ++itr) - { - Unit* target = *itr; - if (!target) return; - for(uint32 i = 0;i<3; ++i) - { - uint8 eff = spellInfo->Effect[i]; - if (eff>=TOTAL_SPELL_EFFECTS) - continue; - - Aura *Aur = new Aura(spellInfo, i, NULL, target); - target->AddAura(Aur); - } - } - }*/ - } - - void RevertThreatOnTarget(uint64 guid) - { - Unit* pUnit = NULL; - pUnit = Unit::GetUnit((*m_creature), guid); - if (pUnit) - { - if (DoGetThreat(pUnit)) - DoModifyThreatPercent(pUnit, -100); - if (TargetThreat) - m_creature->AddThreat(pUnit, TargetThreat); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ArcingSmashTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH); - ArcingSmashTimer = 10000; - }else ArcingSmashTimer -= diff; - - if (FelAcidTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FEL_ACID); - FelAcidTimer = 25000; - }else FelAcidTimer -= diff; - - if (!m_creature->HasAura(SPELL_BERSERK)) - { - if (EnrageTimer < diff) - { - DoCast(m_creature, SPELL_BERSERK); - switch(rand()%2) - { - case 0: DoScriptText(SAY_ENRAGE1, m_creature); break; - case 1: DoScriptText(SAY_ENRAGE2, m_creature); break; - } - }else EnrageTimer -= diff; - } - - if (Phase1) - { - if (BewilderingStrikeTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BEWILDERING_STRIKE); - float mt_threat = DoGetThreat(m_creature->getVictim()); - if (Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1)) - m_creature->AddThreat(target, mt_threat); - BewilderingStrikeTimer = 20000; - }else BewilderingStrikeTimer -= diff; - - if (EjectTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_EJECT1); - DoModifyThreatPercent(m_creature->getVictim(), -40); - EjectTimer = 15000; - }else EjectTimer -= diff; - - if (AcidicWoundTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ACIDIC_WOUND); - AcidicWoundTimer = 10000; - }else AcidicWoundTimer -= diff; - - if (BloodboilTimer < diff) - { - if (BloodboilCount < 5) // Only cast it five times. - { - //CastBloodboil(); // Causes issues on windows, so is commented out. - DoCast(m_creature->getVictim(), SPELL_BLOODBOIL); - ++BloodboilCount; - BloodboilTimer = 10000*BloodboilCount; - } - }else BloodboilTimer -= diff; - } - - if (!Phase1) - { - if (AcidGeyserTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ACID_GEYSER); - AcidGeyserTimer = 30000; - }else AcidGeyserTimer -= diff; - - if (EjectTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_EJECT2); - EjectTimer = 15000; - }else EjectTimer -= diff; - } - - if (PhaseChangeTimer < diff) - { - if (Phase1) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target && target->isAlive()) - { - Phase1 = false; - - TargetThreat = DoGetThreat(target); - TargetGUID = target->GetGUID(); - target->CastSpell(m_creature, SPELL_TAUNT_GURTOGG, true); - if (DoGetThreat(target)) - DoModifyThreatPercent(target, -100); - m_creature->AddThreat(target, 50000000.0f); - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); - // If VMaps are disabled, this spell can call the whole instance - DoCast(m_creature, SPELL_INSIGNIFIGANCE, true); - DoCast(target, SPELL_FEL_RAGE_TARGET, true); - DoCast(target,SPELL_FEL_RAGE_2, true); - /* These spells do not work, comment them out for now. - DoCast(target, SPELL_FEL_RAGE_2, true); - DoCast(target, SPELL_FEL_RAGE_3, true);*/ - - //Cast this without triggered so that it appears in combat logs and shows visual. - DoCast(m_creature, SPELL_FEL_RAGE_SELF); - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; - case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; - } - - AcidGeyserTimer = 1000; - PhaseChangeTimer = 30000; - } - }else // Encounter is a loop pretty much. Phase 1 -> Phase 2 -> Phase 1 -> Phase 2 till death or enrage - { - if (TargetGUID) - RevertThreatOnTarget(TargetGUID); - TargetGUID = 0; - Phase1 = true; - BloodboilTimer = 10000; - BloodboilCount = 0; - AcidicWoundTimer += 2000; - ArcingSmashTimer += 2000; - FelAcidTimer += 2000; - EjectTimer += 2000; - PhaseChangeTimer = 60000; - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); - } - }else PhaseChangeTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_gurtogg_bloodboil(Creature* pCreature) -{ - return new boss_gurtogg_bloodboilAI (pCreature); -} - -void AddSC_boss_gurtogg_bloodboil() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_gurtogg_bloodboil"; - newscript->GetAI = &GetAI_boss_gurtogg_bloodboil; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp deleted file mode 100644 index 2baa0abbe81..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_illidan.cpp +++ /dev/null @@ -1,2208 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: boss_illidan_stormrage -SD%Complete: 90 -SDComment: Somewhat of a workaround for Parasitic Shadowfiend, unable to summon GOs for Cage Trap. -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -#define GETGO(obj, guid) GameObject* obj = pInstance->instance->GetGameObject(guid) -#define GETUNIT(unit, guid) Unit* unit = Unit::GetUnit(*m_creature, guid) -#define GETCRE(cre, guid) Creature* cre = Unit::GetCreature(*m_creature, guid) -#define HPPCT(unit) unit->GetHealth()*100 / unit->GetMaxHealth() - -/************* Quotes and Sounds ***********************/ -// Gossip for when a player clicks Akama -#define GOSSIP_ITEM "We are ready to face Illidan" - -// Yells for/by Akama -#define SAY_AKAMA_BEWARE "Be wary friends, The Betrayer meditates in the court just beyond." -#define SOUND_AKAMA_BEWARE 11388 -#define SAY_AKAMA_MINION "Come, my minions. Deal with this traitor as he deserves!" -#define SOUND_AKAMA_MINION 11465 -#define SAY_AKAMA_LEAVE "I'll deal with these mongrels. Strike now, friends! Strike at the betrayer!" -#define SOUND_AKAMA_LEAVE 11390 - -// Self explanatory -const char* SAY_KILL1 = "Who shall be next to taste my blades?!"; -#define SOUND_KILL1 11473 -const char* SAY_KILL2 = "This is too easy!"; -#define SOUND_KILL2 11472 - -// I think I'll fly now and let my subordinates take you on -#define SAY_TAKEOFF "I will not be touched by rabble such as you!" -#define SOUND_TAKEOFF 11479 -#define SAY_SUMMONFLAMES "Behold the flames of Azzinoth!" -#define SOUND_SUMMONFLAMES 11480 - -// When casting Eye Blast. Demon Fire will be appear on places that he casts this -#define SAY_EYE_BLAST "Stare into the eyes of the Betrayer!" -#define SOUND_EYE_BLAST 11481 - -// kk, I go big, dark and demon on you. -#define SAY_MORPH "Behold the power... of the demon within!" -#define SOUND_MORPH 11475 - -// I KILL! -#define SAY_ENRAGE "You've wasted too much time mortals, now you shall fall!" -#define SOUND_ENRAGE 11474 - -/************** Spells *************/ -// Normal Form -#define SPELL_SHEAR 37335 // 41032 is bugged, cannot be block/dodge/parry// Reduces Max. Health by 60% for 7 seconds. Can stack 19 times. 1.5 second cast -#define SPELL_FLAME_CRASH 40832 // Summons an invis/unselect passive mob that has an aura of flame in a circle around him. -#define SPELL_DRAW_SOUL 40904 // 5k Shadow Damage in front of him. Heals Illidan for 100k health (script effect) -#define SPELL_PARASITIC_SHADOWFIEND 41917 // DoT of 3k Shadow every 2 seconds. Lasts 10 seconds. (Script effect: Summon 2 parasites once the debuff has ticked off) -#define SPELL_PARASITIC_SHADOWFIEND2 41914 // Used by Parasitic -#define SPELL_SUMMON_PARASITICS 41915 // Summons 2 Parasitic Shadowfiends on the target. It's supposed to be cast as soon as the Parasitic Shadowfiend debuff is gone, but the spells aren't linked :( -#define SPELL_AGONIZING_FLAMES 40932 // 4k fire damage initial to target and anyone w/i 5 yards. PHASE 3 ONLY -#define SPELL_ENRAGE 40683 // Increases damage by 50% and attack speed by 30%. 20 seconds, PHASE 5 ONLY -// Flying (Phase 2) -#define SPELL_THROW_GLAIVE 39635 // Throws a glaive on the ground -#define SPELL_THROW_GLAIVE2 39849 // Animation for the above spell -#define SPELL_GLAIVE_RETURNS 39873 // Glaive flies back to Illidan -#define SPELL_FIREBALL 40598 // 2.5k-3.5k damage in 10 yard radius. 2 second cast time. -#define SPELL_DARK_BARRAGE 40585 // 10 second channeled spell, 3k shadow damage per second. -// Demon Form -#define SPELL_DEMON_TRANSFORM_1 40511 // First phase of animations for transforming into Dark Illidan (fall to ground) -#define SPELL_DEMON_TRANSFORM_2 40398 // Second phase of animations (kneel) -#define SPELL_DEMON_TRANSFORM_3 40510 // Final phase of animations (stand up and roar) -#define SPELL_DEMON_FORM 40506 // Transforms into Demon Illidan. Has an Aura of Dread on him. -#define SPELL_SHADOW_BLAST 41078 // 8k - 11k Shadow Damage. Targets highest threat. Has a splash effect, damaging anyone in 20 yards of the target. -#define SPELL_FLAME_BURST 41126 // Hurls fire at entire raid for ~3.5k damage every 10 seconds. Resistable. (Does not work: Script effect) -#define SPELL_FLAME_BURST_EFFECT 41131 // The actual damage. Have each player cast it on itself (workaround) -// Other Illidan spells -#define SPELL_KNEEL 39656 // Before beginning encounter, this is how he appears (talking to skully). -#define SPELL_SHADOW_PRISON 40647 // Illidan casts this spell to immobilize entire raid when he summons Maiev. -#define SPELL_DEATH 41220 // This spell doesn't do anything except stun Illidan and set him on his knees. -#define SPELL_BERSERK 45078 // Damage increased by 500%, attack speed by 150% -#define SPELL_DUAL_WIELD 42459 -//Phase Normal spells -#define SPELL_FLAME_CRASH_EFFECT 40836 // Firey blue ring of circle that the other flame crash summons -#define SPELL_SUMMON_SHADOWDEMON 41117 // Summon four shadowfiends -#define SPELL_SHADOWFIEND_PASSIVE 41913 // Passive aura for shadowfiends -#define SPELL_SHADOW_DEMON_PASSIVE 41079 // Adds the "shadowform" aura to Shadow Demons. -#define SPELL_CONSUME_SOUL 41080 // Once the Shadow Demons reach their target, they use this to kill them -#define SPELL_PARALYZE 41083 // Shadow Demons cast this on their target -#define SPELL_PURPLE_BEAM 39123 // Purple Beam connecting Shadow Demon to their target -//Phase Flight spells -#define SPELL_AZZINOTH_CHANNEL 39857 // Glaives cast it on Flames. Not sure if this is the right spell. -#define SPELL_EYE_BLAST_TRIGGER 40017 // This summons Demon Form every few seconds and deals ~20k damage in its radius -#define SPELL_EYE_BLAST 39908 // This does the blue flamey animation. -#define SPELL_BLAZE_EFFECT 40610 // Green flame on the ground, triggers damage (5k) every few seconds -#define SPELL_BLAZE_SUMMON 40637 // Summons the Blaze creature -#define SPELL_DEMON_FIRE 40029 // Blue fire trail left by Eye Blast. Deals 2k per second if players stand on it. -#define SPELL_FLAME_BLAST 40631 // Flames of Azzinoth use this. Frontal cone AoE 7k-9k damage. -#define SPELL_CHARGE 41581 //40602 // Flames of Azzinoth charges whoever is too far from them. They enrage after this. For simplicity, we'll use the same enrage as Illidan. -#define SPELL_FLAME_ENRAGE 45078 -//Akama spells -#define SPELL_AKAMA_DOOR_CHANNEL 41268 // Akama's channel spell on the door before the Temple Summit -#define SPELL_DEATHSWORN_DOOR_CHANNEL 41269 // Olum and Udalo's channel spell on the door before the Temple Summit -#define SPELL_AKAMA_DOOR_FAIL 41271 // Not sure where this is really used... -#define SPELL_HEALING_POTION 40535 // Akama uses this to heal himself to full. -#define SPELL_CHAIN_LIGHTNING 40536 // 6938 to 8062 for 5 targets -//Maiev spells -#define SPELL_CAGE_TRAP_DUMMY 40761 // Put this in DB for cage trap GO. -#define SPELL_CAGED 40695 // Caged Trap triggers will cast this on Illidan if he is within 3 yards -#define SPELL_CAGE_TRAP_SUMMON 40694 // Summons a Cage Trap GO (bugged) on the ground along with a Cage Trap Disturb Trigger mob (working) -#define SPELL_CAGE_TRAP_BEAM 40713 // 8 Triggers on the ground in an octagon cast spells like this on Illidan 'caging him' -#define SPELL_TELEPORT_VISUAL 41232 // Teleport visual for Maiev -#define SPELL_SHADOW_STRIKE 40685 // 4375 to 5625 every 3 seconds for 12 seconds -#define SPELL_THROW_DAGGER 41152 // 5400 to 6600 damage, need dagger -#define SPELL_FAN_BLADES 39954 // bugged visual - -// Other defines -#define CENTER_X 676.740 -#define CENTER_Y 305.297 -#define CENTER_Z 353.192 - -#define FLAME_ENRAGE_DISTANCE 30 -#define FLAME_CHARGE_DISTANCE 50 - -#define EQUIP_ID_MAIN_HAND 32837 -#define EQUIP_ID_OFF_HAND 32838 - -/**** Creature Summon and Recognition IDs ****/ -enum CreatureEntry -{ - EMPTY = 0, - AKAMA = 22990, - ILLIDAN_STORMRAGE = 22917, - BLADE_OF_AZZINOTH = 22996, - FLAME_OF_AZZINOTH = 22997, - MAIEV_SHADOWSONG = 23197, - SHADOW_DEMON = 23375, - DEMON_FIRE = 23069, - FLAME_CRASH = 23336, - ILLIDAN_DOOR_TRIGGER = 23412, - SPIRIT_OF_OLUM = 23411, - SPIRIT_OF_UDALO = 23410, - ILLIDARI_ELITE = 23226, - PARASITIC_SHADOWFIEND = 23498, - CAGE_TRAP_TRIGGER = 23292, -}; - -/*** Phase Names ***/ -enum PhaseIllidan -{ - PHASE_ILLIDAN_NULL = 0, - PHASE_NORMAL = 1, - PHASE_FLIGHT = 2, - PHASE_NORMAL_2 = 3, - PHASE_DEMON = 4, - PHASE_NORMAL_MAIEV = 5, - PHASE_TALK_SEQUENCE = 6, - PHASE_FLIGHT_SEQUENCE = 7, - PHASE_TRANSFORM_SEQUENCE = 8, - PHASE_ILLIDAN_MAX = 9, -};//Maiev uses the same phase - -enum PhaseAkama -{ - PHASE_AKAMA_NULL = 0, - PHASE_CHANNEL = 1, - PHASE_WALK = 2, - PHASE_TALK = 3, - PHASE_FIGHT_ILLIDAN = 4, - PHASE_FIGHT_MINIONS = 5, - PHASE_RETURN = 6, -}; - -enum EventIllidan -{ - EVENT_NULL = 0, - EVENT_BERSERK = 1, - //normal phase - EVENT_TAUNT = 2, - EVENT_SHEAR = 3, - EVENT_FLAME_CRASH = 4, - EVENT_PARASITIC_SHADOWFIEND = 5, - EVENT_PARASITE_CHECK = 6, - EVENT_DRAW_SOUL = 7, - EVENT_AGONIZING_FLAMES = 8, - EVENT_TRANSFORM_NORMAL = 9, - EVENT_ENRAGE = 10, - //flight phase - EVENT_FIREBALL = 2, - EVENT_DARK_BARRAGE = 3, - EVENT_EYE_BLAST = 4, - EVENT_MOVE_POINT = 5, - //demon phase - EVENT_SHADOW_BLAST = 2, - EVENT_FLAME_BURST = 3, - EVENT_SHADOWDEMON = 4, - EVENT_TRANSFORM_DEMON = 5, - //sequence phase - EVENT_TALK_SEQUENCE = 2, - EVENT_FLIGHT_SEQUENCE = 2, - EVENT_TRANSFORM_SEQUENCE = 2, -}; - -enum EventMaiev -{ - EVENT_MAIEV_NULL = 0, - EVENT_MAIEV_STEALTH = 1, - EVENT_MAIEV_TAUNT = 2, - EVENT_MAIEV_SHADOW_STRIKE = 3, - EVENT_MAIEV_THROW_DAGGER = 4, - EVENT_MAIEV_TRAP = 4, -}; - -static EventIllidan MaxTimer[]= -{ - EVENT_NULL, - EVENT_DRAW_SOUL, - EVENT_MOVE_POINT, - EVENT_TRANSFORM_NORMAL, - EVENT_TRANSFORM_DEMON, - EVENT_ENRAGE, - EVENT_TALK_SEQUENCE, - EVENT_FLIGHT_SEQUENCE, - EVENT_TRANSFORM_SEQUENCE -}; - -struct Yells -{ - uint32 sound; - char* text; - uint32 pCreature, timer, emote; - bool Talk; -}; - -static Yells Conversation[]= -{ - {11463, "Akama... your duplicity is hardly surprising. I should have slaughtered you and your malformed brethren long ago.", ILLIDAN_STORMRAGE, 8000, 0, true}, - {0, NULL, ILLIDAN_STORMRAGE, 5000, 396, true}, - {11389, "We've come to end your reign, Illidan. My people and all of Outland shall be free!", AKAMA, 7000, 25, true}, - {0, NULL, AKAMA, 5000, 66, true}, - {11464, "Boldly said. But I remain unconvinced.", ILLIDAN_STORMRAGE, 8000, 396, true}, - {11380, "The time has come! The moment is at hand!", AKAMA, 3000, 22, true}, - {0, NULL, AKAMA, 2000, 15, true}, - {11466, "You are not prepared!", ILLIDAN_STORMRAGE, 3000, 406, true}, - {0, NULL, EMPTY, 1000, 0, true}, - {0, NULL, EMPTY, 0, 0, false},//9 - {11476, "Is this it, mortals? Is this all the fury you can muster?", ILLIDAN_STORMRAGE, 8000, 0, true}, - {11491, "Their fury pales before mine, Illidan. We have some unsettled business between us.", MAIEV_SHADOWSONG, 8000, 5, true}, - {11477, "Maiev... How is this even possible?", ILLIDAN_STORMRAGE, 5000, 1, true}, - {11492, "Ah... my long hunt is finally over. Today, Justice will be done!", MAIEV_SHADOWSONG, 8000, 15, true}, - {11470, "Feel the hatred of ten thousand years!", ILLIDAN_STORMRAGE, 1000, 0, false},//14 - {11496, "Ahh... It is finished. You are beaten.", MAIEV_SHADOWSONG, 6000, 0, true},//15 - {11478, "You have won... Maiev...but the huntress... is nothing...without the hunt... you... are nothing... without me..", ILLIDAN_STORMRAGE, 30000, 65, true}, // Emote dead for now. Kill him later - {11497, "He is right. I feel nothing... I am nothing... Farewell, champions.", MAIEV_SHADOWSONG, 9000, 0, true}, - {11498, NULL, MAIEV_SHADOWSONG, 5000, 0, true}, - {11498, NULL, EMPTY, 1000, 0, true},//19 Maiev disappear - {11387, "The Light will fill these dismal halls once again. I swear it.", AKAMA, 8000, 0, true}, - {0, NULL, EMPTY, 1000, 0, false}//21 -}; - -static Yells RandomTaunts[]= -{ - {11467, "I can feel your hatred.", ILLIDAN_STORMRAGE, 0, 0, false}, - {11468, "Give in to your fear!", ILLIDAN_STORMRAGE, 0, 0, false}, - {11469, "You know nothing of power!", ILLIDAN_STORMRAGE, 0, 0, false}, - {11471, "Such... arrogance!", ILLIDAN_STORMRAGE, 0, 0, false} -}; - -static Yells MaievTaunts[]= -{ - {11493, "That is for Naisha!", MAIEV_SHADOWSONG, 0, false}, - {11494, "Bleed as I have bled!", MAIEV_SHADOWSONG, 0, 0, false}, - {11495, "There shall be no prison for you this time!", MAIEV_SHADOWSONG, 0, 0, false}, - {11500, "Meet your end, demon!", MAIEV_SHADOWSONG, 0, 0, false} -}; - -struct Locations -{ - float x, y, z; -}; - -static Locations HoverPosition[]= -{ - {657, 340, 355}, - {657, 275, 355}, - {705, 275, 355}, - {705, 340, 355} -}; - -static Locations GlaivePosition[]= -{ - {695.105, 305.303, 354.256}, - {659.338, 305.303, 354.256},//the distance between two glaives is 36 - {700.105, 305.303, 354.256}, - {664.338, 305.303, 354.256} -}; - -static Locations EyeBlast[]= -{ - {677, 350, 354},//start point, pass through glaive point - {677, 260, 354} -}; - -static Locations AkamaWP[]= -{ - {770.01, 304.50, 312.29}, // Bottom of the first stairs, at the doors - {780.66, 304.50, 319.74}, // Top of the first stairs - {790.13, 319.68, 319.76}, // Bottom of the second stairs (left from the entrance) - {787.17, 347.38, 341.42}, // Top of the second stairs - {781.34, 350.31, 341.44}, // Bottom of the third stairs - {762.60, 361.06, 353.60}, // Top of the third stairs - {756.35, 360.52, 353.27}, // Before the door-thingy - {743.82, 342.21, 353.00}, // Somewhere further - {732.69, 305.13, 353.00}, // In front of Illidan - (8) - {738.11, 365.44, 353.00}, // in front of the door-thingy (the other one!) - {792.18, 366.62, 341.42}, // Down the first flight of stairs - {796.84, 304.89, 319.76}, // Down the second flight of stairs - {782.01, 304.55, 319.76} // Final location - back at the initial gates. This is where he will fight the minions! (12) -}; -// 755.762, 304.0747, 312.1769 -- This is where Akama should be spawned -static Locations SpiritSpawns[]= -{ - {755.5426, 309.9156, 312.2129}, - {755.5426, 298.7923, 312.0834} -}; - -struct Animation // For the demon transformation -{ - uint32 aura, unaura, timer, size, displayid, phase; - bool equip; -}; - -static Animation DemonTransformation[]= -{ - {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, true}, - {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, true}, - {0, 0, 3000, 1073741824, 21322, 6, false},//stunned, cannot cast demon form - {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, false}, - {SPELL_DEMON_FORM, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 4, false}, - {SPELL_DEMON_TRANSFORM_1, 0, 1000, 0, 0, 6, false}, - {SPELL_DEMON_TRANSFORM_2, SPELL_DEMON_TRANSFORM_1, 4000, 0, 0, 6, false}, - {0, SPELL_DEMON_FORM, 3000, 1069547520, 21135, 6, false}, - {SPELL_DEMON_TRANSFORM_3, SPELL_DEMON_TRANSFORM_2, 3500, 0, 0, 6, true}, - {0, SPELL_DEMON_TRANSFORM_3, 0, 0, 0, 8, true} -}; - - - -/************************************** Illidan's AI ***************************************/ -struct TRINITY_DLL_DECL boss_illidan_stormrageAI : public ScriptedAI -{ - boss_illidan_stormrageAI(Creature* c) : ScriptedAI(c), Summons(m_creature) - { - pInstance = c->GetInstanceData(); - m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); - - SpellEntry *TempSpell = GET_SPELL(SPELL_SHADOWFIEND_PASSIVE); - if (TempSpell) - TempSpell->EffectApplyAuraName[0] = 4; // proc debuff, and summon infinite fiends - } - - ScriptedInstance* pInstance; - - PhaseIllidan Phase; - EventIllidan Event; - uint32 Timer[EVENT_ENRAGE + 1]; - - uint32 TalkCount; - uint32 TransformCount; - uint32 FlightCount; - - uint32 HoverPoint; - - uint64 AkamaGUID; - uint64 MaievGUID; - uint64 FlameGUID[2]; - uint64 GlaiveGUID[2]; - - SummonList Summons; - - void Reset(); - - void JustSummoned(Creature* summon); - - void SummonedCreatureDespawn(Creature* summon) - { - if (summon->GetCreatureInfo()->Entry == FLAME_OF_AZZINOTH) - { - for(uint8 i = 0; i < 2; ++i) - if (summon->GetGUID() == FlameGUID[i]) - FlameGUID[i] = 0; - - if (!FlameGUID[0] && !FlameGUID[1] && Phase != PHASE_ILLIDAN_NULL) - { - m_creature->InterruptNonMeleeSpells(true); - EnterPhase(PHASE_FLIGHT_SEQUENCE); - } - } - Summons.Despawn(summon); - } - - void MovementInform(uint32 MovementType, uint32 Data) - { - if (FlightCount == 7) //change hover point - { - if (m_creature->getVictim()) - { - m_creature->SetInFront(m_creature->getVictim()); - m_creature->StopMoving(); - } - EnterPhase(PHASE_FLIGHT); - } - else // handle flight sequence - Timer[EVENT_FLIGHT_SEQUENCE] = 1000; - } - - void EnterCombat(Unit *who) - { - m_creature->setActive(true); - DoZoneInCombat(); - } - - void AttackStart(Unit *who) - { - if (!who || Phase >= PHASE_TALK_SEQUENCE) - return; - - if (Phase == PHASE_FLIGHT || Phase == PHASE_DEMON) - AttackStartNoMove(who); - else - ScriptedAI::AttackStart(who); - } - - void MoveInLineOfSight(Unit *who) {} - - void JustDied(Unit *killer) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - if (!pInstance) - return; - - pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, DONE); // Completed - - for(uint8 i = DATA_GAMEOBJECT_ILLIDAN_DOOR_R; i < DATA_GAMEOBJECT_ILLIDAN_DOOR_L + 1; ++i) - pInstance->HandleGameObject(pInstance->GetData64(i), true); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) return; - // TODO: Find better way to handle emote - switch(rand()%2) - { - case 0: - m_creature->MonsterYell(SAY_KILL1, LANG_UNIVERSAL, victim->GetGUID()); - DoPlaySoundToSet(m_creature, SOUND_KILL1); - break; - case 1: - m_creature->MonsterYell(SAY_KILL2, LANG_UNIVERSAL, victim->GetGUID()); - DoPlaySoundToSet(m_creature, SOUND_KILL2); - break; - } - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= m_creature->GetHealth() && done_by != m_creature) - damage = 0; - if (done_by->GetGUID() == MaievGUID) - done_by->AddThreat(m_creature, -(3*(float)damage)/4); // do not let maiev tank him - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_GLAIVE_RETURNS) // Re-equip our warblades! - { - if (!m_creature->GetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID)) - SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - else - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); - m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - } - } - - void DeleteFromThreatList(uint64 TargetGUID) - { - for(std::list::iterator itr = m_creature->getThreatManager().getThreatList().begin(); itr != m_creature->getThreatManager().getThreatList().end(); ++itr) - { - if ((*itr)->getUnitGuid() == TargetGUID) - { - (*itr)->removeReference(); - break; - } - } - } - - void Talk(uint32 count) - { - Timer[EVENT_TALK_SEQUENCE] = Conversation[count].timer; - - Creature* pCreature = NULL; - if (Conversation[count].pCreature == ILLIDAN_STORMRAGE) - pCreature = m_creature; - else if (Conversation[count].pCreature == AKAMA) - pCreature = (Unit::GetCreature((*m_creature), AkamaGUID)); - else if (Conversation[count].pCreature == MAIEV_SHADOWSONG) - pCreature = (Unit::GetCreature((*m_creature), MaievGUID)); - - if (pCreature) - { - if (Conversation[count].emote) - pCreature->HandleEmoteCommand(Conversation[count].emote); // Make the Creature do some animation! - if (Conversation[count].text) - pCreature->MonsterYell(Conversation[count].text, LANG_UNIVERSAL, 0); // Have the Creature yell out some text - if (Conversation[count].sound) - DoPlaySoundToSet(pCreature, Conversation[count].sound); // Play some sound on the creature - } - } - - void EnterPhase(PhaseIllidan NextPhase); - void CastEyeBlast(); - void SummonFlamesOfAzzinoth(); - void SummonMaiev(); - void HandleTalkSequence(); - void HandleFlightSequence() - { - switch(FlightCount) - { - case 1://lift off - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - m_creature->StopMoving(); - m_creature->MonsterYell(SAY_TAKEOFF, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, SOUND_TAKEOFF); - Timer[EVENT_FLIGHT_SEQUENCE] = 3000; - break; - case 2://move to center - m_creature->GetMotionMaster()->MovePoint(0, CENTER_X + 5, CENTER_Y, CENTER_Z); //+5, for SPELL_THROW_GLAIVE bug - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 3://throw one glaive - { - uint8 i=1; - Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (Glaive) - { - GlaiveGUID[i] = Glaive->GetGUID(); - Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Glaive->SetDisplayId(11686); - Glaive->setFaction(m_creature->getFaction()); - DoCast(Glaive, SPELL_THROW_GLAIVE2); - } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 700; - break; - case 4://throw another - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - { - uint8 i=0; - Creature* Glaive = m_creature->SummonCreature(BLADE_OF_AZZINOTH, GlaivePosition[i].x, GlaivePosition[i].y, GlaivePosition[i].z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (Glaive) - { - GlaiveGUID[i] = Glaive->GetGUID(); - Glaive->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Glaive->SetDisplayId(11686); - Glaive->setFaction(m_creature->getFaction()); - DoCast(Glaive, SPELL_THROW_GLAIVE, true); - } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 5000; - break; - case 5://summon flames - SummonFlamesOfAzzinoth(); - Timer[EVENT_FLIGHT_SEQUENCE] = 3000; - break; - case 6://fly to hover point - m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 7://return to center - m_creature->GetMotionMaster()->MovePoint(0, CENTER_X, CENTER_Y, CENTER_Z); - Timer[EVENT_FLIGHT_SEQUENCE] = 0; - break; - case 8://glaive return - for(uint8 i = 0; i < 2; ++i) - { - if (GlaiveGUID[i]) - { - Unit* Glaive = Unit::GetUnit((*m_creature), GlaiveGUID[i]); - if (Glaive) - { - Glaive->CastSpell(m_creature, SPELL_GLAIVE_RETURNS, false); // Make it look like the Glaive flies back up to us - Glaive->SetDisplayId(11686); // disappear but not die for now - } - } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 2000; - break; - case 9://land - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->StopMoving(); - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - for(uint8 i = 0; i < 2; ++i) - { - if (GlaiveGUID[i]) - { - if (GETUNIT(Glaive, GlaiveGUID[i])) - { - Glaive->SetVisibility(VISIBILITY_OFF); - Glaive->setDeathState(JUST_DIED); // Despawn the Glaive - } - GlaiveGUID[i] = 0; - } - } - Timer[EVENT_FLIGHT_SEQUENCE] = 2000; - break; - case 10://attack - DoResetThreat(); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - EnterPhase(PHASE_NORMAL_2); - break; - default: - break; - } - FlightCount++; - } - - void HandleTransformSequence() - { - if (DemonTransformation[TransformCount].unaura) - m_creature->RemoveAurasDueToSpell(DemonTransformation[TransformCount].unaura); - - if (DemonTransformation[TransformCount].aura) - DoCast(m_creature, DemonTransformation[TransformCount].aura, true); - - if (DemonTransformation[TransformCount].displayid) - m_creature->SetDisplayId(DemonTransformation[TransformCount].displayid); // It's morphin time! - - if (DemonTransformation[TransformCount].equip) - { - // Requip warglaives if needed - SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); - m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - } - else - { - // Unequip warglaives if needed - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - } - - switch(TransformCount) - { - case 2: - DoResetThreat(); - break; - case 4: - EnterPhase(PHASE_DEMON); - break; - case 7: - DoResetThreat(); - break; - case 9: - if (MaievGUID) - EnterPhase(PHASE_NORMAL_MAIEV); // Depending on whether we summoned Maiev, we switch to either phase 5 or 3 - else - EnterPhase(PHASE_NORMAL_2); - break; - default: - break; - } - if (Phase == PHASE_TRANSFORM_SEQUENCE) - Timer[EVENT_TRANSFORM_SEQUENCE] = DemonTransformation[TransformCount].timer; - TransformCount++; - } - - void UpdateAI(const uint32 diff) - { - if ((!UpdateVictim()) && Phase < PHASE_TALK_SEQUENCE) - return; - - Event = EVENT_NULL; - for(uint32 i = 1; i <= MaxTimer[Phase]; ++i) - { - if (Timer[i]) // Event is enabled - if (Timer[i] <= diff) - { - if (!Event) // No event with higher priority - Event = (EventIllidan)i; - } - else Timer[i] -= diff; - } - - switch(Phase) - { - case PHASE_NORMAL: - if (HPPCT(m_creature) < 65) - EnterPhase(PHASE_FLIGHT_SEQUENCE); - break; - - case PHASE_NORMAL_2: - if (HPPCT(m_creature) < 30) - EnterPhase(PHASE_TALK_SEQUENCE); - break; - - case PHASE_NORMAL_MAIEV: - if (HPPCT(m_creature) < 1) - EnterPhase(PHASE_TALK_SEQUENCE); - break; - - case PHASE_TALK_SEQUENCE: - if (Event == EVENT_TALK_SEQUENCE) - HandleTalkSequence(); - break; - - case PHASE_FLIGHT_SEQUENCE: - if (Event == EVENT_FLIGHT_SEQUENCE) - HandleFlightSequence(); - break; - - case PHASE_TRANSFORM_SEQUENCE: - if (Event == EVENT_TRANSFORM_SEQUENCE) - HandleTransformSequence(); - break; - } - - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - if (Phase == PHASE_NORMAL || Phase == PHASE_NORMAL_2 || Phase == PHASE_NORMAL_MAIEV && !m_creature->HasAura(SPELL_CAGED)) - { - switch(Event) - { - //PHASE_NORMAL - case EVENT_BERSERK: - m_creature->MonsterYell(SAY_ENRAGE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, SOUND_ENRAGE); - DoCast(m_creature, SPELL_BERSERK, true); - Timer[EVENT_BERSERK] = 5000;//The buff actually lasts forever. - break; - - case EVENT_TAUNT: - { - uint32 random = rand()%4; - char* yell = RandomTaunts[random].text; - uint32 soundid = RandomTaunts[random].sound; - if (yell) - m_creature->MonsterYell(yell, LANG_UNIVERSAL, 0); - if (soundid) - DoPlaySoundToSet(m_creature, soundid); - } - Timer[EVENT_TAUNT] = 25000 + rand()%10000; - break; - - case EVENT_SHEAR: - DoCast(m_creature->getVictim(), SPELL_SHEAR); - Timer[EVENT_SHEAR] = 25000 + (rand()%16 * 1000); - break; - - case EVENT_FLAME_CRASH: - DoCast(m_creature->getVictim(), SPELL_FLAME_CRASH); - Timer[EVENT_FLAME_CRASH] = 30000 + rand()%10000; - break; - - case EVENT_PARASITIC_SHADOWFIEND: - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 200, true)) - m_creature->CastSpell(target, SPELL_PARASITIC_SHADOWFIEND, true); - Timer[EVENT_PARASITIC_SHADOWFIEND] = 35000 + rand()%10000; - }break; - - case EVENT_PARASITE_CHECK: - Timer[EVENT_PARASITE_CHECK] = 0; - break; - - case EVENT_DRAW_SOUL: - DoCast(m_creature->getVictim(), SPELL_DRAW_SOUL); - Timer[EVENT_DRAW_SOUL] = 50000 + rand()%10000; - break; - - //PHASE_NORMAL_2 - case EVENT_AGONIZING_FLAMES: - DoCast(SelectUnit(SELECT_TARGET_RANDOM,0), SPELL_AGONIZING_FLAMES); - Timer[EVENT_AGONIZING_FLAMES] = 0; - break; - - case EVENT_TRANSFORM_NORMAL: - EnterPhase(PHASE_TRANSFORM_SEQUENCE); - break; - - //PHASE_NORMAL_MAIEV - case EVENT_ENRAGE: - DoCast(m_creature, SPELL_ENRAGE); - Timer[EVENT_ENRAGE] = 0; - break; - - default: - break; - } - DoMeleeAttackIfReady(); - } - - if (Phase == PHASE_FLIGHT) - { - switch(Event) - { - case EVENT_FIREBALL: - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); - Timer[EVENT_FIREBALL] = 3000; - break; - - case EVENT_DARK_BARRAGE: - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_DARK_BARRAGE); - Timer[EVENT_DARK_BARRAGE] = 0; - break; - - case EVENT_EYE_BLAST: - CastEyeBlast(); - Timer[EVENT_EYE_BLAST] = 0; - break; - - case EVENT_MOVE_POINT: - Phase = PHASE_FLIGHT_SEQUENCE; - Timer[EVENT_FLIGHT_SEQUENCE] = 0;//do not start Event when changing hover point - HoverPoint += (rand()%3 + 1); - if (HoverPoint > 3) - HoverPoint -= 4; - m_creature->GetMotionMaster()->MovePoint(0, HoverPosition[HoverPoint].x, HoverPosition[HoverPoint].y, HoverPosition[HoverPoint].z); - break; - - default: - break; - } - } - - if (Phase == PHASE_DEMON) - { - switch(Event) - { - case EVENT_SHADOW_BLAST: - m_creature->GetMotionMaster()->Clear(false); - if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 50)||!m_creature->IsWithinLOSInMap(m_creature->getVictim())) - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30); - else - m_creature->GetMotionMaster()->MoveIdle(); - DoCast(m_creature->getVictim(), SPELL_SHADOW_BLAST); - Timer[EVENT_SHADOW_BLAST] = 4000; - break; - case EVENT_SHADOWDEMON: - DoCast(m_creature, SPELL_SUMMON_SHADOWDEMON); - Timer[EVENT_SHADOWDEMON] = 0; - Timer[EVENT_FLAME_BURST] += 10000; - break; - case EVENT_FLAME_BURST: - DoCast(m_creature, SPELL_FLAME_BURST); - Timer[EVENT_FLAME_BURST] = 15000; - break; - case EVENT_TRANSFORM_DEMON: - EnterPhase(PHASE_TRANSFORM_SEQUENCE); - break; - default: - break; - } - } - } -}; - -/********************************** End of Illidan AI ******************************************/ - -struct TRINITY_DLL_DECL flame_of_azzinothAI : public ScriptedAI -{ - flame_of_azzinothAI(Creature *c) : ScriptedAI(c) {} - - uint32 FlameBlastTimer; - uint32 CheckTimer; - uint64 GlaiveGUID; - - void Reset() - { - FlameBlastTimer = 15000; - CheckTimer = 5000; - GlaiveGUID = 0; - } - - void EnterCombat(Unit *who) {DoZoneInCombat();} - - void ChargeCheck() - { - Unit* target = SelectTarget(SELECT_TARGET_FARTHEST, 0, 200, false); - if (target && (!m_creature->IsWithinCombatRange(target, FLAME_CHARGE_DISTANCE))) - { - m_creature->AddThreat(target, 5000000.0f); - AttackStart(target); - DoCast(target, SPELL_CHARGE); - m_creature->MonsterTextEmote("sets its gaze on $N!", target->GetGUID()); - } - } - - void EnrageCheck() - { - if (GETUNIT(Glaive, GlaiveGUID)) - { - if (!m_creature->IsWithinDistInMap(Glaive, FLAME_ENRAGE_DISTANCE)) - { - Glaive->InterruptNonMeleeSpells(true); - DoCast(m_creature, SPELL_FLAME_ENRAGE, true); - DoResetThreat(); - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target && target->isAlive()) - { - m_creature->AddThreat(m_creature->getVictim(), 5000000.0f); - AttackStart(m_creature->getVictim()); - } - } - else if (!m_creature->HasAura(SPELL_AZZINOTH_CHANNEL)) - { - Glaive->CastSpell(m_creature, SPELL_AZZINOTH_CHANNEL, false); - m_creature->RemoveAurasDueToSpell(SPELL_FLAME_ENRAGE); - } - } - } - - void SetGlaiveGUID(uint64 guid){ GlaiveGUID = guid; } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (FlameBlastTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BLAZE_SUMMON, true); //appear at victim - DoCast(m_creature->getVictim(), SPELL_FLAME_BLAST); - FlameBlastTimer = 15000; //10000 is official-like? - DoZoneInCombat(); //in case someone is revived - }else FlameBlastTimer -= diff; - - if (CheckTimer < diff) - { - ChargeCheck(); - EnrageCheck(); - CheckTimer = 1000; - }else CheckTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - - - -/******* Functions and vars for Akama's AI ******/ -struct TRINITY_DLL_DECL npc_akama_illidanAI : public ScriptedAI -{ - npc_akama_illidanAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - PhaseAkama Phase; - bool Event; - uint32 Timer; - - uint64 IllidanGUID; - uint64 ChannelGUID; - uint64 SpiritGUID[2]; - uint64 GateGUID; - uint64 DoorGUID[2]; - - uint32 ChannelCount; - uint32 WalkCount; - uint32 TalkCount; - - void Reset() - { - if (pInstance) - { - pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED); - - IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE); - GateGUID = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_GATE); - DoorGUID[0] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_R); - DoorGUID[1] = pInstance->GetData64(DATA_GAMEOBJECT_ILLIDAN_DOOR_L); - - pInstance->HandleGameObject(GateGUID, false); - - for(uint8 i = 0; i < 2; ++i) - pInstance->HandleGameObject(DoorGUID[i], false); - - } - else - { - IllidanGUID = 0; - GateGUID = 0; - DoorGUID[0] = 0; - DoorGUID[1] = 0; - } - - ChannelGUID = 0; - SpiritGUID[0] = 0; - SpiritGUID[1] = 0; - - Phase = PHASE_AKAMA_NULL; - Timer = 0; - - ChannelCount = 0; - WalkCount = 0; - TalkCount = 0; - - KillAllElites(); - - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has strange values.. - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - m_creature->setActive(false); - } - - // Do not call reset in Akama's evade mode, as this will stop him from summoning minions after he kills the first bit - void EnterEvadeMode() - { - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - } - - void EnterCombat(Unit *who) {} - void MoveInLineOfSight(Unit* who) {} - - void MovementInform(uint32 MovementType, uint32 Data) {Timer = 1;} - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage > m_creature->GetHealth() || done_by->GetGUID() != IllidanGUID) - damage = 0; - } - - void KillAllElites() - { - std::list& threatList = m_creature->getThreatManager().getThreatList(); - std::vector eliteList; - for(std::list::iterator itr = threatList.begin(); itr != threatList.end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); - if (pUnit && pUnit->GetEntry() == ILLIDARI_ELITE) - eliteList.push_back(pUnit); - } - for(std::vector::iterator itr = eliteList.begin(); itr != eliteList.end(); ++itr) - (*itr)->setDeathState(JUST_DIED); - EnterEvadeMode(); - } - - void BeginTalk() - { - if (!pInstance) - return; - - pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, IN_PROGRESS); - - for(uint8 i = 0; i < 2; ++i) - pInstance->HandleGameObject(DoorGUID[i], false); - - if (GETCRE(Illidan, IllidanGUID)) - { - Illidan->RemoveAurasDueToSpell(SPELL_KNEEL); - m_creature->SetInFront(Illidan); - Illidan->SetInFront(m_creature); - m_creature->GetMotionMaster()->MoveIdle(); - Illidan->GetMotionMaster()->MoveIdle(); - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->AkamaGUID = m_creature->GetGUID(); - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->EnterPhase(PHASE_TALK_SEQUENCE); - } - } - - void BeginChannel() - { - m_creature->setActive(true); - - float x, y, z; - if (GETGO(Gate, GateGUID)) - Gate->GetPosition(x, y, z); - else - return;//if door not spawned, don't crash server - - if (Creature* Channel = m_creature->SummonCreature(ILLIDAN_DOOR_TRIGGER, x, y, z+5, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000)) - { - ChannelGUID = Channel->GetGUID(); - Channel->SetDisplayId(11686); // Invisible but spell visuals can still be seen. - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - DoCast(Channel, SPELL_AKAMA_DOOR_FAIL); - } - - for(uint8 i = 0; i < 2; ++i) - if (Creature* Spirit = m_creature->SummonCreature(i ? SPIRIT_OF_OLUM : SPIRIT_OF_UDALO, SpiritSpawns[i].x, SpiritSpawns[i].y, SpiritSpawns[i].z, 0, TEMPSUMMON_TIMED_DESPAWN, 20000)) - { - Spirit->SetVisibility(VISIBILITY_OFF); - SpiritGUID[i] = Spirit->GetGUID(); - } - } - - void BeginWalk() - { - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->SetSpeed(MOVE_RUN, 1.0f); - m_creature->GetMotionMaster()->MovePoint(0, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); - } - - void EnterPhase(PhaseAkama NextPhase) - { - if (!pInstance) return; - switch(NextPhase) - { - case PHASE_CHANNEL: - BeginChannel(); - Timer = 5000; - ChannelCount = 0; - break; - case PHASE_WALK: - if (Phase == PHASE_CHANNEL) - WalkCount = 0; - else if (Phase == PHASE_TALK) - { - if (GETCRE(Illidan, IllidanGUID)) - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID()); - EnterEvadeMode(); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - WalkCount++; - } - BeginWalk(); - Timer = 0; - break; - case PHASE_TALK: - if (Phase == PHASE_WALK) - { - BeginTalk(); - Timer = 0; - } - else if (Phase == PHASE_FIGHT_ILLIDAN) - { - Timer = 1; - TalkCount = 0; - } - break; - case PHASE_FIGHT_ILLIDAN: - if (GETUNIT(Illidan, IllidanGUID)) - { - m_creature->AddThreat(Illidan, 10000000.0f); - m_creature->GetMotionMaster()->MoveChase(Illidan); - } - Timer = 30000; //chain lightning - break; - case PHASE_FIGHT_MINIONS: - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Timer = 10000 + rand()%6000;//summon minion - break; - case PHASE_RETURN: - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - KillAllElites(); - WalkCount = 0; - BeginWalk(); - Timer = 1; - break; - default: - break; - } - Phase = NextPhase; - Event = false; - } - - void HandleTalkSequence() - { - switch(TalkCount) - { - case 0: - if (GETCRE(Illidan, IllidanGUID)) - { - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->Timer[EVENT_TAUNT] += 30000; - Illidan->MonsterYell(SAY_AKAMA_MINION, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(Illidan, SOUND_AKAMA_MINION); - } - Timer = 8000; - break; - case 1: - m_creature->MonsterYell(SAY_AKAMA_LEAVE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, SOUND_AKAMA_LEAVE); - Timer = 3000; - break; - case 2: - EnterPhase(PHASE_WALK); - break; - } - TalkCount++; - } - - void HandleChannelSequence() - { - Unit* Channel, *Spirit[2]; - if (ChannelCount <= 5) - { - Channel = Unit::GetUnit((*m_creature), ChannelGUID); - Spirit[0] = Unit::GetUnit((*m_creature), SpiritGUID[0]); - Spirit[1] = Unit::GetUnit((*m_creature), SpiritGUID[1]); - if (!Channel || !Spirit[0] || !Spirit[1]) - return; - } - - switch(ChannelCount) - { - case 0: // channel failed - m_creature->InterruptNonMeleeSpells(true); - Timer = 2000; - break; - case 1: // spirit appear - Spirit[0]->SetVisibility(VISIBILITY_ON); - Spirit[1]->SetVisibility(VISIBILITY_ON); - Timer = 2000; - break; - case 2: // spirit help - DoCast(Channel, SPELL_AKAMA_DOOR_CHANNEL); - Spirit[0]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false); - Spirit[1]->CastSpell(Channel, SPELL_DEATHSWORN_DOOR_CHANNEL,false); - Timer = 5000; - break; - case 3: //open the gate - m_creature->InterruptNonMeleeSpells(true); - Spirit[0]->InterruptNonMeleeSpells(true); - Spirit[1]->InterruptNonMeleeSpells(true); - pInstance->HandleGameObject(GateGUID, true); - Timer = 2000; - break; - case 4: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_SALUTE); - Timer = 2000; - break; - case 5: - m_creature->MonsterYell(SAY_AKAMA_BEWARE, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, SOUND_AKAMA_BEWARE); - Channel->setDeathState(JUST_DIED); - Spirit[0]->SetVisibility(VISIBILITY_OFF); - Spirit[1]->SetVisibility(VISIBILITY_OFF); - Timer = 3000; - break; - case 6: - EnterPhase(PHASE_WALK); - break; - default: - break; - } - ChannelCount++; - } - - void HandleWalkSequence() - { - switch(WalkCount) - { - case 6: - for(uint8 i = 0; i < 2; ++i) - pInstance->HandleGameObject(DoorGUID[i], true); - break; - case 8: - if (Phase == PHASE_WALK) - EnterPhase(PHASE_TALK); - else - EnterPhase(PHASE_FIGHT_ILLIDAN); - break; - case 12: - EnterPhase(PHASE_FIGHT_MINIONS); - break; - } - - if (Phase == PHASE_WALK) - { - Timer = 0; - WalkCount++; - m_creature->GetMotionMaster()->MovePoint(WalkCount, AkamaWP[WalkCount].x, AkamaWP[WalkCount].y, AkamaWP[WalkCount].z); - } - } - - void UpdateAI(const uint32 diff) - { - Event = false; - if (Timer) - { - if (Timer <= diff) - Event = true; - else Timer -= diff; - } - - if (Event) - { - switch(Phase) - { - case PHASE_CHANNEL: - HandleChannelSequence(); - break; - case PHASE_TALK: - HandleTalkSequence(); - break; - case PHASE_WALK: - case PHASE_RETURN: - HandleWalkSequence(); - break; - case PHASE_FIGHT_ILLIDAN: - { - GETUNIT(Illidan, IllidanGUID); - if (Illidan && HPPCT(Illidan) < 90) - EnterPhase(PHASE_TALK); - else - { - DoCast(m_creature->getVictim(), SPELL_CHAIN_LIGHTNING); - Timer = 30000; - } - }break; - case PHASE_FIGHT_MINIONS: - { - float x, y, z; - m_creature->GetPosition(x, y, z); - Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x+rand()%10, y+rand()%10, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); - //Creature* Elite = m_creature->SummonCreature(ILLIDARI_ELITE, x, y, z, 0, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 30000); - if (Elite) - { - Elite->AI()->AttackStart(m_creature); - Elite->AddThreat(m_creature, 1000000.0f); - AttackStart(Elite); - m_creature->AddThreat(Elite, 1000000.0f); - } - Timer = 10000 + rand()%6000; - GETUNIT(Illidan, IllidanGUID); - if (Illidan && HPPCT(Illidan) < 10) - EnterPhase(PHASE_RETURN); - } - break; - default: - break; - } - } - - if (!UpdateVictim()) - return; - - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 20) - DoCast(m_creature, SPELL_HEALING_POTION); - - DoMeleeAttackIfReady(); - } -}; - - -struct TRINITY_DLL_DECL boss_maievAI : public ScriptedAI -{ - boss_maievAI(Creature *c) : ScriptedAI(c) {}; - - uint64 IllidanGUID; - - PhaseIllidan Phase; - EventMaiev Event; - uint32 Timer[5]; - uint32 MaxTimer; - - void Reset() - { - MaxTimer = 0; - Phase = PHASE_NORMAL_MAIEV; - IllidanGUID = 0; - Timer[EVENT_MAIEV_STEALTH] = 0; - Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; - Timer[EVENT_MAIEV_SHADOW_STRIKE] = 30000; - SetEquipmentSlots(false, 44850, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID + 2, 45738); - } - - void EnterCombat(Unit *who) {} - void MoveInLineOfSight(Unit *who) {} - void EnterEvadeMode() {} - void GetIllidanGUID(uint64 guid) { IllidanGUID = guid; } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by->GetGUID() != IllidanGUID) - damage = 0; - else - { - GETUNIT(Illidan, IllidanGUID); - if (Illidan && Illidan->getVictim() == m_creature) - damage = m_creature->GetMaxHealth()/10; - if (damage >= m_creature->GetHealth()) - damage = 0; - } - } - - void AttackStart(Unit *who) - { - if (!who || Timer[EVENT_MAIEV_STEALTH]) - return; - - if (Phase == PHASE_TALK_SEQUENCE) - AttackStartNoMove(who); - else if (Phase == PHASE_DEMON || Phase == PHASE_TRANSFORM_SEQUENCE) - { - GETUNIT(Illidan, IllidanGUID); - if (Illidan && m_creature->IsWithinDistInMap(Illidan, 25)) - BlinkToPlayer();//Do not let dread aura hurt her. - AttackStartNoMove(who); - } - else - ScriptedAI::AttackStart(who); - } - - void DoAction(const int32 param) - { - if (param > PHASE_ILLIDAN_NULL && param < PHASE_ILLIDAN_MAX) - EnterPhase(PhaseIllidan(param)); - } - - void EnterPhase(PhaseIllidan NextPhase)//This is in fact Illidan's phase. - { - switch(NextPhase) - { - case PHASE_TALK_SEQUENCE: - if (Timer[EVENT_MAIEV_STEALTH]) - { - m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->SetVisibility(VISIBILITY_ON); - Timer[EVENT_MAIEV_STEALTH] = 0; - } - m_creature->InterruptNonMeleeSpells(false); - m_creature->GetMotionMaster()->Clear(false); - m_creature->AttackStop(); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, IllidanGUID); - MaxTimer = 0; - break; - case PHASE_TRANSFORM_SEQUENCE: - MaxTimer = 4; - Timer[EVENT_MAIEV_TAUNT] += 10000; - Timer[EVENT_MAIEV_THROW_DAGGER] = 2000; - break; - case PHASE_DEMON: - break; - case PHASE_NORMAL_MAIEV: - MaxTimer = 4; - Timer[EVENT_MAIEV_TAUNT] += 10000; - Timer[EVENT_MAIEV_TRAP] = 22000; - break; - default: - break; - } - if (Timer[EVENT_MAIEV_STEALTH]) - MaxTimer = 1; - Phase = NextPhase; - } - - void BlinkTo(float x, float y, float z) - { - m_creature->AttackStop(); - m_creature->InterruptNonMeleeSpells(false); - m_creature->GetMotionMaster()->Clear(false); - DoTeleportTo(x, y, z); - DoCast(m_creature, SPELL_TELEPORT_VISUAL, true); - } - - void BlinkToPlayer() - { - if (GETCRE(Illidan, IllidanGUID)) - { - Unit* target = CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (!target || !m_creature->IsWithinDistInMap(target, 80) || Illidan->IsWithinDistInMap(target, 20)) - { - uint8 pos = rand()%4; - BlinkTo(HoverPosition[pos].x, HoverPosition[pos].y, HoverPosition[pos].z); - } - else - { - float x, y, z; - target->GetPosition(x, y, z); - BlinkTo(x, y, z); - } - } - } - - void UpdateAI(const uint32 diff) - { - if ((!UpdateVictim()) - && !Timer[EVENT_MAIEV_STEALTH]) - return; - - Event = EVENT_MAIEV_NULL; - for(uint8 i = 1; i <= MaxTimer; ++i) - if (Timer[i]) - { - if (Timer[i] <= diff) - Event = (EventMaiev)i; - else Timer[i] -= diff; - } - - switch(Event) - { - case EVENT_MAIEV_STEALTH: - { - m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Timer[EVENT_MAIEV_STEALTH] = 0; - BlinkToPlayer(); - EnterPhase(Phase); - }break; - case EVENT_MAIEV_TAUNT: - { - uint32 random = rand()%4; - char* text = MaievTaunts[random].text; - uint32 sound = MaievTaunts[random].sound; - m_creature->MonsterYell(text, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, sound); - Timer[EVENT_MAIEV_TAUNT] = 22000 + rand()%21 * 1000; - }break; - case EVENT_MAIEV_SHADOW_STRIKE: - DoCast(m_creature->getVictim(), SPELL_SHADOW_STRIKE); - Timer[EVENT_MAIEV_SHADOW_STRIKE] = 60000; - break; - case EVENT_MAIEV_TRAP: - if (Phase == PHASE_NORMAL_MAIEV) - { - BlinkToPlayer(); - DoCast(m_creature, SPELL_CAGE_TRAP_SUMMON); - Timer[EVENT_MAIEV_TRAP] = 22000; - } - else - { - if (!m_creature->IsWithinDistInMap(m_creature->getVictim(), 40)) - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim(), 30); - DoCast(m_creature->getVictim(), SPELL_THROW_DAGGER); - Timer[EVENT_MAIEV_THROW_DAGGER] = 2000; - } - break; - default: - break; - } - - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (GETCRE(Illidan, IllidanGUID)) - CAST_AI(boss_illidan_stormrageAI, Illidan->AI())->DeleteFromThreatList(m_creature->GetGUID()); - m_creature->AttackStop(); - Timer[EVENT_MAIEV_STEALTH] = 60000; //reappear after 1 minute - MaxTimer = 1; - } - - if (Phase == PHASE_NORMAL_MAIEV) - DoMeleeAttackIfReady(); - } -}; - - -bool GossipSelect_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF) // Time to begin the Event - { - pPlayer->CLOSE_GOSSIP_MENU(); - CAST_AI(npc_akama_illidanAI, pCreature->AI())->EnterPhase(PHASE_CHANNEL); - } - return true; -} - -bool GossipHello_npc_akama_at_illidan(Player* pPlayer, Creature* pCreature) -{ - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->SEND_GOSSIP_MENU(10465, pCreature->GetGUID()); - - return true; -} - -struct TRINITY_DLL_DECL cage_trap_triggerAI : public ScriptedAI -{ - cage_trap_triggerAI(Creature *c) : ScriptedAI(c) {} - - uint64 IllidanGUID; - uint32 DespawnTimer; - - bool Active; - bool SummonedBeams; - - void Reset() - { - IllidanGUID = 0; - - Active = false; - SummonedBeams = false; - - DespawnTimer = 0; - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit *who){} - - void MoveInLineOfSight(Unit *who) - { - if (!Active) - return; - - if (who && (who->GetTypeId() != TYPEID_PLAYER)) - { - if (who->GetEntry() == ILLIDAN_STORMRAGE) // Check if who is Illidan - { - if (!IllidanGUID && m_creature->IsWithinDistInMap(who, 3) && (!who->HasAura(SPELL_CAGED))) - { - IllidanGUID = who->GetGUID(); - who->CastSpell(who, SPELL_CAGED, true); - DespawnTimer = 5000; - if (who->HasAura(SPELL_ENRAGE)) - who->RemoveAurasDueToSpell(SPELL_ENRAGE); // Dispel his enrage - //if (GameObject* CageTrap = pInstance->instance->GetGameObject(pInstance->GetData64(CageTrapGUID))) - // CageTrap->SetLootState(GO_JUST_DEACTIVATED); - } - } - } - } - - void UpdateAI(const uint32 diff) - { - if (DespawnTimer) - if (DespawnTimer < diff) - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - else DespawnTimer -= diff; - - //if (IllidanGUID && !SummonedBeams) - //{ - // if (Unit* Illidan = Unit::GetUnit(*m_creature, IllidanGUID) - // { - // //TODO: Find proper spells and properly apply 'caged' Illidan effect - // } - //} - } -}; - -bool GOHello_cage_trap(Player* pPlayer, GameObject* pGo) -{ - float x, y, z; - pPlayer->GetPosition(x, y, z); - - // Grid search for nearest live Creature of entry 23304 within 10 yards - if (Creature* pTrigger = pGo->FindNearestCreature(23304, 10.0f)) - CAST_AI(cage_trap_triggerAI, pTrigger->AI())->Active = true; - pGo->SetGoState(GO_STATE_ACTIVE); - return true; -} - -struct TRINITY_DLL_DECL shadow_demonAI : public ScriptedAI -{ - shadow_demonAI(Creature *c) : ScriptedAI(c) {} - - uint64 TargetGUID; - - void EnterCombat(Unit *who) {DoZoneInCombat();} - - void Reset() - { - TargetGUID = 0; - m_creature->CastSpell(m_creature, SPELL_SHADOW_DEMON_PASSIVE, true); - } - - void JustDied(Unit *killer) - { - if (Unit* target = Unit::GetUnit((*m_creature), TargetGUID)) - target->RemoveAurasDueToSpell(SPELL_PARALYZE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) return; - - if (m_creature->getVictim()->GetTypeId() != TYPEID_PLAYER) return; // Only cast the below on players. - - if (!m_creature->getVictim()->HasAura(SPELL_PARALYZE)) - { - TargetGUID = m_creature->getVictim()->GetGUID(); - m_creature->AddThreat(m_creature->getVictim(), 10000000.0f); - DoCast(m_creature->getVictim(), SPELL_PURPLE_BEAM, true); - DoCast(m_creature->getVictim(), SPELL_PARALYZE, true); - } - // Kill our target if we're very close. - if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 3)) - DoCast(m_creature->getVictim(), SPELL_CONSUME_SOUL); - } -}; - -// Shadowfiends interact with Illidan, setting more targets in Illidan's hashmap -struct TRINITY_DLL_DECL mob_parasitic_shadowfiendAI : public ScriptedAI -{ - mob_parasitic_shadowfiendAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - uint64 IllidanGUID; - uint32 CheckTimer; - - void Reset() - { - if (pInstance) - IllidanGUID = pInstance->GetData64(DATA_ILLIDANSTORMRAGE); - else - IllidanGUID = 0; - - CheckTimer = 5000; - DoCast(m_creature, SPELL_SHADOWFIEND_PASSIVE, true); - } - - void EnterCombat(Unit* who) { DoZoneInCombat(); } - - void DoMeleeAttackIfReady() - { - if (m_creature->isAttackReady() && m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - if (!m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND) - && !m_creature->getVictim()->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) - { - if (Creature* illidan = Unit::GetCreature((*m_creature),IllidanGUID))//summon only in 1. phase - if (CAST_AI(boss_illidan_stormrageAI, illidan->AI())->Phase == PHASE_NORMAL) - m_creature->CastSpell(m_creature->getVictim(), SPELL_PARASITIC_SHADOWFIEND2, true, 0, 0, IllidanGUID); //do not stack - } - m_creature->AttackerStateUpdate(m_creature->getVictim()); - m_creature->resetAttackTimer(); - } - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->getVictim()) - { - if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) - AttackStart(target); - else - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->setDeathState(JUST_DIED); - return; - } - } - - if (CheckTimer < diff) - { - GETUNIT(Illidan, IllidanGUID); - if (!Illidan || CAST_CRE(Illidan)->IsInEvadeMode()) - { - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->setDeathState(JUST_DIED); - return; - }else CheckTimer = 5000; - }else CheckTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL blade_of_azzinothAI : public NullCreatureAI -{ - blade_of_azzinothAI(Creature* c) : NullCreatureAI(c) {} - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_THROW_GLAIVE2 || spell->Id == SPELL_THROW_GLAIVE) - me->SetDisplayId(21431);//appear when hit by Illidan's glaive - } -}; - -void boss_illidan_stormrageAI::Reset() -{ - if (pInstance) - pInstance->SetData(DATA_ILLIDANSTORMRAGEEVENT, NOT_STARTED); - - if (AkamaGUID) - { - if (GETCRE(Akama, AkamaGUID)) - { - if (!Akama->isAlive()) - Akama->Respawn(); - else - { - CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterEvadeMode(); - Akama->GetMotionMaster()->MoveTargetedHome(); - CAST_AI(npc_akama_illidanAI, Akama->AI())->Reset(); - } - } - AkamaGUID = 0; - } - - MaievGUID = 0; - for(uint8 i = 0; i < 2; ++i) - { - FlameGUID[i] = 0; - GlaiveGUID[i] = 0; - } - - Phase = PHASE_ILLIDAN_NULL; - Event = EVENT_NULL; - Timer[EVENT_BERSERK] = 1500000; - - HoverPoint = 0; - TalkCount = 0; - FlightCount = 0; - TransformCount = 0; - - m_creature->SetDisplayId(21135); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - SetEquipmentSlots(false, EQUIP_UNEQUIP, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->setActive(false); - Summons.DespawnAll(); -} - -void boss_illidan_stormrageAI::JustSummoned(Creature* summon) -{ - Summons.Summon(summon); - switch(summon->GetEntry()) - { - case PARASITIC_SHADOWFIEND: - { - if (Phase == PHASE_TALK_SEQUENCE) - { - summon->SetVisibility(VISIBILITY_OFF); - summon->setDeathState(JUST_DIED); - return; - } - Unit *target = SelectTarget(SELECT_TARGET_TOPAGGRO, 0, 999, true); - if (!target || target->HasAura(SPELL_PARASITIC_SHADOWFIEND) - || target->HasAura(SPELL_PARASITIC_SHADOWFIEND2)) - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); - if (target) - summon->AI()->AttackStart(target); - }break; - case SHADOW_DEMON: - if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true)) // only on players. - { - summon->AddThreat(target, 5000000.0f); - summon->AI()->AttackStart(target); - }break; - case MAIEV_SHADOWSONG: - { - summon->SetVisibility(VISIBILITY_OFF); // Leave her invisible until she has to talk - summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - MaievGUID = summon->GetGUID(); - CAST_AI(boss_maievAI, summon->AI())->GetIllidanGUID(m_creature->GetGUID()); - summon->AI()->DoAction(PHASE_TALK_SEQUENCE); - }break; - case FLAME_OF_AZZINOTH: - { - summon->AI()->AttackStart(summon->SelectNearestTarget(999)); - }break; - default: - break; - } -} - -void boss_illidan_stormrageAI::HandleTalkSequence() -{ - switch(TalkCount) - { - case 0: - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - break; - case 8: - // Equip our warglaives! - SetEquipmentSlots(false, EQUIP_ID_MAIN_HAND, EQUIP_ID_OFF_HAND, EQUIP_NO_CHANGE); - m_creature->SetByteValue(UNIT_FIELD_BYTES_2, 0, SHEATH_STATE_MELEE); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - break; - case 9: - if (GETCRE(Akama, AkamaGUID)) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - m_creature->AddThreat(Akama, 100.0f); - CAST_AI(npc_akama_illidanAI, Akama->AI())->EnterPhase(PHASE_FIGHT_ILLIDAN); - EnterPhase(PHASE_NORMAL); - } - break; - case 10: - SummonMaiev(); - break; - case 11: - if (GETUNIT(Maiev, MaievGUID)) - { - Maiev->SetVisibility(VISIBILITY_ON); // Maiev is now visible - Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); // onoz she looks like she teleported! - Maiev->SetInFront(m_creature); // Have her face us - m_creature->SetInFront(Maiev); // Face her, so it's not rude =P - Maiev->GetMotionMaster()->MoveIdle(); - m_creature->GetMotionMaster()->MoveIdle(); - }break; - case 14: - if (GETCRE(Maiev, MaievGUID)) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - Maiev->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - Maiev->AddThreat(m_creature, 10000000.0f); // Have Maiev add a lot of threat on us so that players don't pull her off if they damage her via AOE - Maiev->AI()->AttackStart(m_creature); // Force Maiev to attack us. - EnterPhase(PHASE_NORMAL_MAIEV); - }break; - case 15: - DoCast(m_creature, SPELL_DEATH); // Animate his kneeling + stun him - Summons.DespawnAll(); - break; - case 17: - if (GETUNIT(Akama, AkamaGUID)) - { - if (!m_creature->IsWithinDistInMap(Akama, 15)) - { - float x, y, z; - m_creature->GetPosition(x, y, z); - x += 10; y += 10; - Akama->GetMotionMaster()->Clear(false); - //Akama->GetMotionMaster()->MoveIdle(); - Akama->GetMap()->CreatureRelocation(m_creature, x, y, z, 0.0f); - Akama->SendMonsterMove(x, y, z, 0, MOVEMENTFLAG_NONE, 0);//Illidan must not die until Akama arrives. - Akama->GetMotionMaster()->MoveChase(m_creature); - } - } - break; - case 19: // Make Maiev leave - if (GETUNIT(Maiev, MaievGUID)) - { - Maiev->CastSpell(Maiev, SPELL_TELEPORT_VISUAL, true); - Maiev->setDeathState(JUST_DIED); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1,UNIT_STAND_STATE_DEAD); - } - break; - case 21: // Kill ourself. - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - break; - default: - break; - } - if (Phase == PHASE_TALK_SEQUENCE) - Talk(TalkCount); // This function does most of the talking - TalkCount++; -} - - -void boss_illidan_stormrageAI::CastEyeBlast() -{ - m_creature->InterruptNonMeleeSpells(false); - - m_creature->MonsterYell(SAY_EYE_BLAST, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, SOUND_EYE_BLAST); - - float distx, disty, dist[2]; - for(uint8 i = 0; i < 2; ++i) - { - distx = EyeBlast[i].x - HoverPosition[HoverPoint].x; - disty = EyeBlast[i].y - HoverPosition[HoverPoint].y; - dist[i] = distx * distx + disty * disty; - } - Locations initial = EyeBlast[dist[0] < dist[1] ? 0 : 1]; - for(uint8 i = 0; i < 2; ++i) - { - distx = GlaivePosition[i].x - HoverPosition[HoverPoint].x; - disty = GlaivePosition[i].y - HoverPosition[HoverPoint].y; - dist[i] = distx * distx + disty * disty; - } - Locations final = GlaivePosition[dist[0] < dist[1] ? 0 : 1]; - - final.x = 2 * final.x - initial.x; - final.y = 2 * final.y - initial.y; - - Creature* Trigger = m_creature->SummonTrigger(initial.x, initial.y, initial.z, 0, 13000); - if (!Trigger) return; - - Trigger->SetSpeed(MOVE_WALK, 3); - Trigger->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - Trigger->GetMotionMaster()->MovePoint(0, final.x, final.y, final.z); - - //Trigger->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Trigger->GetGUID()); - DoCast(Trigger, SPELL_EYE_BLAST); -} - -void boss_illidan_stormrageAI::SummonFlamesOfAzzinoth() -{ - m_creature->MonsterYell(SAY_SUMMONFLAMES, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, SOUND_SUMMONFLAMES); - - for(uint8 i = 0; i < 2; ++i) - { - if (GETUNIT(Glaive, GlaiveGUID[i])) - { - Creature* Flame = m_creature->SummonCreature(FLAME_OF_AZZINOTH, GlaivePosition[i+2].x, GlaivePosition[i+2].y, GlaivePosition[i+2].z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 5000); - if (Flame) - { - Flame->setFaction(m_creature->getFaction()); // Just in case the database has it as a different faction - Flame->SetMeleeDamageSchool(SPELL_SCHOOL_FIRE); - FlameGUID[i] = Flame->GetGUID(); // Record GUID in order to check if they're dead later on to move to the next phase - CAST_AI(flame_of_azzinothAI, Flame->AI())->SetGlaiveGUID(GlaiveGUID[i]); - Glaive->CastSpell(Flame, SPELL_AZZINOTH_CHANNEL, false); // Glaives do some random Beam type channel on it. - } - } - } -} - -void boss_illidan_stormrageAI::SummonMaiev() -{ - m_creature->CastSpell(m_creature, SPELL_SHADOW_PRISON, true); - m_creature->CastSpell(m_creature, 40403, true); - if (!MaievGUID) // If Maiev cannot be summoned, reset the encounter and post some errors to the console. - { - EnterEvadeMode(); - m_creature->MonsterTextEmote("is unable to summon Maiev Shadowsong and enter Phase 4. Resetting Encounter.", 0); - error_log("SD2 ERROR: Unable to summon Maiev Shadowsong (entry: 23197). Check your database to see if you have the proper SQL for Maiev Shadowsong (entry: 23197)"); - } -} - - -void boss_illidan_stormrageAI::EnterPhase(PhaseIllidan NextPhase) -{ - DoZoneInCombat(); - switch(NextPhase) - { - case PHASE_NORMAL: - case PHASE_NORMAL_2: - case PHASE_NORMAL_MAIEV: - AttackStart(m_creature->getVictim()); - Timer[EVENT_TAUNT] = 32000; - Timer[EVENT_SHEAR] = 10000 + rand()%15 * 1000; - Timer[EVENT_FLAME_CRASH] = 20000; - Timer[EVENT_PARASITIC_SHADOWFIEND] = 25000; - Timer[EVENT_PARASITE_CHECK] = 0; - Timer[EVENT_DRAW_SOUL] = 30000; - if (NextPhase == PHASE_NORMAL) - break; - Timer[EVENT_AGONIZING_FLAMES] = 35000; - Timer[EVENT_TRANSFORM_NORMAL] = 60000; - if (NextPhase == PHASE_NORMAL_2) - break; - Timer[EVENT_ENRAGE] = 30000 + rand()%10 * 1000; - break; - case PHASE_FLIGHT: - Timer[EVENT_FIREBALL] = 1000; - if (!(rand()%4)) - Timer[EVENT_DARK_BARRAGE] = 10000; - Timer[EVENT_EYE_BLAST] = 10000 + rand()%15 * 1000; - Timer[EVENT_MOVE_POINT] = 20000 + rand()%20 * 1000; - break; - case PHASE_DEMON: - Timer[EVENT_SHADOW_BLAST] = 1000; - Timer[EVENT_FLAME_BURST] = 10000; - Timer[EVENT_SHADOWDEMON] = 30000; - Timer[EVENT_TRANSFORM_DEMON] = 60000; - AttackStart(m_creature->getVictim()); - break; - case PHASE_TALK_SEQUENCE: - Timer[EVENT_TALK_SEQUENCE] = 100; - m_creature->RemoveAllAuras(); - m_creature->InterruptNonMeleeSpells(false); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE + UNIT_FLAG_NOT_SELECTABLE); - m_creature->GetMotionMaster()->Clear(false); - m_creature->AttackStop(); - break; - case PHASE_FLIGHT_SEQUENCE: - if (Phase == PHASE_NORMAL) //lift off - { - FlightCount = 1; - Timer[EVENT_FLIGHT_SEQUENCE] = 1; - m_creature->RemoveAllAuras(); - m_creature->InterruptNonMeleeSpells(false); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->GetMotionMaster()->Clear(false); - m_creature->AttackStop(); - } - else //land - Timer[EVENT_FLIGHT_SEQUENCE] = 2000; - break; - case PHASE_TRANSFORM_SEQUENCE: - if (Phase == PHASE_DEMON) - Timer[EVENT_TRANSFORM_SEQUENCE] = 500; - else - { - TransformCount = 0; - Timer[EVENT_TRANSFORM_SEQUENCE] = 500; - m_creature->MonsterYell(SAY_MORPH, LANG_UNIVERSAL, 0); - DoPlaySoundToSet(m_creature, SOUND_MORPH); - } - m_creature->GetMotionMaster()->Clear(); - m_creature->AttackStop(); - break; - default: - break; - } - if (MaievGUID) - { - GETCRE(Maiev, MaievGUID); - if (Maiev && Maiev->isAlive()) - Maiev->AI()->DoAction(NextPhase); - } - Phase = NextPhase; - Event = EVENT_NULL; -} - -CreatureAI* GetAI_boss_illidan_stormrage(Creature* pCreature) -{ - return new boss_illidan_stormrageAI (pCreature); -} - -CreatureAI* GetAI_npc_akama_at_illidan(Creature* pCreature) -{ - return new npc_akama_illidanAI(pCreature); -} - -CreatureAI* GetAI_boss_maiev(Creature* pCreature) -{ - return new boss_maievAI (pCreature); -} - -CreatureAI* GetAI_mob_flame_of_azzinoth(Creature* pCreature) -{ - return new flame_of_azzinothAI (pCreature); -} - -CreatureAI* GetAI_cage_trap_trigger(Creature* pCreature) -{ - return new cage_trap_triggerAI (pCreature); -} - -CreatureAI* GetAI_shadow_demon(Creature* pCreature) -{ - return new shadow_demonAI (pCreature); -} - -CreatureAI* GetAI_blade_of_azzinoth(Creature* pCreature) -{ - return new blade_of_azzinothAI (pCreature); -} - -CreatureAI* GetAI_parasitic_shadowfiend(Creature* pCreature) -{ - return new mob_parasitic_shadowfiendAI (pCreature); -} - -void AddSC_boss_illidan() -{ - Script* newscript; - - newscript = new Script; - newscript->Name = "boss_illidan_stormrage"; - newscript->GetAI = &GetAI_boss_illidan_stormrage; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_akama_illidan"; - newscript->GetAI = &GetAI_npc_akama_at_illidan; - newscript->pGossipHello = &GossipHello_npc_akama_at_illidan; - newscript->pGossipSelect = &GossipSelect_npc_akama_at_illidan; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_maiev_shadowsong"; - newscript->GetAI = &GetAI_boss_maiev; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_flame_of_azzinoth"; - newscript->GetAI = &GetAI_mob_flame_of_azzinoth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_blade_of_azzinoth"; - newscript->GetAI = &GetAI_blade_of_azzinoth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "gameobject_cage_trap"; - newscript->pGOHello = &GOHello_cage_trap; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_cage_trap_trigger"; - newscript->GetAI = &GetAI_cage_trap_trigger; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_shadow_demon"; - newscript->GetAI = &GetAI_shadow_demon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_parasitic_shadowfiend"; - newscript->GetAI = &GetAI_parasitic_shadowfiend; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp deleted file mode 100644 index a33874c74cf..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_mother_shahraz.cpp +++ /dev/null @@ -1,315 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Mother_Shahraz -SD%Complete: 80 -SDComment: Saber Lash missing, Fatal Attraction slightly incorrect; need to damage only if affected players are within range of each other -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -//Speech'n'Sounds -#define SAY_TAUNT1 -1564018 -#define SAY_TAUNT2 -1564019 -#define SAY_TAUNT3 -1564020 -#define SAY_AGGRO -1564021 -#define SAY_SPELL1 -1564022 -#define SAY_SPELL2 -1564023 -#define SAY_SPELL3 -1564024 -#define SAY_SLAY1 -1564025 -#define SAY_SLAY2 -1564026 -#define SAY_ENRAGE -1564027 -#define SAY_DEATH -1564028 - -//Spells -#define SPELL_BEAM_SINISTER 40859 -#define SPELL_BEAM_VILE 40860 -#define SPELL_BEAM_WICKED 40861 -#define SPELL_BEAM_SINFUL 40827 -#define SPELL_ATTRACTION 40871 -#define SPELL_SILENCING_SHRIEK 40823 -#define SPELL_ENRAGE 23537 -#define SPELL_SABER_LASH 40810//43267 -#define SPELL_SABER_LASH_IMM 43690 -#define SPELL_TELEPORT_VISUAL 40869 -#define SPELL_BERSERK 45078 - -uint32 PrismaticAuras[]= -{ - 40880, // Shadow - 40882, // Fire - 40883, // Nature - 40891, // Arcane - 40896, // Frost - 40897, // Holy -}; - -struct Locations -{ - float x,y,z; -}; - -static Locations TeleportPoint[]= -{ - {959.996, 212.576, 193.843}, - {932.537, 231.813, 193.838}, - {958.675, 254.767, 193.822}, - {946.955, 201.316, 192.535}, - {944.294, 149.676, 197.551}, - {930.548, 284.888, 193.367}, - {965.997, 278.398, 195.777} -}; - -struct TRINITY_DLL_DECL boss_shahrazAI : public ScriptedAI -{ - boss_shahrazAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint64 TargetGUID[3]; - uint32 BeamTimer; - uint32 BeamCount; - uint32 CurrentBeam; - uint32 PrismaticShieldTimer; - uint32 FatalAttractionTimer; - uint32 FatalAttractionExplodeTimer; - uint32 ShriekTimer; - uint32 SaberTimer; - uint32 RandomYellTimer; - uint32 EnrageTimer; - uint32 ExplosionCount; - - bool Enraged; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, NOT_STARTED); - - for(uint8 i = 0; i<3; ++i) - TargetGUID[i] = 0; - - BeamTimer = 20000; // Timers may be incorrect - BeamCount = 0; - CurrentBeam = 0; // 0 - Sinister, 1 - Vile, 2 - Wicked, 3 - Sinful - PrismaticShieldTimer = 0; - FatalAttractionTimer = 60000; - FatalAttractionExplodeTimer = 70000; - ShriekTimer = 30000; - SaberTimer = 35000; - RandomYellTimer = 70000 + rand()%41 * 1000; - EnrageTimer = 600000; - ExplosionCount = 0; - - Enraged = false; - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, IN_PROGRESS); - - DoZoneInCombat(); - DoScriptText(SAY_AGGRO, m_creature); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - if (pInstance) - pInstance->SetData(DATA_MOTHERSHAHRAZEVENT, DONE); - - DoScriptText(SAY_DEATH, m_creature); - } - - void TeleportPlayers() - { - uint32 random = rand()%7; - float X = TeleportPoint[random].x; - float Y = TeleportPoint[random].y; - float Z = TeleportPoint[random].z; - for(uint8 i = 0; i < 3; ++i) - { - Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) - { - TargetGUID[i] = pUnit->GetGUID(); - pUnit->CastSpell(pUnit, SPELL_TELEPORT_VISUAL, true); - DoTeleportPlayer(pUnit, X, Y, Z, pUnit->GetOrientation()); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 10) && !Enraged) - { - Enraged = true; - DoCast(m_creature, SPELL_ENRAGE, true); - DoScriptText(SAY_ENRAGE, m_creature); - } - - //Randomly cast one beam. - if (BeamTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (!target || !target->isAlive()) - return; - - BeamTimer = 9000; - - switch(CurrentBeam) - { - case 0: - DoCast(target, SPELL_BEAM_SINISTER); - break; - case 1: - DoCast(target, SPELL_BEAM_VILE); - break; - case 2: - DoCast(target, SPELL_BEAM_WICKED); - break; - case 3: - DoCast(target, SPELL_BEAM_SINFUL); - break; - } - BeamCount++; - uint32 Beam = CurrentBeam; - if (BeamCount > 3) - while(CurrentBeam == Beam) - CurrentBeam = rand()%3; - - }else BeamTimer -= diff; - - // Random Prismatic Shield every 15 seconds. - if (PrismaticShieldTimer < diff) - { - uint32 random = rand()%6; - if (PrismaticAuras[random]) - DoCast(m_creature, PrismaticAuras[random]); - PrismaticShieldTimer = 15000; - }else PrismaticShieldTimer -= diff; - - // Select 3 random targets (can select same target more than once), teleport to a random location then make them cast explosions until they get away from each other. - if (FatalAttractionTimer < diff) - { - ExplosionCount = 0; - - TeleportPlayers(); - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPELL2, m_creature); break; - case 1: DoScriptText(SAY_SPELL3, m_creature); break; - } - FatalAttractionExplodeTimer = 2000; - FatalAttractionTimer = 40000 + rand()%31 * 1000; - }else FatalAttractionTimer -= diff; - - if (FatalAttractionExplodeTimer < diff) - { - // Just make them explode three times... they're supposed to keep exploding while they are in range, but it'll take too much code. I'll try to think of an efficient way for it later. - if (ExplosionCount < 3) - { - for(uint8 i = 0; i < 3; ++i) - { - Unit* pUnit = NULL; - if (TargetGUID[i]) - { - pUnit = Unit::GetUnit((*m_creature), TargetGUID[i]); - if (pUnit) - pUnit->CastSpell(pUnit, SPELL_ATTRACTION, true); - TargetGUID[i] = 0; - } - } - - ExplosionCount++; - FatalAttractionExplodeTimer = 1000; - } - else - { - FatalAttractionExplodeTimer = FatalAttractionTimer + 2000; - ExplosionCount = 0; - } - }else FatalAttractionExplodeTimer -= diff; - - if (ShriekTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SILENCING_SHRIEK); - ShriekTimer = 25000+rand()%10 * 1000; - }else ShriekTimer -= diff; - - if (SaberTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SABER_LASH); - SaberTimer = 25000+rand()%10 * 1000; - }else SaberTimer -= diff; - - //Enrage - if (!m_creature->HasAura(SPELL_BERSERK)) - if (EnrageTimer < diff) - { - DoCast(m_creature, SPELL_BERSERK); - DoScriptText(SAY_ENRAGE, m_creature); - }else EnrageTimer -= diff; - - //Random taunts - if (RandomYellTimer < diff) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_TAUNT1, m_creature); break; - case 1: DoScriptText(SAY_TAUNT2, m_creature); break; - case 2: DoScriptText(SAY_TAUNT3, m_creature); break; - } - RandomYellTimer = 60000 + rand()%91 * 1000; - }else RandomYellTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_shahraz(Creature* pCreature) -{ - return new boss_shahrazAI (pCreature); -} - -void AddSC_boss_mother_shahraz() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_mother_shahraz"; - newscript->GetAI = &GetAI_boss_shahraz; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp deleted file mode 100644 index aa81259e451..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_reliquary_of_souls.cpp +++ /dev/null @@ -1,710 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Reliquary_of_Souls -SD%Complete: 90 -SDComment: -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" -#include "Spell.h" - -//Sound'n'speech -//Suffering -#define SUFF_SAY_FREED -1564047 -#define SUFF_SAY_AGGRO -1564048 -#define SUFF_SAY_SLAY1 -1564049 -#define SUFF_SAY_SLAY2 -1564050 -#define SUFF_SAY_SLAY3 -1564051 -#define SUFF_SAY_RECAP -1564052 -#define SUFF_SAY_AFTER -1564053 -#define SUFF_EMOTE_ENRAGE -1564054 - -//Desire -#define DESI_SAY_FREED -1564055 -#define DESI_SAY_SLAY1 -1564056 -#define DESI_SAY_SLAY2 -1564057 -#define DESI_SAY_SLAY3 -1564058 -#define DESI_SAY_SPEC -1564059 -#define DESI_SAY_RECAP -1564060 -#define DESI_SAY_AFTER -1564061 - -//Anger -#define ANGER_SAY_FREED -1564062 -#define ANGER_SAY_FREED2 -1564063 -#define ANGER_SAY_SLAY1 -1564064 -#define ANGER_SAY_SLAY2 -1564065 -#define ANGER_SAY_SPEC -1564066 -#define ANGER_SAY_BEFORE -1564067 -#define ANGER_SAY_DEATH -1564068 - -//Spells -#define AURA_OF_SUFFERING 41292 -#define AURA_OF_SUFFERING_ARMOR 42017 // linked aura, need core support -#define ESSENCE_OF_SUFFERING_PASSIVE 41296 // periodic trigger 41294 -#define ESSENCE_OF_SUFFERING_PASSIVE2 41623 -#define SPELL_FIXATE_TARGET 41294 // dummy, select target -#define SPELL_FIXATE_TAUNT 41295 // force taunt -#define SPELL_ENRAGE 41305 -#define SPELL_SOUL_DRAIN 41303 - -#define AURA_OF_DESIRE 41350 -#define AURA_OF_DESIRE_DAMAGE 41352 -#define SPELL_RUNE_SHIELD 41431 -#define SPELL_DEADEN 41410 -#define SPELL_SOUL_SHOCK 41426 - -#define AURA_OF_ANGER 41337 -#define SPELL_SELF_SEETHE 41364 // force cast 41520 -#define SPELL_ENEMY_SEETHE 41520 -#define SPELL_SOUL_SCREAM 41545 -#define SPELL_SPITE_TARGET 41376 // cast 41377 after 6 sec -#define SPELL_SPITE_DAMAGE 41377 - -#define ENSLAVED_SOUL_PASSIVE 41535 -#define SPELL_SOUL_RELEASE 41542 -#define SPELL_SUBMERGE 37550 //dropout 'head' - -#define CREATURE_ENSLAVED_SOUL 23469 -#define NUMBER_ENSLAVED_SOUL 8 - -struct Position2d -{ - float x,y; -}; - -static Position2d Coords[]= -{ - {450.4, 212.3}, - {542.1, 212.3}, - {542.1, 168.3}, - {542.1, 137.4}, - {450.4, 137.4}, - {450.4, 168.3} -}; - -struct TRINITY_DLL_DECL npc_enslaved_soulAI : public ScriptedAI -{ - npc_enslaved_soulAI(Creature *c) : ScriptedAI(c) {} - - uint64 ReliquaryGUID; - - void Reset() {ReliquaryGUID = 0;} - - void EnterCombat(Unit* who) - { - m_creature->CastSpell(m_creature, ENSLAVED_SOUL_PASSIVE, true); - DoZoneInCombat(); - } - - void JustDied(Unit *killer); -}; - -struct TRINITY_DLL_DECL boss_reliquary_of_soulsAI : public ScriptedAI -{ - boss_reliquary_of_soulsAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - EssenceGUID = 0; - } - - ScriptedInstance* pInstance; - - uint64 EssenceGUID; - - uint32 Phase; - uint32 Counter; - uint32 Timer; - - uint32 SoulCount; - uint32 SoulDeathCount; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, NOT_STARTED); - - if (EssenceGUID) - { - if (Creature* Essence = Unit::GetCreature(*m_creature, EssenceGUID)) - { - Essence->ForcedDespawn(); - } - EssenceGUID = 0; - } - - Phase = 0; - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); - m_creature->RemoveAurasDueToSpell(SPELL_SUBMERGE); - } - - void EnterCombat(Unit* who) - { - m_creature->AddThreat(who, 10000.0f); - DoZoneInCombat(); - if (pInstance) - pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, IN_PROGRESS); - - Phase = 1; - Counter = 0; - Timer = 0; - } - - bool SummonSoul() - { - uint32 random = rand()%6; - float x = Coords[random].x; - float y = Coords[random].y; - Creature* Soul = m_creature->SummonCreature(CREATURE_ENSLAVED_SOUL, x, y, m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_CORPSE_DESPAWN, 0); - if (!Soul) return false; - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - CAST_AI(npc_enslaved_soulAI, Soul->AI())->ReliquaryGUID = m_creature->GetGUID(); - Soul->AI()->AttackStart(target); - }else EnterEvadeMode(); - return true; - } - - void MergeThreatList(Creature* target) - { - if (!target) - return; - - std::list& m_threatlist = target->getThreatManager().getThreatList(); - std::list::iterator itr = m_threatlist.begin(); - for(; itr != m_threatlist.end(); itr++) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); - if (pUnit) - { - m_creature->AddThreat(pUnit, 1.0f); // This is so that we make sure the unit is in Reliquary's threat list before we reset the unit's threat. - m_creature->getThreatManager().modifyThreatPercent(pUnit, -100); - float threat = target->getThreatManager().getThreat(pUnit); - m_creature->AddThreat(pUnit, threat); // This makes it so that the unit has the same amount of threat in Reliquary's threatlist as in the target creature's (One of the Essences). - } - } - } - - void JustDied(Unit* killer) - { - if (pInstance) - pInstance->SetData(DATA_RELIQUARYOFSOULSEVENT, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!Phase) - return; - - if (m_creature->getThreatManager().getThreatList().empty()) // Reset if event is begun and we don't have a threatlist - { - EnterEvadeMode(); - return; - } - - Creature* Essence; - if (EssenceGUID) - { - Essence = Unit::GetCreature(*m_creature, EssenceGUID); - if (!Essence) - { - EnterEvadeMode(); - return; - } - } - - if (Timer < diff) - { - switch(Counter) - { - case 0: - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_READY2H); // I R ANNNGRRRY! - DoStartNoMovement(m_creature); - Timer = 3000; - break; - case 1: - Timer = 2800; - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_SUBMERGE); // Release the cube - DoCast(m_creature,SPELL_SUBMERGE); - DoStartNoMovement(m_creature); - break; - case 2: - Timer = 5000; - if (Creature* Summon = DoSpawnCreature(23417+Phase, 0, 0, 0, 0, TEMPSUMMON_DEAD_DESPAWN, 0)) - { - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_SUBMERGED); // Ribs: open - Summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_TOPAGGRO, 0)); - EssenceGUID = Summon->GetGUID(); - DoStartNoMovement(m_creature); - }else EnterEvadeMode(); - break; - case 3: - Timer = 1000; - if (Phase == 3) - { - if (!Essence->isAlive()) - m_creature->CastSpell(m_creature, 7, true); - else return; - } - else - { - if (Essence->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) - { - MergeThreatList(Essence); - Essence->RemoveAllAuras(); - Essence->DeleteThreatList(); - Essence->GetMotionMaster()->MoveFollow(m_creature,0.0f,0.0f); - }else return; - } - break; - case 4: - Timer = 1500; - if (Essence->IsWithinDistInMap(m_creature, 10)) - { - Essence->SetUInt32Value(UNIT_NPC_EMOTESTATE,374); //rotate and disappear - Timer = 2000; - m_creature->RemoveAurasDueToSpell(SPELL_SUBMERGE); - } - else - { - MergeThreatList(Essence); - Essence->RemoveAllAuras(); - Essence->DeleteThreatList(); - Essence->GetMotionMaster()->MoveFollow(m_creature, 0, 0); - return; - } - break; - case 5: - if (Phase == 1) - { - DoScriptText(SUFF_SAY_AFTER, Essence); - } - else - { - DoScriptText(DESI_SAY_AFTER, Essence); - } - Essence->ForcedDespawn(); - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE,0); - EssenceGUID = 0; - SoulCount = 0; - SoulDeathCount = 0; - Timer = 3000; - break; - case 6: - if (SoulCount < NUMBER_ENSLAVED_SOUL) - { - if (SummonSoul()) - SoulCount++; - Timer = 500; - return; - }break; - case 7: - if (SoulDeathCount >= SoulCount) - { - Counter = 1; - Phase++; - Timer = 5000; - } - return; - default: - break; - } - Counter++; - }else Timer -= diff; - } -}; - -struct TRINITY_DLL_DECL boss_essence_of_sufferingAI : public ScriptedAI -{ - boss_essence_of_sufferingAI(Creature *c) : ScriptedAI(c) {} - - uint64 StatAuraGUID; - - uint32 AggroYellTimer; - uint32 FixateTimer; - uint32 EnrageTimer; - uint32 SoulDrainTimer; - uint32 AuraTimer; - - void Reset() - { - StatAuraGUID = 0; - - AggroYellTimer = 5000; - FixateTimer = 8000; - EnrageTimer = 30000; - SoulDrainTimer = 45000; - AuraTimer = 5000; - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= m_creature->GetHealth()) - { - damage = 0; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->Yell(SUFF_SAY_RECAP,LANG_UNIVERSAL,0); - DoScriptText(SUFF_SAY_RECAP, m_creature); - } - } - - void EnterCombat(Unit *who) - { - if (!m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE)) - { - DoScriptText(SUFF_SAY_FREED, m_creature); - DoZoneInCombat(); - m_creature->CastSpell(m_creature, AURA_OF_SUFFERING, true); // linked aura need core support - m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE, true); - m_creature->CastSpell(m_creature, ESSENCE_OF_SUFFERING_PASSIVE2, true); - } - else return; - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SUFF_SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SUFF_SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SUFF_SAY_SLAY3, m_creature); break; - } - } - - void CastFixate() - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - if (m_threatlist.empty()) - return; // No point continuing if empty threatlist. - std::list targets; - std::list::iterator itr = m_threatlist.begin(); - for(; itr != m_threatlist.end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); - if (pUnit && pUnit->isAlive() && (pUnit->GetTypeId() == TYPEID_PLAYER)) // Only alive players - targets.push_back(pUnit); - } - if (targets.empty()) - return; // No targets added for some reason. No point continuing. - targets.sort(ObjectDistanceOrder(m_creature)); // Sort players by distance. - targets.resize(1); // Only need closest target. - Unit* target = targets.front(); // Get the first target. - if (target) - target->CastSpell(m_creature, SPELL_FIXATE_TAUNT, true); - DoResetThreat(); - m_creature->AddThreat(target,1000000); - } - - void UpdateAI(const uint32 diff) - { - if (m_creature->isInCombat()) - { - //Supposed to be cast on nearest target - if (FixateTimer < diff) - { - CastFixate(); - FixateTimer = 5000; - if (!(rand()%16)) - { - DoScriptText(SUFF_SAY_AGGRO, m_creature); - } - }else FixateTimer -= diff; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (EnrageTimer < diff) - { - DoCast(m_creature, SPELL_ENRAGE); - EnrageTimer = 60000; - DoScriptText(SUFF_EMOTE_ENRAGE, m_creature); - }else EnrageTimer -= diff; - - if (SoulDrainTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM,0), SPELL_SOUL_DRAIN); - SoulDrainTimer = 60000; - }else SoulDrainTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_essence_of_desireAI : public ScriptedAI -{ - boss_essence_of_desireAI(Creature *c) : ScriptedAI(c) {} - - uint32 RuneShieldTimer; - uint32 DeadenTimer; - uint32 SoulShockTimer; - - void Reset() - { - RuneShieldTimer = 60000; - DeadenTimer = 30000; - SoulShockTimer = 5000; - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_CONFUSE, true); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by == m_creature) - return; - - if (damage >= m_creature->GetHealth()) - { - damage = 0; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoScriptText(SUFF_SAY_RECAP, m_creature); - } - else - { - int32 bp0 = damage / 2; - m_creature->CastCustomSpell(done_by, AURA_OF_DESIRE_DAMAGE, &bp0, NULL, NULL, true); - } - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]) - for(uint8 i = 0; i < 3; ++i) - if (spell->Effect[i] == SPELL_EFFECT_INTERRUPT_CAST) - if (m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_SOUL_SHOCK - || m_creature->m_currentSpells[CURRENT_GENERIC_SPELL]->m_spellInfo->Id == SPELL_DEADEN) - m_creature->InterruptSpell(CURRENT_GENERIC_SPELL, false); - } - - void EnterCombat(Unit *who) - { - DoScriptText(DESI_SAY_FREED, m_creature); - DoZoneInCombat(); - DoCast(m_creature, AURA_OF_DESIRE, true); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(DESI_SAY_SLAY1, m_creature); break; - case 1: DoScriptText(DESI_SAY_SLAY2, m_creature); break; - case 2: DoScriptText(DESI_SAY_SLAY3, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (RuneShieldTimer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - m_creature->CastSpell(m_creature, SPELL_RUNE_SHIELD, true); - SoulShockTimer += 2000; - DeadenTimer += 2000; - RuneShieldTimer = 60000; - }else RuneShieldTimer -= diff; - - if (SoulShockTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SOUL_SHOCK); - SoulShockTimer = 5000; - }else SoulShockTimer -= diff; - - if (DeadenTimer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature->getVictim(), SPELL_DEADEN); - DeadenTimer = 25000 + rand()%10000; - if (!(rand()%2)) - { - DoScriptText(DESI_SAY_SPEC, m_creature); - } - }else DeadenTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_essence_of_angerAI : public ScriptedAI -{ - boss_essence_of_angerAI(Creature *c) : ScriptedAI(c) {} - - uint64 AggroTargetGUID; - - uint32 CheckTankTimer; - uint32 SoulScreamTimer; - uint32 SpiteTimer; - - std::list SpiteTargetGUID; - - bool CheckedAggro; - - void Reset() - { - AggroTargetGUID = 0; - - CheckTankTimer = 5000; - SoulScreamTimer = 10000; - SpiteTimer = 30000; - - SpiteTargetGUID.clear(); - - CheckedAggro = false; - } - - void EnterCombat(Unit *who) - { - switch(rand()%2) - { - case 0: DoScriptText(ANGER_SAY_FREED, m_creature); break; - case 1: DoScriptText(ANGER_SAY_FREED2, m_creature); break; - } - - DoZoneInCombat(); - DoCast(m_creature, AURA_OF_ANGER, true); - } - - void JustDied(Unit *victim) - { - DoScriptText(ANGER_SAY_DEATH, m_creature); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(ANGER_SAY_SLAY1, m_creature); break; - case 1: DoScriptText(ANGER_SAY_SLAY2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (!CheckedAggro) - { - AggroTargetGUID = m_creature->getVictim()->GetGUID(); - CheckedAggro = true; - } - - if (CheckTankTimer < diff) - { - if (m_creature->getVictim()->GetGUID() != AggroTargetGUID) - { - DoScriptText(ANGER_SAY_BEFORE, m_creature); - DoCast(m_creature, SPELL_SELF_SEETHE, true); - AggroTargetGUID = m_creature->getVictim()->GetGUID(); - } - CheckTankTimer = 2000; - }else CheckTankTimer -= diff; - - if (SoulScreamTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SOUL_SCREAM); - SoulScreamTimer = 9000 + rand()%2000; - if (!(rand()%3)) - { - DoScriptText(ANGER_SAY_SPEC, m_creature); - } - }else SoulScreamTimer -= diff; - - if (SpiteTimer < diff) - { - DoCast(m_creature, SPELL_SPITE_TARGET); - SpiteTimer = 30000; - DoScriptText(ANGER_SAY_SPEC, m_creature); - }else SpiteTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -void npc_enslaved_soulAI::JustDied(Unit *killer) -{ - if (ReliquaryGUID) - { - Creature* Reliquary = (Unit::GetCreature((*m_creature), ReliquaryGUID)); - if (Reliquary) - CAST_AI(boss_reliquary_of_soulsAI, Reliquary->AI())->SoulDeathCount++; - } - DoCast(m_creature, SPELL_SOUL_RELEASE, true); -} - -CreatureAI* GetAI_boss_reliquary_of_souls(Creature* pCreature) -{ - return new boss_reliquary_of_soulsAI (pCreature); -} - -CreatureAI* GetAI_boss_essence_of_suffering(Creature* pCreature) -{ - return new boss_essence_of_sufferingAI (pCreature); -} - -CreatureAI* GetAI_boss_essence_of_desire(Creature* pCreature) -{ - return new boss_essence_of_desireAI (pCreature); -} - -CreatureAI* GetAI_boss_essence_of_anger(Creature* pCreature) -{ - return new boss_essence_of_angerAI (pCreature); -} - -CreatureAI* GetAI_npc_enslaved_soul(Creature* pCreature) -{ - return new npc_enslaved_soulAI (pCreature); -} - -void AddSC_boss_reliquary_of_souls() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_reliquary_of_souls"; - newscript->GetAI = &GetAI_boss_reliquary_of_souls; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_essence_of_suffering"; - newscript->GetAI = &GetAI_boss_essence_of_suffering; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_essence_of_desire"; - newscript->GetAI = &GetAI_boss_essence_of_desire; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_essence_of_anger"; - newscript->GetAI = &GetAI_boss_essence_of_anger; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_enslaved_soul"; - newscript->GetAI = &GetAI_npc_enslaved_soul; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp deleted file mode 100644 index ea987bf4963..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_shade_of_akama.cpp +++ /dev/null @@ -1,870 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Shade_of_Akama -SD%Complete: 90 -SDComment: Seems to be complete. -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -#define SAY_DEATH -1564013 -#define SAY_LOW_HEALTH -1564014 -// Ending cinematic text -#define SAY_FREE -1564015 -#define SAY_BROKEN_FREE_01 -1564016 -#define SAY_BROKEN_FREE_02 -1564017 - -#define GOSSIP_ITEM "We are ready to fight alongside you, Akama" - -struct Location -{ - float x, y, o, z; -}; - -static Location ChannelerLocations[]= -{ - {463.161285, 401.219757, 3.141592}, - {457.377625, 391.227661, 2.106461}, - {446.012421, 391.227661, 1.071904}, - {439.533783, 401.219757, 0.000000}, - {446.012421, 411.211853, 5.210546}, - {457.377625, 411.211853, 4.177494} -}; - -static Location SpawnLocations[]= -{ - {498.652740, 461.728119, 0}, - {498.505003, 339.619324, 0} -}; - -static Location AkamaWP[]= -{ - {482.352448, 401.162720, 0, 112.783928}, - {469.597443, 402.264404, 0, 118.537910} -}; - -static Location BrokenCoords[]= -{ - {541.375916, 401.439575, M_PI, 112.783997}, // The place where Akama channels - {534.130005, 352.394531, 2.164150, 112.783737}, // Behind a 'pillar' which is behind the east alcove - {499.621185, 341.534729, 1.652856, 112.783730}, // East Alcove - {499.151093, 461.036438, 4.770888, 112.78370}, // West Alcove -}; - -static Location BrokenWP[]= -{ - {492.491638, 400.744690, 3.122336, 112.783737}, - {494.335724, 382.221771, 2.676230, 112.783737}, - {489.555939, 373.507202, 2.416263, 112.783737}, - {491.136353, 427.868774, 3.519748, 112.783737}, -}; - -// Locations -#define Z1 118.543144 -#define Z2 120.783768 -#define Z_SPAWN 113.537949 -#define AGGRO_X 482.793182 -#define AGGRO_Y 401.270172 -#define AGGRO_Z 112.783928 -#define AKAMA_X 514.583984 -#define AKAMA_Y 400.601013 -#define AKAMA_Z 112.783997 - -// Spells -#define SPELL_VERTEX_SHADE_BLACK 39833 -#define SPELL_SHADE_SOUL_CHANNEL 40401 -#define SPELL_DESTRUCTIVE_POISON 40874 -#define SPELL_LIGHTNING_BOLT 42024 -#define SPELL_AKAMA_SOUL_CHANNEL 40447 -#define SPELL_AKAMA_SOUL_RETRIEVE 40902 -#define AKAMA_SOUL_EXPEL 40855 -#define SPELL_SHADE_SOUL_CHANNEL_2 40520 - -// Channeler entry -#define CREATURE_CHANNELER 23421 -#define CREATURE_SORCERER 23215 -#define CREATURE_DEFENDER 23216 -#define CREATURE_BROKEN 23319 - -const uint32 spawnEntries[4]= { 23523, 23318, 23524 }; - -struct TRINITY_DLL_DECL mob_ashtongue_channelerAI : public ScriptedAI -{ - mob_ashtongue_channelerAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} - - uint64 ShadeGUID; - - void Reset() {} - void JustDied(Unit* killer); - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) {} -}; - -struct TRINITY_DLL_DECL mob_ashtongue_sorcererAI : public ScriptedAI -{ - mob_ashtongue_sorcererAI(Creature* c) : ScriptedAI(c) {ShadeGUID = 0;} - - uint64 ShadeGUID; - uint32 CheckTimer; - bool StartBanishing; - - void Reset() - { - StartBanishing = false; - CheckTimer = 5000; - } - - void JustDied(Unit* killer); - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - if (StartBanishing) - return; - - if (CheckTimer < diff) - { - Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); - if (Shade && Shade->isAlive() && m_creature->isAlive()) - { - if (m_creature->IsWithinDist(Shade, 20,false)) - { - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveIdle(); - DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL, true); - DoCast(Shade, SPELL_SHADE_SOUL_CHANNEL_2, true); - - StartBanishing = true; - } - } - CheckTimer = 2000; - }else CheckTimer -= diff; - } -}; - -struct TRINITY_DLL_DECL boss_shade_of_akamaAI : public ScriptedAI -{ - boss_shade_of_akamaAI(Creature* c) : ScriptedAI(c), summons(m_creature) - { - pInstance = c->GetInstanceData(); - AkamaGUID = pInstance ? pInstance->GetData64(DATA_AKAMA_SHADE) : 0; - m_creature->setActive(true);//if view distance is too low - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); - } - - ScriptedInstance* pInstance; - - std::list Channelers; - std::list Sorcerers; - uint64 AkamaGUID; - - uint32 SorcererCount; - uint32 DeathCount; - - uint32 ReduceHealthTimer; - uint32 SummonTimer; - uint32 ResetTimer; - uint32 DefenderTimer; // They are on a flat 15 second timer, independant of the other summon Creature timer. - - bool IsBanished; - bool HasKilledAkama; - bool reseting; - bool GridSearcherSucceeded; - bool HasKilledAkamaAndReseting; - SummonList summons; - - void Reset() - { - reseting = true; - HasKilledAkamaAndReseting = false; - - GridSearcherSucceeded = false; - - Sorcerers.clear(); - summons.DespawnAll();//despawn all adds - - if (Creature* Akama = Unit::GetCreature(*m_creature, AkamaGUID)) - { - Akama->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);//turn gossip on so players can restart the event - if (Akama->isDead()) - { - Akama->Respawn();//respawn akama if dead - Akama->AI()->EnterEvadeMode(); - } - } - SorcererCount = 0; - DeathCount = 0; - - SummonTimer = 10000; - ReduceHealthTimer = 0; - ResetTimer = 60000; - DefenderTimer = 15000; - - IsBanished = true; - HasKilledAkama = false; - - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //m_creature->GetMotionMaster()->Clear(); - //m_creature->GetMotionMaster()->MoveIdle(); - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_STUN); - - if (pInstance && m_creature->isAlive()) - pInstance->SetData(DATA_SHADEOFAKAMAEVENT, NOT_STARTED); - - reseting = false; - } - void JustDied(Unit* killer) - { - summons.DespawnAll(); - } - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524) - summons.Summon(summon); - } - void SummonedCreatureDespawn(Creature *summon) - { - if (summon->GetEntry() == CREATURE_DEFENDER || summon->GetEntry() == 23523 || summon->GetEntry() == 23318 || summon->GetEntry() == 23524) - summons.Despawn(summon); - } - - void MoveInLineOfSight(Unit *who) - { - if (!GridSearcherSucceeded) - { - FindChannelers(); - - if (!Channelers.empty()) - { - for(std::list::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) - { - Creature* Channeler = (Unit::GetCreature(*m_creature, *itr)); - if (Channeler) - { - if (Channeler->isDead()) - { - Channeler->RemoveCorpse(); - Channeler->Respawn(); - } - - Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL, true); - Channeler->CastSpell(m_creature, SPELL_SHADE_SOUL_CHANNEL_2, true); - Channeler->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - GridSearcherSucceeded = true; - } - } - }else error_log("SD2 ERROR: No Channelers are stored in the list. This encounter will not work properly"); - } - } - - void AttackStart(Unit* who) - { - if (!who || IsBanished) return; - - if (who->isTargetableForAttack() && who != m_creature) - DoStartMovement(who); - } - - void IncrementDeathCount(uint64 guid = 0) // If guid is set, will remove it from list of sorcerer - { - if (reseting) - return; - - debug_log("TSCR: Increasing Death Count for Shade of Akama encounter"); - ++DeathCount; - m_creature->RemoveAuraFromStack(SPELL_SHADE_SOUL_CHANNEL_2); - if (guid) - { - if (Sorcerers.empty()) - error_log("SD2 ERROR: Shade of Akama - attempt to remove guid %u from Sorcerers list but list is already empty", guid); - else Sorcerers.remove(guid); - } - } - - void SummonCreature() - { - uint32 random = rand()%2; - float X = SpawnLocations[random].x; - float Y = SpawnLocations[random].y; - // max of 6 sorcerers can be summoned - if ((rand()%3 == 0) && (DeathCount > 0) && (SorcererCount < 7)) - { - Creature* Sorcerer = m_creature->SummonCreature(CREATURE_SORCERER, X, Y, Z_SPAWN, 0, TEMPSUMMON_DEAD_DESPAWN, 0); - if (Sorcerer) - { - CAST_AI(mob_ashtongue_sorcererAI, Sorcerer->AI())->ShadeGUID = m_creature->GetGUID(); - Sorcerer->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - Sorcerer->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); - Sorcerer->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); - Sorcerers.push_back(Sorcerer->GetGUID()); - --DeathCount; - ++SorcererCount; - } - } - else - { - for(uint8 i = 0; i < 3; ++i) - { - Creature* Spawn = m_creature->SummonCreature(spawnEntries[i], X, Y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); - if (Spawn) - { - Spawn->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - Spawn->GetMotionMaster()->MovePoint(0, AGGRO_X, AGGRO_Y, AGGRO_Z); - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - Spawn->AI()->AttackStart(target); - } - } - } - } - - void FindChannelers() - { - std::list ChannelerList; - m_creature->GetCreatureListWithEntryInGrid(ChannelerList,CREATURE_CHANNELER,50.0f); - - if (!ChannelerList.empty()) - { - for(std::list::iterator itr = ChannelerList.begin(); itr != ChannelerList.end(); ++itr) - { - CAST_AI(mob_ashtongue_channelerAI, (*itr)->AI())->ShadeGUID = m_creature->GetGUID(); - Channelers.push_back((*itr)->GetGUID()); - debug_log("TSCR: Shade of Akama Grid Search found channeler %u. Adding to list", (*itr)->GetGUID()); - } - } - else error_log("SD2 ERROR: Grid Search was unable to find any channelers. Shade of Akama encounter will be buggy"); - } - - void SetSelectableChannelers() - { - if (Channelers.empty()) - { - error_log("SD2 ERROR: Channeler List is empty, Shade of Akama encounter will be buggy"); - return; - } - - for(std::list::iterator itr = Channelers.begin(); itr != Channelers.end(); ++itr) - if (Creature* Channeler = (Unit::GetCreature(*m_creature, *itr))) - Channeler->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void SetAkamaGUID(uint64 guid) { AkamaGUID = guid; } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->isInCombat()) - return; - - if (IsBanished) - { - // Akama is set in the threatlist so when we reset, we make sure that he is not included in our check - if (m_creature->getThreatManager().getThreatList().size() < 2) - { - EnterEvadeMode(); - return; - } - - if (DefenderTimer < diff) - { - uint32 ran = rand()%2; - Creature* Defender = m_creature->SummonCreature(CREATURE_DEFENDER, SpawnLocations[ran].x, SpawnLocations[ran].y, Z_SPAWN, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 25000); - if (Defender) - { - Defender->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - bool move = true; - if (AkamaGUID) - { - if (Creature* Akama = Unit::GetCreature(*m_creature, AkamaGUID)) - { - float x, y, z; - Akama->GetPosition(x,y,z); - // They move towards AKama - Defender->GetMotionMaster()->MovePoint(0, x, y, z); - Defender->AI()->AttackStart(Akama); - }else move = false; - }else move = false; - if (!move) - Defender->GetMotionMaster()->MovePoint(0, AKAMA_X, AKAMA_Y, AKAMA_Z); - } - DefenderTimer = 15000; - }else DefenderTimer -= diff; - - if (SummonTimer < diff) - { - SummonCreature(); - SummonTimer = 35000; - }else SummonTimer -= diff; - - if (DeathCount >= 6) - { - if (AkamaGUID) - { - Creature* Akama = Unit::GetCreature((*m_creature), AkamaGUID); - if (Akama && Akama->isAlive()) - { - IsBanished = false; - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveChase(Akama); - Akama->GetMotionMaster()->Clear(); - // Shade should move to Akama, not the other way around - Akama->GetMotionMaster()->MoveIdle(); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // Crazy amount of threat - m_creature->AddThreat(Akama, 10000000.0f); - Akama->AddThreat(m_creature, 10000000.0f); - m_creature->Attack(Akama, true); - Akama->Attack(m_creature, true); - } - } - } - } - else // No longer banished, let's fight Akama now - { - if (ReduceHealthTimer < diff) - { - if (AkamaGUID) - { - Creature* Akama = Unit::GetCreature((*m_creature), AkamaGUID); - if (Akama && Akama->isAlive()) - { - //10 % less health every few seconds. - m_creature->DealDamage(Akama, Akama->GetMaxHealth()/10, NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - ReduceHealthTimer = 12000; - } - } - }else ReduceHealthTimer -= diff; - - if (HasKilledAkama) - { - if (!HasKilledAkamaAndReseting)//do not let players kill Shade if Akama is dead and Shade is waiting for ResetTimer!! event would bug - { - HasKilledAkamaAndReseting = true; - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(); - //m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->GetMotionMaster()->MoveTargetedHome(); - } - if (ResetTimer < diff) - { - EnterEvadeMode();// Reset a little while after killing Akama, evade and respawn Akama - return; - }else ResetTimer -= diff; - } - - DoMeleeAttackIfReady(); - } - } -}; - -void mob_ashtongue_channelerAI::JustDied(Unit* killer) -{ - Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); - if (Shade && Shade->isAlive()) - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(); - else error_log("SD2 ERROR: Channeler dead but unable to increment DeathCount for Shade of Akama."); -} - -void mob_ashtongue_sorcererAI::JustDied(Unit* killer) -{ - Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); - if (Shade && Shade->isAlive()) - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IncrementDeathCount(m_creature->GetGUID()); - else error_log("SD2 ERROR: Sorcerer dead but unable to increment DeathCount for Shade of Akama."); -} - -struct TRINITY_DLL_DECL npc_akamaAI : public ScriptedAI -{ - npc_akamaAI(Creature* c) : ScriptedAI(c), summons(m_creature) - { - ShadeHasDied = false; - StartCombat = false; - pInstance = c->GetInstanceData(); - ShadeGUID = pInstance ? pInstance->GetData64(DATA_SHADEOFAKAMA) : NOT_STARTED; - m_creature->setActive(true); - EventBegun = false; - CastSoulRetrieveTimer = 0; - SoulRetrieveTimer = 0; - SummonBrokenTimer = 0; - EndingTalkCount = 0; - WayPointId = 0; - BrokenSummonIndex = 0; - BrokenList.clear(); - HasYelledOnce = false; - } - - ScriptedInstance* pInstance; - - uint64 ShadeGUID; - - uint32 DestructivePoisonTimer; - uint32 LightningBoltTimer; - uint32 CheckTimer; - uint32 CastSoulRetrieveTimer; - uint32 SoulRetrieveTimer; - uint32 SummonBrokenTimer; - uint32 EndingTalkCount; - uint32 WayPointId; - uint32 BrokenSummonIndex; - - std::list BrokenList; - - bool EventBegun; - bool ShadeHasDied; - bool StartCombat; - bool HasYelledOnce; - SummonList summons; - - void Reset() - { - DestructivePoisonTimer = 15000; - LightningBoltTimer = 10000; - CheckTimer = 2000; - - if (!EventBegun) - { - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); // Database sometimes has very very strange values - m_creature->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - } - summons.DespawnAll(); - } - - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == CREATURE_BROKEN) - summons.Summon(summon); - } - void SummonedCreatureDespawn(Creature *summon) - { - if (summon->GetEntry() == CREATURE_BROKEN) - summons.Despawn(summon); - } - - void EnterCombat(Unit* who) {} - - void BeginEvent(Player* pl) - { - if (!pInstance) - return; - - ShadeGUID = pInstance->GetData64(DATA_SHADEOFAKAMA); - if (!ShadeGUID) - return; - - Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); - if (Shade) - { - pInstance->SetData(DATA_SHADEOFAKAMAEVENT, IN_PROGRESS); - // Prevent players from trying to restart event - m_creature->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP); - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetAkamaGUID(m_creature->GetGUID()); - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->SetSelectableChannelers(); - Shade->AddThreat(m_creature, 1000000.0f); - m_creature->CombatStart(Shade); - Shade->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); - Shade->SetUInt64Value(UNIT_FIELD_TARGET, m_creature->GetGUID()); - if (pl) Shade->AddThreat(pl, 1.0f); - DoZoneInCombat(Shade); - EventBegun = true; - } - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - switch(id) - { - case 0: ++WayPointId; break; - - case 1: - if (Creature* Shade = Unit::GetCreature(*m_creature, ShadeGUID)) - { - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, ShadeGUID); - DoCast(Shade, SPELL_AKAMA_SOUL_RETRIEVE); - EndingTalkCount = 0; - SoulRetrieveTimer = 16000; - } - break; - } - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - EventBegun = false; - ShadeHasDied = false; - StartCombat = false; - CastSoulRetrieveTimer = 0; - SoulRetrieveTimer = 0; - SummonBrokenTimer = 0; - EndingTalkCount = 0; - WayPointId = 0; - BrokenSummonIndex = 0; - BrokenList.clear(); - HasYelledOnce = false; - Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); - if (Shade && Shade->isAlive()) - CAST_AI(boss_shade_of_akamaAI, Shade->AI())->HasKilledAkama = true; - summons.DespawnAll(); - } - - void UpdateAI(const uint32 diff) - { - if (!EventBegun) - return; - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15 && !HasYelledOnce) - { - DoScriptText(SAY_LOW_HEALTH, m_creature); - HasYelledOnce = true; - } - - if (ShadeGUID && !StartCombat) - { - Creature* Shade = (Unit::GetCreature((*m_creature), ShadeGUID)); - if (Shade && Shade->isAlive()) - { - if (CAST_AI(boss_shade_of_akamaAI, Shade->AI())->IsBanished) - { - if (CastSoulRetrieveTimer < diff) - { - DoCast(Shade, SPELL_AKAMA_SOUL_CHANNEL); - CastSoulRetrieveTimer = 500; - }else CastSoulRetrieveTimer -= diff; - } - else - { - m_creature->InterruptNonMeleeSpells(false); - StartCombat = true; - } - } - } - - if (ShadeHasDied && (WayPointId == 1)) - { - if (pInstance) pInstance->SetData(DATA_SHADEOFAKAMAEVENT, DONE); - m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[1].x, AkamaWP[1].y, AkamaWP[1].z); - ++WayPointId; - } - - if (!ShadeHasDied && StartCombat) - { - if (CheckTimer < diff) - { - if (ShadeGUID) - { - Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); - if (Shade && !Shade->isAlive()) - { - ShadeHasDied = true; - WayPointId = 0; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->GetMotionMaster()->MovePoint(WayPointId, AkamaWP[0].x, AkamaWP[0].y, AkamaWP[0].z); - } - if (Shade && Shade->isAlive()) - { - if (Shade->getThreatManager().getThreatList().size() < 2) - Shade->AI()->EnterEvadeMode(); - } - } - CheckTimer = 5000; - }else CheckTimer -= diff; - } - - if (SummonBrokenTimer && BrokenSummonIndex < 4) - { - if (SummonBrokenTimer <= diff) - { - for(uint8 i = 0; i < 4; ++i) - { - float x = BrokenCoords[BrokenSummonIndex].x + (i*5); - float y = BrokenCoords[BrokenSummonIndex].y + (1*5); - float z = BrokenCoords[BrokenSummonIndex].z; - float o = BrokenCoords[BrokenSummonIndex].o; - Creature* Broken = m_creature->SummonCreature(CREATURE_BROKEN, x, y, z, o, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 360000); - if (Broken) - { - float wx = BrokenWP[BrokenSummonIndex].x + (i*5); - float wy = BrokenWP[BrokenSummonIndex].y + (i*5); - float wz = BrokenWP[BrokenSummonIndex].z; - Broken->GetMotionMaster()->MovePoint(0, wx, wy, wz); - Broken->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - BrokenList.push_back(Broken->GetGUID()); - } - } - ++BrokenSummonIndex; - SummonBrokenTimer = 1000; - }else SummonBrokenTimer -= diff; - } - - if (SoulRetrieveTimer) - if (SoulRetrieveTimer <= diff) - { - switch(EndingTalkCount) - { - case 0: - m_creature->HandleEmoteCommand(EMOTE_ONESHOT_ROAR); - ++EndingTalkCount; - SoulRetrieveTimer = 2000; - SummonBrokenTimer = 1; - break; - case 1: - DoScriptText(SAY_FREE, m_creature); - ++EndingTalkCount; - SoulRetrieveTimer = 25000; - break; - case 2: - if (!BrokenList.empty()) - { - bool Yelled = false; - for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* pUnit = Unit::GetCreature(*m_creature, *itr)) - { - if (!Yelled) - { - DoScriptText(SAY_BROKEN_FREE_01, pUnit); - Yelled = true; - } - pUnit->HandleEmoteCommand(EMOTE_ONESHOT_KNEEL); - } - } - ++EndingTalkCount; - SoulRetrieveTimer = 1500; - break; - case 3: - if (!BrokenList.empty()) - { - for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* pUnit = Unit::GetCreature(*m_creature, *itr)) - // This is the incorrect spell, but can't seem to find the right one. - pUnit->CastSpell(pUnit, 39656, true); - } - ++EndingTalkCount; - SoulRetrieveTimer = 5000; - break; - case 4: - if (!BrokenList.empty()) - { - for(std::list::iterator itr = BrokenList.begin(); itr != BrokenList.end(); ++itr) - if (Creature* pUnit = Unit::GetCreature((*m_creature), *itr)) - pUnit->MonsterYell(SAY_BROKEN_FREE_02, LANG_UNIVERSAL, 0); - } - SoulRetrieveTimer = 0; - break; - } - }else SoulRetrieveTimer -= diff; - - if (!UpdateVictim()) - return; - - if (DestructivePoisonTimer < diff) - { - Creature* Shade = Unit::GetCreature((*m_creature), ShadeGUID); - if (Shade && Shade->isAlive()) - DoCast(Shade, SPELL_DESTRUCTIVE_POISON); - DestructivePoisonTimer = 15000; - }else DestructivePoisonTimer -= diff; - - if (LightningBoltTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT); - LightningBoltTimer = 10000; - }else LightningBoltTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_shade_of_akama(Creature* pCreature) -{ - return new boss_shade_of_akamaAI (pCreature); -} - -CreatureAI* GetAI_mob_ashtongue_channeler(Creature* pCreature) -{ - return new mob_ashtongue_channelerAI (pCreature); -} - -CreatureAI* GetAI_mob_ashtongue_sorcerer(Creature* pCreature) -{ - return new mob_ashtongue_sorcererAI (pCreature); -} - -CreatureAI* GetAI_npc_akama_shade(Creature* pCreature) -{ - return new npc_akamaAI (pCreature); -} - -bool GossipSelect_npc_akama(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) -{ - if (uiAction == GOSSIP_ACTION_INFO_DEF + 1) //Fight time - { - pPlayer->CLOSE_GOSSIP_MENU(); - CAST_AI(npc_akamaAI, pCreature->AI())->BeginEvent(pPlayer); - } - - return true; -} - -bool GossipHello_npc_akama(Player* pPlayer, Creature* pCreature) -{ - if (pPlayer->isAlive()) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); - pPlayer->SEND_GOSSIP_MENU(907, pCreature->GetGUID()); - } - - return true; -} - -void AddSC_boss_shade_of_akama() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_shade_of_akama"; - newscript->GetAI = &GetAI_boss_shade_of_akama; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ashtongue_channeler"; - newscript->GetAI = &GetAI_mob_ashtongue_channeler; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ashtongue_sorcerer"; - newscript->GetAI = &GetAI_mob_ashtongue_sorcerer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_akama_shade"; - newscript->GetAI = &GetAI_npc_akama_shade; - newscript->pGossipHello = &GossipHello_npc_akama; - newscript->pGossipSelect = &GossipSelect_npc_akama; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp deleted file mode 100644 index 669b0a25629..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_supremus.cpp +++ /dev/null @@ -1,296 +0,0 @@ -/* Copyright (C) 2006 - 2008 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Supremus -SD%Complete: 95 -SDComment: Need to implement molten punch -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -#define EMOTE_NEW_TARGET -1564010 -#define EMOTE_PUNCH_GROUND -1564011 //DoScriptText(EMOTE_PUNCH_GROUND, m_creature); -#define EMOTE_GROUND_CRACK -1564012 - -//Spells -#define SPELL_MOLTEN_PUNCH 40126 -#define SPELL_HATEFUL_STRIKE 41926 -#define SPELL_MOLTEN_FLAME 40980 -#define SPELL_VOLCANIC_ERUPTION 40117 -#define SPELL_VOLCANIC_SUMMON 40276 -#define SPELL_BERSERK 45078 - -#define CREATURE_VOLCANO 23085 -#define CREATURE_STALKER 23095 - -#define PHASE_STRIKE 1 -#define PHASE_CHASE 2 - -#define EVENT_BERSERK 1 -#define EVENT_SWITCH_PHASE 2 -#define EVENT_FLAME 3 -#define EVENT_VOLCANO 4 -#define EVENT_SWITCH_TARGET 5 -#define EVENT_HATEFUL_STRIKE 6 - -#define GCD_CAST 1 - -struct TRINITY_DLL_DECL molten_flameAI : public NullCreatureAI -{ - molten_flameAI(Creature *c) : NullCreatureAI(c) {} - - void InitializeAI() - { - float x, y, z; - me->GetNearPoint(me, x, y, z, 1, 100, M_PI*2*rand_norm()); - me->GetMotionMaster()->MovePoint(0, x, y, z); - me->SetVisibility(VISIBILITY_OFF); - me->CastSpell(me,SPELL_MOLTEN_FLAME,true); - } -}; - -struct TRINITY_DLL_DECL boss_supremusAI : public ScriptedAI -{ - boss_supremusAI(Creature *c) : ScriptedAI(c), summons(m_creature) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - EventMap events; - SummonList summons; - uint32 phase; - - void Reset() - { - if (pInstance) - { - if (m_creature->isAlive()) - { - pInstance->SetData(DATA_SUPREMUSEVENT, NOT_STARTED); - //ToggleDoors(true); - } - //else ToggleDoors(false); - } - - phase = 0; - - events.Reset(); - summons.DespawnAll(); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_SUPREMUSEVENT, IN_PROGRESS); - - ChangePhase(); - events.ScheduleEvent(EVENT_BERSERK, 900000, GCD_CAST); - events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST); - } - - void ChangePhase() - { - if (!phase || phase == PHASE_CHASE) - { - phase = PHASE_STRIKE; - summons.DoAction(EVENT_VOLCANO, 0); - events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); - m_creature->SetSpeed(MOVE_RUN, 1.2f); - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, false); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, false); - } - else - { - phase = PHASE_CHASE; - events.ScheduleEvent(EVENT_VOLCANO, 5000, GCD_CAST, PHASE_CHASE); - events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE); - m_creature->SetSpeed(MOVE_RUN, 0.9f); - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); - } - DoResetThreat(); - DoZoneInCombat(); - events.SetPhase(phase); - events.ScheduleEvent(EVENT_SWITCH_PHASE, 60000, GCD_CAST); - } - - void JustDied(Unit *killer) - { - if (pInstance) - { - pInstance->SetData(DATA_SUPREMUSEVENT, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GAMEOBJECT_SUPREMUS_DOORS), true); - } - summons.DespawnAll(); - } - - void JustSummoned(Creature *summon) {summons.Summon(summon);} - void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} - - Unit* CalculateHatefulStrikeTarget() - { - uint32 health = 0; - Unit* target = NULL; - - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - std::list::iterator i = m_threatlist.begin(); - for (i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - if (pUnit && m_creature->IsWithinMeleeRange(pUnit)) - { - if (pUnit->GetHealth() > health) - { - health = pUnit->GetHealth(); - target = pUnit; - } - } - } - - return target; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_BERSERK: - m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - break; - case EVENT_FLAME: - DoCast(m_creature, SPELL_MOLTEN_PUNCH); - events.DelayEvents(1500, GCD_CAST); - events.ScheduleEvent(EVENT_FLAME, 20000, GCD_CAST); - break; - case EVENT_HATEFUL_STRIKE: - if (Unit* target = CalculateHatefulStrikeTarget()) - DoCast(target, SPELL_HATEFUL_STRIKE); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_HATEFUL_STRIKE, 5000, GCD_CAST, PHASE_STRIKE); - break; - case EVENT_SWITCH_TARGET: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true)) - { - DoResetThreat(); - m_creature->AddThreat(target, 5000000.0f); - DoScriptText(EMOTE_NEW_TARGET, m_creature); - } - events.ScheduleEvent(EVENT_SWITCH_TARGET, 10000, 0, PHASE_CHASE); - break; - case EVENT_VOLCANO: - { - Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 999, true); - if (!target) target = m_creature->getVictim(); - if (target) - { - //DoCast(target, SPELL_VOLCANIC_SUMMON);//movement bugged - m_creature->SummonCreature(CREATURE_VOLCANO,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); - DoScriptText(EMOTE_GROUND_CRACK, m_creature); - events.DelayEvents(1500, GCD_CAST); - } - events.ScheduleEvent(EVENT_VOLCANO, 10000, GCD_CAST, PHASE_CHASE); - return; - } - case EVENT_SWITCH_PHASE: - ChangePhase(); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL npc_volcanoAI : public Scripted_NoMovementAI -{ - npc_volcanoAI(Creature *c) : Scripted_NoMovementAI(c) {} - - void Reset() - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); - me->SetReactState(REACT_PASSIVE); - wait = 3000; - } - uint32 wait; - - void EnterCombat(Unit *who) {} - - void MoveInLineOfSight(Unit *who) {} - - void DoAction(const uint32 info) - { - m_creature->RemoveAura(SPELL_VOLCANIC_ERUPTION); - } - - void UpdateAI(const uint32 diff) - { - if (wait<=diff)//wait 3secs before casting - { - DoCast(m_creature, SPELL_VOLCANIC_ERUPTION); - wait = 60000; - } - else wait -= diff; - } - -}; - -CreatureAI* GetAI_boss_supremus(Creature* pCreature) -{ - return new boss_supremusAI (pCreature); -} - -CreatureAI* GetAI_molten_flame(Creature* pCreature) -{ - return new molten_flameAI (pCreature); -} - -CreatureAI* GetAI_npc_volcano(Creature* pCreature) -{ - return new npc_volcanoAI (pCreature); -} - -void AddSC_boss_supremus() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_supremus"; - newscript->GetAI = &GetAI_boss_supremus; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="molten_flame"; - newscript->GetAI = &GetAI_molten_flame; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_volcano"; - newscript->GetAI = &GetAI_npc_volcano; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp deleted file mode 100644 index 25a82877388..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_teron_gorefiend.cpp +++ /dev/null @@ -1,520 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Teron_Gorefiend -SD%Complete: 60 -SDComment: Requires Mind Control support for Ghosts. -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - - //Speech'n'sound -#define SAY_INTRO -1564037 -#define SAY_AGGRO -1564038 -#define SAY_SLAY1 -1564039 -#define SAY_SLAY2 -1564040 -#define SAY_SPELL1 -1564041 -#define SAY_SPELL2 -1564042 -#define SAY_SPECIAL1 -1564043 -#define SAY_SPECIAL2 -1564044 -#define SAY_ENRAGE -1564045 -#define SAY_DEATH -1564046 - -//Spells -#define SPELL_INCINERATE 40239 -#define SPELL_CRUSHING_SHADOWS 40243 -#define SPELL_SHADOWBOLT 40185 -#define SPELL_PASSIVE_SHADOWFORM 40326 -#define SPELL_SHADOW_OF_DEATH 40251 -#define SPELL_BERSERK 45078 - -#define SPELL_ATROPHY 40327 // Shadowy Constructs use this when they get within melee range of a player - -#define CREATURE_DOOM_BLOSSOM 23123 -#define CREATURE_SHADOWY_CONSTRUCT 23111 - -struct TRINITY_DLL_DECL mob_doom_blossomAI : public ScriptedAI -{ - mob_doom_blossomAI(Creature *c) : ScriptedAI(c) {} - - uint32 CheckTeronTimer; - uint32 ShadowBoltTimer; - uint64 TeronGUID; - - void Reset() - { - CheckTeronTimer = 5000; - ShadowBoltTimer = 12000; - TeronGUID = 0; - } - - void EnterCombat(Unit *who) { } - void AttackStart(Unit* who) { } - void MoveInLineOfSight(Unit* who) { } - - void Despawn() - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - } - - void UpdateAI(const uint32 diff) - { - if (CheckTeronTimer < diff) - { - if (TeronGUID) - { - DoZoneInCombat(); - - Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID)); - if ((Teron) && (!Teron->isAlive() || Teron->IsInEvadeMode())) - Despawn(); - } - else - Despawn(); - - CheckTeronTimer = 5000; - }else CheckTeronTimer -= diff; - - if (ShadowBoltTimer < diff && m_creature->isInCombat()) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_SHADOWBOLT); - ShadowBoltTimer = 10000; - }else ShadowBoltTimer -= diff; - return; - } - - void SetTeronGUID(uint64 guid){ TeronGUID = guid; } -}; - -struct TRINITY_DLL_DECL mob_shadowy_constructAI : public ScriptedAI -{ - mob_shadowy_constructAI(Creature* c) : ScriptedAI(c) {} - - uint64 GhostGUID; - uint64 TeronGUID; - - uint32 CheckPlayerTimer; - uint32 CheckTeronTimer; - - void Reset() - { - GhostGUID = 0; - TeronGUID = 0; - - CheckPlayerTimer = 2000; - CheckTeronTimer = 5000; - } - - void EnterCombat(Unit* who) { } - - void MoveInLineOfSight(Unit *who) - { - if (!who || (!who->isAlive()) || (who->GetGUID() == GhostGUID)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - -/* Comment it out for now. NOTE TO FUTURE DEV: UNCOMMENT THIS OUT ONLY AFTER MIND CONTROL IS IMPLEMENTED - void DamageTaken(Unit* done_by, uint32 &damage) - { - if (done_by->GetGUID() != GhostGUID) - damage = 0; // Only the ghost can deal damage. - } - */ - - void CheckPlayers() - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - if (m_threatlist.empty()) - return; // No threat list. Don't continue. - std::list::iterator itr = m_threatlist.begin(); - std::list targets; - for(; itr != m_threatlist.end(); ++itr) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*itr)->getUnitGuid()); - if (pUnit && pUnit->isAlive()) - targets.push_back(pUnit); - } - targets.sort(ObjectDistanceOrder(m_creature)); - Unit* target = targets.front(); - if (target && m_creature->IsWithinDistInMap(target, m_creature->GetAttackDistance(target))) - { - DoCast(target, SPELL_ATROPHY); - m_creature->AI()->AttackStart(target); - } - } - - void UpdateAI(const uint32 diff) - { - if (CheckPlayerTimer < diff) - { - CheckPlayers(); - CheckPlayerTimer = 3000; - }else CheckPlayerTimer -= diff; - - if (CheckTeronTimer < diff) - { - Creature* Teron = (Unit::GetCreature((*m_creature), TeronGUID)); - if (!Teron || !Teron->isAlive() || Teron->IsInEvadeMode()) - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - - CheckTeronTimer = 5000; - }else CheckTeronTimer -= diff; - } -}; - -struct TRINITY_DLL_DECL boss_teron_gorefiendAI : public ScriptedAI -{ - boss_teron_gorefiendAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 IncinerateTimer; - uint32 SummonDoomBlossomTimer; - uint32 EnrageTimer; - uint32 CrushingShadowsTimer; - uint32 ShadowOfDeathTimer; - uint32 SummonShadowsTimer; - uint32 RandomYellTimer; - uint32 AggroTimer; - - uint64 AggroTargetGUID; - uint64 GhostGUID; // Player that gets killed by Shadow of Death and gets turned into a ghost - - bool Intro; - bool Done; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_TERONGOREFIENDEVENT, NOT_STARTED); - - IncinerateTimer = 20000 + rand()%11000; - SummonDoomBlossomTimer = 12000; - EnrageTimer = 600000; - CrushingShadowsTimer = 22000; - SummonShadowsTimer = 60000; - RandomYellTimer = 50000; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // Start off unattackable so that the intro is done properly - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - AggroTimer = 20000; - AggroTargetGUID = 0; - Intro = false; - Done = false; - } - - void EnterCombat(Unit *who) {} - - void MoveInLineOfSight(Unit* pWho) - { - if (!Intro && pWho->GetTypeId() == TYPEID_PLAYER && pWho->isTargetableForAttack() && m_creature->IsHostileTo(pWho) && pWho->isInAccessiblePlaceFor(m_creature)) - { - if (m_creature->IsWithinDistInMap(pWho, VISIBLE_RANGE) && m_creature->IsWithinLOSInMap(pWho)) - { - if (pInstance) - pInstance->SetData(DATA_TERONGOREFIENDEVENT, IN_PROGRESS); - - m_creature->GetMotionMaster()->Clear(false); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoScriptText(SAY_INTRO, m_creature); - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_TALK); - AggroTargetGUID = pWho->GetGUID(); - Intro = true; - } - } - if (Done) - ScriptedAI::MoveInLineOfSight(pWho); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - if (pInstance) - pInstance->SetData(DATA_TERONGOREFIENDEVENT, DONE); - - DoScriptText(SAY_DEATH, m_creature); - } - - float CalculateRandomLocation(float Loc, uint32 radius) - { - float coord = Loc; - switch(rand()%2) - { - case 0: - coord += rand()%radius; - break; - case 1: - coord -= rand()%radius; - break; - } - return coord; - } - - void SetThreatList(Creature* Blossom) - { - if (!Blossom) return; - - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - std::list::iterator i = m_threatlist.begin(); - for(i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - if (pUnit && pUnit->isAlive()) - { - float threat = DoGetThreat(pUnit); - Blossom->AddThreat(pUnit, threat); - } - } - } - - void MindControlGhost() - { - /************************************************************************/ - /** NOTE FOR FUTURE DEVELOPER: PROPERLY IMPLEMENT THE GHOST PORTION *****/ - /** ONLY AFTER TrinIty FULLY IMPLEMENTS MIND CONTROL ABILITIES *****/ - /** THE CURRENT CODE IN THIS FUNCTION IS ONLY THE BEGINNING OF *****/ - /** WHAT IS FULLY NECESSARY FOR GOREFIEND TO BE 100% COMPLETE *****/ - /************************************************************************/ - - Unit* Ghost = NULL; - if (GhostGUID) - Ghost = Unit::GetUnit((*m_creature), GhostGUID); - if (Ghost && Ghost->isAlive() && Ghost->HasAura(SPELL_SHADOW_OF_DEATH)) - { - /*float x,y,z; - Ghost->GetPosition(x,y,z); - Creature* control = m_creature->SummonCreature(CREATURE_GHOST, x, y, z, 0, TEMPSUMMON_TIMED_DESAWN, 30000); - if (control) - { - CAST_PLR(Ghost)->Possess(control); - Ghost->DealDamage(Ghost, Ghost->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, - false); - }*/ - for(uint8 i = 0; i < 4; ++i) - { - Creature* Construct = NULL; - float X = CalculateRandomLocation(Ghost->GetPositionX(), 10); - float Y = CalculateRandomLocation(Ghost->GetPositionY(), 10); - Construct = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, Y, Ghost->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000); - if (Construct) - { - Construct->CastSpell(Construct, SPELL_PASSIVE_SHADOWFORM, true); - SetThreatList(Construct); // Use same function as Doom Blossom to set Threat List. - CAST_AI(mob_shadowy_constructAI, Construct->AI())->GhostGUID = GhostGUID; - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!target) // someone's trying to solo. - target = m_creature->getVictim(); - - if (target) - Construct->GetMotionMaster()->MoveChase(target); - } - } - } - } - - void UpdateAI(const uint32 diff) - { - if (Intro && !Done) - { - if (AggroTimer < diff) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - DoScriptText(SAY_AGGRO, m_creature); - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_NONE); - Done = true; - if (AggroTargetGUID) - { - Unit* pUnit = Unit::GetUnit((*m_creature), AggroTargetGUID); - if (pUnit) - AttackStart(pUnit); - - DoZoneInCombat(); - } - else - { - EnterEvadeMode(); - return; - } - }else AggroTimer -= diff; - } - - if (!UpdateVictim() || !Done) - return; - - if (SummonShadowsTimer < diff) - { - //MindControlGhost(); - - for(uint8 i = 0; i < 2; ++i) - { - Creature* Shadow = NULL; - float X = CalculateRandomLocation(m_creature->GetPositionX(), 10); - Shadow = m_creature->SummonCreature(CREATURE_SHADOWY_CONSTRUCT, X, m_creature->GetPositionY(), m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 0); - if (Shadow) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!target) - target = m_creature->getVictim(); - - if (target) - Shadow->AI()->AttackStart(target); - } - } - SummonShadowsTimer = 60000; - }else SummonShadowsTimer -= diff; - - if (SummonDoomBlossomTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - float X = CalculateRandomLocation(target->GetPositionX(), 20); - float Y = CalculateRandomLocation(target->GetPositionY(), 20); - float Z = target->GetPositionZ(); - Z = m_creature->GetMap()->GetVmapHeight(X, Y, Z, true); - Creature* DoomBlossom = m_creature->SummonCreature(CREATURE_DOOM_BLOSSOM, X, Y, Z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 20000); - if (DoomBlossom) - { - DoomBlossom->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoomBlossom->setFaction(m_creature->getFaction()); - DoomBlossom->AddThreat(target, 1.0f); - CAST_AI(mob_doom_blossomAI, DoomBlossom->AI())->SetTeronGUID(m_creature->GetGUID()); - target->CombatStart(DoomBlossom); - SetThreatList(DoomBlossom); - SummonDoomBlossomTimer = 35000; - } - } - }else SummonDoomBlossomTimer -= diff; - - if (IncinerateTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!target) - target = m_creature->getVictim(); - - if (target) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPECIAL1, m_creature); break; - case 1: DoScriptText(SAY_SPECIAL2, m_creature); break; - } - DoCast(target, SPELL_INCINERATE); - IncinerateTimer = 20000 + rand()%31 * 1000; - } - }else IncinerateTimer -= diff; - - if (CrushingShadowsTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target && target->isAlive()) - DoCast(target, SPELL_CRUSHING_SHADOWS); - CrushingShadowsTimer = 10000 + rand()%16 * 1000; - }else CrushingShadowsTimer -= diff; - - /*** NOTE FOR FUTURE DEV: UNCOMMENT BELOW ONLY IF MIND CONTROL IS FULLY IMPLEMENTED **/ - /*if (ShadowOfDeathTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - - if (!target) - target = m_creature->getVictim(); - - if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) - { - DoCast(target, SPELL_SHADOW_OF_DEATH); - GhostGUID = target->GetGUID(); - ShadowOfDeathTimer = 30000; - SummonShadowsTimer = 53000; // Make it VERY close but slightly less so that we can check if the aura is still on the player - } - }else ShadowOfDeathTimer -= diff;*/ - - if (RandomYellTimer < diff) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPELL1, m_creature); break; - case 1: DoScriptText(SAY_SPELL2, m_creature); break; - } - RandomYellTimer = 50000 + rand()%51 * 1000; - }else RandomYellTimer -= diff; - - if (!m_creature->HasAura(SPELL_BERSERK)) - { - if (EnrageTimer < diff) - { - DoCast(m_creature, SPELL_BERSERK); - DoScriptText(SAY_ENRAGE, m_creature); - }else EnrageTimer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_doom_blossom(Creature* pCreature) -{ - return new mob_doom_blossomAI(pCreature); -} - -CreatureAI* GetAI_mob_shadowy_construct(Creature* pCreature) -{ - return new mob_shadowy_constructAI(pCreature); -} - -CreatureAI* GetAI_boss_teron_gorefiend(Creature* pCreature) -{ - return new boss_teron_gorefiendAI (pCreature); -} - -void AddSC_boss_teron_gorefiend() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "mob_doom_blossom"; - newscript->GetAI = &GetAI_mob_doom_blossom; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_shadowy_construct"; - newscript->GetAI = &GetAI_mob_shadowy_construct; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_teron_gorefiend"; - newscript->GetAI = &GetAI_boss_teron_gorefiend; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp b/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp deleted file mode 100644 index 1616333b007..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/boss_warlord_najentus.cpp +++ /dev/null @@ -1,226 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Warlord_Najentus -SD%Complete: 95 -SDComment: -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -enum -{ - SAY_AGGRO = -1564000, - SAY_NEEDLE1 = -1564001, - SAY_NEEDLE2 = -1564002, - SAY_SLAY1 = -1564003, - SAY_SLAY2 = -1564004, - SAY_SPECIAL1 = -1564005, - SAY_SPECIAL2 = -1564006, - SAY_ENRAGE1 = -1564007, //is this text actually in use? - SAY_ENRAGE2 = -1564008, - SAY_DEATH = -1564009, - - //Spells - SPELL_NEEDLE_SPINE = 39992, - SPELL_TIDAL_BURST = 39878, - SPELL_TIDAL_SHIELD = 39872, - SPELL_IMPALING_SPINE = 39837, - SPELL_CREATE_NAJENTUS_SPINE = 39956, - SPELL_HURL_SPINE = 39948, - SPELL_BERSERK = 26662, - - GOBJECT_SPINE = 185584, - - EVENT_BERSERK = 1, - EVENT_YELL = 2, - EVENT_NEEDLE = 3, - EVENT_SPINE = 4, - EVENT_SHIELD = 5, - - GCD_CAST = 1, - GCD_YELL = 2 -}; - -struct TRINITY_DLL_DECL boss_najentusAI : public ScriptedAI -{ - boss_najentusAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - EventMap events; - - uint64 SpineTargetGUID; - - void Reset() - { - events.Reset(); - - SpineTargetGUID = 0; - - if (pInstance) - pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, NOT_STARTED); - } - - void KilledUnit(Unit *victim) - { - DoScriptText(rand()%2 ? SAY_SLAY1 : SAY_SLAY2, m_creature); - events.DelayEvents(5000, GCD_YELL); - } - - void JustDied(Unit *victim) - { - if (pInstance) - pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, DONE); - - DoScriptText(SAY_DEATH, m_creature); - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - if (spell->Id == SPELL_HURL_SPINE && m_creature->HasAura(SPELL_TIDAL_SHIELD)) - { - m_creature->RemoveAurasDueToSpell(SPELL_TIDAL_SHIELD); - m_creature->CastSpell(m_creature, SPELL_TIDAL_BURST, true); - ResetTimer(); - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_HIGHWARLORDNAJENTUSEVENT, IN_PROGRESS); - - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - events.ScheduleEvent(EVENT_BERSERK, 480000, GCD_CAST); - events.ScheduleEvent(EVENT_YELL, 45000 + (rand()%76)*1000, GCD_YELL); - ResetTimer(); - } - - bool RemoveImpalingSpine() - { - if (!SpineTargetGUID) return false; - Unit* target = Unit::GetUnit(*m_creature, SpineTargetGUID); - if (target && target->HasAura(SPELL_IMPALING_SPINE)) - target->RemoveAurasDueToSpell(SPELL_IMPALING_SPINE); - SpineTargetGUID=0; - return true; - } - - void ResetTimer(uint32 inc = 0) - { - events.RescheduleEvent(EVENT_NEEDLE, 10000 + inc, GCD_CAST); - events.RescheduleEvent(EVENT_SPINE, 20000 + inc, GCD_CAST); - events.RescheduleEvent(EVENT_SHIELD, 60000 + inc); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_SHIELD: - m_creature->CastSpell(m_creature, SPELL_TIDAL_SHIELD, true); - ResetTimer(45000); - break; - case EVENT_BERSERK: - DoScriptText(SAY_ENRAGE2, m_creature); - m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - events.DelayEvents(15000, GCD_YELL); - break; - case EVENT_SPINE: - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (!target) target = m_creature->getVictim(); - if (target) - { - m_creature->CastSpell(target, SPELL_IMPALING_SPINE, true); - SpineTargetGUID = target->GetGUID(); - //must let target summon, otherwise you cannot click the spine - target->SummonGameObject(GOBJECT_SPINE, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), m_creature->GetOrientation(), 0, 0, 0, 0, 30); - DoScriptText(rand()%2 ? SAY_NEEDLE1 : SAY_NEEDLE2, m_creature); - events.DelayEvents(1500, GCD_CAST); - events.DelayEvents(15000, GCD_YELL); - } - events.ScheduleEvent(EVENT_SPINE, 21000, GCD_CAST); - return; - } - case EVENT_NEEDLE: - { - //m_creature->CastSpell(m_creature, SPELL_NEEDLE_SPINE, true); - std::list target; - SelectTargetList(target, 3, SELECT_TARGET_RANDOM, 80, true); - for(std::list::iterator i = target.begin(); i != target.end(); ++i) - m_creature->CastSpell(*i, 39835, true); - events.ScheduleEvent(EVENT_NEEDLE, 15000+rand()%10000, GCD_CAST); - events.DelayEvents(1500, GCD_CAST); - return; - } - case EVENT_YELL: - DoScriptText(rand()%2 ? SAY_SPECIAL1 : SAY_SPECIAL2, m_creature); - events.ScheduleEvent(EVENT_YELL, 25000 + (rand()%76)*1000, GCD_YELL); - events.DelayEvents(15000, GCD_YELL); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -bool GOHello_go_najentus_spine(Player* pPlayer, GameObject* pGo) -{ - if (ScriptedInstance* pInstance = pGo->GetInstanceData()) - if (Creature* Najentus = Unit::GetCreature(*pGo, pInstance->GetData64(DATA_HIGHWARLORDNAJENTUS))) - if (CAST_AI(boss_najentusAI, Najentus->AI())->RemoveImpalingSpine()) - { - pPlayer->CastSpell(pPlayer, SPELL_CREATE_NAJENTUS_SPINE, true); - pGo->DeleteObjectWithOwner(); - } - return true; -} - -CreatureAI* GetAI_boss_najentus(Creature* pCreature) -{ - return new boss_najentusAI (pCreature); -} - -void AddSC_boss_najentus() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_najentus"; - newscript->GetAI = &GetAI_boss_najentus; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "go_najentus_spine"; - newscript->pGOHello = &GOHello_go_najentus_spine; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h b/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h deleted file mode 100644 index c98c0b1c363..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/def_black_temple.h +++ /dev/null @@ -1,39 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_BLACK_TEMPLE_H -#define DEF_BLACK_TEMPLE_H - -enum -{ - DATA_AKAMA = 1, - DATA_AKAMA_SHADE = 2, - DATA_GURTOGGBLOODBOILEVENT = 3, - DATA_HIGHWARLORDNAJENTUS = 4, - DATA_HIGHWARLORDNAJENTUSEVENT = 5, - DATA_ILLIDANSTORMRAGE = 6, - DATA_ILLIDANSTORMRAGEEVENT = 7, - DATA_ILLIDARICOUNCILEVENT = 8, - DATA_ILLIDARICOUNCIL = 9, - DATA_LADYMALANDE = 10, - DATA_HIGHNETHERMANCERZEREVOR = 11, - DATA_GATHIOSTHESHATTERER = 12, - DATA_VERASDARKSHADOW = 13, - DATA_MOTHERSHAHRAZEVENT = 14, - DATA_RELIQUARYOFSOULSEVENT = 15, - DATA_SHADEOFAKAMA = 16, - DATA_SHADEOFAKAMAEVENT = 17, - DATA_SUPREMUS = 18, - DATA_SUPREMUSEVENT = 19, - DATA_TERONGOREFIENDEVENT = 20, - DATA_GAMEOBJECT_NAJENTUS_GATE = 21, - DATA_GAMEOBJECT_ILLIDAN_GATE = 22, - DATA_GAMEOBJECT_ILLIDAN_DOOR_R = 23, - DATA_GAMEOBJECT_ILLIDAN_DOOR_L = 24, - DATA_GAMEOBJECT_SUPREMUS_DOORS = 25, - DATA_BLOOD_ELF_COUNCIL_VOICE = 26 -}; - -#endif - diff --git a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp b/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp deleted file mode 100644 index 6b86140b659..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/illidari_council.cpp +++ /dev/null @@ -1,872 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Illidari_Council -SD%Complete: 95 -SDComment: Circle of Healing not working properly. -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -//Speech'n'Sounds -#define SAY_GATH_SLAY -1564085 -#define SAY_GATH_SLAY_COMNT -1564089 -#define SAY_GATH_DEATH -1564093 -#define SAY_GATH_SPECIAL1 -1564077 -#define SAY_GATH_SPECIAL2 -1564081 - -#define SAY_VERA_SLAY -1564086 -#define SAY_VERA_COMNT -1564089 -#define SAY_VERA_DEATH -1564094 -#define SAY_VERA_SPECIAL1 -1564078 -#define SAY_VERA_SPECIAL2 -1564082 - -#define SAY_MALA_SLAY -1564087 -#define SAY_MALA_COMNT -1564090 -#define SAY_MALA_DEATH -1564095 -#define SAY_MALA_SPECIAL1 -1564079 -#define SAY_MALA_SPECIAL2 -1564083 - -#define SAY_ZERE_SLAY -1564088 -#define SAY_ZERE_COMNT -1564091 -#define SAY_ZERE_DEATH -1564096 -#define SAY_ZERE_SPECIAL1 -1564080 -#define SAY_ZERE_SPECIAL2 -1564084 - -#define ERROR_INST_DATA "SD2 ERROR: Instance Data for Black Temple not set properly; Illidari Council event will not function properly." - -#define AKAMAID 23089 - -struct CouncilYells -{ - int32 entry; - uint32 timer; -}; - -static CouncilYells CouncilAggro[]= -{ - {-1564069, 5000}, // Gathios - {-1564070, 5500}, // Veras - {-1564071, 5000}, // Malande - {-1564072, 0}, // Zerevor -}; - -// Need to get proper timers for this later -static CouncilYells CouncilEnrage[]= -{ - {-1564073, 2000}, // Gathios - {-1564074, 6000}, // Veras - {-1564075, 5000}, // Malande - {-1564076, 0}, // Zerevor -}; - -// High Nethermancer Zerevor's spells -#define SPELL_FLAMESTRIKE 41481 -#define SPELL_BLIZZARD 41482 -#define SPELL_ARCANE_BOLT 41483 -#define SPELL_ARCANE_EXPLOSION 41524 -#define SPELL_DAMPEN_MAGIC 41478 - -// Lady Malande's spells -#define SPELL_EMPOWERED_SMITE 41471 -#define SPELL_CIRCLE_OF_HEALING 41455 -#define SPELL_REFLECTIVE_SHIELD 41475 -#define SPELL_DIVINE_WRATH 41472 -#define SPELL_HEAL_VISUAL 24171 - -// Gathios the Shatterer's spells -#define SPELL_BLESS_PROTECTION 41450 -#define SPELL_BLESS_SPELLWARD 41451 -#define SPELL_CONSECRATION 41541 -#define SPELL_HAMMER_OF_JUSTICE 41468 -#define SPELL_SEAL_OF_COMMAND 41469 -#define SPELL_SEAL_OF_BLOOD 41459 -#define SPELL_CHROMATIC_AURA 41453 -#define SPELL_DEVOTION_AURA 41452 - -// Veras Darkshadow's spells -#define SPELL_DEADLY_POISON 41485 -#define SPELL_ENVENOM 41487 -#define SPELL_VANISH 41479 - -#define SPELL_BERSERK 45078 - -struct TRINITY_DLL_DECL mob_blood_elf_council_voice_triggerAI : public ScriptedAI -{ - mob_blood_elf_council_voice_triggerAI(Creature* c) : ScriptedAI(c) - { - for(uint8 i = 0; i < 4; ++i) - Council[i] = 0; - } - - uint64 Council[4]; - - uint32 EnrageTimer; - uint32 AggroYellTimer; - - uint8 YellCounter; // Serves as the counter for both the aggro and enrage yells - - bool EventStarted; - - void Reset() - { - EnrageTimer = 900000; // 15 minutes - AggroYellTimer = 500; - - YellCounter = 0; - - EventStarted = false; - } - - // finds and stores the GUIDs for each Council member using instance data system. - void LoadCouncilGUIDs() - { - if (ScriptedInstance* pInstance = (m_creature->GetInstanceData())) - { - Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); - Council[1] = pInstance->GetData64(DATA_VERASDARKSHADOW); - Council[2] = pInstance->GetData64(DATA_LADYMALANDE); - Council[3] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); - }else error_log(ERROR_INST_DATA); - } - - void EnterCombat(Unit* who) {} - - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - if (!EventStarted) - return; - - if (YellCounter > 3) - return; - - if (AggroYellTimer) - { - if (AggroYellTimer <= diff) - { - if (Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter])) - { - DoScriptText(CouncilAggro[YellCounter].entry, pMember); - AggroYellTimer = CouncilAggro[YellCounter].timer; - } - ++YellCounter; - if (YellCounter > 3) - YellCounter = 0; // Reuse for Enrage Yells - }else AggroYellTimer -= diff; - } - - if (EnrageTimer) - { - if (EnrageTimer <= diff) - { - if (Unit* pMember = Unit::GetUnit(*m_creature, Council[YellCounter])) - { - pMember->CastSpell(pMember, SPELL_BERSERK, true); - DoScriptText(CouncilEnrage[YellCounter].entry, pMember); - EnrageTimer = CouncilEnrage[YellCounter].timer; - } - ++YellCounter; - }else EnrageTimer -= diff; - } - } -}; - -struct TRINITY_DLL_DECL mob_illidari_councilAI : public ScriptedAI -{ - mob_illidari_councilAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - for(uint8 i = 0; i < 4; ++i) - Council[i] = 0; - } - - ScriptedInstance* pInstance; - - uint64 Council[4]; - - uint32 CheckTimer; - uint32 EndEventTimer; - - uint8 DeathCount; - - bool EventBegun; - - void Reset() - { - CheckTimer = 2000; - EndEventTimer = 0; - - DeathCount = 0; - - Creature* pMember = NULL; - for(uint8 i = 0; i < 4; ++i) - { - if (pMember = (Unit::GetCreature((*m_creature), Council[i]))) - { - if (!pMember->isAlive()) - { - pMember->RemoveCorpse(); - pMember->Respawn(); - } - pMember->AI()->EnterEvadeMode(); - } - } - - if (pInstance) - { - pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, NOT_STARTED); - if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) - VoiceTrigger->AI()->EnterEvadeMode(); - } - - EventBegun = false; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetDisplayId(11686); - } - - void EnterCombat(Unit *who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - - void StartEvent(Unit *target) - { - if (!pInstance) return; - - if (target && target->isAlive()) - { - Council[0] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); - Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); - Council[2] = pInstance->GetData64(DATA_LADYMALANDE); - Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW); - - // Start the event for the Voice Trigger - if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) - { - CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->LoadCouncilGUIDs(); - CAST_AI(mob_blood_elf_council_voice_triggerAI, VoiceTrigger->AI())->EventStarted = true; - } - - for(uint8 i = 0; i < 4; ++i) - { - Unit* Member = NULL; - if (Council[i]) - { - Member = Unit::GetUnit((*m_creature), Council[i]); - if (Member && Member->isAlive()) - CAST_CRE(Member)->AI()->AttackStart(target); - } - } - - pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, IN_PROGRESS); - - EventBegun = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!EventBegun) return; - - if (EndEventTimer) - { - if (EndEventTimer <= diff) - { - if (DeathCount > 3) - { - if (pInstance) - { - if (Creature* VoiceTrigger = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_BLOOD_ELF_COUNCIL_VOICE)))) - VoiceTrigger->DealDamage(VoiceTrigger, VoiceTrigger->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - pInstance->SetData(DATA_ILLIDARICOUNCILEVENT, DONE); - m_creature->SummonCreature(AKAMAID,746.466980f,304.394989f,311.90208f,6.272870f,TEMPSUMMON_DEAD_DESPAWN,0); - } - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - - Creature* pMember = (Unit::GetCreature(*m_creature, Council[DeathCount])); - if (pMember && pMember->isAlive()) - pMember->DealDamage(pMember, pMember->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - ++DeathCount; - EndEventTimer = 1500; - }else EndEventTimer -= diff; - } - - if (CheckTimer) - { - if (CheckTimer <= diff) - { - uint8 EvadeCheck = 0; - for(uint8 i = 0; i < 4; ++i) - { - if (Council[i]) - { - if (Creature* Member = (Unit::GetCreature((*m_creature), Council[i]))) - { - // This is the evade/death check. - if (Member->isAlive() && !Member->getVictim()) - ++EvadeCheck; //If all members evade, we reset so that players can properly reset the event - else if (!Member->isAlive()) // If even one member dies, kill the rest, set instance data, and kill self. - { - EndEventTimer = 1000; - CheckTimer = 0; - return; - } - } - } - } - - if (EvadeCheck > 3) - Reset(); - - CheckTimer = 2000; - }else CheckTimer -= diff; - } - - } -}; - -struct TRINITY_DLL_DECL boss_illidari_councilAI : public ScriptedAI -{ - boss_illidari_councilAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - for(uint8 i = 0; i < 4; ++i) - Council[i] = 0; - LoadedGUIDs = false; - } - - uint64 Council[4]; - - ScriptedInstance* pInstance; - - bool LoadedGUIDs; - - void EnterCombat(Unit* who) - { - if (pInstance) - { - Creature* Controller = (Unit::GetCreature(*m_creature, pInstance->GetData64(DATA_ILLIDARICOUNCIL))); - if (Controller) - CAST_AI(mob_illidari_councilAI, Controller->AI())->StartEvent(who); - } - else - { - error_log(ERROR_INST_DATA); - EnterEvadeMode(); - return; - } - DoZoneInCombat(); - // Load GUIDs on first aggro because the Creature guids are only set as the creatures are created in world- - // this means that for each pCreature, it will attempt to LoadGUIDs even though some of the other creatures are - // not in world, and thus have no GUID set in the instance data system. Putting it in aggro ensures that all the creatures - // have been loaded and have their GUIDs set in the instance data system. - if (!LoadedGUIDs) - LoadGUIDs(); - } - - void EnterEvadeMode() - { - for(uint8 i = 0; i < 4; ++i) - { - if (Unit* pUnit = Unit::GetUnit(*m_creature, Council[i])) - if (pUnit != m_creature && pUnit->getVictim()) - { - AttackStart(pUnit->getVictim()); - return; - } - } - ScriptedAI::EnterEvadeMode(); - } - - void DamageTaken(Unit* done_by, uint32 &damage) - { - if (done_by == m_creature) - return; - - damage /= 4; - for(uint8 i = 0; i < 4; ++i) - { - if (Creature* pUnit = Unit::GetCreature(*m_creature, Council[i])) - if (pUnit != m_creature && damage < pUnit->GetHealth()) - { - pUnit->SetHealth(pUnit->GetHealth() - damage); - pUnit->LowerPlayerDamageReq(damage); - } - } - } - - void LoadGUIDs() - { - if (!pInstance) - { - error_log(ERROR_INST_DATA); - return; - } - - Council[0] = pInstance->GetData64(DATA_LADYMALANDE); - Council[1] = pInstance->GetData64(DATA_HIGHNETHERMANCERZEREVOR); - Council[2] = pInstance->GetData64(DATA_GATHIOSTHESHATTERER); - Council[3] = pInstance->GetData64(DATA_VERASDARKSHADOW); - - LoadedGUIDs = true; - } -}; - -struct TRINITY_DLL_DECL boss_gathios_the_shattererAI : public boss_illidari_councilAI -{ - boss_gathios_the_shattererAI(Creature *c) : boss_illidari_councilAI(c) {} - - uint32 ConsecrationTimer; - uint32 HammerOfJusticeTimer; - uint32 SealTimer; - uint32 AuraTimer; - uint32 BlessingTimer; - - void Reset() - { - ConsecrationTimer = 40000; - HammerOfJusticeTimer = 10000; - SealTimer = 40000; - AuraTimer = 90000; - BlessingTimer = 60000; - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_GATH_SLAY, m_creature); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_GATH_DEATH, m_creature); - } - - Unit* SelectCouncilMember() - { - Unit* pUnit = m_creature; - uint32 member = 0; // He chooses Lady Malande most often - - if (rand()%10 == 0) // But there is a chance he picks someone else. - member = urand(1, 3); - - if (member != 2) // No need to create another pointer to us using Unit::GetUnit - pUnit = Unit::GetUnit((*m_creature), Council[member]); - return pUnit; - } - - void CastAuraOnCouncil() - { - uint32 spellid = 0; - switch(rand()%2) - { - case 0: spellid = SPELL_DEVOTION_AURA; break; - case 1: spellid = SPELL_CHROMATIC_AURA; break; - } - for(uint8 i = 0; i < 4; ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), Council[i]); - if (pUnit) - pUnit->CastSpell(pUnit, spellid, true, 0, 0, m_creature->GetGUID()); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (BlessingTimer < diff) - { - if (Unit* pUnit = SelectCouncilMember()) - { - switch(rand()%2) - { - case 0: DoCast(pUnit, SPELL_BLESS_SPELLWARD); break; - case 1: DoCast(pUnit, SPELL_BLESS_PROTECTION); break; - } - } - BlessingTimer = 60000; - }else BlessingTimer -= diff; - - if (ConsecrationTimer < diff) - { - DoCast(m_creature, SPELL_CONSECRATION); - ConsecrationTimer = 40000; - }else ConsecrationTimer -= diff; - - if (HammerOfJusticeTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - // is in ~10-40 yd range - if (m_creature->IsInRange(target, 10.0f, 40.0f, false)) - { - DoCast(target, SPELL_HAMMER_OF_JUSTICE); - HammerOfJusticeTimer = 20000; - } - } - }else HammerOfJusticeTimer -= diff; - - if (SealTimer < diff) - { - switch(rand()%2) - { - case 0: DoCast(m_creature, SPELL_SEAL_OF_COMMAND); break; - case 1: DoCast(m_creature, SPELL_SEAL_OF_BLOOD); break; - } - SealTimer = 40000; - }else SealTimer -= diff; - - if (AuraTimer < diff) - { - CastAuraOnCouncil(); - AuraTimer = 90000; - }else AuraTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_high_nethermancer_zerevorAI : public boss_illidari_councilAI -{ - boss_high_nethermancer_zerevorAI(Creature *c) : boss_illidari_councilAI(c) {} - - uint32 BlizzardTimer; - uint32 FlamestrikeTimer; - uint32 ArcaneBoltTimer; - uint32 DampenMagicTimer; - uint32 Cooldown; - uint32 ArcaneExplosionTimer; - - void Reset() - { - BlizzardTimer = 30000 + rand()%61 * 1000; - FlamestrikeTimer = 30000 + rand()%61 * 1000; - ArcaneBoltTimer = 10000; - DampenMagicTimer = 2000; - ArcaneExplosionTimer = 14000; - Cooldown = 0; - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_ZERE_SLAY, m_creature); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_ZERE_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Cooldown) - { - if (Cooldown < diff) Cooldown = 0; - else - { - Cooldown -= diff; - return; // Don't cast any other spells if global cooldown is still ticking - } - } - - if (DampenMagicTimer < diff) - { - DoCast(m_creature, SPELL_DAMPEN_MAGIC); - Cooldown = 1000; - DampenMagicTimer = 67200; // almost 1,12 minutes - ArcaneBoltTimer += 1000; // Give the Mage some time to spellsteal Dampen. - }else DampenMagicTimer -= diff; - - if (ArcaneExplosionTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); - Cooldown = 1000; - ArcaneExplosionTimer = 14000; - }else ArcaneExplosionTimer -= diff; - - if (ArcaneBoltTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCANE_BOLT); - ArcaneBoltTimer = 3000; - Cooldown = 2000; - }else ArcaneBoltTimer -= diff; - - if (BlizzardTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_BLIZZARD); - BlizzardTimer = 45000 + rand()%46 * 1000; - FlamestrikeTimer += 10000; - Cooldown = 1000; - } - }else BlizzardTimer -= diff; - - if (FlamestrikeTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_FLAMESTRIKE); - FlamestrikeTimer = 55000 + rand()%46 * 1000; - BlizzardTimer += 10000; - Cooldown = 2000; - } - }else FlamestrikeTimer -= diff; - } -}; - -struct TRINITY_DLL_DECL boss_lady_malandeAI : public boss_illidari_councilAI -{ - boss_lady_malandeAI(Creature *c) : boss_illidari_councilAI(c) {} - - uint32 EmpoweredSmiteTimer; - uint32 CircleOfHealingTimer; - uint32 DivineWrathTimer; - uint32 ReflectiveShieldTimer; - - void Reset() - { - EmpoweredSmiteTimer = 38000; - CircleOfHealingTimer = 20000; - DivineWrathTimer = 40000; - ReflectiveShieldTimer = 0; - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_MALA_SLAY, m_creature); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_MALA_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (EmpoweredSmiteTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_EMPOWERED_SMITE); - EmpoweredSmiteTimer = 38000; - } - }else EmpoweredSmiteTimer -= diff; - - if (CircleOfHealingTimer < diff) - { - DoCast(m_creature, SPELL_CIRCLE_OF_HEALING); - CircleOfHealingTimer = 60000; - }else CircleOfHealingTimer -= diff; - - if (DivineWrathTimer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, SPELL_DIVINE_WRATH); - DivineWrathTimer = 40000 + rand()%41 * 1000; - } - }else DivineWrathTimer -= diff; - - if (ReflectiveShieldTimer < diff) - { - DoCast(m_creature, SPELL_REFLECTIVE_SHIELD); - ReflectiveShieldTimer = 65000; - }else ReflectiveShieldTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_veras_darkshadowAI : public boss_illidari_councilAI -{ - boss_veras_darkshadowAI(Creature *c) : boss_illidari_councilAI(c) {} - - uint64 EnvenomTargetGUID; - - uint32 DeadlyPoisonTimer; - uint32 VanishTimer; - uint32 AppearEnvenomTimer; - - bool HasVanished; - - void Reset() - { - EnvenomTargetGUID = 0; - - DeadlyPoisonTimer = 20000; - VanishTimer = 60000 + rand()%61 * 1000; - AppearEnvenomTimer = 150000; - - HasVanished = false; - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_VERA_SLAY, m_creature); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_VERA_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!HasVanished) - { - if (DeadlyPoisonTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_DEADLY_POISON); - DeadlyPoisonTimer = 15000 + rand()%31 * 1000; - }else DeadlyPoisonTimer -= diff; - - if (AppearEnvenomTimer < diff) // Cast Envenom. This is cast 4 seconds after Vanish is over - { - DoCast(m_creature->getVictim(), SPELL_ENVENOM); - AppearEnvenomTimer = 90000; - }else AppearEnvenomTimer -= diff; - - if (VanishTimer < diff) // Disappear and stop attacking, but follow a random unit - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - VanishTimer = 30000; - AppearEnvenomTimer= 28000; - HasVanished = true; - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoResetThreat(); - // Chase a unit. Check before DoMeleeAttackIfReady prevents from attacking - m_creature->AddThreat(target, 500000.0f); - m_creature->GetMotionMaster()->MoveChase(target); - } - }else VanishTimer -= diff; - - DoMeleeAttackIfReady(); - } - else - { - if (VanishTimer < diff) // Become attackable and poison current target - { - Unit* target = m_creature->getVictim(); - DoCast(target, SPELL_DEADLY_POISON); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoResetThreat(); - m_creature->AddThreat(target, 3000.0f); // Make Veras attack his target for a while, he will cast Envenom 4 seconds after. - DeadlyPoisonTimer += 6000; - VanishTimer = 90000; - AppearEnvenomTimer = 4000; - HasVanished = false; - }else VanishTimer -= diff; - - if (AppearEnvenomTimer < diff) // Appear 2 seconds before becoming attackable (Shifting out of vanish) - { - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - m_creature->SetVisibility(VISIBILITY_ON); - AppearEnvenomTimer = 6000; - }else AppearEnvenomTimer -= diff; - } - } -}; - -CreatureAI* GetAI_mob_blood_elf_council_voice_trigger(Creature* c) -{ - return new mob_blood_elf_council_voice_triggerAI(c); -} - -CreatureAI* GetAI_mob_illidari_council(Creature* pCreature) -{ - return new mob_illidari_councilAI (pCreature); -} - -CreatureAI* GetAI_boss_gathios_the_shatterer(Creature* pCreature) -{ - return new boss_gathios_the_shattererAI (pCreature); -} - -CreatureAI* GetAI_boss_lady_malande(Creature* pCreature) -{ - return new boss_lady_malandeAI (pCreature); -} - -CreatureAI* GetAI_boss_veras_darkshadow(Creature* pCreature) -{ - return new boss_veras_darkshadowAI (pCreature); -} - -CreatureAI* GetAI_boss_high_nethermancer_zerevor(Creature* pCreature) -{ - return new boss_high_nethermancer_zerevorAI (pCreature); -} - -void AddSC_boss_illidari_council() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="mob_illidari_council"; - newscript->GetAI = &GetAI_mob_illidari_council; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_blood_elf_council_voice_trigger"; - newscript->GetAI = &GetAI_mob_blood_elf_council_voice_trigger; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_gathios_the_shatterer"; - newscript->GetAI = &GetAI_boss_gathios_the_shatterer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_lady_malande"; - newscript->GetAI = &GetAI_boss_lady_malande; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_veras_darkshadow"; - newscript->GetAI = &GetAI_boss_veras_darkshadow; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_high_nethermancer_zerevor"; - newscript->GetAI = &GetAI_boss_high_nethermancer_zerevor; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp b/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp deleted file mode 100644 index 173632009ba..00000000000 --- a/src/bindings/scripts/scripts/zone/black_temple/instance_black_temple.cpp +++ /dev/null @@ -1,346 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Instance_Black_Temple -SD%Complete: 100 -SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Black Temple Scripts -SDCategory: Black Temple -EndScriptData */ - -#include "precompiled.h" -#include "def_black_temple.h" - -#define MAX_ENCOUNTER 9 - -/* Black Temple encounters: -0 - High Warlord Naj'entus event -1 - Supremus Event -2 - Shade of Akama Event -3 - Teron Gorefiend Event -4 - Gurtogg Bloodboil Event -5 - Reliquary Of Souls Event -6 - Mother Shahraz Event -7 - Illidari Council Event -8 - Illidan Stormrage Event -*/ - -struct TRINITY_DLL_DECL instance_black_temple : public ScriptedInstance -{ - instance_black_temple(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - uint64 Najentus; - uint64 Akama; // This is the Akama that starts the Illidan encounter. - uint64 Akama_Shade; // This is the Akama that starts the Shade of Akama encounter. - uint64 ShadeOfAkama; - uint64 Supremus; - uint64 LadyMalande; - uint64 GathiosTheShatterer; - uint64 HighNethermancerZerevor; - uint64 VerasDarkshadow; - uint64 IllidariCouncil; - uint64 BloodElfCouncilVoice; - uint64 IllidanStormrage; - - uint64 NajentusGate; - uint64 MainTempleDoors; - uint64 ShadeOfAkamaDoor; - uint64 CommonDoor;//Teron - uint64 TeronDoor; - uint64 GuurtogDoor; - uint64 MotherDoor; - uint64 TempleDoor;//Befor mother - uint64 CouncilDoor; - uint64 SimpleDoor;//council - uint64 IllidanGate; - uint64 IllidanDoor[2]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - Najentus = 0; - Akama = 0; - Akama_Shade = 0; - ShadeOfAkama = 0; - Supremus = 0; - LadyMalande = 0; - GathiosTheShatterer = 0; - HighNethermancerZerevor = 0; - VerasDarkshadow = 0; - IllidariCouncil = 0; - BloodElfCouncilVoice = 0; - IllidanStormrage = 0; - - NajentusGate = 0; - MainTempleDoors = 0; - ShadeOfAkamaDoor= 0; - CommonDoor = 0;//teron - TeronDoor = 0; - GuurtogDoor = 0; - MotherDoor = 0; - TempleDoor = 0; - SimpleDoor = 0;//Bycouncil - CouncilDoor = 0; - IllidanGate = 0; - IllidanDoor[0] = 0; - IllidanDoor[1] = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("TSCR: Instance Black Temple: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 22887: Najentus = pCreature->GetGUID(); break; - case 23089: Akama = pCreature->GetGUID(); break; - case 22990: Akama_Shade = pCreature->GetGUID(); break; - case 22841: ShadeOfAkama = pCreature->GetGUID(); break; - case 22898: Supremus = pCreature->GetGUID(); break; - case 22917: IllidanStormrage = pCreature->GetGUID(); break; - case 22949: GathiosTheShatterer = pCreature->GetGUID(); break; - case 22950: HighNethermancerZerevor = pCreature->GetGUID(); break; - case 22951: LadyMalande = pCreature->GetGUID(); break; - case 22952: VerasDarkshadow = pCreature->GetGUID(); break; - case 23426: IllidariCouncil = pCreature->GetGUID(); break; - case 23499: BloodElfCouncilVoice = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 185483: NajentusGate = pGo->GetGUID();// Gate past Naj'entus (at the entrance to Supermoose's courtyards) - if (m_auiEncounter[0] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185882: MainTempleDoors = pGo->GetGUID();// Main Temple Doors - right past Supermoose (Supremus) - if (m_auiEncounter[1] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185478: ShadeOfAkamaDoor = pGo->GetGUID();break; - case 185480: CommonDoor = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);;break; - case 186153: TeronDoor = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE)HandleGameObject(NULL,true,pGo);;break; - case 185892: GuurtogDoor = pGo->GetGUID(); - if (m_auiEncounter[4] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185479: TempleDoor = pGo->GetGUID(); - if (m_auiEncounter[5] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185482: MotherDoor = pGo->GetGUID(); - if (m_auiEncounter[6] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185481: CouncilDoor = pGo->GetGUID(); - if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break; - case 186152: SimpleDoor = pGo->GetGUID(); - if (m_auiEncounter[7] == DONE)HandleGameObject(NULL,true,pGo);break; - case 185905: IllidanGate = pGo->GetGUID(); break; // Gate leading to Temple Summit - case 186261: IllidanDoor[0] = pGo->GetGUID(); break; // Right door at Temple Summit - case 186262: IllidanDoor[1] = pGo->GetGUID(); break; // Left door at Temple Summit - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_HIGHWARLORDNAJENTUS: return Najentus; - case DATA_AKAMA: return Akama; - case DATA_AKAMA_SHADE: return Akama_Shade; - case DATA_SHADEOFAKAMA: return ShadeOfAkama; - case DATA_SUPREMUS: return Supremus; - case DATA_ILLIDANSTORMRAGE: return IllidanStormrage; - case DATA_GATHIOSTHESHATTERER: return GathiosTheShatterer; - case DATA_HIGHNETHERMANCERZEREVOR: return HighNethermancerZerevor; - case DATA_LADYMALANDE: return LadyMalande; - case DATA_VERASDARKSHADOW: return VerasDarkshadow; - case DATA_ILLIDARICOUNCIL: return IllidariCouncil; - case DATA_GAMEOBJECT_NAJENTUS_GATE: return NajentusGate; - case DATA_GAMEOBJECT_ILLIDAN_GATE: return IllidanGate; - case DATA_GAMEOBJECT_ILLIDAN_DOOR_R: return IllidanDoor[0]; - case DATA_GAMEOBJECT_ILLIDAN_DOOR_L: return IllidanDoor[1]; - case DATA_GAMEOBJECT_SUPREMUS_DOORS: return MainTempleDoors; - case DATA_BLOOD_ELF_COUNCIL_VOICE: return BloodElfCouncilVoice; - } - - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_HIGHWARLORDNAJENTUSEVENT: - if (data == DONE) - { - HandleGameObject(NajentusGate, true); - } - m_auiEncounter[0] = data;break; - case DATA_SUPREMUSEVENT: - if (data == DONE) - { - HandleGameObject(NajentusGate, true); - } - m_auiEncounter[1] = data; break; - case DATA_SHADEOFAKAMAEVENT: - if (data == IN_PROGRESS) - { - HandleGameObject(ShadeOfAkamaDoor, false); - }else HandleGameObject(ShadeOfAkamaDoor, true); - m_auiEncounter[2] = data; break; - case DATA_TERONGOREFIENDEVENT: - if (data == IN_PROGRESS) - { - HandleGameObject(TeronDoor, false); - HandleGameObject(CommonDoor, false); - }else - { - HandleGameObject(TeronDoor, true); - HandleGameObject(CommonDoor, true); - } - m_auiEncounter[3] = data; break; - case DATA_GURTOGGBLOODBOILEVENT: - if (data == DONE) - { - HandleGameObject(GuurtogDoor, true); - } - m_auiEncounter[4] = data; break; - case DATA_RELIQUARYOFSOULSEVENT: - if (data == DONE) - { - HandleGameObject(TempleDoor, true); - } - m_auiEncounter[5] = data; break; - case DATA_MOTHERSHAHRAZEVENT: - if (data == DONE) - { - HandleGameObject(MotherDoor, true); - } - m_auiEncounter[6] = data; break; - case DATA_ILLIDARICOUNCILEVENT: - if (data == IN_PROGRESS) - { - HandleGameObject(CouncilDoor, false); - HandleGameObject(SimpleDoor, false); - }else - { - HandleGameObject(CouncilDoor, true); - HandleGameObject(SimpleDoor, true); - } - m_auiEncounter[7] = data; break; - case DATA_ILLIDANSTORMRAGEEVENT: m_auiEncounter[8] = data; break; - } - - if (data == DONE) - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4] - << " " << m_auiEncounter[5] << " " << m_auiEncounter[6] << " " << m_auiEncounter[7] - << " " << m_auiEncounter[8]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_HIGHWARLORDNAJENTUSEVENT: return m_auiEncounter[0]; - case DATA_SUPREMUSEVENT: return m_auiEncounter[1]; - case DATA_SHADEOFAKAMAEVENT: return m_auiEncounter[2]; - case DATA_TERONGOREFIENDEVENT: return m_auiEncounter[3]; - case DATA_GURTOGGBLOODBOILEVENT: return m_auiEncounter[4]; - case DATA_RELIQUARYOFSOULSEVENT: return m_auiEncounter[5]; - case DATA_MOTHERSHAHRAZEVENT: return m_auiEncounter[6]; - case DATA_ILLIDARICOUNCILEVENT: return m_auiEncounter[7]; - case DATA_ILLIDANSTORMRAGEEVENT: return m_auiEncounter[8]; - } - - return 0; - } - - std::string GetSaveData() - { - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] - >> m_auiEncounter[3] >> m_auiEncounter[4] >> m_auiEncounter[5] >> m_auiEncounter[6] - >> m_auiEncounter[7] >> m_auiEncounter[8]; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_black_temple(Map* pMap) -{ - return new instance_black_temple(pMap); -} - -void AddSC_instance_black_temple() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_black_temple"; - newscript->GetInstanceData = &GetInstanceData_instance_black_temple; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp deleted file mode 100644 index 1e62083f1f9..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp +++ /dev/null @@ -1,759 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Fathomlord_Karathress -SD%Complete: 70 -SDComment: Cyclone workaround -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "precompiled.h" -#include "def_serpent_shrine.h" -#include "escortAI.h" - -#define SAY_AGGRO -1548021 -#define SAY_GAIN_BLESSING -1548022 -#define SAY_GAIN_ABILITY1 -1548023 -#define SAY_GAIN_ABILITY2 -1548024 -#define SAY_GAIN_ABILITY3 -1548025 -#define SAY_SLAY1 -1548026 -#define SAY_SLAY2 -1548027 -#define SAY_SLAY3 -1548028 -#define SAY_DEATH -1548029 - -//Karathress spells -#define SPELL_CATACLYSMIC_BOLT 38441 -#define SPELL_POWER_OF_SHARKKIS 38455 -#define SPELL_POWER_OF_TIDALVESS 38452 -#define SPELL_POWER_OF_CARIBDIS 38451 -#define SPELL_ENRAGE 24318 -#define SPELL_SEAR_NOVA 38445 -#define SPELL_BLESSING_OF_THE_TIDES 38449 - -//Sharkkis spells -#define SPELL_LEECHING_THROW 29436 -#define SPELL_THE_BEAST_WITHIN 38373 -#define SPELL_MULTISHOT 38366 -#define SPELL_SUMMON_FATHOM_LURKER 38433 -#define SPELL_SUMMON_FATHOM_SPOREBAT 38431 -#define SPELL_PET_ENRAGE 19574 - -//Tidalvess spells -#define SPELL_FROST_SHOCK 38234 -#define SPELL_SPITFIRE_TOTEM 38236 -#define SPELL_POISON_CLEANSING_TOTEM 38306 -// Spell obsolete -// #define SPELL_POISON_CLEANSING_EFFECT 8167 -#define SPELL_EARTHBIND_TOTEM 38304 -#define SPELL_EARTHBIND_TOTEM_EFFECT 6474 -#define SPELL_WINDFURY_WEAPON 38184 - -//Caribdis Spells -#define SPELL_WATER_BOLT_VOLLEY 38335 -#define SPELL_TIDAL_SURGE 38358 -#define SPELL_TIDAL_SURGE_FREEZE 38357 -#define SPELL_HEAL 38330 -#define SPELL_SUMMON_CYCLONE 38337 -#define SPELL_CYCLONE_CYCLONE 29538 - -//Yells and Quotes -#define SAY_GAIN_BLESSING_OF_TIDES "Your overconfidence will be your undoing! Guards, lend me your strength!" -#define SOUND_GAIN_BLESSING_OF_TIDES 11278 -#define SAY_MISC "Alana be'lendor!" //don't know what use this -#define SOUND_MISC 11283 - -//Summoned Unit GUIDs -#define CREATURE_CYCLONE 22104 -#define CREATURE_FATHOM_SPOREBAT 22120 -#define CREATURE_FATHOM_LURKER 22119 -#define CREATURE_SPITFIRE_TOTEM 22091 -#define CREATURE_EARTHBIND_TOTEM 22486 -#define CREATURE_POISON_CLEANSING_TOTEM 22487 - -//entry and position for Seer Olum -#define SEER_OLUM 22820 -#define OLUM_X 446.78f -#define OLUM_Y -542.76f -#define OLUM_Z -7.54773f -#define OLUM_O 0.401581f - -//Fathom-Lord Karathress AI -struct TRINITY_DLL_DECL boss_fathomlord_karathressAI : public ScriptedAI -{ - boss_fathomlord_karathressAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Advisors[0] = 0; - Advisors[1] = 0; - Advisors[2] = 0; - } - - ScriptedInstance* pInstance; - - uint32 CataclysmicBolt_Timer; - uint32 Enrage_Timer; - uint32 SearNova_Timer; - - bool BlessingOfTides; - - uint64 Advisors[3]; - - void Reset() - { - CataclysmicBolt_Timer = 10000; - Enrage_Timer = 600000; //10 minutes - SearNova_Timer = 20000+rand()%40000; // 20 - 60 seconds - - BlessingOfTides = false; - - - - if (pInstance) - { - uint64 RAdvisors[3]; - RAdvisors[0] = pInstance->GetData64(DATA_SHARKKIS); - RAdvisors[1] = pInstance->GetData64(DATA_TIDALVESS); - RAdvisors[2] = pInstance->GetData64(DATA_CARIBDIS); - //Respawn of the 3 Advisors - Creature* pAdvisor = NULL; - for(int i=0; i<3; ++i) - - if (RAdvisors[i]) - { - pAdvisor = (Unit::GetCreature((*m_creature), RAdvisors[i])); - if (pAdvisor && !pAdvisor->isAlive()) - { - pAdvisor->Respawn(); - pAdvisor->AI()->EnterEvadeMode(); - pAdvisor->GetMotionMaster()->MoveTargetedHome(); - } - } - pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); - } - - - } - - void EventSharkkisDeath() - { - DoScriptText(SAY_GAIN_ABILITY1, m_creature); - DoCast(m_creature, SPELL_POWER_OF_SHARKKIS); - } - - void EventTidalvessDeath() - { - DoScriptText(SAY_GAIN_ABILITY2, m_creature); - DoCast(m_creature, SPELL_POWER_OF_TIDALVESS); - } - - void EventCaribdisDeath() - { - DoScriptText(SAY_GAIN_ABILITY3, m_creature); - DoCast(m_creature, SPELL_POWER_OF_CARIBDIS); - } - - void GetAdvisors() - { - if (!pInstance) - return; - - Advisors[0] = pInstance->GetData64(DATA_SHARKKIS); - Advisors[1] = pInstance->GetData64(DATA_TIDALVESS); - Advisors[2] = pInstance->GetData64(DATA_CARIBDIS); - } - - void StartEvent(Unit *who) - { - if (!pInstance) - return; - - GetAdvisors(); - - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - - pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); - pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit *killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_FATHOMLORDKARATHRESSEVENT, DONE); - - //support for quest 10944 - m_creature->SummonCreature(SEER_OLUM, OLUM_X, OLUM_Y, OLUM_Z, OLUM_O, TEMPSUMMON_TIMED_DESPAWN, 3600000); - } - - void EnterCombat(Unit *who) - { - StartEvent(who); - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); - - if (target) - { - AttackStart(target); - GetAdvisors(); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { - EnterEvadeMode(); - return; - } - - //CataclysmicBolt_Timer - if (CataclysmicBolt_Timer < diff) - { - //select a random unit other than the main tank - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 1); - - //if there aren't other units, cast on the tank - if (!target) - target = m_creature->getVictim(); - - if (target) - DoCast(target, SPELL_CATACLYSMIC_BOLT); - CataclysmicBolt_Timer = 10000; - }else CataclysmicBolt_Timer -= diff; - - //SearNova_Timer - if (SearNova_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SEAR_NOVA); - SearNova_Timer = 20000+rand()%40000; - }else SearNova_Timer -= diff; - - //Enrage_Timer - if (Enrage_Timer < diff) - { - DoCast(m_creature, SPELL_ENRAGE); - Enrage_Timer = 90000; - }else Enrage_Timer -= diff; - - //Blessing of Tides Trigger - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 75 && !BlessingOfTides) - { - BlessingOfTides = true; - bool continueTriggering; - Creature* Advisor; - for(uint8 i = 0; i < 4; ++i) - if (Advisors[i]) - { - Advisor = (Unit::GetCreature(*m_creature, Advisors[i])); - if (Advisor) - { - if (Advisor->isAlive()) - { - continueTriggering = true; - break; - } - } - } - if (continueTriggering) - { - DoCast(m_creature, SPELL_BLESSING_OF_THE_TIDES); - m_creature->MonsterYell(SAY_GAIN_BLESSING_OF_TIDES, LANG_UNIVERSAL, NULL); - DoPlaySoundToSet(m_creature, SOUND_GAIN_BLESSING_OF_TIDES); - } - } - - DoMeleeAttackIfReady(); - } -}; - -//Fathom-Guard Sharkkis AI -struct TRINITY_DLL_DECL boss_fathomguard_sharkkisAI : public ScriptedAI -{ - boss_fathomguard_sharkkisAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 LeechingThrow_Timer; - uint32 TheBeastWithin_Timer; - uint32 Multishot_Timer; - uint32 Pet_Timer; - - bool pet; - - uint64 SummonedPet; - - - void Reset() - { - LeechingThrow_Timer = 20000; - TheBeastWithin_Timer = 30000; - Multishot_Timer = 15000; - Pet_Timer = 10000; - - pet = false; - - Creature *Pet = Unit::GetCreature(*m_creature, SummonedPet); - if (Pet && Pet->isAlive()) - { - Pet->DealDamage(Pet, Pet->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - - SummonedPet = 0; - - if (pInstance) - pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); - } - - void JustDied(Unit *victim) - { - if (pInstance) - { - Creature *Karathress = NULL; - Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); - - if (Karathress) - CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath(); - CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventSharkkisDeath(); - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); - pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); - - if (target) - { - AttackStart(target); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { - EnterEvadeMode(); - return; - } - - //LeechingThrow_Timer - if (LeechingThrow_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_LEECHING_THROW); - LeechingThrow_Timer = 20000; - }else LeechingThrow_Timer -= diff; - - //Multishot_Timer - if (Multishot_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_MULTISHOT); - Multishot_Timer = 20000; - }else Multishot_Timer -= diff; - - //TheBeastWithin_Timer - if (TheBeastWithin_Timer < diff) - { - DoCast(m_creature, SPELL_THE_BEAST_WITHIN); - Creature *Pet = Unit::GetCreature(*m_creature, SummonedPet); - if (Pet && Pet->isAlive()) - { - Pet->CastSpell(Pet, SPELL_PET_ENRAGE, true); - } - TheBeastWithin_Timer = 30000; - }else TheBeastWithin_Timer -= diff; - - //Pet_Timer - if (Pet_Timer < diff && pet == false) - { - pet = true; - //uint32 spell_id; - uint32 pet_id; - switch(rand()%2) - { - case 0: - //spell_id = SPELL_SUMMON_FATHOM_LURKER; - pet_id = CREATURE_FATHOM_LURKER; - break; - case 1: - //spell_id = SPELL_SUMMON_FATHOM_SPOREBAT; - pet_id = CREATURE_FATHOM_SPOREBAT; - break; - } - //DoCast(m_creature, spell_id, true); - Creature *Pet = DoSpawnCreature(pet_id,0,0,0,0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 15000); - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (Pet && target) - { - Pet->AI()->AttackStart(target); - SummonedPet = Pet->GetGUID(); - } - }else Pet_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Fathom-Guard Tidalvess AI -struct TRINITY_DLL_DECL boss_fathomguard_tidalvessAI : public ScriptedAI -{ - boss_fathomguard_tidalvessAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 FrostShock_Timer; - uint32 Spitfire_Timer; - uint32 PoisonCleansing_Timer; - uint32 Earthbind_Timer; - - void Reset() - { - FrostShock_Timer = 25000; - Spitfire_Timer = 60000; - PoisonCleansing_Timer = 30000; - Earthbind_Timer = 45000; - - if (pInstance) - pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); - } - - void JustDied(Unit *victim) - { - if (pInstance) - { - Creature *Karathress = NULL; - Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); - - if (Karathress) - if (!m_creature->isAlive() && Karathress) - CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventTidalvessDeath(); - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); - pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); - } - DoCast(m_creature, SPELL_WINDFURY_WEAPON); - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); - - if (target) - { - AttackStart(target); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { - EnterEvadeMode(); - return; - } - - if (!m_creature->HasAura(SPELL_WINDFURY_WEAPON)) - { - DoCast(m_creature, SPELL_WINDFURY_WEAPON); - } - - //FrostShock_Timer - if (FrostShock_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FROST_SHOCK); - FrostShock_Timer = 25000+rand()%5000; - }else FrostShock_Timer -= diff; - - //Spitfire_Timer - if (Spitfire_Timer < diff) - { - DoCast(m_creature, SPELL_SPITFIRE_TOTEM); - Unit *SpitfireTotem = Unit::GetUnit(*m_creature, CREATURE_SPITFIRE_TOTEM); - if (SpitfireTotem) - { - CAST_CRE(SpitfireTotem)->AI()->AttackStart(m_creature->getVictim()); - } - Spitfire_Timer = 60000; - }else Spitfire_Timer -= diff; - - //PoisonCleansing_Timer - if (PoisonCleansing_Timer < diff) - { - DoCast(m_creature, SPELL_POISON_CLEANSING_TOTEM); - PoisonCleansing_Timer = 30000; - }else PoisonCleansing_Timer -= diff; - - //Earthbind_Timer - if (Earthbind_Timer < diff) - { - DoCast(m_creature, SPELL_EARTHBIND_TOTEM); - Earthbind_Timer = 45000; - }else Earthbind_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Fathom-Guard Caribdis AI -struct TRINITY_DLL_DECL boss_fathomguard_caribdisAI : public ScriptedAI -{ - boss_fathomguard_caribdisAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 WaterBoltVolley_Timer; - uint32 TidalSurge_Timer; - uint32 Heal_Timer; - uint32 Cyclone_Timer; - - void Reset() - { - WaterBoltVolley_Timer = 35000; - TidalSurge_Timer = 15000+rand()%5000; - Heal_Timer = 55000; - Cyclone_Timer = 30000+rand()%10000; - - if (pInstance) - pInstance->SetData(DATA_KARATHRESSEVENT, NOT_STARTED); - } - - void JustDied(Unit *victim) - { - if (pInstance) - { - Creature *Karathress = NULL; - Karathress = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_KARATHRESS))); - - if (Karathress) - if (!m_creature->isAlive() && Karathress) - CAST_AI(boss_fathomlord_karathressAI, Karathress->AI())->EventCaribdisDeath(); - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_KARATHRESSEVENT_STARTER, who->GetGUID()); - pInstance->SetData(DATA_KARATHRESSEVENT, IN_PROGRESS); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_KARATHRESSEVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESSEVENT_STARTER)); - - if (target) - { - AttackStart(target); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_KARATHRESSEVENT)) - { - EnterEvadeMode(); - return; - } - - //WaterBoltVolley_Timer - if (WaterBoltVolley_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_WATER_BOLT_VOLLEY); - WaterBoltVolley_Timer = 30000; - }else WaterBoltVolley_Timer -= diff; - - //TidalSurge_Timer - if (TidalSurge_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_TIDAL_SURGE); - // Hacky way to do it - won't trigger elseways - m_creature->getVictim()->CastSpell(m_creature->getVictim(), SPELL_TIDAL_SURGE_FREEZE, true); - TidalSurge_Timer = 15000+rand()%5000; - }else TidalSurge_Timer -= diff; - - //Cyclone_Timer - if (Cyclone_Timer < diff) - { - //DoCast(m_creature, SPELL_SUMMON_CYCLONE); // Doesn't work - Cyclone_Timer = 30000+rand()%10000; - Creature *Cyclone = m_creature->SummonCreature(CREATURE_CYCLONE, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 15000); - if (Cyclone) - { - CAST_CRE(Cyclone)->SetFloatValue(OBJECT_FIELD_SCALE_X, 3.0f); - Cyclone->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Cyclone->setFaction(m_creature->getFaction()); - Cyclone->CastSpell(Cyclone, SPELL_CYCLONE_CYCLONE, true); - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - { - Cyclone->AI()->AttackStart(target); - } - } - }else Cyclone_Timer -= diff; - - //Heal_Timer - if (Heal_Timer < diff) - { - // It can be cast on any of the mobs - Unit *pUnit = NULL; - - while(pUnit == NULL || !pUnit->isAlive()) - { - pUnit = selectAdvisorUnit(); - } - - if (pUnit && pUnit->isAlive()) - DoCast(pUnit, SPELL_HEAL); - Heal_Timer = 60000; - }else Heal_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - Unit* selectAdvisorUnit() - { - Unit* pUnit = NULL; - if (pInstance) - { - switch(rand()%4) - { - case 0: - pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_KARATHRESS)); - break; - case 1: - pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_SHARKKIS)); - break; - case 2: - pUnit = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_TIDALVESS)); - break; - case 3: - pUnit = m_creature; - break; - } - }else pUnit = m_creature; - - return pUnit; - } -}; - -CreatureAI* GetAI_boss_fathomlord_karathress(Creature* pCreature) -{ - return new boss_fathomlord_karathressAI (pCreature); -} - -CreatureAI* GetAI_boss_fathomguard_sharkkis(Creature* pCreature) -{ - return new boss_fathomguard_sharkkisAI (pCreature); -} - -CreatureAI* GetAI_boss_fathomguard_tidalvess(Creature* pCreature) -{ - return new boss_fathomguard_tidalvessAI (pCreature); -} - -CreatureAI* GetAI_boss_fathomguard_caribdis(Creature* pCreature) -{ - return new boss_fathomguard_caribdisAI (pCreature); -} - -void AddSC_boss_fathomlord_karathress() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_fathomlord_karathress"; - newscript->GetAI = &GetAI_boss_fathomlord_karathress; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_fathomguard_sharkkis"; - newscript->GetAI = &GetAI_boss_fathomguard_sharkkis; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_fathomguard_tidalvess"; - newscript->GetAI = &GetAI_boss_fathomguard_tidalvess; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_fathomguard_caribdis"; - newscript->GetAI = &GetAI_boss_fathomguard_caribdis; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp deleted file mode 100644 index 434e088cd99..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_hydross_the_unstable.cpp +++ /dev/null @@ -1,386 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Hydross_The_Unstable -SD%Complete: 90 -SDComment: Some details and adjustments left to do, probably nothing major. Spawns may be spawned in different way/location. -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "precompiled.h" -#include "def_serpent_shrine.h" - -#define SAY_AGGRO -1548000 -#define SAY_SWITCH_TO_CLEAN -1548001 -#define SAY_CLEAN_SLAY1 -1548002 -#define SAY_CLEAN_SLAY2 -1548003 -#define SAY_CLEAN_DEATH -1548004 -#define SAY_SWITCH_TO_CORRUPT -1548005 -#define SAY_CORRUPT_SLAY1 -1548006 -#define SAY_CORRUPT_SLAY2 -1548007 -#define SAY_CORRUPT_DEATH -1548008 - -#define SWITCH_RADIUS 18 - -#define MODEL_CORRUPT 20609 -#define MODEL_CLEAN 20162 - -#define SPELL_WATER_TOMB 38235 -#define SPELL_MARK_OF_HYDROSS1 38215 -#define SPELL_MARK_OF_HYDROSS2 38216 -#define SPELL_MARK_OF_HYDROSS3 38217 -#define SPELL_MARK_OF_HYDROSS4 38218 -#define SPELL_MARK_OF_HYDROSS5 38231 -#define SPELL_MARK_OF_HYDROSS6 40584 -#define SPELL_MARK_OF_CORRUPTION1 38219 -#define SPELL_MARK_OF_CORRUPTION2 38220 -#define SPELL_MARK_OF_CORRUPTION3 38221 -#define SPELL_MARK_OF_CORRUPTION4 38222 -#define SPELL_MARK_OF_CORRUPTION5 38230 -#define SPELL_MARK_OF_CORRUPTION6 40583 -#define SPELL_VILE_SLUDGE 38246 -#define SPELL_ENRAGE 27680 //this spell need verification -#define SPELL_SUMMON_WATER_ELEMENT 36459 //not in use yet(in use ever?) -#define SPELL_ELEMENTAL_SPAWNIN 25035 -#define SPELL_BLUE_BEAM 40227 //channeled Hydross Beam Helper (not in use yet) - -#define ENTRY_PURE_SPAWN 22035 -#define ENTRY_TAINTED_SPAWN 22036 -#define ENTRY_BEAM_DUMMY 21934 - -#define HYDROSS_X -239.439 -#define HYDROSS_Y -363.481 - -#define SPAWN_X_DIFF1 6.934003 -#define SPAWN_Y_DIFF1 -11.255012 -#define SPAWN_X_DIFF2 -6.934003 -#define SPAWN_Y_DIFF2 11.255012 -#define SPAWN_X_DIFF3 -12.577011 -#define SPAWN_Y_DIFF3 -4.72702 -#define SPAWN_X_DIFF4 12.577011 -#define SPAWN_Y_DIFF4 4.72702 - -struct TRINITY_DLL_DECL boss_hydross_the_unstableAI : public ScriptedAI -{ - boss_hydross_the_unstableAI(Creature *c) : ScriptedAI(c), Summons(m_creature) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - uint64 beams[2]; - uint32 PosCheck_Timer; - uint32 MarkOfHydross_Timer; - uint32 MarkOfCorruption_Timer; - uint32 WaterTomb_Timer; - uint32 VileSludge_Timer; - uint32 MarkOfHydross_Count; - uint32 MarkOfCorruption_Count; - uint32 EnrageTimer; - bool CorruptedForm; - bool beam; - SummonList Summons; - - void Reset() - { - DeSummonBeams(); - beams[0] = 0; - beams[1] = 0; - PosCheck_Timer = 2500; - MarkOfHydross_Timer = 15000; - MarkOfCorruption_Timer = 15000; - WaterTomb_Timer = 7000; - VileSludge_Timer = 7000; - MarkOfHydross_Count = 0; - MarkOfCorruption_Count = 0; - EnrageTimer = 600000; - - CorruptedForm = false; - m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - - m_creature->SetDisplayId(MODEL_CLEAN); - - if (pInstance) - pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, NOT_STARTED); - beam = false; - Summons.DespawnAll(); - } - - void SummonBeams() - { - Creature* beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-258.333,-356.34,22.0499,5.90835,TEMPSUMMON_CORPSE_DESPAWN,0); - if (beamer) - { - beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true); - beamer->SetDisplayId(11686); //invisible - beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - beams[0]=beamer->GetGUID(); - } - beamer = beamer = m_creature->SummonCreature(ENTRY_BEAM_DUMMY,-219.918,-371.308,22.0042,2.73072,TEMPSUMMON_CORPSE_DESPAWN,0); - if (beamer) - { - beamer->CastSpell(m_creature,SPELL_BLUE_BEAM,true); - beamer->SetDisplayId(11686); //invisible - beamer->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - beams[1]=beamer->GetGUID(); - } - } - void DeSummonBeams() - { - for(uint8 i=0;i<2; ++i) - { - Creature* mob = Unit::GetCreature(*m_creature,beams[i]); - if (mob) - { - mob->setDeathState(DEAD); - mob->RemoveCorpse(); - } - } - } - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, IN_PROGRESS); - } - - void KilledUnit(Unit *victim) - { - if (CorruptedForm) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_CORRUPT_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_CORRUPT_SLAY2, m_creature); break; - } - } - else - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_CLEAN_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_CLEAN_SLAY2, m_creature); break; - } - } - } - - void JustSummoned(Creature* summoned) - { - if (summoned->GetEntry() == ENTRY_PURE_SPAWN) - { - summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); - Summons.Summon(summoned); - } - if (summoned->GetEntry() == ENTRY_TAINTED_SPAWN) - { - summoned->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); - summoned->CastSpell(summoned,SPELL_ELEMENTAL_SPAWNIN,true); - Summons.Summon(summoned); - } - } - - void SummonedCreatureDespawn(Creature *summon) - { - Summons.Despawn(summon); - } - - void JustDied(Unit *victim) - { - if (CorruptedForm) - DoScriptText(SAY_CORRUPT_DEATH, m_creature); - else - DoScriptText(SAY_CLEAN_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_HYDROSSTHEUNSTABLEEVENT, DONE); - Summons.DespawnAll(); - } - - void UpdateAI(const uint32 diff) - { - if (!beam) - { - SummonBeams(); - beam=true; - } - //Return since we have no target - if (!UpdateVictim()) - return; - - // corrupted form - if (CorruptedForm) - { - //MarkOfCorruption_Timer - if (MarkOfCorruption_Timer < diff) - { - if (MarkOfCorruption_Count <= 5) - { - uint32 mark_spell; - - switch(MarkOfCorruption_Count) - { - case 0: mark_spell = SPELL_MARK_OF_CORRUPTION1; break; - case 1: mark_spell = SPELL_MARK_OF_CORRUPTION2; break; - case 2: mark_spell = SPELL_MARK_OF_CORRUPTION3; break; - case 3: mark_spell = SPELL_MARK_OF_CORRUPTION4; break; - case 4: mark_spell = SPELL_MARK_OF_CORRUPTION5; break; - case 5: mark_spell = SPELL_MARK_OF_CORRUPTION6; break; - } - - DoCast(m_creature->getVictim(), mark_spell); - - if (MarkOfCorruption_Count < 5) - MarkOfCorruption_Count++; - } - - MarkOfCorruption_Timer = 15000; - }else MarkOfCorruption_Timer -= diff; - - //VileSludge_Timer - if (VileSludge_Timer < diff) - { - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - DoCast(target, SPELL_VILE_SLUDGE); - - VileSludge_Timer = 15000; - }else VileSludge_Timer -= diff; - - //PosCheck_Timer - if (PosCheck_Timer < diff) - { - if (m_creature->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS)) - { - // switch to clean form - m_creature->SetDisplayId(MODEL_CLEAN); - CorruptedForm = false; - MarkOfHydross_Count = 0; - - DoScriptText(SAY_SWITCH_TO_CLEAN, m_creature); - DoResetThreat(); - SummonBeams(); - - // spawn 4 adds - DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_PURE_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - - m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_FROST); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - } - - PosCheck_Timer = 2500; - }else PosCheck_Timer -=diff; - } - // clean form - else - { - //MarkOfHydross_Timer - if (MarkOfHydross_Timer < diff) - { - if (MarkOfHydross_Count <= 5) - { - uint32 mark_spell; - - switch(MarkOfHydross_Count) - { - case 0: mark_spell = SPELL_MARK_OF_HYDROSS1; break; - case 1: mark_spell = SPELL_MARK_OF_HYDROSS2; break; - case 2: mark_spell = SPELL_MARK_OF_HYDROSS3; break; - case 3: mark_spell = SPELL_MARK_OF_HYDROSS4; break; - case 4: mark_spell = SPELL_MARK_OF_HYDROSS5; break; - case 5: mark_spell = SPELL_MARK_OF_HYDROSS6; break; - } - - DoCast(m_creature->getVictim(), mark_spell); - - if (MarkOfHydross_Count < 5) - MarkOfHydross_Count++; - } - - MarkOfHydross_Timer = 15000; - }else MarkOfHydross_Timer -= diff; - - //WaterTomb_Timer - if (WaterTomb_Timer < diff) - { - Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 100, true); - if (target) - DoCast(target, SPELL_WATER_TOMB); - - WaterTomb_Timer = 7000; - }else WaterTomb_Timer -= diff; - - //PosCheck_Timer - if (PosCheck_Timer < diff) - { - if (!m_creature->IsWithinDist2d(HYDROSS_X, HYDROSS_Y, SWITCH_RADIUS)) - { - // switch to corrupted form - m_creature->SetDisplayId(MODEL_CORRUPT); - MarkOfCorruption_Count = 0; - CorruptedForm = true; - - DoScriptText(SAY_SWITCH_TO_CORRUPT, m_creature); - DoResetThreat(); - DeSummonBeams(); - - // spawn 4 adds - DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF1, SPAWN_Y_DIFF1, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF2, SPAWN_Y_DIFF2, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF3, SPAWN_Y_DIFF3, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - DoSpawnCreature(ENTRY_TAINTED_SPAWN, SPAWN_X_DIFF4, SPAWN_Y_DIFF4, 3, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - - m_creature->SetMeleeDamageSchool(SPELL_SCHOOL_NATURE); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - } - - PosCheck_Timer = 2500; - }else PosCheck_Timer -=diff; - } - - //EnrageTimer - if (EnrageTimer < diff) - { - DoCast(m_creature, SPELL_ENRAGE); - EnrageTimer = 60000; - }else EnrageTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_hydross_the_unstable(Creature* pCreature) -{ - return new boss_hydross_the_unstableAI (pCreature); -} - -void AddSC_boss_hydross_the_unstable() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_hydross_the_unstable"; - newscript->GetAI = &GetAI_boss_hydross_the_unstable; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp deleted file mode 100644 index c1a2280653c..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lady_vashj.cpp +++ /dev/null @@ -1,1066 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA02111-1307USA - */ - -/* ScriptData -SDName: Boss_Lady_Vashj -SD%Complete: 99 -SDComment: Missing blizzlike Shield Generators coords -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "precompiled.h" -#include "def_serpent_shrine.h" -#include "simple_ai.h" -#include "Spell.h" - -#define SAY_INTRO -1548042 -#define SAY_AGGRO1 -1548043 -#define SAY_AGGRO2 -1548044 -#define SAY_AGGRO3 -1548045 -#define SAY_AGGRO4 -1548046 -#define SAY_PHASE1 -1548047 -#define SAY_PHASE2 -1548048 -#define SAY_PHASE3 -1548049 -#define SAY_BOWSHOT1 -1548050 -#define SAY_BOWSHOT2 -1548051 -#define SAY_SLAY1 -1548052 -#define SAY_SLAY2 -1548053 -#define SAY_SLAY3 -1548054 -#define SAY_DEATH -1548055 - -#define SPELL_SURGE 38044 -#define SPELL_MULTI_SHOT 38310 -#define SPELL_SHOCK_BLAST 38509 -#define SPELL_ENTANGLE 38316 -#define SPELL_STATIC_CHARGE_TRIGGER 38280 -#define SPELL_FORKED_LIGHTNING 40088 -#define SPELL_SHOOT 40873 -#define SPELL_POISON_BOLT 40095 -#define SPELL_TOXIC_SPORES 38575 -#define SPELL_MAGIC_BARRIER 38112 - -#define MIDDLE_X 30.134 -#define MIDDLE_Y -923.65 -#define MIDDLE_Z 42.9 - -#define SPOREBAT_X 30.977156 -#define SPOREBAT_Y -925.297761 -#define SPOREBAT_Z 77.176567 -#define SPOREBAT_O 5.223932 - -#define SHIED_GENERATOR_CHANNEL 19870 -#define ENCHANTED_ELEMENTAL 21958 -#define TAINTED_ELEMENTAL 22009 -#define COILFANG_STRIDER 22056 -#define COILFANG_ELITE 22055 -#define TOXIC_SPOREBAT 22140 -#define TOXIC_SPORES_TRIGGER 22207 - -float ElementPos[8][4] = -{ - {8.3, -835.3, 21.9, 5}, - {53.4, -835.3, 21.9, 4.5}, - {96, -861.9, 21.8, 4}, - {96, -986.4, 21.4, 2.5}, - {54.4, -1010.6, 22, 1.8}, - {9.8, -1012, 21.7, 1.4}, - {-35, -987.6, 21.5, 0.8}, - {-58.9, -901.6, 21.5, 6} -}; - -float ElementWPPos[8][3] = -{ - {71.700752, -883.905884, 41.097168}, - {45.039848, -868.022827, 41.097015}, - {14.585141, -867.894470, 41.097061}, - {-25.415508, -906.737732, 41.097061}, - {-11.801594, -963.405884, 41.097067}, - {14.556657, -979.051514, 41.097137}, - {43.466549, -979.406677, 41.097027}, - {69.945908, -964.663940, 41.097054} -}; - -float SporebatWPPos[8][3] = -{ - {31.6,-896.3,59.1}, - {9.1, -913.9, 56}, - {5.2, -934.4, 52.4}, - {20.7, -946.9, 49.7}, - {41, -941.9, 51}, - {47.7, -927.3, 55}, - {42.2, -912.4, 51.7}, - {27, -905.9, 50} -}; - -float CoilfangElitePos[3][4] = -{ - {28.84, -923.28, 42.9, 6}, - {31.183281, -953.502625, 41.523602, 1.640957}, - {58.895180, -923.124268, 41.545307, 3.152848} -}; - -float CoilfangStriderPos[3][4] = -{ - {66.427010, -948.778503, 41.262245, 2.584220}, - {7.513962, -959.538208, 41.300422, 1.034629}, - {-12.843201, -907.798401, 41.239620, 6.087094} -}; - -float ShieldGeneratorChannelPos[4][4] = -{ - {49.6262, -902.181, 43.0975, 3.95683}, - {10.988, -901.616, 42.5371, 5.4373}, - {10.3859, -944.036, 42.5446, 0.779888}, - {49.3126, -943.398, 42.5501, 2.40174} -}; - -//Lady Vashj AI -struct TRINITY_DLL_DECL boss_lady_vashjAI : public ScriptedAI -{ - boss_lady_vashjAI (Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Intro = false; - JustCreated = true; - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); //set it only once on Creature create (no need do intro if wiped) - } - - ScriptedInstance *pInstance; - - uint64 ShieldGeneratorChannel[4]; - - uint32 AggroTimer; - uint32 ShockBlast_Timer; - uint32 Entangle_Timer; - uint32 StaticCharge_Timer; - uint32 ForkedLightning_Timer; - uint32 Check_Timer; - uint32 EnchantedElemental_Timer; - uint32 TaintedElemental_Timer; - uint32 CoilfangElite_Timer; - uint32 CoilfangStrider_Timer; - uint32 SummonSporebat_Timer; - uint32 SummonSporebat_StaticTimer; - uint8 EnchantedElemental_Pos; - uint8 Phase; - - bool Entangle; - bool Intro; - bool CanAttack; - bool JustCreated; - - void Reset() - { - AggroTimer = 19000; - ShockBlast_Timer = 1+rand()%60000; - Entangle_Timer = 30000; - StaticCharge_Timer = 10000+rand()%15000; - ForkedLightning_Timer = 2000; - Check_Timer = 15000; - EnchantedElemental_Timer = 5000; - TaintedElemental_Timer = 50000; - CoilfangElite_Timer = 45000+rand()%5000; - CoilfangStrider_Timer = 60000+rand()%10000; - SummonSporebat_Timer = 10000; - SummonSporebat_StaticTimer = 30000; - EnchantedElemental_Pos = 0; - Phase = 0; - - Entangle = false; - if (JustCreated) - { - CanAttack = false; - JustCreated = false; - }else CanAttack = true; - - Unit *remo; - for(uint8 i = 0; i < 4; ++i) - { - remo = Unit::GetUnit(*m_creature, ShieldGeneratorChannel[i]); - if (remo) - remo->setDeathState(JUST_DIED); - } - - if (pInstance) - pInstance->SetData(DATA_LADYVASHJEVENT, NOT_STARTED); - ShieldGeneratorChannel[0] = 0; - ShieldGeneratorChannel[1] = 0; - ShieldGeneratorChannel[2] = 0; - ShieldGeneratorChannel[3] = 0; - - m_creature->SetCorpseDelay(1000*60*60); - } - - //Called when a tainted elemental dies - void EventTaintedElementalDeath() - { - //the next will spawn 50 seconds after the previous one's death - if (TaintedElemental_Timer > 50000) - TaintedElemental_Timer = 50000; - } - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_LADYVASHJEVENT, DONE); - } - - void StartEvent() - { - switch(rand()%4) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - case 3: DoScriptText(SAY_AGGRO4, m_creature); break; - } - - Phase = 1; - - if (pInstance) - pInstance->SetData(DATA_LADYVASHJEVENT, IN_PROGRESS); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - //remove old tainted cores to prevent cheating in phase 2 - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin();i != PlayerList.end(); ++i) - { - if (Player* i_pl = i->getSource()) - { - i_pl->DestroyItemCount(31088, 1, true); - } - } - } - StartEvent();//this is EnterCombat(), so were are 100% in combat, start the event - - if (Phase != 2) - AttackStart(who); - } - - void MoveInLineOfSight(Unit *who) - { - if (!Intro) - { - Intro = true; - DoScriptText(SAY_INTRO, m_creature); - } - if (!CanAttack) - return; - if (!who || m_creature->getVictim()) - return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->GetDistanceZ(who) <= CREATURE_Z_ATTACK_RANGE && m_creature->IsWithinLOSInMap(who)) - { - //if (who->HasStealthAura()) - // who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - - if (!m_creature->isInCombat())//AttackStart() sets UNIT_FLAG_IN_COMBAT, so this msut be before attacking - StartEvent(); - - if (Phase != 2) - AttackStart(who); - } - } - } - - void CastShootOrMultishot() - { - switch(rand()%2) - { - case 0: - //Shoot - //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits her target for 4097-5543 Physical damage. - DoCast(m_creature->getVictim(), SPELL_SHOOT); - break; - case 1: - //Multishot - //Used in Phases 1 and 3 after Entangle or while having nobody in melee range. A shot that hits 1 person and 4 people around him for 6475-7525 physical damage. - DoCast(m_creature->getVictim(), SPELL_MULTI_SHOT); - break; - } - if (rand()%3) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_BOWSHOT1, m_creature); break; - case 1: DoScriptText(SAY_BOWSHOT2, m_creature); break; - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!CanAttack && Intro) - { - if (AggroTimer < diff) - { - CanAttack = true; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - AggroTimer=19000; - }else - { - AggroTimer-=diff; - return; - } - } - //to prevent abuses during phase 2 - if (Phase == 2 && !m_creature->getVictim() && m_creature->isInCombat()) - { - EnterEvadeMode(); - return; - } - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Phase == 1 || Phase == 3) - { - //ShockBlast_Timer - if (ShockBlast_Timer < diff) - { - //Shock Burst - //Randomly used in Phases 1 and 3 on Vashj's target, it's a Shock spell doing 8325-9675 nature damage and stunning the target for 5 seconds, during which she will not attack her target but switch to the next person on the aggro list. - DoCast(m_creature->getVictim(), SPELL_SHOCK_BLAST); - m_creature->TauntApply(m_creature->getVictim()); - - ShockBlast_Timer = 1000+rand()%14000; //random cooldown - }else ShockBlast_Timer -= diff; - - //StaticCharge_Timer - if (StaticCharge_Timer < diff) - { - //Static Charge - //Used on random people (only 1 person at any given time) in Phases 1 and 3, it's a debuff doing 2775 to 3225 Nature damage to the target and everybody in about 5 yards around it, every 1 seconds for 30 seconds. It can be removed by Cloak of Shadows, Iceblock, Divine Shield, etc, but not by Cleanse or Dispel Magic. - Unit *target = NULL; - target = SelectTarget(SELECT_TARGET_RANDOM, 0, 200, true); - - if (target && !target->HasAura(SPELL_STATIC_CHARGE_TRIGGER)) - //cast Static Charge every 2 seconds for 20 seconds - DoCast(target, SPELL_STATIC_CHARGE_TRIGGER); - - StaticCharge_Timer = 10000+rand()%20000; //blizzlike - }else StaticCharge_Timer -= diff; - - //Entangle_Timer - if (Entangle_Timer < diff) - { - if (!Entangle) - { - //Entangle - //Used in Phases 1 and 3, it casts Entangling Roots on everybody in a 15 yard radius of Vashj, immobilzing them for 10 seconds and dealing 500 damage every 2 seconds. It's not a magic effect so it cannot be dispelled, but is removed by various buffs such as Cloak of Shadows or Blessing of Freedom. - DoCast(m_creature->getVictim(), SPELL_ENTANGLE); - Entangle = true; - Entangle_Timer = 10000; - } - else - { - CastShootOrMultishot(); - Entangle = false; - Entangle_Timer = 20000+rand()%5000; - } - }else Entangle_Timer -= diff; - - //Phase 1 - if (Phase == 1) - { - //Start phase 2 - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 70) - { - //Phase 2 begins when Vashj hits 70%. She will run to the middle of her platform and surround herself in a shield making her invulerable. - Phase = 2; - - m_creature->GetMotionMaster()->Clear(); - DoTeleportTo(MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - - Creature *pCreature; - for(uint8 i = 0; i < 4; ++i) - { - pCreature = m_creature->SummonCreature(SHIED_GENERATOR_CHANNEL, ShieldGeneratorChannelPos[i][0], ShieldGeneratorChannelPos[i][1], ShieldGeneratorChannelPos[i][2], ShieldGeneratorChannelPos[i][3], TEMPSUMMON_CORPSE_DESPAWN, 0); - if (pCreature) - ShieldGeneratorChannel[i] = pCreature->GetGUID(); - } - DoScriptText(SAY_PHASE2, m_creature); - } - } - //Phase 3 - else - { - //SummonSporebat_Timer - if (SummonSporebat_Timer < diff) - { - Creature *Sporebat = NULL; - Sporebat = m_creature->SummonCreature(TOXIC_SPOREBAT, SPOREBAT_X, SPOREBAT_Y, SPOREBAT_Z, SPOREBAT_O, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (Sporebat) - { - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - Sporebat->AI()->AttackStart(target); - } - - //summon sporebats faster and faster - if (SummonSporebat_StaticTimer > 1000) - SummonSporebat_StaticTimer -= 1000; - - SummonSporebat_Timer = SummonSporebat_StaticTimer; - - if (SummonSporebat_Timer < 5000) - SummonSporebat_Timer = 5000; - - }else SummonSporebat_Timer -= diff; - } - - //Melee attack - DoMeleeAttackIfReady(); - - //Check_Timer - used to check if somebody is in melee range - if (Check_Timer < diff) - { - bool InMeleeRange = false; - Unit *target; - std::list t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - //if in melee range - if (target && target->IsWithinDistInMap(m_creature, 5)) - { - InMeleeRange = true; - break; - } - } - - //if nobody is in melee range - if (!InMeleeRange) - CastShootOrMultishot(); - - Check_Timer = 5000; - }else Check_Timer -= diff; - } - //Phase 2 - else - { - //ForkedLightning_Timer - if (ForkedLightning_Timer < diff) - { - //Forked Lightning - //Used constantly in Phase 2, it shoots out completely randomly targeted bolts of lightning which hit everybody in a roughtly 60 degree cone in front of Vashj for 2313-2687 nature damage. - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (!target) - target = m_creature->getVictim(); - - DoCast(target, SPELL_FORKED_LIGHTNING); - - ForkedLightning_Timer = 2000+rand()%6000; //blizzlike - }else ForkedLightning_Timer -= diff; - - //EnchantedElemental_Timer - if (EnchantedElemental_Timer < diff) - { - Creature *Elemental; - Elemental = m_creature->SummonCreature(ENCHANTED_ELEMENTAL, ElementPos[EnchantedElemental_Pos][0], ElementPos[EnchantedElemental_Pos][1], ElementPos[EnchantedElemental_Pos][2], ElementPos[EnchantedElemental_Pos][3], TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (EnchantedElemental_Pos == 7) - EnchantedElemental_Pos = 0; - else - EnchantedElemental_Pos++; - - EnchantedElemental_Timer = 10000+rand()%5000; - }else EnchantedElemental_Timer -= diff; - - //TaintedElemental_Timer - if (TaintedElemental_Timer < diff) - { - Creature *Tain_Elemental; - uint32 pos = rand()%8; - Tain_Elemental = m_creature->SummonCreature(TAINTED_ELEMENTAL, ElementPos[pos][0], ElementPos[pos][1], ElementPos[pos][2], ElementPos[pos][3], TEMPSUMMON_DEAD_DESPAWN, 0); - - TaintedElemental_Timer = 120000; - }else TaintedElemental_Timer -= diff; - - //CoilfangElite_Timer - if (CoilfangElite_Timer < diff) - { - uint32 pos = rand()%3; - Creature* CoilfangElite = NULL; - CoilfangElite = m_creature->SummonCreature(COILFANG_ELITE, CoilfangElitePos[pos][0], CoilfangElitePos[pos][1], CoilfangElitePos[pos][2], CoilfangElitePos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (CoilfangElite) - { - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - CoilfangElite->AI()->AttackStart(target); - else if (m_creature->getVictim()) - CoilfangElite->AI()->AttackStart(m_creature->getVictim()); - } - CoilfangElite_Timer = 45000+rand()%5000; - }else CoilfangElite_Timer -= diff; - - //CoilfangStrider_Timer - if (CoilfangStrider_Timer < diff) - { - uint32 pos = rand()%3; - Creature* CoilfangStrider = NULL; - CoilfangStrider = m_creature->SummonCreature(COILFANG_STRIDER, CoilfangStriderPos[pos][0], CoilfangStriderPos[pos][1], CoilfangStriderPos[pos][2], CoilfangStriderPos[pos][3], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (CoilfangStrider) - { - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - CoilfangStrider->AI()->AttackStart(target); - else if (m_creature->getVictim()) - CoilfangStrider->AI()->AttackStart(m_creature->getVictim()); - } - CoilfangStrider_Timer = 60000+rand()%10000; - }else CoilfangStrider_Timer -= diff; - - //Check_Timer - if (Check_Timer < diff) - { - //Start Phase 3 - if (pInstance && pInstance->GetData(DATA_CANSTARTPHASE3)) - { - //set life 50% - m_creature->SetHealth(m_creature->GetMaxHealth()/2); - - m_creature->RemoveAurasDueToSpell(SPELL_MAGIC_BARRIER); - - DoScriptText(SAY_PHASE3, m_creature); - - Phase = 3; - - //return to the tank - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - Check_Timer = 1000; - }else Check_Timer -= diff; - } - } -}; - -//Enchanted Elemental -//If one of them reaches Vashj he will increase her damage done by 5%. -struct TRINITY_DLL_DECL mob_enchanted_elementalAI : public ScriptedAI -{ - mob_enchanted_elementalAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - uint32 move; - uint32 phase; - float x, y, z; - Creature *Vashj; - - void Reset() - { - m_creature->SetSpeed(MOVE_WALK,0.6);//walk - m_creature->SetSpeed(MOVE_RUN,0.6);//run - move = 0; - phase = 1; - Vashj = NULL; - - for (int i = 0;i<8; ++i)//search for nearest waypoint (up on stairs) - { - if (!x || !y || !z) - { - x = ElementWPPos[i][0]; - y = ElementWPPos[i][1]; - z = ElementWPPos[i][2]; - } - else - { - if (m_creature->GetDistance(ElementWPPos[i][0],ElementWPPos[i][1],ElementWPPos[i][2]) < m_creature->GetDistance(x,y,z)) - { - x = ElementWPPos[i][0]; - y = ElementWPPos[i][1]; - z = ElementWPPos[i][2]; - } - } - } - if (pInstance) - Vashj = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); - } - - void EnterCombat(Unit *who) { return; } - - void MoveInLineOfSight(Unit *who){return;} - - void UpdateAI(const uint32 diff) - { - if (!pInstance) - return; - - if (!Vashj) - { - return; - } - - if (move < diff) - { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - if (phase == 1) - { - m_creature->GetMotionMaster()->MovePoint(0, x, y, z); - } - if (phase == 1 && m_creature->IsWithinDist3d(x,y,z, 0.1)) - { - phase = 2; - } - if (phase == 2) - { - m_creature->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - phase = 3; - } - if (phase == 3) - { - m_creature->GetMotionMaster()->MovePoint(0, MIDDLE_X, MIDDLE_Y, MIDDLE_Z); - if (m_creature->IsWithinDist3d(MIDDLE_X, MIDDLE_Y, MIDDLE_Z, 3)) - { - SpellEntry *spell = GET_SPELL(SPELL_SURGE); - if (spell) - { - uint8 eff_mask=0; - for (int i=0; i<3; ++i) - { - if (!spell->Effect[i]) - continue; - eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, Vashj, Vashj)); - } - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - if (!Vashj->isInCombat() || CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase != 2 || Vashj->isDead()) - { - //call Unsummon() - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - move = 1000; - }else move -= diff; - } -}; - -//Tainted Elemental -//This mob has 7,900 life, doesn't move, and shoots Poison Bolts at one person anywhere in the area, doing 3,000 nature damage and placing a posion doing 2,000 damage every 2 seconds. He will switch targets often, or sometimes just hang on a single player, but there is nothing you can do about it except heal the damage and kill the Tainted Elemental -struct TRINITY_DLL_DECL mob_tainted_elementalAI : public ScriptedAI -{ - mob_tainted_elementalAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 PoisonBolt_Timer; - uint32 Despawn_Timer; - - void Reset() - { - PoisonBolt_Timer = 5000+rand()%5000; - Despawn_Timer = 30000; - } - - void JustDied(Unit *killer) - { - if (pInstance) - { - Creature *Vashj = NULL; - Vashj = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_LADYVASHJ))); - - if (Vashj) - CAST_AI(boss_lady_vashjAI, Vashj->AI())->EventTaintedElementalDeath(); - } - } - - void EnterCombat(Unit *who) - { - m_creature->AddThreat(who, 0.1f); - } - - void UpdateAI(const uint32 diff) - { - //PoisonBolt_Timer - if (PoisonBolt_Timer < diff) - { - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (target && target->IsWithinDistInMap(m_creature, 30)) - DoCast(target, SPELL_POISON_BOLT); - - PoisonBolt_Timer = 5000+rand()%5000; - }else PoisonBolt_Timer -= diff; - - //Despawn_Timer - if (Despawn_Timer < diff) - { - //call Unsummon() - m_creature->setDeathState(DEAD); - - //to prevent crashes - Despawn_Timer = 1000; - }else Despawn_Timer -= diff; - } -}; - -//Toxic Sporebat -//Toxic Spores: Used in Phase 3 by the Spore Bats, it creates a contaminated green patch of ground, dealing about 2775-3225 nature damage every second to anyone who stands in it. -struct TRINITY_DLL_DECL mob_toxic_sporebatAI : public ScriptedAI -{ - mob_toxic_sporebatAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - EnterEvadeMode(); - } - - ScriptedInstance *pInstance; - - uint32 movement_timer; - uint32 ToxicSpore_Timer; - uint32 bolt_timer; - uint32 Check_Timer; - - void Reset() - { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->setFaction(14); - movement_timer = 0; - ToxicSpore_Timer = 5000; - bolt_timer = 5500; - Check_Timer = 1000; - } - - void EnterCombat(Unit *who) - { - - } - - void MoveInLineOfSight(Unit *who) - { - - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id == 1) - movement_timer = 0; - } - - void UpdateAI (const uint32 diff) - { - //Random movement - if (movement_timer < diff) - { - uint32 rndpos = rand()%8; - m_creature->GetMotionMaster()->MovePoint(1,SporebatWPPos[rndpos][0], SporebatWPPos[rndpos][1], SporebatWPPos[rndpos][2]); - movement_timer = 6000; - }else movement_timer -= diff; - - //toxic spores - if (bolt_timer < diff) - { - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - { - Creature* trig = m_creature->SummonCreature(TOXIC_SPORES_TRIGGER,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,30000); - if (trig) - { - trig->setFaction(14); - trig->CastSpell(trig, SPELL_TOXIC_SPORES,true); - } - } - bolt_timer = 10000+rand()%5000; - } - else bolt_timer -= diff; - - //Check_Timer - if (Check_Timer < diff) - { - if (pInstance) - { - //check if vashj is death - Unit *Vashj = NULL; - Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); - if (!Vashj || (Vashj && !Vashj->isAlive()) || (Vashj && CAST_AI(boss_lady_vashjAI, CAST_CRE(Vashj)->AI())->Phase != 3)) - { - //remove - m_creature->setDeathState(DEAD); - m_creature->RemoveCorpse(); - m_creature->setFaction(35); - } - } - - Check_Timer = 1000; - }else Check_Timer -= diff; - } -}; - -//Coilfang Elite -//It's an elite Naga mob with 170,000 HP. It does about 5000 damage on plate, and has a nasty cleave hitting for about 7500 damage -CreatureAI* GetAI_mob_coilfang_elite(Creature* pCreature) -{ - SimpleAI* ai = new SimpleAI (pCreature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = 31345; //Cleave - ai->Spell[0].Cooldown = 15000; - ai->Spell[0].CooldownRandomAddition = 5000; - ai->Spell[0].First_Cast = 5000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_RANDOM; - - ai->EnterEvadeMode(); - - return ai; -} - -//Coilfang Strider -//It hits plate for about 8000 damage, has a Mind Blast spell doing about 3000 shadow damage, and a Psychic Scream Aura, which fears everybody in a 8 yard range of it every 2-3 seconds , for 5 seconds and increasing their movement speed by 150% during the fear. -CreatureAI* GetAI_mob_coilfang_strider(Creature* pCreature) -{ - SimpleAI* ai = new SimpleAI (pCreature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = 41374; //Mind Blast - ai->Spell[0].Cooldown = 30000; - ai->Spell[0].CooldownRandomAddition = 10000; - ai->Spell[0].First_Cast = 8000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - //Scream aura not implemented - - ai->EnterEvadeMode(); - - return ai; -} - -struct TRINITY_DLL_DECL mob_shield_generator_channelAI : public ScriptedAI -{ - mob_shield_generator_channelAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - uint32 Check_Timer; - bool Casted; - void Reset() - { - Check_Timer = 0; - Casted = false; - m_creature->SetDisplayId(11686); //invisible - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - - void EnterCombat(Unit *who) { return; } - - void MoveInLineOfSight(Unit *who) { return; } - - void UpdateAI (const uint32 diff) - { - if (!pInstance) - return; - - if (Check_Timer < diff) - { - Unit *Vashj = NULL; - Vashj = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_LADYVASHJ)); - - if (Vashj && Vashj->isAlive()) - { - //start visual channel - if (!Casted || !Vashj->HasAura(SPELL_MAGIC_BARRIER)) - { - m_creature->CastSpell(Vashj,SPELL_MAGIC_BARRIER,true); - Casted = true; - } - } - Check_Timer = 1000; - }else Check_Timer -= diff; - } -}; - -bool ItemUse_item_tainted_core(Player* pPlayer, Item* _Item, SpellCastTargets const& targets) -{ - ScriptedInstance *pInstance = (pPlayer->GetInstanceData()) ? (pPlayer->GetInstanceData()) : NULL; - - if (!pInstance) - { - pPlayer->GetSession()->SendNotification("Instance script not initialized"); - return true; - } - - Creature *Vashj = NULL; - Vashj = (Unit::GetCreature((*pPlayer), pInstance->GetData64(DATA_LADYVASHJ))); - if (Vashj && CAST_AI(boss_lady_vashjAI, Vashj->AI())->Phase == 2) - { - if (targets.getGOTarget() && targets.getGOTarget()->GetTypeId()==TYPEID_GAMEOBJECT) - { - uint32 identifier; - uint8 channel_identifier; - switch(targets.getGOTarget()->GetEntry()) - { - case 185052: - identifier = DATA_SHIELDGENERATOR1; - channel_identifier = 0; - break; - case 185053: - identifier = DATA_SHIELDGENERATOR2; - channel_identifier = 1; - break; - case 185051: - identifier = DATA_SHIELDGENERATOR3; - channel_identifier = 2; - break; - case 185054: - identifier = DATA_SHIELDGENERATOR4; - channel_identifier = 3; - break; - default: - return true; - } - - if (pInstance->GetData(identifier)) - { - pPlayer->GetSession()->SendNotification("Already deactivated"); - return true; - } - - //get and remove channel - Unit *Channel = NULL; - Channel = Unit::GetCreature(*Vashj, CAST_AI(boss_lady_vashjAI, Vashj->AI())->ShieldGeneratorChannel[channel_identifier]); - if (Channel) - { - //call Unsummon() - Channel->setDeathState(JUST_DIED); - } - - pInstance->SetData(identifier, 1); - - //remove this item - pPlayer->DestroyItemCount(31088, 1, true); - return true; - } - else if (targets.getUnitTarget()->GetTypeId() == TYPEID_UNIT) - return false; - else if (targets.getUnitTarget()->GetTypeId() == TYPEID_PLAYER) - { - pPlayer->DestroyItemCount(31088, 1, true); - pPlayer->CastSpell(targets.getUnitTarget(), 38134, true); - return true; - } - } - return true; -} - -CreatureAI* GetAI_boss_lady_vashj(Creature* pCreature) -{ - return new boss_lady_vashjAI (pCreature); -} - -CreatureAI* GetAI_mob_enchanted_elemental(Creature* pCreature) -{ - return new mob_enchanted_elementalAI (pCreature); -} - -CreatureAI* GetAI_mob_tainted_elemental(Creature* pCreature) -{ - return new mob_tainted_elementalAI (pCreature); -} - -CreatureAI* GetAI_mob_toxic_sporebat(Creature* pCreature) -{ - return new mob_toxic_sporebatAI (pCreature); -} - -CreatureAI* GetAI_mob_shield_generator_channel(Creature* pCreature) -{ - return new mob_shield_generator_channelAI (pCreature); -} - -void AddSC_boss_lady_vashj() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_lady_vashj"; - newscript->GetAI = &GetAI_boss_lady_vashj; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_enchanted_elemental"; - newscript->GetAI = &GetAI_mob_enchanted_elemental; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_tainted_elemental"; - newscript->GetAI = &GetAI_mob_tainted_elemental; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_toxic_sporebat"; - newscript->GetAI = &GetAI_mob_toxic_sporebat; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_coilfang_elite"; - newscript->GetAI = &GetAI_mob_coilfang_elite; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_coilfang_strider"; - newscript->GetAI = &GetAI_mob_coilfang_strider; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_shield_generator_channel"; - newscript->GetAI = &GetAI_mob_shield_generator_channel; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="item_tainted_core"; - newscript->pItemUse = &ItemUse_item_tainted_core; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp deleted file mode 100644 index e43afc2926f..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_leotheras_the_blind.cpp +++ /dev/null @@ -1,808 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Leotheras_The_Blind -SD%Complete: 80 -SDComment: Possesion Support -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "precompiled.h" -#include "def_serpent_shrine.h" - -// --- Spells used by Leotheras The Blind -#define SPELL_WHIRLWIND 37640 -#define SPELL_CHAOS_BLAST 37674 -#define SPELL_BERSERK 26662 -#define SPELL_INSIDIOUS_WHISPER 37676 -#define SPELL_DUAL_WIELD 42459 - -// --- Spells used in banish phase --- -#define BANISH_BEAM 38909 -#define AURA_BANISH 37833 - -// --- Spells used by Greyheart Spellbinders -#define SPELL_EARTHSHOCK 39076 -#define SPELL_MINDBLAST 37531 - -// --- Spells used by Inner Demons and Creature ID -#define INNER_DEMON_ID 21857 -#define AURA_DEMONIC_ALIGNMENT 37713 -#define SPELL_SHADOWBOLT 39309 -#define SPELL_SOUL_LINK 38007 -#define SPELL_CONSUMING_MADNESS 37749 //not supported by core yet - -//Misc. -#define MODEL_DEMON 20125 -#define MODEL_NIGHTELF 20514 -#define DEMON_FORM 21875 -#define MOB_SPELLBINDER 21806 - -#define SAY_AGGRO -1548009 -#define SAY_SWITCH_TO_DEMON -1548010 -#define SAY_INNER_DEMONS -1548011 -#define SAY_DEMON_SLAY1 -1548012 -#define SAY_DEMON_SLAY2 -1548013 -#define SAY_DEMON_SLAY3 -1548014 -#define SAY_NIGHTELF_SLAY1 -1548015 -#define SAY_NIGHTELF_SLAY2 -1548016 -#define SAY_NIGHTELF_SLAY3 -1548017 -#define SAY_FINAL_FORM -1548018 -#define SAY_FREE -1548019 -#define SAY_DEATH -1548020 - -struct TRINITY_DLL_DECL mob_inner_demonAI : public ScriptedAI -{ - mob_inner_demonAI(Creature *c) : ScriptedAI(c) - { - victimGUID = 0; - } - - uint32 ShadowBolt_Timer; - - uint32 Link_Timer; - uint64 victimGUID; - - void Reset() - { - ShadowBolt_Timer = 10000; - Link_Timer = 1000; - } - void JustDied(Unit *victim) - { - Unit* pUnit = Unit::GetUnit((*m_creature),victimGUID); - if (pUnit && pUnit->HasAura(SPELL_INSIDIOUS_WHISPER)) - pUnit->RemoveAurasDueToSpell(SPELL_INSIDIOUS_WHISPER); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by->GetGUID() != victimGUID && done_by->GetGUID() != m_creature->GetGUID()) - { - damage = 0; - DoModifyThreatPercent(done_by, -100); - } - } - - void EnterCombat(Unit *who) - { - if (!victimGUID) return; - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (m_creature->getVictim()->GetGUID() != victimGUID) - { - DoModifyThreatPercent(m_creature->getVictim(), -100); - Unit* owner = Unit::GetUnit((*m_creature),victimGUID); - if (owner && owner->isAlive()) - { - m_creature->AddThreat(owner,999999); - AttackStart(owner); - }else if (owner && owner->isDead()) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - } - - if (Link_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SOUL_LINK, true); - Link_Timer = 1000; - }else Link_Timer -= diff; - - - if (!m_creature->HasAura(AURA_DEMONIC_ALIGNMENT)) - DoCast(m_creature, AURA_DEMONIC_ALIGNMENT,true); - - if (ShadowBolt_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SHADOWBOLT, false); - ShadowBolt_Timer = 10000; - }else ShadowBolt_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -//Original Leotheras the Blind AI -struct TRINITY_DLL_DECL boss_leotheras_the_blindAI : public ScriptedAI -{ - boss_leotheras_the_blindAI(Creature *c) : ScriptedAI(c) - { - m_creature->GetPosition(x,y,z); - pInstance = c->GetInstanceData(); - Demon = 0; - - for(uint8 i = 0; i < 3; ++i)//clear guids - SpellBinderGUID[i] = 0; - } - - ScriptedInstance *pInstance; - - uint32 Whirlwind_Timer; - uint32 ChaosBlast_Timer; - uint32 SwitchToDemon_Timer; - uint32 SwitchToHuman_Timer; - uint32 Berserk_Timer; - uint32 InnerDemons_Timer; - uint32 BanishTimer; - - bool DealDamage; - bool NeedThreatReset; - bool DemonForm; - bool IsFinalForm; - bool EnrageUsed; - float x,y,z; - - uint64 InnderDemon[5]; - uint32 InnderDemon_Count; - uint64 Demon; - uint64 SpellBinderGUID[3]; - - void Reset() - { - CheckChannelers(); - BanishTimer = 1000; - Whirlwind_Timer = 15000; - ChaosBlast_Timer = 1000; - SwitchToDemon_Timer = 45000; - SwitchToHuman_Timer = 60000; - Berserk_Timer = 600000; - InnerDemons_Timer = 30000; - m_creature->SetCanDualWield(true); - DealDamage = true; - DemonForm = false; - IsFinalForm = false; - NeedThreatReset = false; - EnrageUsed = false; - InnderDemon_Count = 0; - m_creature->SetSpeed(MOVE_RUN, 2.0f, true); - m_creature->SetDisplayId(MODEL_NIGHTELF); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); - m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); - m_creature->SetCorpseDelay(1000*60*60); - if (pInstance) - pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, NOT_STARTED); - } - - void CheckChannelers(bool DoEvade = true) - { - for(uint8 i = 0; i < 3; ++i) - { - if (Creature *add = Unit::GetCreature(*m_creature,SpellBinderGUID[i])) - add->DisappearAndDie(); - - float nx = x; - float ny = y; - float o = 2.4f; - if (i == 0) {nx += 10; ny -= 5; o=2.5f;} - if (i == 1) {nx -= 8; ny -= 7; o=0.9f;} - if (i == 2) {nx -= 3; ny += 9; o=5.0f;} - Creature* binder = m_creature->SummonCreature(MOB_SPELLBINDER,nx,ny,z,o,TEMPSUMMON_DEAD_DESPAWN,0); - if (binder) - SpellBinderGUID[i] = binder->GetGUID(); - - } - } - void MoveInLineOfSight(Unit *who) - { - if (m_creature->HasAura(AURA_BANISH)) - return; - - if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) - { - if (m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius)) - { - // Check first that object is in an angle in front of this one before LoS check - if (m_creature->HasInArc(M_PI/2.0f, who) && m_creature->IsWithinLOSInMap(who)) - { - AttackStart(who); - } - } - } - } - - void StartEvent() - { - DoScriptText(SAY_AGGRO, m_creature); - if (pInstance) - pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, IN_PROGRESS); - } - - void CheckBanish() - { - uint8 AliveChannelers = 0; - for(uint8 i = 0; i < 3; ++i) - { - Unit *add = Unit::GetUnit(*m_creature,SpellBinderGUID[i]); - if (add && add->isAlive()) - AliveChannelers++; - } - - // channelers == 0 remove banish aura - if (AliveChannelers == 0 && m_creature->HasAura(AURA_BANISH)) - { - // removing banish aura - m_creature->RemoveAurasDueToSpell(AURA_BANISH); - - // Leotheras is getting immune again - m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, true); - - // changing model to bloodelf - m_creature->SetDisplayId(MODEL_NIGHTELF); - - // and reseting equipment - m_creature->LoadEquipment(m_creature->GetEquipmentId()); - - if (pInstance && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) - { - Unit *victim = NULL; - victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); - if (victim) - m_creature->getThreatManager().addThreat(victim, 1); - StartEvent(); - } - } - else if (AliveChannelers != 0 && !m_creature->HasAura(AURA_BANISH)) - { - // channelers != 0 apply banish aura - // removing Leotheras banish immune to apply AURA_BANISH - m_creature->ApplySpellImmune(AURA_BANISH, IMMUNITY_MECHANIC, MECHANIC_BANISH, false); - DoCast(m_creature, AURA_BANISH); - - // changing model - m_creature->SetDisplayId(MODEL_DEMON); - - // and removing weapons - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); - } - } - - //Despawn all Inner Demon summoned - void DespawnDemon() - { - for(uint8 i=0; i<5; ++i) - { - if (InnderDemon[i]) - { - //delete creature - Creature* pCreature = Unit::GetCreature((*m_creature), InnderDemon[i]); - if (pCreature && pCreature->isAlive()) - { - pCreature->ForcedDespawn(); - } - InnderDemon[i] = 0; - } - } - - InnderDemon_Count = 0; - } - - void CastConsumingMadness() //remove this once SPELL_INSIDIOUS_WHISPER is supported by core - { - for(uint8 i=0; i<5; ++i) - { - if (InnderDemon[i] > 0) - { - Creature* pUnit = Unit::GetCreature((*m_creature), InnderDemon[i]); - if (pUnit && pUnit->isAlive()) - { - Unit* pUnit_target = Unit::GetUnit(*pUnit, CAST_AI(mob_inner_demonAI, pUnit->AI())->victimGUID); - if (pUnit_target && pUnit_target->isAlive()) - { - pUnit->CastSpell(pUnit_target, SPELL_CONSUMING_MADNESS, true); - DoModifyThreatPercent(pUnit_target, -100); - } - } - } - } - } - - void KilledUnit(Unit *victim) - { - if (victim->GetTypeId() != TYPEID_PLAYER) - return; - - if (DemonForm) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_DEMON_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_DEMON_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_DEMON_SLAY3, m_creature); break; - } - } - else - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_NIGHTELF_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_NIGHTELF_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_NIGHTELF_SLAY3, m_creature); break; - } - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - //despawn copy - if (Demon) - { - if (Creature* pDemon = Unit::GetCreature(*m_creature, Demon)) - pDemon->ForcedDespawn(); - } - if (pInstance) - pInstance->SetData(DATA_LEOTHERASTHEBLINDEVENT, DONE); - } - - void EnterCombat(Unit *who) - { - if (m_creature->HasAura(AURA_BANISH)) - return; - - m_creature->LoadEquipment(m_creature->GetEquipmentId()); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (m_creature->HasAura(AURA_BANISH) || !UpdateVictim()) - { - if (BanishTimerHasAura(SPELL_WHIRLWIND)) - if (Whirlwind_Timer < diff) - { - Unit *newTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (newTarget) - { - DoResetThreat(); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MovePoint(0,newTarget->GetPositionX(),newTarget->GetPositionY(),newTarget->GetPositionZ()); - } - Whirlwind_Timer = 2000; - }else Whirlwind_Timer -= diff; - - // reseting after changing forms and after ending whirlwind - if (NeedThreatReset && !m_creature->HasAura(SPELL_WHIRLWIND)) - { - // when changing forms seting timers (or when ending whirlwind - to avoid adding new variable i use Whirlwind_Timer to countdown 2s while whirlwinding) - if (DemonForm) - InnerDemons_Timer = 30000; - else - Whirlwind_Timer = 15000; - - NeedThreatReset = false; - DoResetThreat(); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - - //Enrage_Timer (10 min) - if (Berserk_Timer < diff && !EnrageUsed) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_BERSERK); - EnrageUsed = true; - }else Berserk_Timer -= diff; - - if (!DemonForm) - { - //Whirldind Timer - if (!m_creature->HasAura(SPELL_WHIRLWIND)) - { - if (Whirlwind_Timer < diff) - { - DoCast(m_creature, SPELL_WHIRLWIND); - // while whirlwinding this variable is used to countdown target's change - Whirlwind_Timer = 2000; - NeedThreatReset = true; - }else Whirlwind_Timer -= diff; - } - //Switch_Timer - - if (!IsFinalForm) - if (SwitchToDemon_Timer < diff) - { - //switch to demon form - m_creature->RemoveAurasDueToSpell(SPELL_WHIRLWIND,0); - m_creature->SetDisplayId(MODEL_DEMON); - DoScriptText(SAY_SWITCH_TO_DEMON, m_creature); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID , 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); - DemonForm = true; - NeedThreatReset = true; - SwitchToDemon_Timer = 45000; - }else SwitchToDemon_Timer -= diff; - DoMeleeAttackIfReady(); - } - else - { - //ChaosBlast_Timer - if (!m_creature->getVictim()) - return; - if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) - m_creature->StopMoving(); - if (ChaosBlast_Timer < diff) - { - // will cast only when in range of spell - if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) - { - //m_creature->CastSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, true); - int damage = 100; - m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); - } - ChaosBlast_Timer = 3000; - }else ChaosBlast_Timer -= diff; - //Summon Inner Demon - if (InnerDemons_Timer < diff) - { - std::list& ThreatList = m_creature->getThreatManager().getThreatList(); - std::vector TargetList; - for(std::list::iterator itr = ThreatList.begin(); itr != ThreatList.end(); ++itr) - { - Unit *tempTarget = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (tempTarget && tempTarget->GetTypeId() == TYPEID_PLAYER && tempTarget->GetGUID() != m_creature->getVictim()->GetGUID() && TargetList.size()<5) - TargetList.push_back(tempTarget); - } - SpellEntry *spell = GET_SPELL(SPELL_INSIDIOUS_WHISPER); - for(std::vector::iterator itr = TargetList.begin(); itr != TargetList.end(); ++itr) - { - if ((*itr) && (*itr)->isAlive()) - { - Creature * demon = m_creature->SummonCreature(INNER_DEMON_ID, (*itr)->GetPositionX()+10, (*itr)->GetPositionY()+10, (*itr)->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (demon) - { - demon->AI()->AttackStart((*itr)); - CAST_AI(mob_inner_demonAI, demon->AI())->victimGUID = (*itr)->GetGUID(); - - uint8 eff_mask=0; - for (int i=0; i<3; ++i) - { - if (!spell->Effect[i]) - continue; - eff_mask|=1<AddAura(new Aura(spell, eff_mask, NULL, (*itr), (*itr))); - if (InnderDemon_Count > 4) InnderDemon_Count = 0; - - //Safe storing of creatures - InnderDemon[InnderDemon_Count] = demon->GetGUID(); - - //Update demon count - InnderDemon_Count++; - } - } - } - DoScriptText(SAY_INNER_DEMONS, m_creature); - - InnerDemons_Timer = 999999; - }else InnerDemons_Timer -= diff; - - //Switch_Timer - if (SwitchToHuman_Timer < diff) - { - //switch to nightelf form - m_creature->SetDisplayId(MODEL_NIGHTELF); - m_creature->LoadEquipment(m_creature->GetEquipmentId()); - - CastConsumingMadness(); - DespawnDemon(); - - DemonForm = false; - NeedThreatReset = true; - - SwitchToHuman_Timer = 60000; - }else SwitchToHuman_Timer -= diff; - } - - if (!IsFinalForm && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 15) - { - //at this point he divides himself in two parts - CastConsumingMadness(); - DespawnDemon(); - Creature *Copy = NULL; - Copy = DoSpawnCreature(DEMON_FORM, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 6000); - if (Copy) - { - Demon = Copy->GetGUID(); - if (m_creature->getVictim()) - Copy->AI()->AttackStart(m_creature->getVictim()); - } - //set nightelf final form - IsFinalForm = true; - DemonForm = false; - - DoScriptText(SAY_FINAL_FORM, m_creature); - m_creature->SetDisplayId(MODEL_NIGHTELF); - m_creature->LoadEquipment(m_creature->GetEquipmentId()); - } - } -}; - -//Leotheras the Blind Demon Form AI -struct TRINITY_DLL_DECL boss_leotheras_the_blind_demonformAI : public ScriptedAI -{ - boss_leotheras_the_blind_demonformAI(Creature *c) : ScriptedAI(c) {} - - uint32 ChaosBlast_Timer; - bool DealDamage; - - void Reset() - { - ChaosBlast_Timer = 1000; - DealDamage = true; - } - - void StartEvent() - { - DoScriptText(SAY_FREE, m_creature); - } - - void KilledUnit(Unit *victim) - { - if (victim->GetTypeId() != TYPEID_PLAYER) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_DEMON_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_DEMON_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_DEMON_SLAY3, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - //invisibility (blizzlike, at the end of the fight he doesn't die, he disappears) - m_creature->CastSpell(m_creature, 8149, true); - } - - void EnterCombat(Unit *who) - { - StartEvent(); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - //ChaosBlast_Timer - if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) - m_creature->StopMoving(); - - if (ChaosBlast_Timer < diff) - { - // will cast only when in range od spell - if (m_creature->IsWithinDist(m_creature->getVictim(), 30)) - { - //m_creature->CastSpell(m_creature->getVictim(),SPELL_CHAOS_BLAST,true); - int damage = 100; - m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_CHAOS_BLAST, &damage, NULL, NULL, false, NULL, NULL, m_creature->GetGUID()); - ChaosBlast_Timer = 3000; - } - }else ChaosBlast_Timer -= diff; - - //Do NOT deal any melee damage to the target. - } -}; -struct TRINITY_DLL_DECL mob_greyheart_spellbinderAI : public ScriptedAI -{ - mob_greyheart_spellbinderAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData();; - leotherasGUID = 0; - AddedBanish = false; - } - - ScriptedInstance *pInstance; - - uint64 leotherasGUID; - - uint32 Mindblast_Timer; - uint32 Earthshock_Timer; - - bool AddedBanish; - - void Reset() - { - Mindblast_Timer = 3000 + rand()%5000; - Earthshock_Timer = 5000 + rand()%5000; - - if (pInstance) - { - pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, 0); - Creature *leotheras = Unit::GetCreature(*m_creature, leotherasGUID); - if (leotheras && leotheras->isAlive()) - CAST_AI(boss_leotheras_the_blindAI, leotheras->AI())->CheckChannelers(false); - } - } - - void EnterCombat(Unit *who) - { - m_creature->InterruptNonMeleeSpells(false); - if (pInstance) - pInstance->SetData64(DATA_LEOTHERAS_EVENT_STARTER, who->GetGUID()); - } - - void JustRespawned() - { - AddedBanish = false; - Reset(); - } - - void CastChanneling() - { - if (!m_creature->isInCombat() && !m_creature->m_currentSpells[CURRENT_CHANNELED_SPELL]) - { - if (leotherasGUID) - { - Creature *leotheras = Unit::GetCreature(*m_creature, leotherasGUID); - if (leotheras && leotheras->isAlive()) - DoCast(leotheras, BANISH_BEAM); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (pInstance) - { - if (!leotherasGUID) - leotherasGUID = pInstance->GetData64(DATA_LEOTHERAS); - - if (!m_creature->isInCombat() && pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) - { - Unit *victim = NULL; - victim = Unit::GetUnit(*m_creature, pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)); - if (victim) - AttackStart(victim); - } - } - - if (!UpdateVictim()) - { - CastChanneling(); - return; - } - - if (pInstance && !pInstance->GetData64(DATA_LEOTHERAS_EVENT_STARTER)) - { - EnterEvadeMode(); - return; - } - - if (Mindblast_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (target)DoCast(target, SPELL_MINDBLAST); - - Mindblast_Timer = 10000 + rand()%5000; - }else Mindblast_Timer -= diff; - - if (Earthshock_Timer < diff) - { - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator itr = PlayerList.begin();itr != PlayerList.end(); ++itr) - { - if (Player* i_pl = itr->getSource()) - { - bool isCasting = false; - for(uint8 i = 0; i < CURRENT_MAX_SPELL; ++i) - if (i_pl->m_currentSpells[i]) - isCasting = true; - - if (isCasting) - { - DoCast(i_pl, SPELL_EARTHSHOCK); - break; - } - } - } - Earthshock_Timer = 8000 + rand()%7000; - }else Earthshock_Timer -= diff; - DoMeleeAttackIfReady(); - } - - void JustDied(Unit *killer) {} -}; -CreatureAI* GetAI_boss_leotheras_the_blind(Creature* pCreature) -{ - return new boss_leotheras_the_blindAI (pCreature); -} - -CreatureAI* GetAI_boss_leotheras_the_blind_demonform(Creature* pCreature) -{ - return new boss_leotheras_the_blind_demonformAI (pCreature); -} - -CreatureAI* GetAI_mob_greyheart_spellbinder(Creature* pCreature) -{ - return new mob_greyheart_spellbinderAI (pCreature); -} - -CreatureAI* GetAI_mob_inner_demon(Creature* pCreature) -{ - return new mob_inner_demonAI (pCreature); -} -void AddSC_boss_leotheras_the_blind() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_leotheras_the_blind"; - newscript->GetAI = &GetAI_boss_leotheras_the_blind; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_leotheras_the_blind_demonform"; - newscript->GetAI = &GetAI_boss_leotheras_the_blind_demonform; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_greyheart_spellbinder"; - newscript->GetAI = &GetAI_mob_greyheart_spellbinder; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_inner_demon"; - newscript->GetAI = &GetAI_mob_inner_demon; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp deleted file mode 100644 index 38abc8f1507..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_lurker_below.cpp +++ /dev/null @@ -1,489 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: boss_the_lurker_below -SD%Complete: 80 -SDComment: Coilfang Frenzy, find out how could we fishing in the strangepool -SDCategory: The Lurker Below -EndScriptData */ - -#include "precompiled.h" -#include "def_serpent_shrine.h" -#include "simple_ai.h" -#include "Spell.h" - -#define SPELL_SPOUT 37433 -#define SPELL_SPOUT_ANIM 42835 -#define SPELL_SPOUT_BREATH 37431 -#define SPELL_KNOCKBACK 19813 -#define SPELL_GEYSER 37478 -#define SPELL_WHIRL 37660 -#define SPELL_WATERBOLT 37138 -#define SPELL_SUBMERGE 37550 -#define SPELL_EMERGE 20568 -#define SPELL_SCALDINGWATER 37284 - -#define EMOTE_SPOUT "takes a deep breath." - -#define SPOUT_DIST 100 - -#define MOB_COILFANG_GUARDIAN 21873 -#define MOB_COILFANG_AMBUSHER 21865 - -//Ambusher spells -#define SPELL_SPREAD_SHOT 37790 -#define SPELL_SHOOT 37770 - -//Guardian spells -#define SPELL_ARCINGSMASH 38761 // Wrong SpellId. Can't find the right one. -#define SPELL_HAMSTRING 26211 - -float AddPos[9][3] = -{ - {2.8553810, -459.823914, -19.182686}, //MOVE_AMBUSHER_1 X, Y, Z - {12.400000, -466.042267, -19.182686}, //MOVE_AMBUSHER_2 X, Y, Z - {51.366653, -460.836060, -19.182686}, //MOVE_AMBUSHER_3 X, Y, Z - {62.597980, -457.433044, -19.182686}, //MOVE_AMBUSHER_4 X, Y, Z - {77.607452, -384.302765, -19.182686}, //MOVE_AMBUSHER_5 X, Y, Z - {63.897900, -378.984924, -19.182686}, //MOVE_AMBUSHER_6 X, Y, Z - {34.447250, -387.333618, -19.182686}, //MOVE_GUARDIAN_1 X, Y, Z - {14.388216, -423.468018, -19.625271}, //MOVE_GUARDIAN_2 X, Y, Z - {42.471519, -445.115295, -19.769423} //MOVE_GUARDIAN_3 X, Y, Z -}; - -enum RotationType -{ - NOROTATE = 0, - CLOCKWISE = 1, - COUNTERCLOCKWISE = 2, -}; - -struct TRINITY_DLL_DECL boss_the_lurker_belowAI : public Scripted_NoMovementAI -{ - boss_the_lurker_belowAI(Creature *c) : Scripted_NoMovementAI(c), Summons(m_creature) - { - pInstance = c->GetInstanceData(); - SpellEntry *TempSpell = GET_SPELL(SPELL_SPOUT_ANIM); - if (TempSpell) - { - TempSpell->Effect[0] = 0;//remove all spell effect, only anim is needed - TempSpell->Effect[1] = 0; - TempSpell->Effect[2] = 0; - } - } - - ScriptedInstance* pInstance; - SummonList Summons; - - bool Spawned; - bool Submerged; - - double SpoutAngle; - - uint8 RotType; - - uint32 RotTimer; - uint32 SpoutAnimTimer; - uint32 WaterboltTimer; - uint32 SpoutTimer; - uint32 WhirlTimer;//after avery spout - uint32 PhaseTimer; - uint32 GeyserTimer; - - void Reset() - { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_SWIMMING + MOVEMENTFLAG_LEVITATING); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetCorpseDelay(1000*60*60); - - RotType = NOROTATE; - - SpoutAngle = 0; - SpoutAnimTimer = 1000; - RotTimer = 20000; - WaterboltTimer = 3000; - SpoutTimer = 15000; - WhirlTimer = 18000;//after avery spout - PhaseTimer = 120000; - GeyserTimer = rand()%5000 + 15000; - - Submerged = false; - Spawned = false; - - Summons.DespawnAll(); - - if (pInstance) - pInstance->SetData(DATA_THELURKERBELOWEVENT, NOT_STARTED); - - /*if (pInstance->GetData(DATA_STRANGE_POOL) != DONE) - { - m_creature->SetReactState(REACT_PASSIVE); - m_creature->SetVisibility(VISIBILITY_OFF); - }else { - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->SetReactState(REACT_AGGRESSIVE); - }*/ - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || m_creature->getVictim()) - return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - AttackStart(who); - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_THELURKERBELOWEVENT, IN_PROGRESS); - - if (!who || m_creature->getVictim()) - return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - AttackStart(who); - } - } - - void JustDied(Unit* Killer) - { - if (pInstance) - pInstance->SetData(DATA_THELURKERBELOWEVENT, DONE); - - Summons.DespawnAll(); - } - - void Rotate(const uint32 diff) - { - bool Spout = false; - switch (RotType) - { - case NOROTATE: - return; - case CLOCKWISE://20secs for 360turn - //no target if rotating! - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - SpoutAngle += (double)diff/20000*(double)M_PI*2; - if (SpoutAngle >= M_PI*2)SpoutAngle = 0; - m_creature->SetOrientation(SpoutAngle); - m_creature->StopMoving(); - Spout = true; - break; - case COUNTERCLOCKWISE://20secs for 360turn - //no target if rotating! - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - SpoutAngle -= (double)diff/20000*(double)M_PI*2; - if (SpoutAngle <= 0)SpoutAngle = M_PI*2; - m_creature->SetOrientation(SpoutAngle); - m_creature->StopMoving(); - Spout = true; - break; - } - - if (!Spout) - return; - - if (RotTimerInterruptNonMeleeSpells(false); - WhirlTimer = 4000; //whirl directly after spout ends - return; - }else RotTimer-=diff; - - if (SpoutAnimTimerGetMap(); - if (pMap->IsDungeon() && pInstance->GetData(DATA_THELURKERBELOWEVENT) == IN_PROGRESS) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - Player *target = i->getSource(); - if (target && target->isAlive() && m_creature->HasInArc((double)diff/20000*(double)M_PI*2,target) && m_creature->IsWithinDist(target, SPOUT_DIST) && !target->IsInWater()) - DoCast(target,SPELL_SPOUT,true);//only knock back palyers in arc, in 100yards, not in water - } - } - } - - void StartRotate(Unit* victim) - { - switch (rand()%2) - { - case 0: RotType = CLOCKWISE; break; - case 1: RotType = COUNTERCLOCKWISE; break; - } - RotTimer=20000; - - if (victim) - SpoutAngle = m_creature->GetAngle(victim); - - m_creature->MonsterTextEmote(EMOTE_SPOUT,0,true); - //DoCast(m_creature,SPELL_SPOUT_BREATH);//take breath anim - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim() /*|| !m_creature->getVictim()*/)//rotate resets target - return; - - //Check if players in water and if in water cast spell - Map* pMap = m_creature->GetMap(); - if (pMap->IsDungeon() && pInstance->GetData(DATA_THELURKERBELOWEVENT) == IN_PROGRESS) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - - if (PlayerList.isEmpty()) - return; - - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()->isAlive() && i->getSource()->IsInWater() && !i->getSource()->HasAura(SPELL_SCALDINGWATER)) - i->getSource()->CastSpell(i->getSource(), SPELL_SCALDINGWATER, true); - else if (!i->getSource()->IsInWater()) - i->getSource()->RemoveAurasDueToSpell(SPELL_SCALDINGWATER); - } - } - - Rotate(diff);//always check rotate things - if (!Submerged) - { - if (PhaseTimer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_SUBMERGE); - PhaseTimer = 60000;//60secs submerged - Submerged = true; - }else PhaseTimer-=diff; - } - - if (!Submerged && RotType == NOROTATE)//is not spouting and not submerged - { - if (SpoutTimer < diff) - { - if (m_creature->getVictim() && RotType == NOROTATE) - StartRotate(m_creature->getVictim());//start spout and random rotate - - SpoutTimer= 35000; - return; - }else SpoutTimer -= diff; - - //Whirl directly after a Spout and at random times - if (WhirlTimer < diff) - { - WhirlTimer = rand()%5000 + 15000; - DoCast(m_creature,SPELL_WHIRL); - WaterboltTimer += 5000;//add 5secs to waterbolt timer, to add some time to run back to boss - }else WhirlTimer -= diff; - - if (GeyserTimer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM,1); - - if (target) - DoCast(target,SPELL_GEYSER,true); - else - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - DoCast(target,SPELL_GEYSER,true); - - GeyserTimer = rand()%5000 + 15000; - }else GeyserTimer -= diff; - - if (WaterboltTimer < diff) - { - Unit* target = SelectTarget(SELECT_TARGET_NEAREST,0,14,true); - if (!target) - { - target = SelectUnit(SELECT_TARGET_RANDOM,0); - if (target) - DoCast(target,SPELL_WATERBOLT); - } - WaterboltTimer = 3000; - }else WaterboltTimer -= diff; - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - - }else if (!Submerged) - return; - else if (Submerged)//phase 2, submerged - { - if (PhaseTimer < diff) - { - Submerged = false; - m_creature->InterruptNonMeleeSpells(false);//shouldn't be any - m_creature->RemoveAllAuras(); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_NPC_EMOTESTATE,EMOTE_STATE_SUBMERGED); - m_creature->RemoveFlag(UNIT_FIELD_BYTES_1,9); - DoCast(m_creature,SPELL_EMERGE); - Spawned = false; - SpoutTimer = 4000; // directly cast Spout after emerging! - WhirlTimer = 26000; - PhaseTimer = 120000; - return; - }else PhaseTimer-=diff; - - if (!m_creature->isInCombat()) - DoZoneInCombat(); - - if (!Spawned) - { - m_creature->SetUInt32Value(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - //spawn adds - for (uint8 i = 0; i < 9; ++i) - { - Creature* Summoned; - if (i < 7) - Summoned = m_creature->SummonCreature(MOB_COILFANG_AMBUSHER,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - else Summoned = m_creature->SummonCreature(MOB_COILFANG_GUARDIAN,AddPos[i][0],AddPos[i][1],AddPos[i][2], 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - - if (Summoned) - Summons.Summon(Summoned); - Spawned = true; - } - } - } - } - }; - -CreatureAI* GetAI_mob_coilfang_guardian(Creature* pCreature) -{ - SimpleAI* ai = new SimpleAI (pCreature); - - ai->Spell[0].Enabled = true; - ai->Spell[0].Spell_Id = SPELL_ARCINGSMASH; - ai->Spell[0].Cooldown = 15000; - ai->Spell[0].First_Cast = 5000; - ai->Spell[0].Cast_Target_Type = CAST_HOSTILE_TARGET; - - ai->Spell[1].Enabled = true; - ai->Spell[1].Spell_Id = SPELL_HAMSTRING; - ai->Spell[1].Cooldown = 10000; - ai->Spell[1].First_Cast = 2000; - ai->Spell[1].Cast_Target_Type = CAST_HOSTILE_TARGET; - - return ai; -} - -struct TRINITY_DLL_DECL mob_coilfang_ambusherAI : public Scripted_NoMovementAI -{ - mob_coilfang_ambusherAI(Creature *c) : Scripted_NoMovementAI(c) - { - SpellEntry *TempSpell = GET_SPELL(SPELL_SHOOT); - if (TempSpell) - TempSpell->Effect[0] = 2;//change spell effect from weapon % dmg to simple phisical dmg - } - - uint32 MultiShotTimer; - uint32 ShootBowTimer; - - void Reset() - { - MultiShotTimer = 10000; - ShootBowTimer = 4000; - - } - - void EnterCombat(Unit *who) - { - - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || m_creature->getVictim()) return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - AttackStart(who); - } - } - - void UpdateAI(const uint32 diff) - { - if (MultiShotTimer < diff) - { - if (m_creature->getVictim()) - DoCast(m_creature->getVictim(), SPELL_SPREAD_SHOT, true); - - MultiShotTimer = 10000; - ShootBowTimer += 1500;//add global cooldown - }else MultiShotTimer -= diff; - - if (ShootBowTimer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - int bp0 = 1100; - if (target) - m_creature->CastCustomSpell(target,SPELL_SHOOT,&bp0,NULL,NULL,true); - ShootBowTimer = 4000; - MultiShotTimer += 1500;//add global cooldown - }else ShootBowTimer -= diff; - } -}; - -CreatureAI* GetAI_mob_coilfang_ambusher(Creature* pCreature) -{ - return new mob_coilfang_ambusherAI (pCreature); -} - -CreatureAI* GetAI_boss_the_lurker_below(Creature* pCreature) -{ - return new boss_the_lurker_belowAI (pCreature); -} - -void AddSC_boss_the_lurker_below() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_the_lurker_below"; - newscript->GetAI = &GetAI_boss_the_lurker_below; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_coilfang_guardian"; - newscript->GetAI = &GetAI_mob_coilfang_guardian; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_coilfang_ambusher"; - newscript->GetAI = &GetAI_mob_coilfang_ambusher; - newscript->RegisterSelf(); -} - - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp deleted file mode 100644 index 80e05cc494b..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/boss_morogrim_tidewalker.cpp +++ /dev/null @@ -1,372 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Morogrim_Tidewalker -SD%Complete: 90 -SDComment: Water globules don't explode properly, remove hacks -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "precompiled.h" -#include "def_serpent_shrine.h" - -#define SAY_AGGRO -1548030 -#define SAY_SUMMON1 -1548031 -#define SAY_SUMMON2 -1548032 -#define SAY_SUMMON_BUBL1 -1548033 -#define SAY_SUMMON_BUBL2 -1548034 -#define SAY_SLAY1 -1548035 -#define SAY_SLAY2 -1548036 -#define SAY_SLAY3 -1548037 -#define SAY_DEATH -1548038 -#define EMOTE_WATERY_GRAVE -1548039 -#define EMOTE_EARTHQUAKE -1548040 -#define EMOTE_WATERY_GLOBULES -1548041 - -#define SPELL_TIDAL_WAVE 37730 -#define SPELL_WATERY_GRAVE 38049 -#define SPELL_EARTHQUAKE 37764 -#define SPELL_WATERY_GRAVE_EXPLOSION 37852 - -#define WATERY_GRAVE_X1 334.64 -#define WATERY_GRAVE_Y1 -728.89 -#define WATERY_GRAVE_Z1 -14.42 -#define WATERY_GRAVE_X2 365.51 -#define WATERY_GRAVE_Y2 -737.14 -#define WATERY_GRAVE_Z2 -14.44 -#define WATERY_GRAVE_X3 366.19 -#define WATERY_GRAVE_Y3 -709.59 -#define WATERY_GRAVE_Z3 -14.36 -#define WATERY_GRAVE_X4 372.93 -#define WATERY_GRAVE_Y4 -690.96 -#define WATERY_GRAVE_Z4 -14.44 - -#define SPELL_WATERY_GRAVE_1 38023 -#define SPELL_WATERY_GRAVE_2 38024 -#define SPELL_WATERY_GRAVE_3 38025 -#define SPELL_WATERY_GRAVE_4 37850 - -#define SPELL_SUMMON_WATER_GLOBULE_1 37854 -#define SPELL_SUMMON_WATER_GLOBULE_2 37858 -#define SPELL_SUMMON_WATER_GLOBULE_3 37860 -#define SPELL_SUMMON_WATER_GLOBULE_4 37861 - -/*#define SPELL_SUMMON_MURLOC_A6 39813 -#define SPELL_SUMMON_MURLOC_A7 39814 -#define SPELL_SUMMON_MURLOC_A8 39815 -#define SPELL_SUMMON_MURLOC_A9 39816 -#define SPELL_SUMMON_MURLOC_A10 39817 - -#define SPELL_SUMMON_MURLOC_B6 39818 -#define SPELL_SUMMON_MURLOC_B7 39819 -#define SPELL_SUMMON_MURLOC_B8 39820 -#define SPELL_SUMMON_MURLOC_B9 39821 -#define SPELL_SUMMON_MURLOC_B10 39822*/ - -float MurlocCords[10][5] = -{ - {21920, 424.36, -715.4, -7.14, 0.124}, - {21920, 425.13, -719.3, -7.14, 0.124}, - {21920, 425.05, -724.23, -7.14, 0.124}, - {21920, 424.91, -728.68, -7.14, 0.124}, - {21920, 424.84, -732.18, -7.14, 0.124}, - {21920, 321.05, -734.2, -13.15, 0.124}, - {21920, 321.05, -729.4, -13.15, 0.124}, - {21920, 321.05, -724.03, -13.15, 0.124}, - {21920, 321.05, -718.73, -13.15, 0.124}, - {21920, 321.05, -714.24, -13.15, 0.124} -}; - -//Creatures -#define WATER_GLOBULE 21913 -#define TIDEWALKER_LURKER 21920 - -//Morogrim Tidewalker AI -struct TRINITY_DLL_DECL boss_morogrim_tidewalkerAI : public ScriptedAI -{ - boss_morogrim_tidewalkerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - Map::PlayerList const *PlayerList; - - uint32 TidalWave_Timer; - uint32 WateryGrave_Timer; - uint32 Earthquake_Timer; - uint32 WateryGlobules_Timer; - uint32 globulespell[4]; - int8 Playercount; - int8 counter; - - bool Earthquake; - bool Phase2; - - void Reset() - { - TidalWave_Timer = 10000; - WateryGrave_Timer = 30000; - Earthquake_Timer = 40000; - WateryGlobules_Timer = 0; - globulespell[0] = SPELL_SUMMON_WATER_GLOBULE_1; - globulespell[1] = SPELL_SUMMON_WATER_GLOBULE_2; - globulespell[2] = SPELL_SUMMON_WATER_GLOBULE_3; - globulespell[3] = SPELL_SUMMON_WATER_GLOBULE_4; - - Earthquake = false; - Phase2 = false; - - if (pInstance) - pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, NOT_STARTED); - } - - void StartEvent() - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, IN_PROGRESS); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_MOROGRIMTIDEWALKEREVENT, DONE); - } - - void EnterCombat(Unit *who) - { - PlayerList = &m_creature->GetMap()->GetPlayers(); - Playercount = PlayerList->getSize(); - StartEvent(); - } - - void ApplyWateryGrave(Unit* pPlayer, uint8 i) - { - switch(i) - { - case 0: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_1, true); break; - case 1: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_2, true); break; - case 2: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_3, true); break; - case 3: pPlayer->CastSpell(pPlayer, SPELL_WATERY_GRAVE_4, true); break; - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Earthquake_Timer - if (Earthquake_Timer < diff) - { - if (!Earthquake) - { - DoCast(m_creature->getVictim(), SPELL_EARTHQUAKE); - Earthquake = true; - Earthquake_Timer = 10000; - } - else - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SUMMON1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON2, m_creature); break; - } - - for(uint8 i = 0; i < 10; ++i) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - Creature* Murloc = m_creature->SummonCreature(MurlocCords[i][0],MurlocCords[i][1],MurlocCords[i][2],MurlocCords[i][3],MurlocCords[i][4], TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - if (target && Murloc) - Murloc->AI()->AttackStart(target); - } - DoScriptText(EMOTE_EARTHQUAKE, m_creature); - Earthquake = false; - Earthquake_Timer = 40000+rand()%5000; - } - }else Earthquake_Timer -= diff; - - //TidalWave_Timer - if (TidalWave_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_TIDAL_WAVE); - TidalWave_Timer = 20000; - }else TidalWave_Timer -= diff; - - if (!Phase2) - { - //WateryGrave_Timer - if (WateryGrave_Timer < diff) - { - //Teleport 4 players under the waterfalls - Unit *target; - using std::set; - setlist; - set::iterator itr; - for(uint8 i = 0; i < 4; ++i) - { - counter = 0; - do{target = SelectTarget(SELECT_TARGET_RANDOM, 1, 50, true); //target players only - if (counter < Playercount) - break; - if (target) itr = list.find(target->GetGUID()); - counter++; - }while(itr != list.end()); - if (target){list.insert(target->GetGUID()); - ApplyWateryGrave(target, i); - } - } - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SUMMON_BUBL1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON_BUBL2, m_creature); break; - } - - DoScriptText(EMOTE_WATERY_GRAVE, m_creature); - WateryGrave_Timer = 30000; - }else WateryGrave_Timer -= diff; - - //Start Phase2 - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) - Phase2 = true; - } - else - { - //WateryGlobules_Timer - if (WateryGlobules_Timer < diff) - { - Unit* globuletarget; - using std::set; - setglobulelist; - set::iterator itr; - for (int8 g = 0; g < 4; g++) //one unit cant cast more than one spell per update, so some players have to cast for us XD - { - counter = 0; - do {globuletarget = SelectTarget(SELECT_TARGET_RANDOM, 0,50,true); - if (globuletarget) itr = globulelist.find(globuletarget->GetGUID()); - if (counter > Playercount) - break; - counter++; - } while (itr != globulelist.end()); - if (globuletarget)globulelist.insert(globuletarget->GetGUID()); - globuletarget->CastSpell(globuletarget, globulespell[g], true); - } - DoScriptText(EMOTE_WATERY_GLOBULES, m_creature); - WateryGlobules_Timer = 25000; - }else WateryGlobules_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -//Water Globule AI -#define SPELL_GLOBULE_EXPLOSION 37871 - -struct TRINITY_DLL_DECL mob_water_globuleAI : public ScriptedAI -{ - mob_water_globuleAI(Creature *c) : ScriptedAI(c) {} - - uint32 Check_Timer; - - void Reset() - { - Check_Timer = 1000; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->setFaction(14); - } - - void EnterCombat(Unit *who) {} - - void MoveInLineOfSight(Unit *who) - { - if (!who || m_creature->getVictim()) - return; - - if (who->isTargetableForAttack() && who->isInAccessiblePlaceFor(m_creature) && m_creature->IsHostileTo(who)) - { - //no attack radius check - it attacks the first target that moves in his los - //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Check_Timer < diff) - { - if (m_creature->IsWithinDistInMap(m_creature->getVictim(), 5)) - { - DoCast(m_creature->getVictim(), SPELL_GLOBULE_EXPLOSION); - - //despawn - m_creature->ForcedDespawn(); - return; - } - Check_Timer = 500; - }else Check_Timer -= diff; - - //do NOT deal any melee damage to the target. - } -}; - -CreatureAI* GetAI_boss_morogrim_tidewalker(Creature* pCreature) -{ - return new boss_morogrim_tidewalkerAI (pCreature); -} -CreatureAI* GetAI_mob_water_globule(Creature* pCreature) -{ - return new mob_water_globuleAI (pCreature); -} - -void AddSC_boss_morogrim_tidewalker() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_morogrim_tidewalker"; - newscript->GetAI = &GetAI_boss_morogrim_tidewalker; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_water_globule"; - newscript->GetAI = &GetAI_mob_water_globule; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h deleted file mode 100644 index 13144bc93c0..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/def_serpent_shrine.h +++ /dev/null @@ -1,32 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SERPENT_SHRINE_H -#define DEF_SERPENT_SHRINE_H - -#define DATA_CANSTARTPHASE3 1 -#define DATA_CARIBDIS 2 -#define DATA_HYDROSSTHEUNSTABLEEVENT 3 -#define DATA_KARATHRESS 4 -#define DATA_KARATHRESSEVENT 5 -#define DATA_KARATHRESSEVENT_STARTER 6 -#define DATA_LADYVASHJ 7 -#define DATA_LADYVASHJEVENT 8 -#define DATA_LEOTHERASTHEBLINDEVENT 9 -#define DATA_MOROGRIMTIDEWALKEREVENT 10 -#define DATA_SHARKKIS 11 -#define DATA_SHIELDGENERATOR1 12 -#define DATA_SHIELDGENERATOR2 13 -#define DATA_SHIELDGENERATOR3 14 -#define DATA_SHIELDGENERATOR4 15 -#define DATA_THELURKERBELOW 16 -#define DATA_THELURKERBELOWEVENT 17 -#define DATA_TIDALVESS 18 -#define DATA_FATHOMLORDKARATHRESSEVENT 19 -#define DATA_LEOTHERAS 20 -#define DATA_LEOTHERAS_EVENT_STARTER 21 -#define DATA_CONTROL_CONSOLE 22 -#define DATA_STRANGE_POOL 23 -#endif - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp deleted file mode 100644 index ebeda6aa565..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/serpent_shrine/instance_serpent_shrine.cpp +++ /dev/null @@ -1,285 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Serpent_Shrine -SD%Complete: 100 -SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Serpent Shrine Scripts -SDCategory: Coilfang Resevoir, Serpent Shrine Cavern -EndScriptData */ - -#include "precompiled.h" -#include "def_serpent_shrine.h" - -#define MAX_ENCOUNTER 6 - -/* Serpentshrine cavern encounters: -0 - Hydross The Unstable event -1 - Leotheras The Blind Event -2 - The Lurker Below Event -3 - Fathom-Lord Karathress Event -4 - Morogrim Tidewalker Event -5 - Lady Vashj Event -*/ - -bool GOHello_go_bridge_console(Player* pPlayer, GameObject* pGo) -{ - ScriptedInstance* pInstance = pGo->GetInstanceData(); - - if (!pInstance) - return false; - - if (pInstance) - pInstance->SetData(DATA_CONTROL_CONSOLE, DONE); - - return true; -} - -struct TRINITY_DLL_DECL instance_serpentshrine_cavern : public ScriptedInstance -{ - instance_serpentshrine_cavern(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 LurkerBelow; - uint64 Sharkkis; - uint64 Tidalvess; - uint64 Caribdis; - uint64 LadyVashj; - uint64 Karathress; - uint64 KarathressEvent_Starter; - uint64 LeotherasTheBlind; - uint64 LeotherasEventStarter; - - uint64 ControlConsole; - uint64 BridgePart[3]; - uint64 StrangePool; - - bool ShieldGeneratorDeactivated[4]; - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - LurkerBelow = 0; - Sharkkis = 0; - Tidalvess = 0; - Caribdis = 0; - LadyVashj = 0; - Karathress = 0; - KarathressEvent_Starter = 0; - LeotherasTheBlind = 0; - LeotherasEventStarter = 0; - - ControlConsole = 0; - BridgePart[0] = 0; - BridgePart[1] = 0; - BridgePart[2] = 0; - StrangePool = 0; - - ShieldGeneratorDeactivated[0] = false; - ShieldGeneratorDeactivated[1] = false; - ShieldGeneratorDeactivated[2] = false; - ShieldGeneratorDeactivated[3] = false; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 184568: - ControlConsole = pGo->GetGUID(); - pGo->setActive(true); - break; - - case 184203: - BridgePart[0] = pGo->GetGUID(); - pGo->setActive(true); - break; - - case 184204: - BridgePart[1] = pGo->GetGUID(); - pGo->setActive(true); - break; - - case 184205: - BridgePart[2] = pGo->GetGUID(); - pGo->setActive(true); - break; - case 184956: - StrangePool = pGo->GetGUID(); - if (pGo->isActiveObject()) - SetData(DATA_STRANGE_POOL, DONE); - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 21212: LadyVashj = pCreature->GetGUID(); break; - case 21214: Karathress = pCreature->GetGUID(); break; - case 21966: Sharkkis = pCreature->GetGUID(); break; - case 21217: LurkerBelow = pCreature->GetGUID(); break; - case 21965: Tidalvess = pCreature->GetGUID(); break; - case 21964: Caribdis = pCreature->GetGUID(); break; - case 21215: LeotherasTheBlind = pCreature->GetGUID(); break;} - } - - void SetData64(uint32 type, uint64 data) - { - if (type == DATA_KARATHRESSEVENT_STARTER) - KarathressEvent_Starter = data; - if (type == DATA_LEOTHERAS_EVENT_STARTER) - LeotherasEventStarter = data; - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_THELURKERBELOW: return LurkerBelow; - case DATA_SHARKKIS: return Sharkkis; - case DATA_TIDALVESS: return Tidalvess; - case DATA_CARIBDIS: return Caribdis; - case DATA_LADYVASHJ: return LadyVashj; - case DATA_KARATHRESS: return Karathress; - case DATA_KARATHRESSEVENT_STARTER: return KarathressEvent_Starter; - case DATA_LEOTHERAS: return LeotherasTheBlind; - case DATA_LEOTHERAS_EVENT_STARTER: return LeotherasEventStarter; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_STRANGE_POOL: StrangePool = data; - case DATA_CONTROL_CONSOLE: - if (data == DONE) - { - HandleGameObject(BridgePart[0], true); - HandleGameObject(BridgePart[0], true); - HandleGameObject(BridgePart[0], true); - } - ControlConsole = data; - case DATA_HYDROSSTHEUNSTABLEEVENT: m_auiEncounter[0] = data; break; - case DATA_LEOTHERASTHEBLINDEVENT: m_auiEncounter[1] = data; break; - case DATA_THELURKERBELOWEVENT: m_auiEncounter[2] = data; break; - case DATA_KARATHRESSEVENT: m_auiEncounter[3] = data; break; - case DATA_MOROGRIMTIDEWALKEREVENT: m_auiEncounter[4] = data; break; - //Lady Vashj - case DATA_LADYVASHJEVENT: - if (data == NOT_STARTED) - { - ShieldGeneratorDeactivated[0] = false; - ShieldGeneratorDeactivated[1] = false; - ShieldGeneratorDeactivated[2] = false; - ShieldGeneratorDeactivated[3] = false; - } - m_auiEncounter[5] = data; break; - case DATA_SHIELDGENERATOR1:ShieldGeneratorDeactivated[0] = (data) ? true : false; break; - case DATA_SHIELDGENERATOR2:ShieldGeneratorDeactivated[1] = (data) ? true : false; break; - case DATA_SHIELDGENERATOR3:ShieldGeneratorDeactivated[2] = (data) ? true : false; break; - case DATA_SHIELDGENERATOR4:ShieldGeneratorDeactivated[3] = (data) ? true : false; break; - } - - if (data == DONE) - SaveToDB(); - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_HYDROSSTHEUNSTABLEEVENT: return m_auiEncounter[0]; - case DATA_LEOTHERASTHEBLINDEVENT: return m_auiEncounter[1]; - case DATA_THELURKERBELOWEVENT: return m_auiEncounter[2]; - case DATA_KARATHRESSEVENT: return m_auiEncounter[3]; - case DATA_MOROGRIMTIDEWALKEREVENT: return m_auiEncounter[4]; - //Lady Vashj - case DATA_LADYVASHJEVENT: return m_auiEncounter[5]; - case DATA_SHIELDGENERATOR1: return ShieldGeneratorDeactivated[0]; - case DATA_SHIELDGENERATOR2: return ShieldGeneratorDeactivated[1]; - case DATA_SHIELDGENERATOR3: return ShieldGeneratorDeactivated[2]; - case DATA_SHIELDGENERATOR4: return ShieldGeneratorDeactivated[3]; - case DATA_CANSTARTPHASE3: - if (ShieldGeneratorDeactivated[0] && ShieldGeneratorDeactivated[1] && ShieldGeneratorDeactivated[2] && ShieldGeneratorDeactivated[3])return 1;break; - } - return 0; - } - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " - << m_auiEncounter[3] << " " << m_auiEncounter[4] << " " << m_auiEncounter[5]; - 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_serpentshrine_cavern(Map* pMap) -{ - return new instance_serpentshrine_cavern(pMap); -} - -void AddSC_instance_serpentshrine_cavern() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "instance_serpent_shrine"; - newscript->GetInstanceData = &GetInstanceData_instance_serpentshrine_cavern; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="go_bridge_console"; - newscript->pGOHello = &GOHello_go_bridge_console; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp deleted file mode 100644 index 3bec4de6876..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_hydromancer_thespia.cpp +++ /dev/null @@ -1,197 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Hydromancer_Thespia -SD%Complete: 80 -SDComment: Needs additional adjustments (when instance script is adjusted) -SDCategory: Coilfang Resevoir, The Steamvault -EndScriptData */ - -/* ContentData -boss_hydromancer_thespia -mob_coilfang_waterelemental -EndContentData */ - -#include "precompiled.h" -#include "def_steam_vault.h" - -#define SAY_SUMMON -1545000 -#define SAY_AGGRO_1 -1545001 -#define SAY_AGGRO_2 -1545002 -#define SAY_AGGRO_3 -1545003 -#define SAY_SLAY_1 -1545004 -#define SAY_SLAY_2 -1545005 -#define SAY_DEAD -1545006 - -#define SPELL_LIGHTNING_CLOUD 25033 -#define SPELL_LUNG_BURST 31481 -#define SPELL_ENVELOPING_WINDS 31718 - -struct TRINITY_DLL_DECL boss_thespiaAI : public ScriptedAI -{ - boss_thespiaAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - bool HeroicMode; - - uint32 LightningCloud_Timer; - uint32 LungBurst_Timer; - uint32 EnvelopingWinds_Timer; - - void Reset() - { - LightningCloud_Timer = 15000; - LungBurst_Timer = 7000; - EnvelopingWinds_Timer = 9000; - - if (pInstance && m_creature->isAlive()) - pInstance->SetData(TYPE_HYDROMANCER_THESPIA, NOT_STARTED); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEAD, m_creature); - - if (pInstance) - pInstance->SetData(TYPE_HYDROMANCER_THESPIA, DONE); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - if (pInstance) - pInstance->SetData(TYPE_HYDROMANCER_THESPIA, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //LightningCloud_Timer - if (LightningCloud_Timer < diff) - { - //cast twice in Heroic mode - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_LIGHTNING_CLOUD); - if (HeroicMode) - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_LIGHTNING_CLOUD); - LightningCloud_Timer = 15000+rand()%10000; - }else LightningCloud_Timer -=diff; - - //LungBurst_Timer - if (LungBurst_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_LUNG_BURST); - LungBurst_Timer = 7000+rand()%5000; - }else LungBurst_Timer -=diff; - - //EnvelopingWinds_Timer - if (EnvelopingWinds_Timer < diff) - { - //cast twice in Heroic mode - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_ENVELOPING_WINDS); - if (HeroicMode) - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_ENVELOPING_WINDS); - EnvelopingWinds_Timer = 10000+rand()%5000; - }else EnvelopingWinds_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -#define SPELL_WATER_BOLT_VOLLEY 34449 -#define H_SPELL_WATER_BOLT_VOLLEY 37924 - -struct TRINITY_DLL_DECL mob_coilfang_waterelementalAI : public ScriptedAI -{ - mob_coilfang_waterelementalAI(Creature *c) : ScriptedAI(c) {} - - bool HeroicMode; - uint32 WaterBoltVolley_Timer; - - void Reset() - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - WaterBoltVolley_Timer = 3000+rand()%3000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (WaterBoltVolley_Timer < diff) - { - DoCast(m_creature, HeroicMode ? H_SPELL_WATER_BOLT_VOLLEY : SPELL_WATER_BOLT_VOLLEY); - WaterBoltVolley_Timer = 7000+rand()%5000; - }else WaterBoltVolley_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_thespiaAI(Creature* pCreature) -{ - return new boss_thespiaAI (pCreature); -} - -CreatureAI* GetAI_mob_coilfang_waterelementalAI(Creature* pCreature) -{ - return new mob_coilfang_waterelementalAI (pCreature); -} - -void AddSC_boss_hydromancer_thespia() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_hydromancer_thespia"; - newscript->GetAI = &GetAI_boss_thespiaAI; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_coilfang_waterelemental"; - newscript->GetAI = &GetAI_mob_coilfang_waterelementalAI; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp deleted file mode 100644 index d8cc2e0ef47..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_mekgineer_steamrigger.cpp +++ /dev/null @@ -1,279 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Mekgineer_Steamrigger -SD%Complete: 60 -SDComment: Mechanics' interrrupt heal doesn't work very well, also a proper movement needs to be implemented -> summon further away and move towards target to repair. -SDCategory: Coilfang Resevoir, The Steamvault -EndScriptData */ - -/* ContentData -boss_mekgineer_steamrigger -mob_steamrigger_mechanic -EndContentData */ - -#include "precompiled.h" -#include "def_steam_vault.h" - -#define SAY_MECHANICS -1545007 -#define SAY_AGGRO_1 -1545008 -#define SAY_AGGRO_2 -1545009 -#define SAY_AGGRO_3 -1545010 -#define SAY_AGGRO_4 -1545011 -#define SAY_SLAY_1 -1545012 -#define SAY_SLAY_2 -1545013 -#define SAY_SLAY_3 -1545014 -#define SAY_DEATH -1545015 - -#define SPELL_SUPER_SHRINK_RAY 31485 -#define SPELL_SAW_BLADE 31486 -#define SPELL_ELECTRIFIED_NET 35107 -#define H_SPELL_ENRAGE 1 //corrent enrage spell not known - -#define ENTRY_STREAMRIGGER_MECHANIC 17951 - -struct TRINITY_DLL_DECL boss_mekgineer_steamriggerAI : public ScriptedAI -{ - boss_mekgineer_steamriggerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - bool HeroicMode; - - uint32 Shrink_Timer; - uint32 Saw_Blade_Timer; - uint32 Electrified_Net_Timer; - bool Summon75; - bool Summon50; - bool Summon25; - - void Reset() - { - Shrink_Timer = 20000; - Saw_Blade_Timer = 15000; - Electrified_Net_Timer = 10000; - - Summon75 = false; - Summon50 = false; - Summon25 = false; - - if (pInstance && m_creature->isAlive()) - pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, NOT_STARTED); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, DONE); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - case 2: DoScriptText(SAY_SLAY_3, m_creature); break; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - if (pInstance) - pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER, IN_PROGRESS); - } - - //no known summon spells exist - void SummonMechanichs() - { - DoScriptText(SAY_MECHANICS, m_creature); - - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,-5,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - - if (rand()%2) - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,5,-7,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - if (rand()%2) - DoSpawnCreature(ENTRY_STREAMRIGGER_MECHANIC,7,-5,0,0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 240000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Shrink_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SUPER_SHRINK_RAY); - Shrink_Timer = 20000; - }else Shrink_Timer -= diff; - - if (Saw_Blade_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,SPELL_SAW_BLADE); - else - DoCast(m_creature->getVictim(),SPELL_SAW_BLADE); - - Saw_Blade_Timer = 15000; - } else Saw_Blade_Timer -= diff; - - if (Electrified_Net_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ELECTRIFIED_NET); - Electrified_Net_Timer = 10000; - } - else Electrified_Net_Timer -= diff; - - if (!Summon75) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 75) - { - SummonMechanichs(); - Summon75 = true; - } - } - - if (!Summon50) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) - { - SummonMechanichs(); - Summon50 = true; - } - } - - if (!Summon25) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) - { - SummonMechanichs(); - Summon25 = true; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_mekgineer_steamrigger(Creature* pCreature) -{ - return new boss_mekgineer_steamriggerAI (pCreature); -} - -#define SPELL_DISPEL_MAGIC 17201 -#define SPELL_REPAIR 31532 -#define H_SPELL_REPAIR 37936 - -#define MAX_REPAIR_RANGE (13.0f) //we should be at least at this range for repair -#define MIN_REPAIR_RANGE (7.0f) //we can stop movement at this range to repair but not required - -struct TRINITY_DLL_DECL mob_steamrigger_mechanicAI : public ScriptedAI -{ - mob_steamrigger_mechanicAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - uint32 Repair_Timer; - - void Reset() - { - Repair_Timer = 2000; - } - - void MoveInLineOfSight(Unit* who) - { - //react only if attacked - return; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (Repair_Timer < diff) - { - if (pInstance && pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER) && pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == IN_PROGRESS) - { - if (Unit* pMekgineer = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MEKGINEERSTEAMRIGGER))) - { - if (m_creature->IsWithinDistInMap(pMekgineer, MAX_REPAIR_RANGE)) - { - //are we already channeling? Doesn't work very well, find better check? - if (!m_creature->GetUInt32Value(UNIT_CHANNEL_SPELL)) - { - //m_creature->GetMotionMaster()->MovementExpired(); - //m_creature->GetMotionMaster()->MoveIdle(); - - DoCast(m_creature,HeroicMode ? H_SPELL_REPAIR : SPELL_REPAIR, true); - } - Repair_Timer = 5000; - } - else - { - //m_creature->GetMotionMaster()->MovementExpired(); - //m_creature->GetMotionMaster()->MoveFollow(pMekgineer,0,0); - } - } - }else Repair_Timer = 5000; - }else Repair_Timer -= diff; - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_steamrigger_mechanic(Creature* pCreature) -{ - return new mob_steamrigger_mechanicAI (pCreature); -} - -void AddSC_boss_mekgineer_steamrigger() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_mekgineer_steamrigger"; - newscript->GetAI = &GetAI_boss_mekgineer_steamrigger; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_steamrigger_mechanic"; - newscript->GetAI = &GetAI_mob_steamrigger_mechanic; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp deleted file mode 100644 index 0f4f2689398..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/boss_warlord_kalithresh.cpp +++ /dev/null @@ -1,213 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Warlord_Kalithres -SD%Complete: 65 -SDComment: Contains workarounds regarding warlord's rage spells not acting as expected. Both scripts here require review and fine tuning. -SDCategory: Coilfang Resevoir, The Steamvault -EndScriptData */ - -#include "precompiled.h" -#include "def_steam_vault.h" - -#define SAY_INTRO -1545016 -#define SAY_REGEN -1545017 -#define SAY_AGGRO1 -1545018 -#define SAY_AGGRO2 -1545019 -#define SAY_AGGRO3 -1545020 -#define SAY_SLAY1 -1545021 -#define SAY_SLAY2 -1545022 -#define SAY_DEATH -1545023 - -#define SPELL_SPELL_REFLECTION 31534 -#define SPELL_IMPALE 39061 -#define SPELL_WARLORDS_RAGE 37081 -#define SPELL_WARLORDS_RAGE_NAGA 31543 - -#define SPELL_WARLORDS_RAGE_PROC 36453 - -struct TRINITY_DLL_DECL mob_naga_distillerAI : public ScriptedAI -{ - mob_naga_distillerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - void Reset() - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - //hack, due to really weird spell behaviour :( - if (pInstance) - { - if (pInstance->GetData(TYPE_DISTILLER) == IN_PROGRESS) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - } - } - - void EnterCombat(Unit *who) { } - - void StartRageGen(Unit *caster) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - DoCast(m_creature,SPELL_WARLORDS_RAGE_NAGA,true); - - if (pInstance) - pInstance->SetData(TYPE_DISTILLER,IN_PROGRESS); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (m_creature->GetHealth() <= damage) - if (pInstance) - pInstance->SetData(TYPE_DISTILLER,DONE); - } -}; - -struct TRINITY_DLL_DECL boss_warlord_kalithreshAI : public ScriptedAI -{ - boss_warlord_kalithreshAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 Reflection_Timer; - uint32 Impale_Timer; - uint32 Rage_Timer; - bool CanRage; - - void Reset() - { - Reflection_Timer = 10000; - Impale_Timer = 7000+rand()%7000; - Rage_Timer = 45000; - CanRage = false; - - if (pInstance) - pInstance->SetData(TYPE_WARLORD_KALITHRESH, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - - if (pInstance) - pInstance->SetData(TYPE_WARLORD_KALITHRESH, IN_PROGRESS); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - //hack :( - if (spell->Id == SPELL_WARLORDS_RAGE_PROC) - if (pInstance) - if (pInstance->GetData(TYPE_DISTILLER) == DONE) - m_creature->RemoveAurasDueToSpell(SPELL_WARLORDS_RAGE_PROC); - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(TYPE_WARLORD_KALITHRESH, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Rage_Timer < diff) - { - if (Creature* distiller = me->FindNearestCreature(17954, 100.0f)) - { - DoScriptText(SAY_REGEN, m_creature); - DoCast(m_creature,SPELL_WARLORDS_RAGE); - CAST_AI(mob_naga_distillerAI, distiller->AI())->StartRageGen(m_creature); - } - Rage_Timer = 3000+rand()%15000; - }else Rage_Timer -= diff; - - //Reflection_Timer - if (Reflection_Timer < diff) - { - DoCast(m_creature, SPELL_SPELL_REFLECTION); - Reflection_Timer = 15000+rand()%10000; - }else Reflection_Timer -= diff; - - //Impale_Timer - if (Impale_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_IMPALE); - - Impale_Timer = 7500+rand()%5000; - }else Impale_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_naga_distiller(Creature* pCreature) -{ - return new mob_naga_distillerAI (pCreature); -} - -CreatureAI* GetAI_boss_warlord_kalithresh(Creature* pCreature) -{ - return new boss_warlord_kalithreshAI (pCreature); -} - -void AddSC_boss_warlord_kalithresh() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="mob_naga_distiller"; - newscript->GetAI = &GetAI_mob_naga_distiller; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_warlord_kalithresh"; - newscript->GetAI = &GetAI_boss_warlord_kalithresh; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h deleted file mode 100644 index 4b407ac4816..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/def_steam_vault.h +++ /dev/null @@ -1,17 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_STEAM_VAULT_H -#define DEF_STEAM_VAULT_H - -#define TYPE_HYDROMANCER_THESPIA 1 -#define TYPE_MEKGINEER_STEAMRIGGER 2 -#define TYPE_WARLORD_KALITHRESH 3 -#define TYPE_DISTILLER 4 - -#define DATA_MEKGINEERSTEAMRIGGER 5 -#define DATA_KALITRESH 6 -#define DATA_THESPIA 7 -#endif - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp deleted file mode 100644 index 29616a123ad..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/steam_vault/instance_steam_vault.cpp +++ /dev/null @@ -1,231 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Steam_Vault -SD%Complete: 80 -SDComment: Instance script and access panel GO -SDCategory: Coilfang Resevoir, The Steamvault -EndScriptData */ - -#include "precompiled.h" -#include "def_steam_vault.h" - -#define MAX_ENCOUNTER 4 - -#define MAIN_CHAMBERS_DOOR 183049 -#define ACCESS_PANEL_HYDRO 184125 -#define ACCESS_PANEL_MEK 184126 - -/* Steam Vaults encounters: -1 - Hydromancer Thespia Event -2 - Mekgineer Steamrigger Event -3 - Warlord Kalithresh Event -*/ - -bool GOHello_go_main_chambers_access_panel(Player* pPlayer, GameObject* pGo) -{ - ScriptedInstance* pInstance = pGo->GetInstanceData(); - - if (!pInstance) - return false; - - if (pGo->GetEntry() == ACCESS_PANEL_HYDRO && (pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == DONE || pInstance->GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL)) - pInstance->SetData(TYPE_HYDROMANCER_THESPIA,SPECIAL); - - if (pGo->GetEntry() == ACCESS_PANEL_MEK && (pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == DONE || pInstance->GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL)) - pInstance->SetData(TYPE_MEKGINEER_STEAMRIGGER,SPECIAL); - - return true; -} - -struct TRINITY_DLL_DECL instance_steam_vault : public ScriptedInstance -{ - instance_steam_vault(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint64 ThespiaGUID; - uint64 MekgineerGUID; - uint64 KalithreshGUID; - - uint64 MainChambersDoor; - uint64 AccessPanelHydro; - uint64 AccessPanelMek; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - ThespiaGUID = 0; - MekgineerGUID = 0; - KalithreshGUID = 0; - MainChambersDoor = 0; - AccessPanelHydro = 0; - AccessPanelMek = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - return true; - - return false; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 17797: ThespiaGUID = pCreature->GetGUID(); break; - case 17796: MekgineerGUID = pCreature->GetGUID(); break; - case 17798: KalithreshGUID = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case MAIN_CHAMBERS_DOOR: MainChambersDoor = pGo->GetGUID(); break; - case ACCESS_PANEL_HYDRO: AccessPanelHydro = pGo->GetGUID(); break; - case ACCESS_PANEL_MEK: AccessPanelMek = pGo->GetGUID(); break; - } - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_HYDROMANCER_THESPIA: - if (data == SPECIAL) - { - HandleGameObject(AccessPanelHydro, true); - - if (GetData(TYPE_MEKGINEER_STEAMRIGGER) == SPECIAL) - HandleGameObject(MainChambersDoor, true); - - debug_log("TSCR: Instance Steamvault: Access panel used."); - } - m_auiEncounter[0] = data; - break; - case TYPE_MEKGINEER_STEAMRIGGER: - if (data == SPECIAL) - { - HandleGameObject(AccessPanelMek, true); - - if (GetData(TYPE_HYDROMANCER_THESPIA) == SPECIAL) - HandleGameObject(MainChambersDoor, true); - - debug_log("TSCR: Instance Steamvault: Access panel used."); - } - m_auiEncounter[1] = data; - break; - case TYPE_WARLORD_KALITHRESH: - m_auiEncounter[2] = data; - break; - case TYPE_DISTILLER: - m_auiEncounter[3] = data; - break; - } - - if (data == DONE || data == SPECIAL) - SaveToDB(); - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_HYDROMANCER_THESPIA: - return m_auiEncounter[0]; - case TYPE_MEKGINEER_STEAMRIGGER: - return m_auiEncounter[1]; - case TYPE_WARLORD_KALITHRESH: - return m_auiEncounter[2]; - case TYPE_DISTILLER: - return m_auiEncounter[3]; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_THESPIA: - return ThespiaGUID; - case DATA_MEKGINEERSTEAMRIGGER: - return MekgineerGUID; - case DATA_KALITRESH: - return KalithreshGUID; - } - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if (out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - return NULL; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - OUT_LOAD_INST_DATA(in); - std::istringstream stream(in); - stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_steam_vault(Map* pMap) -{ - return new instance_steam_vault(pMap); -} - -void AddSC_instance_steam_vault() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "go_main_chambers_access_panel"; - newscript->pGOHello = &GOHello_go_main_chambers_access_panel; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "instance_steam_vault"; - newscript->GetInstanceData = &GetInstanceData_instance_steam_vault; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp deleted file mode 100644 index 309c63d857e..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_hungarfen.cpp +++ /dev/null @@ -1,156 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Hungarfen -SD%Complete: 95 -SDComment: Need confirmation if spell data are same in both modes. Summons should have faster rate in heroic -SDCategory: Coilfang Resevoir, Underbog -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_FOUL_SPORES 31673 -#define SPELL_ACID_GEYSER 38739 - -struct TRINITY_DLL_DECL boss_hungarfenAI : public ScriptedAI -{ - boss_hungarfenAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - bool Root; - uint32 Mushroom_Timer; - uint32 AcidGeyser_Timer; - - void Reset() - { - Root = false; - Mushroom_Timer = 5000; // 1 mushroom after 5s, then one per 10s. This should be different in heroic mode - AcidGeyser_Timer = 10000; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20) - { - if (!Root) - { - DoCast(m_creature,SPELL_FOUL_SPORES); - Root = true; - } - } - - if (Mushroom_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - m_creature->SummonCreature(17990, target->GetPositionX()+(rand()%8), target->GetPositionY()+(rand()%8), target->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); - else - m_creature->SummonCreature(17990, m_creature->GetPositionX()+(rand()%8), m_creature->GetPositionY()+(rand()%8), m_creature->GetPositionZ(), (rand()%5), TEMPSUMMON_TIMED_DESPAWN, 22000); - - Mushroom_Timer = 10000; - }else Mushroom_Timer -= diff; - - if (AcidGeyser_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ACID_GEYSER); - AcidGeyser_Timer = 10000+rand()%7500; - }else AcidGeyser_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_hungarfen(Creature* pCreature) -{ - return new boss_hungarfenAI (pCreature); -} - -#define SPELL_SPORE_CLOUD 34168 -#define SPELL_PUTRID_MUSHROOM 31690 -#define SPELL_GROW 31698 - -struct TRINITY_DLL_DECL mob_underbog_mushroomAI : public ScriptedAI -{ - mob_underbog_mushroomAI(Creature *c) : ScriptedAI(c) {} - - bool Stop; - uint32 Grow_Timer; - uint32 Shrink_Timer; - - void Reset() - { - Stop = false; - Grow_Timer = 0; - Shrink_Timer = 20000; - - DoCast(m_creature,SPELL_PUTRID_MUSHROOM,true); - DoCast(m_creature,SPELL_SPORE_CLOUD,true); - } - - void MoveInLineOfSight(Unit *who) { return; } - - void AttackStart(Unit* who) { return; } - - void EnterCombat(Unit* who) { } - - void UpdateAI(const uint32 diff) - { - if (Stop) - return; - - if (Grow_Timer <= diff) - { - DoCast(m_creature,SPELL_GROW); - Grow_Timer = 3000; - }else Grow_Timer -= diff; - - if (Shrink_Timer <= diff) - { - m_creature->RemoveAurasDueToSpell(SPELL_GROW); - Stop = true; - }else Shrink_Timer -= diff; - } -}; -CreatureAI* GetAI_mob_underbog_mushroom(Creature* pCreature) -{ - return new mob_underbog_mushroomAI (pCreature); -} - -void AddSC_boss_hungarfen() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_hungarfen"; - newscript->GetAI = &GetAI_boss_hungarfen; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_underbog_mushroom"; - newscript->GetAI = &GetAI_mob_underbog_mushroom; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp b/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp deleted file mode 100644 index 6da2a022adf..00000000000 --- a/src/bindings/scripts/scripts/zone/coilfang_resevoir/underbog/boss_the_black_stalker.cpp +++ /dev/null @@ -1,191 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_the_black_stalker -SD%Complete: 95 -SDComment: Timers may be incorrect -SDCategory: Coilfang Resevoir, Underbog -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_LEVITATE 31704 -#define SPELL_SUSPENSION 31719 -#define SPELL_LEVITATION_PULSE 31701 -#define SPELL_MAGNETIC_PULL 31705 -#define SPELL_CHAIN_LIGHTNING 31717 -#define SPELL_STATIC_CHARGE 31715 -#define SPELL_SUMMON_SPORE_STRIDER 38755 - -#define ENTRY_SPORE_STRIDER 22299 - -struct TRINITY_DLL_DECL boss_the_black_stalkerAI : public ScriptedAI -{ - boss_the_black_stalkerAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 SporeStriders_Timer; - uint32 Levitate_Timer; - uint32 ChainLightning_Timer; - uint32 StaticCharge_Timer; - uint64 LevitatedTarget; - uint32 LevitatedTarget_Timer; - bool InAir; - uint32 check_Timer; - std::list Striders; - - void Reset() - { - Levitate_Timer = 12000; - ChainLightning_Timer = 6000; - StaticCharge_Timer = 10000; - SporeStriders_Timer = 10000+rand()%5000; - check_Timer = 5000; - LevitatedTarget = 0; - LevitatedTarget_Timer = 0; - Striders.clear(); - } - - void EnterCombat(Unit *who) {} - - void JustSummoned(Creature *summon) - { - if (summon && summon->GetEntry() == ENTRY_SPORE_STRIDER) - { - Striders.push_back(summon->GetGUID()); - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1)) - summon->AI()->AttackStart(target); - else - if (m_creature->getVictim()) - summon->AI()->AttackStart(m_creature->getVictim()); - } - } - - void JustDied(Unit *who) - { - for(std::list::iterator i = Striders.begin(); i != Striders.end(); ++i) - if (Creature *strider = Unit::GetCreature(*m_creature, *i)) - { - strider->SetLootRecipient(NULL); - strider->DealDamage(strider,strider->GetMaxHealth(),NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - strider->RemoveCorpse(); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - // Evade if too far - if (check_Timer < diff) - { - float x,y,z,o; - m_creature->GetHomePosition(x,y,z,o); - if (!m_creature->IsWithinDist3d(x,y,z, 60)) - { - EnterEvadeMode(); - return; - } - check_Timer = 1000; - }else check_Timer -= diff; - - // Spore Striders - if (HeroicMode && SporeStriders_Timer < diff) - { - DoCast(m_creature,SPELL_SUMMON_SPORE_STRIDER); - SporeStriders_Timer = 10000+rand()%5000; - }else SporeStriders_Timer -= diff; - - // Levitate - if (LevitatedTarget) - { - if (LevitatedTarget_Timer < diff) - { - if (Unit* target = Unit::GetUnit(*m_creature, LevitatedTarget)) - { - if (!target->HasAura(SPELL_LEVITATE)) - { - LevitatedTarget = 0; - return; - } - if (InAir) - { - target->AddAura(SPELL_SUSPENSION, target); - LevitatedTarget = 0; - } - else - { - target->CastSpell(target, SPELL_MAGNETIC_PULL, true); - InAir = true; - LevitatedTarget_Timer = 1500; - } - } - else - LevitatedTarget = 0; - }else LevitatedTarget_Timer -= diff; - } - if (Levitate_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1)) - { - DoCast(target, SPELL_LEVITATE); - LevitatedTarget = target->GetGUID(); - LevitatedTarget_Timer = 2000; - InAir = false; - } - Levitate_Timer = 12000+rand()%3000; - }else Levitate_Timer -= diff; - - // Chain Lightning - if (ChainLightning_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_CHAIN_LIGHTNING); - ChainLightning_Timer = 7000; - }else ChainLightning_Timer -= diff; - - // Static Charge - if (StaticCharge_Timer < diff) - { - if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,true)) - DoCast(target, SPELL_STATIC_CHARGE); - StaticCharge_Timer = 10000; - }else StaticCharge_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_the_black_stalker(Creature* pCreature) -{ - return new boss_the_black_stalkerAI (pCreature); -} - -void AddSC_boss_the_black_stalker() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_the_black_stalker"; - newscript->GetAI = &GetAI_boss_the_black_stalker; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_dred.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_dred.cpp deleted file mode 100644 index 98425a29e1a..00000000000 --- a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_dred.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/* Script Data Start -SDName: Boss dred -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_BELLOWING_ROAR 44863 // fears the group, can be resisted/dispelled -#define SPELL_GRIEVOUS_BITE 48920 -#define SPELL_MANGLING_SLASH 48873 //casted on the current tank, adds debuf -#define SPELL_FEARSOME_ROAR_N 48849 -#define SPELL_FEARSOME_ROAR_H 48849 //Not stacking, debuff -#define SPELL_PIERCING_SLASH 48878 //debuff -->Armor reduced by 75% -#define SPELL_RAPTOR_CALL 59416 //dummy - - -struct TRINITY_DLL_DECL boss_dredAI : public ScriptedAI -{ - boss_dredAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; - -CreatureAI* GetAI_boss_dred(Creature* pCreature) -{ - return new boss_dredAI (pCreature); -} - -void AddSC_boss_dred() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_dred"; - newscript->GetAI = &GetAI_boss_dred; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp deleted file mode 100644 index 2f1cc7d22fc..00000000000 --- a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_novos.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* Script Data Start -SDName: Boss novos -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_novos' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ARCANE_BLAST_N 49198 -#define SPELL_ARCANE_BLAST_H 59909 -#define SPELL_ARCANE_FIELD 47346 -#define SPELL_BLIZZARD_N 49034 -#define SPELL_BLIZZARD_H 59854 -#define SPELL_FROSTBOLT_N 49037 -#define SPELL_FROSTBOLT_H 59855 -#define SPELL_WRATH_OF_MISERY_N 50089 -#define SPELL_WRATH_OF_MISERY_H 59856 -#define SPELL_SUMMON_MINIONS 59910 //Summons an army of Fetid Troll Corpses to assist the caster. - -//Yell -#define SAY_AGGRO -1600000 -#define SAY_KILL -1600001 -#define SAY_DEATH -1600002 -#define SAY_NECRO_ADD -1600003 -#define SAY_REUBBLE_1 -1600004 -#define SAY_REUBBLE_2 -1600005 - -struct TRINITY_DLL_DECL boss_novosAI : public ScriptedAI -{ - boss_novosAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - DoScriptText(SAY_KILL, m_creature); - } -}; - -CreatureAI* GetAI_boss_novos(Creature* pCreature) -{ - return new boss_novosAI (pCreature); -} - -void AddSC_boss_novos() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_novos"; - newscript->GetAI = &GetAI_boss_novos; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp deleted file mode 100644 index 62d724f4de4..00000000000 --- a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_tharon_ja.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* Script Data Start -SDName: Boss tharon_ja -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_tharon_ja' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_COURSE_OF_LIFE 49527 -#define SPELL_DECAY_FLESH 49356 //casted at end of pahase 1, starts phase 2 -#define SPELL_EYE_BEAM_N 49544 -#define SPELL_LIGHTNING_BREATH_N 49537 -#define SPELL_POISON_CLOUD_N 49548 -#define SPELL_RAIN_OF_FIRE_N 49518 -#define SPELL_RETURN_FLESH 53463 //Channeled spell ending phase two and returning to phase 1. This ability will stun the party for 6 seconds. -#define SPELL_SHADOW_VOLLEY_N 49528 - -//Spells Heroic -#define SPELL_COURSE_OF_LIFE_H 59972 -#define SPELL_EYE_BEAM_H 59965 -#define SPELL_LIGHTNING_BREATH_H 59963 -#define SPELL_POISON_CLOUD_H 59969 -#define SPELL_RAIN_OF_FIRE_H 59971 -#define SPELL_SHADOW_VOLLEY_H 59973 - -//Players skills durring Phase2 -#define PLAYER_PHASE2_SLAYING_STRIKE 50799 -#define PLAYER_PHASE2_TAUNT 49613 -#define PLAYER_PHASE2_BONE_ARMOR 49609 -#define PLAYER_PHASE2_TOUCH_OF_LIFE 49617 -//Phase 1 all abilities except Eye beam -//Phase 2 turns players to skeletons with new abilities, boss grows skin - -//Yell -#define SAY_AGGRO 1600011 -#define SAY_KILL_1 1600012 -#define SAY_KILL_2 1600013 -#define SAY_FLESH_1 1600014 -#define SAY_FLESH_2 1600015 -#define SAY_SKELETON_1 1600016 -#define SAY_SKELETON_2 1600017 -#define SAY_DEATH 1600018 - -struct TRINITY_DLL_DECL boss_tharon_jaAI : public ScriptedAI -{ - boss_tharon_jaAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH,m_creature); - } -}; - -CreatureAI* GetAI_boss_tharon_ja(Creature* pCreature) -{ - return new boss_tharon_jaAI (pCreature); -} - -void AddSC_boss_tharon_ja() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_tharon_ja"; - newscript->GetAI = &GetAI_boss_tharon_ja; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp deleted file mode 100644 index 59f68c37205..00000000000 --- a/src/bindings/scripts/scripts/zone/draktharon_keep/boss_trollgore.cpp +++ /dev/null @@ -1,75 +0,0 @@ -/* Script Data Start -SDName: Boss trollgore -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_trollgore' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spell -#define SPELL_INFECTED_WOUND 49637 -#define SPELL_CRUSH 49639 -#define SPELL_CORPSE_EXPLODE_N 49555 -#define SPELL_CONSUME_N 49380 - -//Spell Heroic -#define SPELL_CORPSE_EXPLODE_H 59807 -#define SPELL_CONSUME_H 59803 - -//Yell -#define SAY_AGGRO -1600006 -#define SAY_KILL -1600007 -#define SAY_CONSUME -1600008 -#define SAY_EXPLODE -1600009 -#define SAY_DEATH -1600010 - -struct TRINITY_DLL_DECL boss_trollgoreAI : public ScriptedAI -{ - boss_trollgoreAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - DoScriptText(SAY_KILL, m_creature); - } -}; - -CreatureAI* GetAI_boss_trollgore(Creature* pCreature) -{ - return new boss_trollgoreAI (pCreature); -} - -void AddSC_boss_trollgore() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_trollgore"; - newscript->GetAI = &GetAI_boss_trollgore; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h b/src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h deleted file mode 100644 index 321d77a9c27..00000000000 --- a/src/bindings/scripts/scripts/zone/draktharon_keep/def_drak_tharon_keep.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_DRAK_THARON_H -#define DEF_DRAK_THARON_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp b/src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp deleted file mode 100644 index 795f36eca18..00000000000 --- a/src/bindings/scripts/scripts/zone/draktharon_keep/instance_drak_tharon_keep.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_drak_tharon_keep.h" - -struct TRINITY_DLL_DECL instance_drak_tharon : public ScriptedInstance -{ - instance_drak_tharon(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_drak_tharon(Map* pMap) -{ - return new instance_drak_tharon(pMap); -} - -void AddSC_instance_drak_tharon() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_drak_tharon"; - newscript->GetInstanceData = &GetInstanceData_instance_drak_tharon; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp deleted file mode 100644 index dc4d9df18c4..00000000000 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_gruul.cpp +++ /dev/null @@ -1,260 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Gruul -SD%Complete: 60 -SDComment: Ground Slam need further development (knock back effect and shatter effect must be added to mangos) -SDCategory: Gruul's Lair -EndScriptData */ - -#include "precompiled.h" -#include "def_gruuls_lair.h" - -enum -{ - SAY_AGGRO = -1565010, - SAY_SLAM1 = -1565011, - SAY_SLAM2 = -1565012, - SAY_SHATTER1 = -1565013, - SAY_SHATTER2 = -1565014, - SAY_SLAY1 = -1565015, - SAY_SLAY2 = -1565016, - SAY_SLAY3 = -1565017, - SAY_DEATH = -1565018, - - EMOTE_GROW = -1565019, - - SPELL_GROWTH = 36300, - SPELL_CAVE_IN = 36240, - SPELL_GROUND_SLAM = 33525, //AoE Ground Slam applying Ground Slam to everyone with a script effect (most likely the knock back, we can code it to a set knockback) - SPELL_REVERBERATION = 36297, - SPELL_SHATTER = 33654, - - SPELL_SHATTER_EFFECT = 33671, - SPELL_HURTFUL_STRIKE = 33813, - SPELL_STONED = 33652, //Spell is self cast by target - - SPELL_MAGNETIC_PULL = 28337, - SPELL_KNOCK_BACK = 24199, //Knockback spell until correct implementation is made -}; - -struct TRINITY_DLL_DECL boss_gruulAI : public ScriptedAI -{ - boss_gruulAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 m_uiGrowth_Timer; - uint32 m_uiCaveIn_Timer; - uint32 m_uiCaveIn_StaticTimer; - uint32 m_uiGroundSlamTimer; - uint32 m_uiHurtfulStrike_Timer; - uint32 m_uiReverberation_Timer; - - bool m_bPerformingGroundSlam; - - void Reset() - { - m_uiGrowth_Timer= 30000; - m_uiCaveIn_Timer= 27000; - m_uiCaveIn_StaticTimer = 30000; - m_uiGroundSlamTimer= 35000; - m_bPerformingGroundSlam= false; - m_uiHurtfulStrike_Timer= 8000; - m_uiReverberation_Timer= 60000+45000; - - if (pInstance) - pInstance->SetData(DATA_GRUULEVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_GRUULEVENT, IN_PROGRESS); - } - - void KilledUnit() - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - { - pInstance->SetData(DATA_GRUULEVENT, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_GRUULDOOR), true); // Open the encounter door - } - } - - void SpellHitTarget(Unit* pTarget, const SpellEntry* pSpell) - { - //This to emulate effect1 (77) of SPELL_GROUND_SLAM, knock back to any direction - //It's initially wrong, since this will cause fall damage, which is by comments, not intended. - if (pSpell->Id == SPELL_GROUND_SLAM) - { - if (pTarget->GetTypeId() == TYPEID_PLAYER) - { - switch(rand()%2) - { - case 0: pTarget->CastSpell(pTarget, SPELL_MAGNETIC_PULL, true, NULL, NULL, m_creature->GetGUID()); break; - case 1: pTarget->CastSpell(pTarget, SPELL_KNOCK_BACK, true, NULL, NULL, m_creature->GetGUID()); break; - } - } - } - - //this part should be in mangos - if (pSpell->Id == SPELL_SHATTER) - { - //this spell must have custom handling in mangos, dealing damage based on distance - pTarget->CastSpell(pTarget, SPELL_SHATTER_EFFECT, true); - - if (pTarget->HasAura(SPELL_STONED)) - pTarget->RemoveAurasDueToSpell(SPELL_STONED); - - //clear this, if we are still performing - if (m_bPerformingGroundSlam) - { - m_bPerformingGroundSlam = false; - - //and correct movement, if not already - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) - { - if (m_creature->getVictim()) - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - // Growth - // Gruul can cast this spell up to 30 times - if (m_uiGrowth_Timer < uiDiff) - { - DoScriptText(EMOTE_GROW, m_creature); - DoCast(m_creature,SPELL_GROWTH); - m_uiGrowth_Timer = 30000; - } - else - m_uiGrowth_Timer -= uiDiff; - - if (m_bPerformingGroundSlam) - { - if (m_uiGroundSlamTimer < uiDiff) - { - m_uiGroundSlamTimer =120000; - m_uiHurtfulStrike_Timer= 8000; - - if (m_uiReverberation_Timer < 10000) //Give a little time to the players to undo the damage from shatter - m_uiReverberation_Timer += 10000; - - DoCast(m_creature, SPELL_SHATTER); - } - else - m_uiGroundSlamTimer -= uiDiff; - } - else - { - // Hurtful Strike - if (m_uiHurtfulStrike_Timer < uiDiff) - { - Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO,1); - - if (target && m_creature->IsWithinMeleeRange(m_creature->getVictim())) - DoCast(target,SPELL_HURTFUL_STRIKE); - else - DoCast(m_creature->getVictim(),SPELL_HURTFUL_STRIKE); - - m_uiHurtfulStrike_Timer= 8000; - } - else - m_uiHurtfulStrike_Timer -= uiDiff; - - // Reverberation - if (m_uiReverberation_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_REVERBERATION, true); - m_uiReverberation_Timer = 15000 + rand()%10000; - } - else - m_uiReverberation_Timer -= uiDiff; - - // Cave In - if (m_uiCaveIn_Timer < uiDiff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_CAVE_IN); - - if (m_uiCaveIn_StaticTimer >= 4000) - m_uiCaveIn_StaticTimer -= 2000; - - m_uiCaveIn_Timer = m_uiCaveIn_StaticTimer; - } - else - m_uiCaveIn_Timer -= uiDiff; - - // Ground Slam, Gronn Lord's Grasp, Stoned, Shatter - if (m_uiGroundSlamTimer < uiDiff) - { - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveIdle(); - - m_bPerformingGroundSlam= true; - m_uiGroundSlamTimer = 10000; - - DoCast(m_creature, SPELL_GROUND_SLAM); - } - else - m_uiGroundSlamTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } - } -}; - -CreatureAI* GetAI_boss_gruul(Creature* pCreature) -{ - return new boss_gruulAI (pCreature); -} - -void AddSC_boss_gruul() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_gruul"; - newscript->GetAI = &GetAI_boss_gruul; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp deleted file mode 100644 index 6918feaabba..00000000000 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/boss_high_king_maulgar.cpp +++ /dev/null @@ -1,793 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_High_King_Maulgar -SD%Complete: 90 -SDComment: Correct timers, after whirlwind melee attack bug, prayer of healing -SDCategory: Gruul's Lair -EndScriptData */ - -#include "precompiled.h" -#include "def_gruuls_lair.h" - -#define SAY_AGGRO -1565000 -#define SAY_ENRAGE -1565001 -#define SAY_OGRE_DEATH1 -1565002 -#define SAY_OGRE_DEATH2 -1565003 -#define SAY_OGRE_DEATH3 -1565004 -#define SAY_OGRE_DEATH4 -1565005 -#define SAY_SLAY1 -1565006 -#define SAY_SLAY2 -1565007 -#define SAY_SLAY3 -1565008 -#define SAY_DEATH -1565009 - -// High King Maulgar -#define SPELL_ARCING_SMASH 39144 -#define SPELL_MIGHTY_BLOW 33230 -#define SPELL_WHIRLWIND 33238 -#define SPELL_BERSERKER_C 26561 -#define SPELL_ROAR 16508 -#define SPELL_FLURRY 33232 -#define SPELL_DUAL_WIELD 29651 //used in phase - -// Olm the Summoner -#define SPELL_DARK_DECAY 33129 -#define SPELL_DEATH_COIL 33130 -#define SPELL_SUMMON_WFH 33131 - -//Kiggler the Craed -#define SPELL_GREATER_POLYMORPH 33173 -#define SPELL_LIGHTNING_BOLT 36152 -#define SPELL_ARCANE_SHOCK 33175 -#define SPELL_ARCANE_EXPLOSION 33237 - -//Blindeye the Seer -#define SPELL_GREATER_PW_SHIELD 33147 -#define SPELL_HEAL 33144 -#define SPELL_PRAYER_OH 33152 - -//Krosh Firehand -#define SPELL_GREATER_FIREBALL 33051 -#define SPELL_SPELLSHIELD 33054 -#define SPELL_BLAST_WAVE 33061 - -bool CheckAllBossDied(ScriptedInstance* pInstance, Creature* m_creature) -{ - if (!pInstance || !m_creature) - return false; - - uint64 MaulgarGUID = 0; - uint64 KigglerGUID = 0; - uint64 BlindeyeGUID = 0; - uint64 OlmGUID = 0; - uint64 KroshGUID = 0; - - Creature* Maulgar = NULL; - Creature* Kiggler = NULL; - Creature* Blindeye = NULL; - Creature* Olm = NULL; - Creature* Krosh = NULL; - - MaulgarGUID = pInstance->GetData64(DATA_MAULGAR); - KigglerGUID = pInstance->GetData64(DATA_KIGGLERTHECRAZED); - BlindeyeGUID = pInstance->GetData64(DATA_BLINDEYETHESEER); - OlmGUID = pInstance->GetData64(DATA_OLMTHESUMMONER); - KroshGUID = pInstance->GetData64(DATA_KROSHFIREHAND); - - Maulgar = (Unit::GetCreature((*m_creature), MaulgarGUID)); - Kiggler = (Unit::GetCreature((*m_creature), KigglerGUID)); - Blindeye = (Unit::GetCreature((*m_creature), BlindeyeGUID)); - Olm = (Unit::GetCreature((*m_creature), OlmGUID)); - Krosh = (Unit::GetCreature((*m_creature), KroshGUID)); - - if (!Maulgar || !Kiggler || !Blindeye || !Olm || !Krosh) - return false; - - if (!Maulgar->isAlive() && !Kiggler->isAlive() && !Blindeye->isAlive() && !Olm->isAlive() && !Krosh->isAlive()) - return true; - - return false; -} - -//High King Maulgar AI -struct TRINITY_DLL_DECL boss_high_king_maulgarAI : public ScriptedAI -{ - boss_high_king_maulgarAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - for(uint8 i = 0; i < 4; ++i) - Council[i] = 0; - } - - ScriptedInstance* pInstance; - - uint32 ArcingSmash_Timer; - uint32 MightyBlow_Timer; - uint32 Whirlwind_Timer; - uint32 Charging_Timer; - uint32 Roar_Timer; - - bool Phase2; - - uint64 Council[4]; - - void Reset() - { - ArcingSmash_Timer = 10000; - MightyBlow_Timer = 40000; - Whirlwind_Timer = 30000; - Charging_Timer = 0; - Roar_Timer = 0; - - m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, false); - - Phase2 = false; - - Creature *pCreature = NULL; - for(uint8 i = 0; i < 4; ++i) - { - if (Council[i]) - { - pCreature = (Unit::GetCreature((*m_creature), Council[i])); - if (pCreature && !pCreature->isAlive()) - { - pCreature->Respawn(); - pCreature->AI()->EnterEvadeMode(); - } - } - } - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void KilledUnit() - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (CheckAllBossDied(pInstance, m_creature)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - - void AddDeath() - { - switch(rand()%4) - { - case 0: DoScriptText(SAY_OGRE_DEATH1, m_creature);break; - case 1: DoScriptText(SAY_OGRE_DEATH2, m_creature);break; - case 2: DoScriptText(SAY_OGRE_DEATH3, m_creature);break; - case 3: DoScriptText(SAY_OGRE_DEATH4, m_creature);break; - } - } - - - void EnterCombat(Unit *who) - { - StartEvent(who); - } - - void GetCouncil() - { - //get council member's guid to respawn them if needed - Council[0] = pInstance->GetData64(DATA_KIGGLERTHECRAZED); - Council[1] = pInstance->GetData64(DATA_BLINDEYETHESEER); - Council[2] = pInstance->GetData64(DATA_OLMTHESUMMONER); - Council[3] = pInstance->GetData64(DATA_KROSHFIREHAND); - } - - void StartEvent(Unit *who) - { - if (!pInstance) - return; - - GetCouncil(); - - DoScriptText(SAY_AGGRO, m_creature); - - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - - DoZoneInCombat(); - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (target) - { - AttackStart(target); - GetCouncil(); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //ArcingSmash_Timer - if (ArcingSmash_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCING_SMASH); - ArcingSmash_Timer = 10000; - }else ArcingSmash_Timer -= diff; - - //Whirlwind_Timer - if (Whirlwind_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_WHIRLWIND); - Whirlwind_Timer = 55000; - }else Whirlwind_Timer -= diff; - - //MightyBlow_Timer - if (MightyBlow_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_MIGHTY_BLOW); - MightyBlow_Timer = 30000+rand()%10000; - }else MightyBlow_Timer -= diff; - - //Entering Phase 2 - if (!Phase2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) - { - Phase2 = true; - DoScriptText(SAY_ENRAGE, m_creature); - - m_creature->CastSpell(m_creature, SPELL_DUAL_WIELD, true); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID, 0); - m_creature->SetUInt32Value(UNIT_VIRTUAL_ITEM_SLOT_ID+1, 0); - } - - if (Phase2) - { - //Charging_Timer - if (Charging_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - { - AttackStart(target); - DoCast(target, SPELL_BERSERKER_C); - } - Charging_Timer = 20000; - }else Charging_Timer -= diff; - - //Intimidating Roar - if (Roar_Timer < diff) - { - DoCast(m_creature, SPELL_ROAR); - Roar_Timer = 40000+(rand()%10000); - }else Roar_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -//Olm The Summoner AI -struct TRINITY_DLL_DECL boss_olm_the_summonerAI : public ScriptedAI -{ - boss_olm_the_summonerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 DarkDecay_Timer; - uint32 Summon_Timer; - uint32 DeathCoil_Timer; - - ScriptedInstance* pInstance; - - void Reset() - { - DarkDecay_Timer = 10000; - Summon_Timer = 15000; - DeathCoil_Timer = 20000; - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void AttackStart(Unit* pWho) - { - if (!pWho) - return; - - if (m_creature->Attack(pWho, true)) - { - m_creature->AddThreat(pWho, 0.0f); - m_creature->SetInCombatWith(pWho); - pWho->SetInCombatWith(m_creature); - - m_creature->GetMotionMaster()->MoveChase(pWho, 30.0f); - } - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - Creature *Maulgar = NULL; - Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); - - if (Maulgar) - CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); - - if (CheckAllBossDied(pInstance, m_creature)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (target) - { - AttackStart(target); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //DarkDecay_Timer - if (DarkDecay_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_DARK_DECAY); - DarkDecay_Timer = 20000; - }else DarkDecay_Timer -= diff; - - //Summon_Timer - if (Summon_Timer < diff) - { - DoCast(m_creature, SPELL_SUMMON_WFH); - Summon_Timer = 30000; - }else Summon_Timer -= diff; - - //DeathCoil Timer /need correct timer - if (DeathCoil_Timer < diff) - { - Unit* target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - DoCast(target, SPELL_DEATH_COIL); - DeathCoil_Timer = 20000; - }else DeathCoil_Timer -= diff; - - - DoMeleeAttackIfReady(); - } -}; - -//Kiggler The Crazed AI -struct TRINITY_DLL_DECL boss_kiggler_the_crazedAI : public ScriptedAI -{ - boss_kiggler_the_crazedAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 GreaterPolymorph_Timer; - uint32 LightningBolt_Timer; - uint32 ArcaneShock_Timer; - uint32 ArcaneExplosion_Timer; - - ScriptedInstance* pInstance; - - void Reset() - { - GreaterPolymorph_Timer = 5000; - LightningBolt_Timer = 10000; - ArcaneShock_Timer = 20000; - ArcaneExplosion_Timer = 30000; - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - Creature *Maulgar = NULL; - Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); - - if (Maulgar) - CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); - - if (CheckAllBossDied(pInstance, m_creature)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (target) - { - AttackStart(target); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //GreaterPolymorph_Timer - if (GreaterPolymorph_Timer < diff) - { - Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - DoCast(target, SPELL_GREATER_POLYMORPH); - - GreaterPolymorph_Timer = 15000 + rand()%5000; - }else GreaterPolymorph_Timer -= diff; - - //LightningBolt_Timer - if (LightningBolt_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_LIGHTNING_BOLT); - LightningBolt_Timer = 15000; - }else LightningBolt_Timer -= diff; - - //ArcaneShock_Timer - if (ArcaneShock_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCANE_SHOCK); - ArcaneShock_Timer = 20000; - }else ArcaneShock_Timer -= diff; - - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = 30000; - }else ArcaneExplosion_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Blindeye The Seer AI -struct TRINITY_DLL_DECL boss_blindeye_the_seerAI : public ScriptedAI -{ - boss_blindeye_the_seerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 GreaterPowerWordShield_Timer; - uint32 Heal_Timer; - uint32 PrayerofHealing_Timer; - - ScriptedInstance* pInstance; - - void Reset() - { - GreaterPowerWordShield_Timer = 5000; - Heal_Timer = 25000 + rand()%15000; - PrayerofHealing_Timer = 45000 + rand()%10000; - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - Creature *Maulgar = NULL; - Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); - - if (Maulgar) - CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); - - if (CheckAllBossDied(pInstance, m_creature)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (target) - { - AttackStart(target); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //GreaterPowerWordShield_Timer - if (GreaterPowerWordShield_Timer < diff) - { - DoCast(m_creature, SPELL_GREATER_PW_SHIELD); - GreaterPowerWordShield_Timer = 40000; - }else GreaterPowerWordShield_Timer -= diff; - - //Heal_Timer - if (Heal_Timer < diff) - { - DoCast(m_creature, SPELL_HEAL); - Heal_Timer = 15000 + rand()%25000; - }else Heal_Timer -= diff; - - //PrayerofHealing_Timer - if (PrayerofHealing_Timer < diff) - { - DoCast(m_creature, SPELL_PRAYER_OH); - PrayerofHealing_Timer = 35000 + rand()%15000; - }else PrayerofHealing_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Krosh Firehand AI -struct TRINITY_DLL_DECL boss_krosh_firehandAI : public ScriptedAI -{ - boss_krosh_firehandAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - uint32 GreaterFireball_Timer; - uint32 SpellShield_Timer; - uint32 BlastWave_Timer; - - ScriptedInstance* pInstance; - - void Reset() - { - GreaterFireball_Timer = 1000; - SpellShield_Timer = 5000; - BlastWave_Timer = 20000; - - //reset encounter - if (pInstance) - pInstance->SetData(DATA_MAULGAREVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - { - pInstance->SetData64(DATA_MAULGAREVENT_TANK, who->GetGUID()); - pInstance->SetData(DATA_MAULGAREVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - Creature *Maulgar = NULL; - Maulgar = (Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_MAULGAR))); - - if (Maulgar) - CAST_AI(boss_high_king_maulgarAI, Maulgar->AI())->AddDeath(); - - if (CheckAllBossDied(pInstance, m_creature)) - pInstance->SetData(DATA_MAULGAREVENT, DONE); - } - } - - void UpdateAI(const uint32 diff) - { - //Only if not incombat check if the event is started - if (!m_creature->isInCombat() && pInstance && pInstance->GetData(DATA_MAULGAREVENT)) - { - Unit* target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_MAULGAREVENT_TANK)); - - if (target) - { - AttackStart(target); - } - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - //someone evaded! - if (pInstance && !pInstance->GetData(DATA_MAULGAREVENT)) - { - EnterEvadeMode(); - return; - } - - //GreaterFireball_Timer - if (GreaterFireball_Timer < diff || m_creature->IsWithinDist(m_creature->getVictim(), 30)) - { - DoCast(m_creature->getVictim(), SPELL_GREATER_FIREBALL); - GreaterFireball_Timer = 2000; - }else GreaterFireball_Timer -= diff; - - //SpellShield_Timer - if (SpellShield_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature->getVictim(), SPELL_SPELLSHIELD); - SpellShield_Timer = 30000; - }else SpellShield_Timer -= diff; - - //BlastWave_Timer - if (BlastWave_Timer < diff) - { - Unit *target; - std::list t_list = m_creature->getThreatManager().getThreatList(); - std::vector target_list; - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - //15 yard radius minimum - if (target && target->IsWithinDist(m_creature, 15,false)) - target_list.push_back(target); - target = NULL; - } - if (target_list.size()) - target = *(target_list.begin()+rand()%target_list.size()); - - m_creature->InterruptNonMeleeSpells(false); - DoCast(target, SPELL_BLAST_WAVE); - BlastWave_Timer = 60000; - }else BlastWave_Timer -= diff; - } -}; - -CreatureAI* GetAI_boss_high_king_maulgar(Creature* pCreature) -{ - return new boss_high_king_maulgarAI (pCreature); -} - -CreatureAI* GetAI_boss_olm_the_summoner(Creature* pCreature) -{ - return new boss_olm_the_summonerAI (pCreature); -} - -CreatureAI *GetAI_boss_kiggler_the_crazed(Creature* pCreature) -{ - return new boss_kiggler_the_crazedAI (pCreature); -} - -CreatureAI *GetAI_boss_blindeye_the_seer(Creature* pCreature) -{ - return new boss_blindeye_the_seerAI (pCreature); -} - -CreatureAI *GetAI_boss_krosh_firehand(Creature* pCreature) -{ - return new boss_krosh_firehandAI (pCreature); -} - -void AddSC_boss_high_king_maulgar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_high_king_maulgar"; - newscript->GetAI = &GetAI_boss_high_king_maulgar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_kiggler_the_crazed"; - newscript->GetAI = &GetAI_boss_kiggler_the_crazed; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_blindeye_the_seer"; - newscript->GetAI = &GetAI_boss_blindeye_the_seer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_olm_the_summoner"; - newscript->GetAI = &GetAI_boss_olm_the_summoner; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_krosh_firehand"; - newscript->GetAI = &GetAI_boss_krosh_firehand; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h b/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h deleted file mode 100644 index 7003dcb1e26..00000000000 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/def_gruuls_lair.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_GRUULS_LAIR_H -#define DEF_GRUULS_LAIR_H - -#define DATA_BLINDEYETHESEER 1 -#define DATA_GRUULEVENT 2 -#define DATA_KIGGLERTHECRAZED 3 -#define DATA_KROSHFIREHAND 4 -#define DATA_MAULGAREVENT 5 -#define DATA_MAULGAREVENT_TANK 6 -#define DATA_OLMTHESUMMONER 7 -#define DATA_MAULGARDOOR 8 -#define DATA_GRUULDOOR 9 -#define DATA_MAULGAR 10 - -#define ERROR_INST_DATA "TSCR Error: Instance Data not set properly for Gruul's Lair instance (map 565). Encounters will be buggy." -#endif - diff --git a/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp b/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp deleted file mode 100644 index 0ac5cbcaf7a..00000000000 --- a/src/bindings/scripts/scripts/zone/gruuls_lair/instance_gruuls_lair.cpp +++ /dev/null @@ -1,193 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Gruuls_Lair -SD%Complete: 100 -SDComment: -SDCategory: Gruul's Lair -EndScriptData */ - -#include "precompiled.h" -#include "def_gruuls_lair.h" - -#define MAX_ENCOUNTER 2 - -/* Gruuls Lair encounters: -1 - High King Maulgar event -2 - Gruul event -*/ - -struct TRINITY_DLL_DECL instance_gruuls_lair : public ScriptedInstance -{ - instance_gruuls_lair(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint64 MaulgarEvent_Tank; - uint64 KigglerTheCrazed; - uint64 BlindeyeTheSeer; - uint64 OlmTheSummoner; - uint64 KroshFirehand; - uint64 Maulgar; - - uint64 MaulgarDoor; - uint64 GruulDoor; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - MaulgarEvent_Tank = 0; - KigglerTheCrazed = 0; - BlindeyeTheSeer = 0; - OlmTheSummoner = 0; - KroshFirehand = 0; - Maulgar = 0; - - MaulgarDoor = 0; - GruulDoor = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 18835: KigglerTheCrazed = pCreature->GetGUID(); break; - case 18836: BlindeyeTheSeer = pCreature->GetGUID(); break; - case 18834: OlmTheSummoner = pCreature->GetGUID(); break; - case 18832: KroshFirehand = pCreature->GetGUID(); break; - case 18831: Maulgar = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 184468: - MaulgarDoor = pGo->GetGUID(); - if (m_auiEncounter[0] == DONE) HandleGameObject(NULL, true, pGo); - break; - case 184662: GruulDoor = pGo->GetGUID(); break; - } - } - - void SetData64(uint32 type, uint64 data) - { - if (type == DATA_MAULGAREVENT_TANK) - MaulgarEvent_Tank = data; - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_MAULGAREVENT_TANK: return MaulgarEvent_Tank; - case DATA_KIGGLERTHECRAZED: return KigglerTheCrazed; - case DATA_BLINDEYETHESEER: return BlindeyeTheSeer; - case DATA_OLMTHESUMMONER: return OlmTheSummoner; - case DATA_KROSHFIREHAND: return KroshFirehand; - case DATA_MAULGARDOOR: return MaulgarDoor; - case DATA_GRUULDOOR: return GruulDoor; - case DATA_MAULGAR: return Maulgar; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_MAULGAREVENT: - if (data == DONE) HandleGameObject(MaulgarDoor, true); - m_auiEncounter[0] = data; break; - case DATA_GRUULEVENT: - if (data == IN_PROGRESS) HandleGameObject(GruulDoor, false); - else HandleGameObject(GruulDoor, true); - m_auiEncounter[1] = data; break; - } - - if (data == DONE) - SaveToDB(); - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_MAULGAREVENT: return m_auiEncounter[0]; - case DATA_GRUULEVENT: return m_auiEncounter[1]; - } - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1]; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if (out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - - return NULL; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - std::istringstream stream(in); - stream >> m_auiEncounter[0] >> m_auiEncounter[1]; - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. - m_auiEncounter[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_gruuls_lair(Map* pMap) -{ - return new instance_gruuls_lair(pMap); -} - -void AddSC_instance_gruuls_lair() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_gruuls_lair"; - newscript->GetInstanceData = &GetInstanceData_instance_gruuls_lair; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp deleted file mode 100644 index 4d18ad6ba7c..00000000000 --- a/src/bindings/scripts/scripts/zone/gundrak/boss_drakkari_colossus.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/* Script Data Start -SDName: Boss Drakkari Colossus -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_EMERGE 54850 //to phase2, Colossus unatackable, Elemental emerges -#define SPELL_EMERGE_2 54851 -#define SPELL_MIGHTY_BLOW 54719 - -struct TRINITY_DLL_DECL boss_drakkari_colossusAI : public ScriptedAI -{ - boss_drakkari_colossusAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase; - - void Reset() {} - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - phase =1; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; - -CreatureAI* GetAI_boss_drakkari_colossus(Creature* pCreature) -{ - return new boss_drakkari_colossusAI (pCreature); -} - -void AddSC_boss_drakkari_colossus() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_drakkari_colossus"; - newscript->GetAI = &GetAI_boss_drakkari_colossus; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp deleted file mode 100644 index 8c72de6c9ad..00000000000 --- a/src/bindings/scripts/scripts/zone/gundrak/boss_eck.cpp +++ /dev/null @@ -1,65 +0,0 @@ -/* Script Data Start -SDName: Boss Eck the Ferocious -SDAuthor: LordVanMartin -SD%Complete: -SDComment: Only appears in Heroic mode -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -#define SPELL_ECK_BERSERK 55816 //Eck goes berserk, increasing his attack speed by 150% and all damage he deals by 500%. -#define SPELL_ECK_BITE 55813 //Eck bites down hard, inflicting 150% of his normal damage to an enemy. -#define SPELL_ECK_SPIT 55814 //Eck spits toxic bile at enemies in a cone in front of him, inflicting 2970 Nature damage and draining 220 mana every 1 sec for 3 sec. -#define SPELL_ECK_SPRING_1 55815 //Eck leaps at a distant target. --> Drops aggro and charges a random player. Tank can simply taunt him back. -#define SPELL_ECK_SPRING_2 55837 //Eck leaps at a distant target. - -struct TRINITY_DLL_DECL boss_eckAI : public ScriptedAI -{ - boss_eckAI(Creature *c) : ScriptedAI(c) {} - - uint32 berserk; - - void Reset() - { - //Source Deadly Boss Mod - berserk = 120000; //2min - } - - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (berserk < diff) - { - DoCast(m_creature,SPELL_ECK_BERSERK); - berserk = 120000; - }else berserk -= diff; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; - -CreatureAI* GetAI_boss_eck(Creature* pCreature) -{ - return new boss_eckAI (pCreature); -} - -void AddSC_boss_eck() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_eck"; - newscript->GetAI = &GetAI_boss_eck; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp deleted file mode 100644 index 65edd1b312e..00000000000 --- a/src/bindings/scripts/scripts/zone/gundrak/boss_gal_darah.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* Script Data Start -SDName: Boss gal_darah -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ENRAGE 55285 -#define SPELL_IMPALING_CHARGE 54956 -#define SPELL_STOMP 55292 - -#define SPELL_PUNCTURE 55276 -#define SPELL_STAMPEDE 55218 -#define SPELL_WHIRLING_SLASH 55285 - -//Yells -#define SAY_AGGRO -1604000 -#define SAY_SLAY_1 -1604001 -#define SAY_SLAY_2 -1604002 -#define SAY_SLAY_3 -1604003 -#define SAY_DEATH -1604004 -#define SAY_SUMMON_RHINO_1 -1604005 -#define SAY_SUMMON_RHINO_2 -1604006 -#define SAY_SUMMON_RHINO_3 -1604007 -#define SAY_TRANSFORM_1 -1604008 //Phase change -#define SAY_TRANSFORM_2 -1604009 - -struct TRINITY_DLL_DECL boss_gal_darahAI : public ScriptedAI -{ - boss_gal_darahAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_gal_darah(Creature* pCreature) -{ - return new boss_gal_darahAI (pCreature); -} - -void AddSC_boss_gal_darah() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_gal_darah"; - newscript->GetAI = &GetAI_boss_gal_darah; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp deleted file mode 100644 index 7bdbe0eebc9..00000000000 --- a/src/bindings/scripts/scripts/zone/gundrak/boss_moorabi.cpp +++ /dev/null @@ -1,88 +0,0 @@ -/* Script Data Start -SDName: Boss moorabi -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_moorabi' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_DETERMINED_GORE 55102 -#define SPELL_DETERMINED_STAB_2 59444 -#define SPELL_DETERMINED_STAB_3 55104 - -#define SPELL_GROUND_TREMOR 55142 -#define SPELL_MOJO_FRENZY 55163 -#define SPELL_NUMBING_ROAR_1 55100 -#define SPELL_NUMBING_ROAR_2 55106 -#define SPELL_TRANSFORMATION 55098 //Periodic, The caster transforms into a powerful mammoth, increasing Physical damage done by 25% and granting immunity to Stun effects. -#define SPELL_QUAKE 55101 - -//Yell -#define SAY_AGGRO -1604010 -#define SAY_SLAY_1 -1604011 -#define SAY_SLAY_2 -1604012 -#define SAY_SLAY_3 -1604013 -#define SAY_DEATH -1604014 -#define SAY_TRANSFORM -1604015 -#define SAY_QUAKE -1604016 - -struct TRINITY_DLL_DECL boss_moorabiAI : public ScriptedAI -{ - boss_moorabiAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase; - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - phase =1; - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_moorabi(Creature* pCreature) -{ - return new boss_moorabiAI (pCreature); -} - -void AddSC_boss_moorabi() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_moorabi"; - newscript->GetAI = &GetAI_boss_moorabi; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp b/src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp deleted file mode 100644 index 559a0090e3b..00000000000 --- a/src/bindings/scripts/scripts/zone/gundrak/boss_slad_ran.cpp +++ /dev/null @@ -1,95 +0,0 @@ -/* Script Data Start -SDName: Boss slad_ran -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_slad_ran' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_POISON_NOVA 55081 -#define SPELL_POISON_NOVA_2 59842 -//-- -#define SPELL_POWERFUL_BITE 48287 -#define SPELL_POWERFUL_BITE_2 59840 -//-- -#define SPELL_VENOM_BOLT 54970 -#define SPELL_VENOM_BOLT_2 59839 -//At 30% HPStart summoning small serpents - -//Yell -#define SAY_AGGRO -1604017 -#define SAY_SLAY_1 -1604018 -#define SAY_SLAY_2 -1604019 -#define SAY_SLAY_3 -1604020 -#define SAY_DEATH -1604021 -#define SAY_SUMMON_SNAKES -1604022 //npc 29680 -#define SAY_SUMMON_CONSTRICTORS -1604023 //npc 29713, can cast Grip of Slad'ran (spell 55093) - -struct TRINITY_DLL_DECL boss_slad_ranAI : public ScriptedAI -{ - boss_slad_ranAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 30) - { - //Summon 3 snakes --> npc 29680 - DoScriptText(SAY_SUMMON_SNAKES,m_creature); - } - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 25) - { - //Summon 3 constrictors --> npc 29713 - DoScriptText(SAY_SUMMON_CONSTRICTORS,m_creature); - } - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%3) - { - case 0:DoScriptText(SAY_SLAY_1, m_creature);break; - case 1:DoScriptText(SAY_SLAY_2, m_creature);break; - case 2:DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_slad_ran(Creature* pCreature) -{ - return new boss_slad_ranAI (pCreature); -} - -void AddSC_boss_slad_ran() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_slad_ran"; - newscript->GetAI = &GetAI_boss_slad_ran; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h b/src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h deleted file mode 100644 index 5f015610312..00000000000 --- a/src/bindings/scripts/scripts/zone/gundrak/def_gundrak.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_GUNDRAK_H -#define DEF_GUNDRAK_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp b/src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp deleted file mode 100644 index 0ed874d905f..00000000000 --- a/src/bindings/scripts/scripts/zone/gundrak/instance_gundrak.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_gundrak.h" - -struct TRINITY_DLL_DECL instance_gundrak : public ScriptedInstance -{ - instance_gundrak(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_gundrak(Map* pMap) -{ - return new instance_gundrak(pMap); -} - -void AddSC_instance_gundrak() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_gundrak"; - newscript->GetInstanceData = &GetInstanceData_instance_gundrak; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp deleted file mode 100644 index 6c877602426..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_broggok.cpp +++ /dev/null @@ -1,131 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Broggok -SD%Complete: 70 -SDComment: pre-event not made -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - -#include "precompiled.h" -#include "def_blood_furnace.h" - -enum -{ - SAY_AGGRO = -1542008, - - SPELL_SLIME_SPRAY = 30913, - SPELL_POISON_CLOUD = 30916, - SPELL_POISON_BOLT = 30917, - - SPELL_POISON = 30914 -}; - -struct TRINITY_DLL_DECL boss_broggokAI : public ScriptedAI -{ - boss_broggokAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 AcidSpray_Timer; - uint32 PoisonSpawn_Timer; - uint32 PoisonBolt_Timer; - - void Reset() - { - AcidSpray_Timer = 10000; - PoisonSpawn_Timer = 5000; - PoisonBolt_Timer = 7000; - if (pInstance) - { - pInstance->SetData(TYPE_BROGGOK_EVENT, NOT_STARTED); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), true); - } - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - if (pInstance) - { - pInstance->SetData(TYPE_BROGGOK_EVENT, IN_PROGRESS); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), false); - } - } - - void JustSummoned(Creature *summoned) - { - summoned->setFaction(16); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - summoned->CastSpell(summoned,SPELL_POISON,false,0,0,m_creature->GetGUID()); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (AcidSpray_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SLIME_SPRAY); - AcidSpray_Timer = 4000+rand()%8000; - }else AcidSpray_Timer -=diff; - - if (PoisonBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_POISON_BOLT); - PoisonBolt_Timer = 4000+rand()%8000; - }else PoisonBolt_Timer -=diff; - - if (PoisonSpawn_Timer < diff) - { - DoCast(m_creature,SPELL_POISON_CLOUD); - PoisonSpawn_Timer = 20000; - }else PoisonSpawn_Timer -=diff; - - DoMeleeAttackIfReady(); - } - - void JustDied(Unit* who) - { - if (pInstance) - { - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR4), true); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR5), true); - pInstance->SetData(TYPE_BROGGOK_EVENT, DONE); - } - } - -}; - -CreatureAI* GetAI_boss_broggok(Creature* pCreature) -{ - return new boss_broggokAI (pCreature); -} - -void AddSC_boss_broggok() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_broggok"; - newscript->GetAI = &GetAI_boss_broggok; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp deleted file mode 100644 index 097a1f21a0d..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_kelidan_the_breaker.cpp +++ /dev/null @@ -1,378 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Kelidan_The_Breaker -SD%Complete: 100 -SDComment: -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - -/* ContentData -boss_kelidan_the_breaker -mob_shadowmoon_channeler -EndContentData */ - -#include "precompiled.h" -#include "def_blood_furnace.h" - -enum -{ - SAY_WAKE = -1542000, - SAY_ADD_AGGRO_1 = -1542001, - SAY_ADD_AGGRO_2 = -1542002, - SAY_ADD_AGGRO_3 = -1542003, - SAY_KILL_1 = -1542004, - SAY_KILL_2 = -1542005, - SAY_NOVA = -1542006, - SAY_DIE = -1542007, - - SPELL_CORRUPTION = 30938, - SPELL_EVOCATION = 30935, - - SPELL_FIRE_NOVA = 33132, - H_SPELL_FIRE_NOVA = 37371, - - SPELL_SHADOW_BOLT_VOLLEY = 28599, - H_SPELL_SHADOW_BOLT_VOLLEY = 40070, - - SPELL_BURNING_NOVA = 30940, - SPELL_VORTEX = 37370, - - ENTRY_KELIDAN = 17377, - ENTRY_CHANNELER = 17653 -}; - -const float ShadowmoonChannelers[5][4]= -{ - {302,-87,-24.4,0.157}, - {321,-63.5,-24.6,4.887}, - {346,-74.5,-24.6,3.595}, - {344,-103.5,-24.5,2.356}, - {316,-109,-24.6,1.257} -}; - -struct TRINITY_DLL_DECL boss_kelidan_the_breakerAI : public ScriptedAI -{ - boss_kelidan_the_breakerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - for(uint8 i=0; i<5; ++i) - Channelers[i] = 0; - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - uint32 ShadowVolley_Timer; - uint32 BurningNova_Timer; - uint32 Firenova_Timer; - uint32 Corruption_Timer; - uint32 check_Timer; - bool Firenova; - bool addYell; - uint64 Channelers[5]; - - void Reset() - { - ShadowVolley_Timer = 1000; - BurningNova_Timer = 15000; - Corruption_Timer = 5000; - check_Timer = 0; - Firenova = false; - addYell = false; - SummonChannelers(); - if (pInstance) - pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_WAKE, m_creature); - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - DoStartMovement(who); - if (pInstance) - pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, IN_PROGRESS); - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void ChannelerEngaged(Unit* who) - { - if (who && !addYell) - { - addYell = true; - switch(rand()%3) - { - case 0: DoScriptText(SAY_ADD_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_ADD_AGGRO_2, m_creature); break; - default: DoScriptText(SAY_ADD_AGGRO_3, m_creature); break; - } - } - for(uint8 i=0; i<5; ++i) - { - Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); - if (who && channeler && !channeler->isInCombat()) - channeler->AI()->AttackStart(who); - } - } - - void ChannelerDied(Unit* killer) - { - for(uint8 i=0; i<5; ++i) - { - Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); - if (channeler && channeler->isAlive()) - return; - } - - if (killer) - m_creature->AI()->AttackStart(killer); - } - - uint64 GetChanneled(Creature *channeler1) - { - SummonChannelers(); - if (!channeler1) return NULL; - uint8 i; - for(i=0; i<5; ++i) - { - Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); - if (channeler && channeler->GetGUID() == channeler1->GetGUID()) - break; - } - return Channelers[(i+2)%5]; - } - - void SummonChannelers() - { - for(uint8 i=0; i<5; ++i) - { - Creature *channeler = Unit::GetCreature(*m_creature, Channelers[i]); - if (!channeler || channeler->isDead()) - channeler = m_creature->SummonCreature(ENTRY_CHANNELER,ShadowmoonChannelers[i][0],ShadowmoonChannelers[i][1],ShadowmoonChannelers[i][2],ShadowmoonChannelers[i][3],TEMPSUMMON_CORPSE_TIMED_DESPAWN,300000); - if (channeler) - Channelers[i] = channeler->GetGUID(); - else - Channelers[i] = 0; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DIE, m_creature); - - if (!pInstance) - return; - - pInstance->SetData(TYPE_KELIDAN_THE_BREAKER_EVENT, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR1), true); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR6), true); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (check_Timer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - DoCast(m_creature,SPELL_EVOCATION); - check_Timer = 5000; - }else check_Timer -= diff; - return; - } - - if (Firenova) - { - if (Firenova_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_FIRE_NOVA : SPELL_FIRE_NOVA,true); - Firenova = false; - ShadowVolley_Timer = 2000; - }else Firenova_Timer -=diff; - - return; - } - - if (ShadowVolley_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_SHADOW_BOLT_VOLLEY : SPELL_SHADOW_BOLT_VOLLEY); - ShadowVolley_Timer = 5000+rand()%8000; - }else ShadowVolley_Timer -=diff; - - if (Corruption_Timer < diff) - { - DoCast(m_creature,SPELL_CORRUPTION); - Corruption_Timer = 30000+rand()%20000; - }else Corruption_Timer -=diff; - - if (BurningNova_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoScriptText(SAY_NOVA, m_creature); - - if (SpellEntry *nova = GET_SPELL(SPELL_BURNING_NOVA)) - { - uint8 eff_mask=0; - for (int i=0; i<3; ++i) - { - if (!nova->Effect[i]) - continue; - eff_mask|=1<AddAura(new Aura(nova, eff_mask, NULL, m_creature, m_creature)); - } - - if (HeroicMode) - DoTeleportAll(m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation()); - - BurningNova_Timer = 20000+rand()%8000; - Firenova_Timer= 5000; - Firenova = true; - }else BurningNova_Timer -=diff; - - DoMeleeAttackIfReady(); - } - -}; - -CreatureAI* GetAI_boss_kelidan_the_breaker(Creature* pCreature) -{ - return new boss_kelidan_the_breakerAI (pCreature); -} - -/*###### -## mob_shadowmoon_channeler -######*/ - -enum -{ - SPELL_SHADOW_BOLT = 12739, - H_SPELL_SHADOW_BOLT = 15472, - - SPELL_MARK_OF_SHADOW = 30937, - SPELL_CHANNELING = 39123 -}; - -struct TRINITY_DLL_DECL mob_shadowmoon_channelerAI : public ScriptedAI -{ - mob_shadowmoon_channelerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - uint32 ShadowBolt_Timer; - uint32 MarkOfShadow_Timer; - uint32 check_Timer; - - void Reset() - { - ShadowBolt_Timer = 1000+rand()%1000; - MarkOfShadow_Timer = 5000+rand()%2000; - check_Timer = 0; - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - } - - void EnterCombat(Unit* who) - { - if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) - CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerEngaged(who); - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - DoStartMovement(who); - } - - void JustDied(Unit* Killer) - { - if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) - CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->ChannelerDied(Killer); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (check_Timer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - if (Creature *Kelidan = me->FindNearestCreature(ENTRY_KELIDAN, 100)) - { - uint64 channeler = CAST_AI(boss_kelidan_the_breakerAI, Kelidan->AI())->GetChanneled(m_creature); - if (Unit *channeled = Unit::GetUnit(*m_creature, channeler)) - DoCast(channeled,SPELL_CHANNELING); - } - check_Timer = 5000; - }else check_Timer -= diff; - return; - } - - if (MarkOfShadow_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target,SPELL_MARK_OF_SHADOW); - MarkOfShadow_Timer = 15000+rand()%5000; - }else MarkOfShadow_Timer -=diff; - - if (ShadowBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT); - ShadowBolt_Timer = 5000+rand()%1000; - }else ShadowBolt_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_shadowmoon_channeler(Creature* pCreature) -{ - return new mob_shadowmoon_channelerAI (pCreature); -} - -void AddSC_boss_kelidan_the_breaker() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_kelidan_the_breaker"; - newscript->GetAI = &GetAI_boss_kelidan_the_breaker; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_shadowmoon_channeler"; - newscript->GetAI = &GetAI_mob_shadowmoon_channeler; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp deleted file mode 100644 index 9902c505b6b..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/boss_the_maker.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_The_Maker -SD%Complete: 80 -SDComment: Mind control no support -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - -#include "precompiled.h" -#include "def_blood_furnace.h" - -enum -{ - SAY_AGGRO_1 = -1542009, - SAY_AGGRO_2 = -1542010, - SAY_AGGRO_3 = -1542011, - SAY_KILL_1 = -1542012, - SAY_KILL_2 = -1542013, - SAY_DIE = -1542014, - - SPELL_ACID_SPRAY = 38153, // heroic 38973 ??? 38153 - SPELL_EXPLODING_BREAKER = 30925, - SPELL_KNOCKDOWN = 20276, - SPELL_DOMINATION = 25772 // ??? -}; - -struct TRINITY_DLL_DECL boss_the_makerAI : public ScriptedAI -{ - boss_the_makerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 AcidSpray_Timer; - uint32 ExplodingBreaker_Timer; - uint32 Domination_Timer; - uint32 Knockdown_Timer; - - void Reset() - { - AcidSpray_Timer = 15000; - ExplodingBreaker_Timer = 6000; - Domination_Timer = 120000; - Knockdown_Timer = 10000; - - if (!pInstance) - return; - - pInstance->SetData(TYPE_THE_MAKER_EVENT, NOT_STARTED); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), true); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - if (!pInstance) - return; - - pInstance->SetData(TYPE_THE_MAKER_EVENT, IN_PROGRESS); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), false); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DIE, m_creature); - - if (!pInstance) - return; - - pInstance->SetData(TYPE_THE_MAKER_EVENT, DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR2), true); - pInstance->HandleGameObject(pInstance->GetData64(DATA_DOOR3), true); - - - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (AcidSpray_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ACID_SPRAY); - AcidSpray_Timer = 15000+rand()%8000; - }else AcidSpray_Timer -=diff; - - if (ExplodingBreaker_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_EXPLODING_BREAKER); - ExplodingBreaker_Timer = 4000+rand()%8000; - }else ExplodingBreaker_Timer -=diff; - - /* // Disabled until Core Support for mind control - if (domination_timer_timer < diff) - { - Unit* target; - target = SelectUnit(SELECT_TARGET_RANDOM,0); - - DoCast(target,SPELL_DOMINATION); - - domination_timer = 120000; - }else domination_timer -=diff; - */ - - if (Knockdown_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KNOCKDOWN); - Knockdown_Timer = 4000+rand()%8000; - }else Knockdown_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_the_makerAI(Creature* pCreature) -{ - return new boss_the_makerAI (pCreature); -} - -void AddSC_boss_the_maker() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_the_maker"; - newscript->GetAI = &GetAI_boss_the_makerAI; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h deleted file mode 100644 index b845c66823f..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/def_blood_furnace.h +++ /dev/null @@ -1,29 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_BLOOD_FURNACE_H -#define DEF_BLOOD_FURNACE_H - -#define DATA_THE_MAKER 1 -#define DATA_BROGGOK 2 -#define DATA_KELIDAN_THE_MAKER 3 -#define TYPE_THE_MAKER_EVENT 4 -#define TYPE_BROGGOK_EVENT 5 -#define TYPE_KELIDAN_THE_BREAKER_EVENT 6 -#define DATA_DOOR1 7 -#define DATA_DOOR2 8 -#define DATA_DOOR3 9 -#define DATA_DOOR4 10 -#define DATA_DOOR5 11 -#define DATA_DOOR6 12 -#define DATA_PRISON_CELL1 13 -#define DATA_PRISON_CELL2 14 -#define DATA_PRISON_CELL3 15 -#define DATA_PRISON_CELL4 16 -#define DATA_PRISON_CELL5 17 -#define DATA_PRISON_CELL6 18 -#define DATA_PRISON_CELL7 19 -#define DATA_PRISON_CELL8 20 -#endif - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp deleted file mode 100644 index 5a18ded0c08..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/blood_furnace/instance_blood_furnace.cpp +++ /dev/null @@ -1,234 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Blood_Furnace -SD%Complete: 85 -SDComment: -SDCategory: Hellfire Citadel, Blood Furnace -EndScriptData */ - -#include "precompiled.h" -#include "def_blood_furnace.h" - -#define ENTRY_SEWER1 181823 -#define ENTRY_SEWER2 181766 -#define MAX_ENCOUNTER 3 - -struct TRINITY_DLL_DECL instance_blood_furnace : public ScriptedInstance -{ - instance_blood_furnace(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 The_MakerGUID; - uint64 BroggokGUID; - uint64 Kelidan_The_BreakerGUID; - - uint64 Door1GUID; - uint64 Door2GUID; - uint64 Door3GUID; - uint64 Door4GUID; - uint64 Door5GUID; - uint64 Door6GUID; - - uint64 PrisonCell1GUID; - uint64 PrisonCell2GUID; - uint64 PrisonCell3GUID; - uint64 PrisonCell4GUID; - uint64 PrisonCell5GUID; - uint64 PrisonCell6GUID; - uint64 PrisonCell7GUID; - uint64 PrisonCell8GUID; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - The_MakerGUID = 0; - BroggokGUID = 0; - Kelidan_The_BreakerGUID = 0; - - Door1GUID = 0; - Door2GUID = 0; - Door3GUID = 0; - Door4GUID = 0; - Door5GUID = 0; - Door6GUID = 0; - - PrisonCell1GUID = 0; - PrisonCell2GUID = 0; - PrisonCell3GUID = 0; - PrisonCell4GUID = 0; - PrisonCell5GUID = 0; - PrisonCell6GUID = 0; - PrisonCell7GUID = 0; - PrisonCell8GUID = 0; - } - - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (!add) - return; - - switch(pCreature->GetEntry()) - { - case 17381: The_MakerGUID = pCreature->GetGUID(); break; - case 17380: BroggokGUID = pCreature->GetGUID(); break; - case 17377: Kelidan_The_BreakerGUID = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - if (!add) - return; - - if (pGo->GetEntry() == 181766) //Final exit door - Door1GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181811) //The Maker Front door - Door2GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181812) //The Maker Rear door - Door3GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181822) //Broggok Front door - Door4GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181819) //Broggok Rear door - Door5GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181823) //Kelidan exit door - Door6GUID = pGo->GetGUID(); - - if (pGo->GetEntry() == 181813) //The Maker prison cell front right - PrisonCell1GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181814) //The Maker prison cell back right - PrisonCell2GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181816) //The Maker prison cell front left - PrisonCell3GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181815) //The Maker prison cell back left - PrisonCell4GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181821) //Broggok prison cell front right - PrisonCell5GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181818) //Broggok prison cell back right - PrisonCell6GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181820) //Broggok prison cell front left - PrisonCell7GUID = pGo->GetGUID(); - if (pGo->GetEntry() == 181817) //Broggok prison cell back left - PrisonCell8GUID = pGo->GetGUID(); - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_THE_MAKER: return The_MakerGUID; - case DATA_BROGGOK: return BroggokGUID; - case DATA_KELIDAN_THE_MAKER: return Kelidan_The_BreakerGUID; - case DATA_DOOR1: return Door1GUID; - case DATA_DOOR2: return Door2GUID; - case DATA_DOOR3: return Door3GUID; - case DATA_DOOR4: return Door4GUID; - case DATA_DOOR5: return Door5GUID; - case DATA_DOOR6: return Door6GUID; - case DATA_PRISON_CELL1: return PrisonCell1GUID; - case DATA_PRISON_CELL2: return PrisonCell2GUID; - case DATA_PRISON_CELL3: return PrisonCell3GUID; - case DATA_PRISON_CELL4: return PrisonCell4GUID; - case DATA_PRISON_CELL5: return PrisonCell5GUID; - case DATA_PRISON_CELL6: return PrisonCell6GUID; - case DATA_PRISON_CELL7: return PrisonCell7GUID; - case DATA_PRISON_CELL8: return PrisonCell8GUID; - } - - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(data) - { - case TYPE_THE_MAKER_EVENT: m_auiEncounter[0] = data; break; - case TYPE_BROGGOK_EVENT: m_auiEncounter[1] = data; break; - case TYPE_KELIDAN_THE_BREAKER_EVENT: m_auiEncounter[2] = data; break; - } - - if (data == DONE) - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 data) - { - switch(data) - { - case TYPE_THE_MAKER_EVENT: return m_auiEncounter[0]; - case TYPE_BROGGOK_EVENT: return m_auiEncounter[1]; - case TYPE_KELIDAN_THE_BREAKER_EVENT: return m_auiEncounter[2]; - } - - return 0; - } - - const char* Save() - { - return str_data.c_str(); - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2]; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS || m_auiEncounter[i] == FAIL) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - - -InstanceData* GetInstanceData_instance_blood_furnace(Map* pMap) -{ - return new instance_blood_furnace(pMap); -} - -void AddSC_instance_blood_furnace() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_blood_furnace"; - newscript->GetInstanceData = &GetInstanceData_instance_blood_furnace; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp deleted file mode 100644 index e7411187e86..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_omor_the_unscarred.cpp +++ /dev/null @@ -1,214 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Omar_The_Unscarred -SD%Complete: 90 -SDComment: Temporary solution for orbital/shadow whip-ability. Needs more core support before making it more proper. -SDCategory: Hellfire Citadel, Hellfire Ramparts -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO_1 -1543009 -#define SAY_AGGRO_2 -1543010 -#define SAY_AGGRO_3 -1543011 -#define SAY_SUMMON -1543012 -#define SAY_CURSE -1543013 -#define SAY_KILL_1 -1543014 -#define SAY_DIE -1543015 -#define SAY_WIPE -1543016 - -#define SPELL_ORBITAL_STRIKE 30637 -#define SPELL_SHADOW_WHIP 30638 -#define SPELL_TREACHEROUS_AURA 30695 -#define H_SPELL_BANE_OF_TREACHERY 37566 -#define SPELL_DEMONIC_SHIELD 31901 -#define SPELL_SHADOW_BOLT 30686 -#define H_SPELL_SHADOW_BOLT 39297 -#define SPELL_SUMMON_FIENDISH_HOUND 30707 - -struct TRINITY_DLL_DECL boss_omor_the_unscarredAI : public ScriptedAI -{ - boss_omor_the_unscarredAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - - uint32 OrbitalStrike_Timer; - uint32 ShadowWhip_Timer; - uint32 Aura_Timer; - uint32 DemonicShield_Timer; - uint32 Shadowbolt_Timer; - uint32 Summon_Timer; - uint32 SummonedCount; - uint64 PlayerGUID; - bool CanPullBack; - - void Reset() - { - DoScriptText(SAY_WIPE, m_creature); - - OrbitalStrike_Timer = 25000; - ShadowWhip_Timer = 2000; - Aura_Timer = 10000; - DemonicShield_Timer = 1000; - Shadowbolt_Timer = 2000; - Summon_Timer = 10000; - SummonedCount = 0; - PlayerGUID = 0; - CanPullBack = false; - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - DoScriptText(SAY_KILL_1, m_creature); - } - - void JustSummoned(Creature* summoned) - { - DoScriptText(SAY_SUMMON, m_creature); - - if (Unit* random = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(random); - - ++SummonedCount; - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DIE, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //only two may be wrong, perhaps increase timer and spawn periodically instead. - if (SummonedCount < 2) - { - if (Summon_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature,SPELL_SUMMON_FIENDISH_HOUND); - Summon_Timer = 15000+rand()%15000; - }else Summon_Timer -= diff; - } - - if (CanPullBack) - { - if (ShadowWhip_Timer < diff) - { - if (Player* temp = Unit::GetPlayer(PlayerGUID)) - { - //if unit dosen't have this flag, then no pulling back (script will attempt cast, even if orbital strike was resisted) - if (temp->HasUnitMovementFlag(MOVEMENTFLAG_FALLING)) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(temp,SPELL_SHADOW_WHIP); - } - } - PlayerGUID = 0; - ShadowWhip_Timer = 2000; - CanPullBack = false; - }else ShadowWhip_Timer -= diff; - } - else if (OrbitalStrike_Timer < diff) - { - Unit* temp = NULL; - if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) - temp = m_creature->getVictim(); - else temp = SelectUnit(SELECT_TARGET_RANDOM,0); - - if (temp && temp->GetTypeId() == TYPEID_PLAYER) - { - DoCast(temp,SPELL_ORBITAL_STRIKE); - OrbitalStrike_Timer = 14000+rand()%2000; - PlayerGUID = temp->GetGUID(); - - if (PlayerGUID) - CanPullBack = true; - } - }else OrbitalStrike_Timer -= diff; - - if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20) - { - if (DemonicShield_Timer < diff) - { - DoCast(m_creature,SPELL_DEMONIC_SHIELD); - DemonicShield_Timer = 15000; - }else DemonicShield_Timer -= diff; - } - - if (Aura_Timer < diff) - { - DoScriptText(SAY_CURSE, m_creature); - - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoCast(target,HeroicMode ? H_SPELL_BANE_OF_TREACHERY : SPELL_TREACHEROUS_AURA); - Aura_Timer = 8000+rand()%8000; - } - }else Aura_Timer -= diff; - - if (Shadowbolt_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (target) - target = m_creature->getVictim(); - - DoCast(target,HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT); - Shadowbolt_Timer = 4000+rand()%2500; - } - }else Shadowbolt_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_omor_the_unscarredAI(Creature* pCreature) -{ - return new boss_omor_the_unscarredAI (pCreature); -} - -void AddSC_boss_omor_the_unscarred() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_omor_the_unscarred"; - newscript->GetAI = &GetAI_boss_omor_the_unscarredAI; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp deleted file mode 100644 index 98aa4627be2..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_vazruden_the_herald.cpp +++ /dev/null @@ -1,490 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -Name: Boss_Vazruden_the_Herald -%Complete: 90 -Comment: -Category: Hellfire Citadel, Hellfire Ramparts -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_FIREBALL (HeroicMode?36920:34653) -#define SPELL_CONE_OF_FIRE (HeroicMode?36921:30926) -#define SPELL_SUMMON_LIQUID_FIRE (HeroicMode?30928:23971) -#define SPELL_BELLOWING_ROAR 39427 -#define SPELL_REVENGE (HeroicMode?40392:19130) -#define SPELL_KIDNEY_SHOT 30621 -#define SPELL_FIRE_NOVA_VISUAL 19823 - -#define ENTRY_HELLFIRE_SENTRY 17517 -#define ENTRY_VAZRUDEN_HERALD 17307 -#define ENTRY_VAZRUDEN 17537 -#define ENTRY_NAZAN 17536 -#define ENTRY_LIQUID_FIRE 22515 -#define ENTRY_REINFORCED_FEL_IRON_CHEST (HeroicMode?185169:185168) - -#define SAY_INTRO -1543017 -#define SAY_WIPE -1543018 -#define SAY_AGGRO_1 -1543019 -#define SAY_AGGRO_2 -1543020 -#define SAY_AGGRO_3 -1543021 -#define SAY_KILL_1 -1543022 -#define SAY_KILL_2 -1543023 -#define SAY_DIE -1543024 -#define EMOTE -1543025 - -#define PATH_ENTRY 2081 - -const float VazrudenMiddle[3] = {-1406.5, 1746.5, 81.2}; -const float VazrudenRing[2][3] = -{ - {-1430, 1705, 112}, - {-1377, 1760, 112} -}; - -struct TRINITY_DLL_DECL boss_nazanAI : public ScriptedAI -{ - boss_nazanAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - VazrudenGUID = 0; - flight = true; - } - - uint32 Fireball_Timer; - uint32 ConeOfFire_Timer; - uint32 BellowingRoar_Timer; - uint32 Fly_Timer; - uint32 Turn_Timer; - uint32 UnsummonCheck; - bool flight; - uint64 VazrudenGUID; - bool HeroicMode; - SpellEntry *liquid_fire; - - void Reset() - { - Fireball_Timer = 4000; - Fly_Timer = 45000; - Turn_Timer = 0; - UnsummonCheck = 5000; - } - - void EnterCombat(Unit* who) {} - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == ENTRY_LIQUID_FIRE) - { - summoned->SetLevel(m_creature->getLevel()); - summoned->setFaction(m_creature->getFaction()); - summoned->CastSpell(summoned,SPELL_SUMMON_LIQUID_FIRE,true); - summoned->CastSpell(summoned,SPELL_FIRE_NOVA_VISUAL,true); - } - } - - void SpellHitTarget(Unit* target, const SpellEntry* entry) - { - if (target && entry->Id == SPELL_FIREBALL) - m_creature->SummonCreature(ENTRY_LIQUID_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),target->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,30000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (UnsummonCheck < diff && m_creature->isAlive()) - { - m_creature->SetLootRecipient(NULL); - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - }else UnsummonCheck -= diff; - return; - } - - if (Fireball_Timer < diff) - { - if (Unit *victim = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(victim, SPELL_FIREBALL,true); - Fireball_Timer = 4000+rand()%3000; - }else Fireball_Timer -= diff; - - if (flight) // phase 1 - the flight - { - Creature *Vazruden = Unit::GetCreature(*m_creature,VazrudenGUID); - if (Fly_Timer < diff || !(Vazruden && Vazruden->isAlive() && (Vazruden->GetHealth()*5 > Vazruden->GetMaxHealth()))) - { - flight = false; - BellowingRoar_Timer = 6000; - ConeOfFire_Timer = 12000; - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->GetMotionMaster()->Clear(); - if (Unit *victim = SelectUnit(SELECT_TARGET_NEAREST,0)) - m_creature->AI()->AttackStart(victim); - DoStartMovement(m_creature->getVictim()); - DoScriptText(EMOTE, m_creature); - return; - }else Fly_Timer -= diff; - - if (Turn_Timer < diff) - { - uint32 waypoint = (Fly_Timer/10000)%2; - if (m_creature->IsWithinDist3d(VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2], 5)) - m_creature->GetMotionMaster()->MovePoint(0,VazrudenRing[waypoint][0],VazrudenRing[waypoint][1],VazrudenRing[waypoint][2]); - Turn_Timer = 10000; - }else Turn_Timer -= diff; - } - else // phase 2 - land fight - { - if (ConeOfFire_Timer < diff) - { - DoCast(m_creature, SPELL_CONE_OF_FIRE); - ConeOfFire_Timer = 12000; - Fireball_Timer = 4000; - }else ConeOfFire_Timer -= diff; - - if (HeroicMode && BellowingRoar_Timer < diff) - { - DoCast(m_creature, SPELL_BELLOWING_ROAR); - BellowingRoar_Timer = 45000; - }else BellowingRoar_Timer -= diff; - - DoMeleeAttackIfReady(); - } - } -}; - -struct TRINITY_DLL_DECL boss_vazrudenAI : public ScriptedAI -{ - boss_vazrudenAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 Revenge_Timer; - bool HeroicMode; - bool WipeSaid; - uint32 UnsummonCheck; - - void Reset() - { - Revenge_Timer = 4000; - UnsummonCheck = 2000; - WipeSaid = false; - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - default: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void KilledUnit(Unit* who) - { - if (who && who->GetEntry()!=ENTRY_VAZRUDEN) - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - default: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void JustDied(Unit* who) - { - if (who && who != m_creature) - DoScriptText(SAY_DIE, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (UnsummonCheck < diff && m_creature->isAlive()) - { - if (!WipeSaid) - { - DoScriptText(SAY_WIPE, m_creature); - WipeSaid = true; - } - m_creature->SetLootRecipient(NULL); - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - m_creature->RemoveCorpse(); - }else UnsummonCheck -= diff; - return; - } - - if (Revenge_Timer < diff) - { - if (Unit *victim = m_creature->getVictim()) - DoCast(victim, SPELL_REVENGE); - Revenge_Timer = 5000; - }else Revenge_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_vazruden_the_heraldAI : public ScriptedAI -{ - boss_vazruden_the_heraldAI(Creature *c) : ScriptedAI(c) - { - summoned = false; - sentryDown = false; - NazanGUID = 0; - VazrudenGUID = 0; - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 phase; - uint32 waypoint; - uint32 check; - bool sentryDown; - uint64 NazanGUID; - uint64 VazrudenGUID; - bool summoned; - bool HeroicMode; - - void Reset() - { - phase = 0; - waypoint = 0; - check = 0; - UnsummonAdds(); - m_creature->GetMotionMaster()->MovePath(PATH_ENTRY, true); - } - - void UnsummonAdds() - { - if (summoned) - { - Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID); - Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID); - if (Nazan || (Nazan = me->FindNearestCreature(ENTRY_NAZAN, 5000))) - { - Nazan->SetLootRecipient(NULL); - Nazan->SetVisibility(VISIBILITY_OFF); - Nazan->DealDamage(Nazan, Nazan->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - Nazan->RemoveCorpse(); - NazanGUID = 0; - } - if (Vazruden || (Vazruden = me->FindNearestCreature(ENTRY_VAZRUDEN, 5000))) - { - Vazruden->SetLootRecipient(NULL); - Vazruden->SetVisibility(VISIBILITY_OFF); - Vazruden->DealDamage(Vazruden, Vazruden->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - Vazruden->RemoveCorpse(); - VazrudenGUID = 0; - } - summoned = false; - m_creature->clearUnitState(UNIT_STAT_ROOT); - m_creature->SetVisibility(VISIBILITY_ON); - } - } - - void SummonAdds() - { - if (!summoned) - { - Creature* Vazruden = m_creature->SummonCreature(ENTRY_VAZRUDEN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000); - if (Vazruden) - VazrudenGUID = Vazruden->GetGUID(); - Creature* Nazan = m_creature->SummonCreature(ENTRY_NAZAN,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,6000000); - if (Nazan) - NazanGUID = Nazan->GetGUID(); - summoned = true; - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->addUnitState(UNIT_STAT_ROOT); - } - } - - void EnterCombat(Unit *who) - { - if (phase==0) - { - phase = 1; - check = 0; - DoScriptText(SAY_INTRO, m_creature); - } - } - - void JustSummoned(Creature *summoned) - { - if (!summoned) return; - Unit *victim = m_creature->getVictim(); - if (summoned->GetEntry() == ENTRY_NAZAN) - { - CAST_AI(boss_nazanAI, summoned->AI())->VazrudenGUID = VazrudenGUID; - summoned->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - summoned->SetSpeed(MOVE_FLIGHT, 2.5); - if (victim) - AttackStartNoMove(victim); - } - else if (victim) - summoned->AI()->AttackStart(victim); - } - - void SentryDownBy(Unit* killer) - { - if (sentryDown) - { - AttackStartNoMove(killer); - sentryDown = false; - } - else - sentryDown = true; - } - - void UpdateAI(const uint32 diff) - { - switch(phase) - { - case 0: // circle around the platform - return; - break; - case 1: // go to the middle and begin the fight - if (check < diff) - { - if (!m_creature->IsWithinDist3d(VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],5)) - { - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MovePoint(0,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2]); - check = 1000; - } - else - { - SummonAdds(); - phase = 2; - return; - } - }else check -= diff; - break; - default: // adds do the job now - if (check < diff) - { - Creature *Nazan = Unit::GetCreature(*m_creature, NazanGUID); - Creature *Vazruden = Unit::GetCreature(*m_creature, VazrudenGUID); - if (Nazan && Nazan->isAlive() || Vazruden && Vazruden->isAlive()) - { - if (Nazan && Nazan->getVictim() || Vazruden && Vazruden->getVictim()) - return; - else - { - UnsummonAdds(); - EnterEvadeMode(); - return; - } - }else - { - m_creature->SummonGameObject(ENTRY_REINFORCED_FEL_IRON_CHEST,VazrudenMiddle[0],VazrudenMiddle[1],VazrudenMiddle[2],0,0,0,0,0,0); - m_creature->SetLootRecipient(NULL); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - check = 2000; - }else check -= diff; - break; - } - } -}; - -struct TRINITY_DLL_DECL mob_hellfire_sentryAI : public ScriptedAI -{ - mob_hellfire_sentryAI(Creature *c) : ScriptedAI(c) {} - - uint32 KidneyShot_Timer; - - void Reset() - { - KidneyShot_Timer = 3000+rand()%4000; - } - - void EnterCombat(Unit* who) {} - - void JustDied(Unit* who) - { - if (Creature *herald = me->FindNearestCreature(ENTRY_VAZRUDEN_HERALD,150)) - CAST_AI(boss_vazruden_the_heraldAI, herald->AI())->SentryDownBy(who); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (KidneyShot_Timer < diff) - { - if (Unit *victim = m_creature->getVictim()) - DoCast(victim, SPELL_KIDNEY_SHOT); - KidneyShot_Timer = 20000; - }else KidneyShot_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_vazruden_the_herald(Creature* pCreature) -{ - return new boss_vazruden_the_heraldAI (pCreature); -} - -CreatureAI* GetAI_boss_vazruden(Creature* pCreature) -{ - return new boss_vazrudenAI (pCreature); -} - - -CreatureAI* GetAI_boss_nazan(Creature* pCreature) -{ - return new boss_nazanAI (pCreature); -} - -CreatureAI* GetAI_mob_hellfire_sentry(Creature* pCreature) -{ - return new mob_hellfire_sentryAI (pCreature); -} - -void AddSC_boss_vazruden_the_herald() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_vazruden_the_herald"; - newscript->GetAI = &GetAI_boss_vazruden_the_herald; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_vazruden"; - newscript->GetAI = &GetAI_boss_vazruden; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_nazan"; - newscript->GetAI = &GetAI_boss_nazan; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_hellfire_sentry"; - newscript->GetAI = &GetAI_mob_hellfire_sentry; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp deleted file mode 100644 index 13059c55ff2..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/boss_watchkeeper_gargolmar.cpp +++ /dev/null @@ -1,168 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Watchkeeper_Gargolmar -SD%Complete: 80 -SDComment: Missing adds to heal him. Surge should be used on target furthest away, not random. -SDCategory: Hellfire Citadel, Hellfire Ramparts -EndScriptData */ - -#include "precompiled.h" - -#define SAY_TAUNT -1543000 -#define SAY_HEAL -1543001 -#define SAY_SURGE -1543002 -#define SAY_AGGRO_1 -1543003 -#define SAY_AGGRO_2 -1543004 -#define SAY_AGGRO_3 -1543005 -#define SAY_KILL_1 -1543006 -#define SAY_KILL_2 -1543007 -#define SAY_DIE -1543008 - -#define SPELL_MORTAL_WOUND 30641 -#define H_SPELL_MORTAL_WOUND 36814 -#define SPELL_SURGE 34645 -#define SPELL_RETALIATION 22857 - -struct TRINITY_DLL_DECL boss_watchkeeper_gargolmarAI : public ScriptedAI -{ - boss_watchkeeper_gargolmarAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - - uint32 Surge_Timer; - uint32 MortalWound_Timer; - uint32 Retaliation_Timer; - - bool HasTaunted; - bool YelledForHeal; - - void Reset() - { - Surge_Timer = 5000; - MortalWound_Timer = 4000; - Retaliation_Timer = 0; - - HasTaunted = false; - YelledForHeal = false; - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void MoveInLineOfSight(Unit* who) - { - if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) - { - if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - { - //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - else if (!HasTaunted && m_creature->IsWithinDistInMap(who, 60.0f)) - { - DoScriptText(SAY_TAUNT, m_creature); - HasTaunted = true; - } - } - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DIE, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (MortalWound_Timer < diff) - { - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_MORTAL_WOUND : SPELL_MORTAL_WOUND); - MortalWound_Timer = 5000+rand()%8000; - }else MortalWound_Timer -= diff; - - if (Surge_Timer < diff) - { - DoScriptText(SAY_SURGE, m_creature); - - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SURGE); - - Surge_Timer = 5000+rand()%8000; - }else Surge_Timer -= diff; - - if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20) - { - if (Retaliation_Timer < diff) - { - DoCast(m_creature,SPELL_RETALIATION); - Retaliation_Timer = 30000; - }else Retaliation_Timer -= diff; - } - - if (!YelledForHeal) - { - if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 40) - { - DoScriptText(SAY_HEAL, m_creature); - YelledForHeal = true; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_watchkeeper_gargolmarAI(Creature* pCreature) -{ - return new boss_watchkeeper_gargolmarAI (pCreature); -} - -void AddSC_boss_watchkeeper_gargolmar() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_watchkeeper_gargolmar"; - newscript->GetAI = &GetAI_boss_watchkeeper_gargolmarAI; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h deleted file mode 100644 index 4adf140b0ca..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/def_hellfire_ramparts.h +++ /dev/null @@ -1,16 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_RAMPARTS_H -#define DEF_RAMPARTS_H - -#define MAX_ENCOUNTER 2 - -enum -{ - TYPE_VAZRUDEN = 1, - TYPE_NAZAN = 2 -}; - -#endif diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp deleted file mode 100644 index 5942f0142ef..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/hellfire_ramparts/instance_hellfire_ramparts.cpp +++ /dev/null @@ -1,84 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Hellfire_Ramparts -SD%Complete: 50 -SDComment: -SDCategory: Hellfire Ramparts -EndScriptData */ - -#include "precompiled.h" -#include "def_hellfire_ramparts.h" - -struct TRINITY_DLL_DECL instance_ramparts : public ScriptedInstance -{ - instance_ramparts(Map* pMap) : ScriptedInstance(pMap) {Initialize();} - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint64 m_uiChestNGUID; - uint64 m_uiChestHGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiChestNGUID = 0; - m_uiChestHGUID = 0; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 185168: m_uiChestNGUID = pGo->GetGUID(); break; - case 185169: m_uiChestHGUID = pGo->GetGUID(); break; - } - } - - void SetData(uint32 uiType, uint32 uiData) - { - debug_log("TSCR: Instance Ramparts: SetData received for type %u with data %u",uiType,uiData); - - switch(uiType) - { - case TYPE_VAZRUDEN: - if (uiData == DONE && m_auiEncounter[1] == DONE) - DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILISECONDS); - m_auiEncounter[0] = uiData; - break; - case TYPE_NAZAN: - if (uiData == DONE && m_auiEncounter[0] == DONE) - DoRespawnGameObject(instance->IsHeroic() ? m_uiChestHGUID : m_uiChestNGUID, HOUR*IN_MILISECONDS); - m_auiEncounter[1] = uiData; - break; - } - } -}; - -InstanceData* GetInstanceData_instance_ramparts(Map* pMap) -{ - return new instance_ramparts(pMap); -} - -void AddSC_instance_ramparts() -{ - Script* pNewScript; - pNewScript = new Script; - pNewScript->Name = "instance_ramparts"; - pNewScript->GetInstanceData = &GetInstanceData_instance_ramparts; - pNewScript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp deleted file mode 100644 index 8f7c076a701..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp +++ /dev/null @@ -1,562 +0,0 @@ -/* Copyright(C) 2006 - 2008 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -*(at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Magtheridon -SD%Complete: 60 -SDComment: In Development -SDCategory: Hellfire Citadel, Magtheridon's lair -EndScriptData */ - -#include "precompiled.h" -#include "def_magtheridons_lair.h" - -struct Yell -{ - int32 id; -}; - -static Yell RandomTaunt[]= -{ - {-1544000}, - {-1544001}, - {-1544002}, - {-1544003}, - {-1544004}, - {-1544005}, -}; - -#define SAY_FREED -1544006 -#define SAY_AGGRO -1544007 -#define SAY_BANISH -1544008 -#define SAY_CHAMBER_DESTROY -1544009 -#define SAY_PLAYER_KILLED -1544010 -#define SAY_DEATH -1544011 - -#define EMOTE_BERSERK -1544012 -#define EMOTE_BLASTNOVA -1544013 -#define EMOTE_BEGIN -1544014 - -#define MOB_MAGTHERIDON 17257 -#define MOB_ROOM 17516 -#define MOB_CHANNELLER 17256 -#define MOB_ABYSSAL 17454 - -#define SPELL_BLASTNOVA 30616 -#define SPELL_CLEAVE 30619 -#define SPELL_QUAKE_TRIGGER 30657 // must be cast with 30561 as the proc spell -#define SPELL_QUAKE_KNOCKBACK 30571 -#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7 -#define SPELL_BLAZE_TRAP 30542 -#define SPELL_DEBRIS_KNOCKDOWN 36449 -#define SPELL_DEBRIS_VISUAL 30632 -#define SPELL_DEBRIS_DAMAGE 30631 // core bug, does not support target 8 -#define SPELL_CAMERA_SHAKE 36455 -#define SPELL_BERSERK 27680 - -#define SPELL_SHADOW_CAGE 30168 -#define SPELL_SHADOW_GRASP 30410 -#define SPELL_SHADOW_GRASP_VISUAL 30166 -#define SPELL_MIND_EXHAUSTION 44032 //Casted by the cubes when channeling ends - -#define SPELL_SHADOW_CAGE_C 30205 -#define SPELL_SHADOW_GRASP_C 30207 - -#define SPELL_SHADOW_BOLT_VOLLEY 30510 -#define SPELL_DARK_MENDING 30528 -#define SPELL_FEAR 30530 //39176 -#define SPELL_BURNING_ABYSSAL 30511 -#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 - -#define SPELL_FIRE_BLAST 37110 - -// count of clickers needed to interrupt blast nova -#define CLICKERS_COUNT 5 - -typedef std::map CubeMap; - -struct TRINITY_DLL_DECL mob_abyssalAI : public ScriptedAI -{ - mob_abyssalAI(Creature *c) : ScriptedAI(c) - { - trigger = 0; - Despawn_Timer = 60000; - } - - uint32 FireBlast_Timer; - uint32 Despawn_Timer; - uint32 trigger; - - void Reset() - { - FireBlast_Timer = 6000; - } - - void SpellHit(Unit*, const SpellEntry *spell) - { - if (trigger == 2 && spell->Id == SPELL_BLAZE_TARGET) - { - m_creature->CastSpell(m_creature, SPELL_BLAZE_TRAP, true); - m_creature->SetVisibility(VISIBILITY_OFF); - Despawn_Timer = 130000; - } - } - - void SetTrigger(uint32 _trigger) - { - trigger = _trigger; - m_creature->SetDisplayId(11686); - if (trigger == 1) //debris - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->CastSpell(m_creature, SPELL_DEBRIS_VISUAL, true); - FireBlast_Timer = 5000; - Despawn_Timer = 10000; - } - } - - void EnterCombat(Unit* who) {DoZoneInCombat();} - void AttackStart(Unit *who) {if (!trigger) ScriptedAI::AttackStart(who);} - void MoveInLineOfSight(Unit *who) {if (!trigger) ScriptedAI::MoveInLineOfSight(who);} - - void UpdateAI(const uint32 diff) - { - if (trigger) - { - if (trigger == 1) - { - if (FireBlast_Timer < diff) - { - m_creature->CastSpell(m_creature, SPELL_DEBRIS_DAMAGE, true); - trigger = 3; - }else FireBlast_Timer -= diff; - } - return; - } - - if (Despawn_Timer < diff) - { - m_creature->ForcedDespawn(); - }else Despawn_Timer -= diff; - - if (!UpdateVictim()) - return; - - if (FireBlast_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FIRE_BLAST); - FireBlast_Timer = 5000+rand()%10000; - }else FireBlast_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI -{ - boss_magtheridonAI(Creature *c) : ScriptedAI(c) - { - pInstance =m_creature->GetInstanceData(); - m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); - m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); - - // target 7, random target with certain entry spell, need core fix - SpellEntry *TempSpell; - TempSpell = GET_SPELL(SPELL_BLAZE_TARGET); - if (TempSpell && TempSpell->EffectImplicitTargetA[0] != 6) - { - TempSpell->EffectImplicitTargetA[0] = 6; - TempSpell->EffectImplicitTargetB[0] = 0; - } - TempSpell = GET_SPELL(SPELL_QUAKE_TRIGGER); - if (TempSpell && TempSpell->EffectTriggerSpell[0] != SPELL_QUAKE_KNOCKBACK) - { - TempSpell->EffectTriggerSpell[0] = SPELL_QUAKE_KNOCKBACK; - } - } - - CubeMap Cube; - - ScriptedInstance* pInstance; - - uint32 Berserk_Timer; - uint32 Quake_Timer; - uint32 Cleave_Timer; - uint32 BlastNova_Timer; - uint32 Blaze_Timer; - uint32 Debris_Timer; - uint32 RandChat_Timer; - - bool Phase3; - bool NeedCheckCube; - - void Reset() - { - if (pInstance) - { - pInstance->SetData(DATA_MAGTHERIDON_EVENT, NOT_STARTED); - pInstance->SetData(DATA_COLLAPSE, false); - } - - Berserk_Timer = 1320000; - Quake_Timer = 40000; - Debris_Timer = 10000; - Blaze_Timer = 10000+rand()%20000; - BlastNova_Timer = 60000; - Cleave_Timer = 15000; - RandChat_Timer = 90000; - - Phase3 = false; - NeedCheckCube = false; - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->addUnitState(UNIT_STAT_STUNNED); - m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE_C, true); - } - - void SetClicker(uint64 cubeGUID, uint64 clickerGUID) - { - // to avoid multiclicks from 1 cube - if (uint64 guid = Cube[cubeGUID]) - DebuffClicker(Unit::GetUnit(*m_creature, guid)); - Cube[cubeGUID] = clickerGUID; - NeedCheckCube = true; - } - - //function to interrupt channeling and debuff clicker with mind exh(used if second person clicks with same cube or after dispeling/ending shadow grasp DoT) - void DebuffClicker(Unit *clicker) - { - if (!clicker || !clicker->isAlive()) - return; - - clicker->RemoveAurasDueToSpell(SPELL_SHADOW_GRASP); // cannot interrupt triggered spells - clicker->InterruptNonMeleeSpells(false); - clicker->CastSpell(clicker, SPELL_MIND_EXHAUSTION, true); - } - - void NeedCheckCubeStatus() - { - uint32 ClickerNum = 0; - // now checking if every clicker has debuff from manticron(it is dispelable atm rev 6110 : S) - // if not - apply mind exhaustion and delete from clicker's list - for(CubeMap::iterator i = Cube.begin(); i != Cube.end(); ++i) - { - Unit *clicker = Unit::GetUnit(*m_creature, (*i).second); - if (!clicker || !clicker->HasAura(SPELL_SHADOW_GRASP)) - { - DebuffClicker(clicker); - (*i).second = 0; - }else ClickerNum++; - } - - // if 5 clickers from other cubes apply shadow cage - if (ClickerNum >= CLICKERS_COUNT && !m_creature->HasAura(SPELL_SHADOW_CAGE)) - { - DoScriptText(SAY_BANISH, m_creature); - m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE, true); - } - else if (ClickerNum < CLICKERS_COUNT && m_creature->HasAura(SPELL_SHADOW_CAGE)) - m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE); - - if (!ClickerNum) NeedCheckCube = false; - } - - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_PLAYER_KILLED, m_creature); - } - - void JustDied(Unit* Killer) - { - if (pInstance) - pInstance->SetData(DATA_MAGTHERIDON_EVENT, DONE); - - DoScriptText(SAY_DEATH, m_creature); - } - - void MoveInLineOfSight(Unit* who) {} - - void AttackStart(Unit *who) - { - if (!m_creature->hasUnitState(UNIT_STAT_STUNNED)) - ScriptedAI::AttackStart(who); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_MAGTHERIDON_EVENT, IN_PROGRESS); - DoZoneInCombat(); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->RemoveAurasDueToSpell(SPELL_SHADOW_CAGE_C); - - DoScriptText(SAY_FREED, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->isInCombat()) - { - if (RandChat_Timer < diff) - { - DoScriptText(RandomTaunt[rand()%6].id, m_creature); - RandChat_Timer = 90000; - }else RandChat_Timer -= diff; - } - - if (!UpdateVictim()) - return; - - if (NeedCheckCube) NeedCheckCubeStatus(); - - if (Berserk_Timer < diff) - { - m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - DoScriptText(EMOTE_BERSERK, m_creature); - Berserk_Timer = 60000; - }else Berserk_Timer -= diff; - - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 10000; - }else Cleave_Timer -= diff; - - if (BlastNova_Timer < diff) - { - // to avoid earthquake interruption - if (!m_creature->hasUnitState(UNIT_STAT_STUNNED)) - { - DoScriptText(EMOTE_BLASTNOVA, m_creature); - DoCast(m_creature, SPELL_BLASTNOVA); - BlastNova_Timer = 60000; - } - }else BlastNova_Timer -= diff; - - if (Quake_Timer < diff) - { - // to avoid blastnova interruption - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - m_creature->CastSpell(m_creature, SPELL_QUAKE_TRIGGER, true); - Quake_Timer = 50000; - } - }else Quake_Timer -= diff; - - if (Blaze_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - float x, y, z; - target->GetPosition(x, y, z); - Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (summon) - { - CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(2); - m_creature->CastSpell(summon, SPELL_BLAZE_TARGET, true); - summon->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - } - } - Blaze_Timer = 20000 + rand()%20000; - }else Blaze_Timer -= diff; - - if (!Phase3 && m_creature->GetHealth()*10 < m_creature->GetMaxHealth()*3 - && !m_creature->IsNonMeleeSpellCasted(false) // blast nova - && !m_creature->hasUnitState(UNIT_STAT_STUNNED)) // shadow cage and earthquake - { - Phase3 = true; - DoScriptText(SAY_CHAMBER_DESTROY, m_creature); - m_creature->CastSpell(m_creature, SPELL_CAMERA_SHAKE, true); - m_creature->CastSpell(m_creature, SPELL_DEBRIS_KNOCKDOWN, true); - - if (pInstance) - pInstance->SetData(DATA_COLLAPSE, true); - } - - if (Phase3) - { - if (Debris_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - float x, y, z; - target->GetPosition(x, y, z); - Creature *summon = m_creature->SummonCreature(MOB_ABYSSAL, x, y, z, 0, TEMPSUMMON_CORPSE_DESPAWN, 0); - if (summon) CAST_AI(mob_abyssalAI, summon->AI())->SetTrigger(1); - } - Debris_Timer = 10000; - }else Debris_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI -{ - mob_hellfire_channelerAI(Creature *c) : ScriptedAI(c) - { - pInstance =m_creature->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 ShadowBoltVolley_Timer; - uint32 DarkMending_Timer; - uint32 Fear_Timer; - uint32 Infernal_Timer; - - uint32 Check_Timer; - - void Reset() - { - ShadowBoltVolley_Timer = 8000 + rand()%2000; - DarkMending_Timer = 10000; - Fear_Timer = 15000 + rand()%5000; - Infernal_Timer = 10000 + rand()%40000; - - Check_Timer = 5000; - - if (pInstance) - pInstance->SetData(DATA_CHANNELER_EVENT, NOT_STARTED); - - m_creature->CastSpell(m_creature, SPELL_SHADOW_GRASP_C, false); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_CHANNELER_EVENT, IN_PROGRESS); - - m_creature->InterruptNonMeleeSpells(false); - DoZoneInCombat(); - } - - void JustSummoned(Creature *summon) {summon->AI()->AttackStart(m_creature->getVictim());} - - void MoveInLineOfSight(Unit* who) {} - - void DamageTaken(Unit*, uint32 &damage) - { - if (damage >= m_creature->GetHealth()) - m_creature->CastSpell(m_creature, SPELL_SOUL_TRANSFER, true); - } - - void JustDied(Unit* who) - { - if (pInstance) - pInstance->SetData(DATA_CHANNELER_EVENT, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ShadowBoltVolley_Timer < diff) - { - DoCast(m_creature, SPELL_SHADOW_BOLT_VOLLEY); - ShadowBoltVolley_Timer = 10000 + rand()%10000; - }else ShadowBoltVolley_Timer -= diff; - - if (DarkMending_Timer < diff) - { - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) - DoCast(m_creature, SPELL_DARK_MENDING); - DarkMending_Timer = 10000 +(rand() % 10000); - }else DarkMending_Timer -= diff; - - if (Fear_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1)) - DoCast(target, SPELL_FEAR); - Fear_Timer = 25000 + rand()%15000; - }else Fear_Timer -= diff; - - if (Infernal_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - m_creature->CastSpell(target, SPELL_BURNING_ABYSSAL, true); - Infernal_Timer = 30000 + rand()%10000; - }else Infernal_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Manticron Cube -bool GOHello_go_Manticron_Cube(Player* pPlayer, GameObject* pGo) -{ - ScriptedInstance* pInstance = pGo->GetInstanceData(); - if (!pInstance) return true; - if (pInstance->GetData(DATA_MAGTHERIDON_EVENT) != IN_PROGRESS) return true; - Creature *Magtheridon =Unit::GetCreature(*pGo, pInstance->GetData64(DATA_MAGTHERIDON)); - if (!Magtheridon || !Magtheridon->isAlive()) return true; - - // if exhausted or already channeling return - if (pPlayer->HasAura(SPELL_MIND_EXHAUSTION) || pPlayer->HasAura(SPELL_SHADOW_GRASP)) - return true; - - pPlayer->InterruptNonMeleeSpells(false); - pPlayer->CastSpell(pPlayer, SPELL_SHADOW_GRASP, true); - pPlayer->CastSpell(pPlayer, SPELL_SHADOW_GRASP_VISUAL, false); - CAST_AI(boss_magtheridonAI, Magtheridon->AI())->SetClicker(pGo->GetGUID(), pPlayer->GetGUID()); - return true; -} - -CreatureAI* GetAI_boss_magtheridon(Creature* pCreature) -{ - return new boss_magtheridonAI(pCreature); -} - -CreatureAI* GetAI_mob_hellfire_channeler(Creature* pCreature) -{ - return new mob_hellfire_channelerAI(pCreature); -} - -CreatureAI* GetAI_mob_abyssalAI(Creature* pCreature) -{ - return new mob_abyssalAI(pCreature); -} - -void AddSC_boss_magtheridon() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_magtheridon"; - newscript->GetAI = &GetAI_boss_magtheridon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_hellfire_channeler"; - newscript->GetAI = &GetAI_mob_hellfire_channeler; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="go_manticron_cube"; - newscript->pGOHello = &GOHello_go_Manticron_Cube; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_abyssal"; - newscript->GetAI = &GetAI_mob_abyssalAI; - newscript->RegisterSelf(); - -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h deleted file mode 100644 index c5469acaea0..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/def_magtheridons_lair.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_MAGTHERIDONS_LAIR_H -#define DEF_MAGTHERIDONS_LAIR_H - -#define DATA_MAGTHERIDON_EVENT 1 -#define DATA_MAGTHERIDON 3 -#define DATA_CHANNELER_EVENT 2 -#define DATA_COLLAPSE 6 -#define DATA_CHANNELER 9 -#endif - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp deleted file mode 100644 index eb8e9b1a961..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/magtheridons_lair/instance_magtheridons_lair.cpp +++ /dev/null @@ -1,249 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Magtheridons_Lair -SD%Complete: 100 -SDComment: -SDCategory: Hellfire Citadel, Magtheridon's lair -EndScriptData */ - -#include "precompiled.h" -#include "def_magtheridons_lair.h" - -#define SPELL_SOUL_TRANSFER 30531 // core bug, does not support target 7 -#define SPELL_BLAZE_TARGET 30541 // core bug, does not support target 7 - -#define CHAMBER_CENTER_X -15.14 -#define CHAMBER_CENTER_Y 1.8 -#define CHAMBER_CENTER_Z -0.4 - -#define MAX_ENCOUNTER 2 - -struct TRINITY_DLL_DECL instance_magtheridons_lair : public ScriptedInstance -{ - instance_magtheridons_lair(Map* pMap) : ScriptedInstance(pMap) - { - Initialize(); - } - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint64 MagtheridonGUID; - std::set ChannelerGUID; - uint64 DoorGUID; - std::set ColumnGUID; - - uint32 CageTimer; - uint32 RespawnTimer; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - MagtheridonGUID = 0; - ChannelerGUID.clear(); - DoorGUID = 0; - ColumnGUID.clear(); - - CageTimer = 0; - RespawnTimer = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - return false; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 17257: - MagtheridonGUID = pCreature->GetGUID(); - break; - case 17256: - ChannelerGUID.insert(pCreature->GetGUID()); - break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 181713: - pGo->SetUInt32Value(GAMEOBJECT_FLAGS, 0); - break; - case 183847: - DoorGUID = pGo->GetGUID(); - break; - case 184653: // hall - case 184634: // six columns - case 184635: - case 184636: - case 184637: - case 184638: - case 184639: - ColumnGUID.insert(pGo->GetGUID()); - break; - } - } - - uint64 GetData64(uint32 type) - { - switch(type) - { - case DATA_MAGTHERIDON: - return MagtheridonGUID; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_MAGTHERIDON_EVENT: - m_auiEncounter[0] = data; - if (data == NOT_STARTED) - RespawnTimer = 10000; - if (data != IN_PROGRESS) - HandleGameObject(DoorGUID, true); - break; - case DATA_CHANNELER_EVENT: - switch(data) - { - case NOT_STARTED: // Reset all channelers once one is reset. - if (m_auiEncounter[1] != NOT_STARTED) - { - m_auiEncounter[1] = NOT_STARTED; - for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) - { - if (Creature *Channeler = instance->GetCreature(*i)) - { - if (Channeler->isAlive()) - Channeler->AI()->EnterEvadeMode(); - else - Channeler->Respawn(); - } - } - CageTimer = 0; - HandleGameObject(DoorGUID, true); - }break; - case IN_PROGRESS: // Event start. - if (m_auiEncounter[1] != IN_PROGRESS) - { - m_auiEncounter[1] = IN_PROGRESS; - // Let all five channelers aggro. - for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) - { - Creature *Channeler = instance->GetCreature(*i); - if (Channeler && Channeler->isAlive()) - Channeler->AI()->AttackStart(Channeler->SelectNearestTarget(999)); - } - // Release Magtheridon after two minutes. - Creature *Magtheridon = instance->GetCreature(MagtheridonGUID); - if (Magtheridon && Magtheridon->isAlive()) - { - Magtheridon->MonsterTextEmote("'s bonds begin to weaken!", 0); - CageTimer = 120000; - } - HandleGameObject(DoorGUID, false); - }break; - case DONE: // Add buff and check if all channelers are dead. - for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) - { - Creature *Channeler = instance->GetCreature(*i); - if (Channeler && Channeler->isAlive()) - { - //Channeler->CastSpell(Channeler, SPELL_SOUL_TRANSFER, true); - data = IN_PROGRESS; - break; - } - }break; - } - m_auiEncounter[1] = data; - break; - case DATA_COLLAPSE: - // true - collapse / false - reset - for(std::set::iterator i = ColumnGUID.begin(); i != ColumnGUID.end(); ++i) - DoUseDoorOrButton(*i); - break; - default: - break; - } - } - - uint32 GetData(uint32 type) - { - if (type == DATA_MAGTHERIDON_EVENT) - return m_auiEncounter[0]; - return 0; - } - - void Update(uint32 diff) - { - if (CageTimer) - { - if (CageTimer <= diff) - { - Creature *Magtheridon = instance->GetCreature(MagtheridonGUID); - if (Magtheridon && Magtheridon->isAlive()) - { - Magtheridon->clearUnitState(UNIT_STAT_STUNNED); - Magtheridon->AI()->AttackStart(Magtheridon->SelectNearestTarget(999)); - } - CageTimer = 0; - }else CageTimer -= diff; - } - - if (RespawnTimer) - { - if (RespawnTimer <= diff) - { - for(std::set::iterator i = ChannelerGUID.begin(); i != ChannelerGUID.end(); ++i) - { - if (Creature *Channeler = instance->GetCreature(*i)) - { - if (Channeler->isAlive()) - Channeler->AI()->EnterEvadeMode(); - else - Channeler->Respawn(); - } - } - RespawnTimer = 0; - }else RespawnTimer -= diff; - } - } -}; - -InstanceData* GetInstanceData_instance_magtheridons_lair(Map* pMap) -{ - return new instance_magtheridons_lair(pMap); -} - -void AddSC_instance_magtheridons_lair() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_magtheridons_lair"; - newscript->GetInstanceData = &GetInstanceData_instance_magtheridons_lair; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp deleted file mode 100644 index 721d1efd03c..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_nethekurse.cpp +++ /dev/null @@ -1,412 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Grand_Warlock_Nethekurse -SD%Complete: 75 -SDComment: encounter not fully completed. missing part where boss kill minions. -SDCategory: Hellfire Citadel, Shattered Halls -EndScriptData */ - -/* ContentData -boss_grand_warlock_nethekurse -mob_fel_orc_convert -mob_lesser_shadow_fissure -EndContentData */ - -#include "precompiled.h" -#include "def_shattered_halls.h" - -struct Say -{ - int32 id; -}; - -static Say PeonAttacked[]= -{ - {-1540001}, - {-1540002}, - {-1540003}, - {-1540004}, -}; -static Say PeonDies[]= -{ - {-1540005}, - {-1540006}, - {-1540007}, - {-1540008}, -}; - -#define SAY_INTRO -1540000 -#define SAY_TAUNT_1 -1540009 -#define SAY_TAUNT_2 -1540010 -#define SAY_TAUNT_3 -1540011 -#define SAY_AGGRO_1 -1540012 -#define SAY_AGGRO_2 -1540013 -#define SAY_AGGRO_3 -1540014 -#define SAY_SLAY_1 -1540015 -#define SAY_SLAY_2 -1540016 -#define SAY_DIE -1540017 - -#define SPELL_DEATH_COIL 30500 -#define SPELL_DARK_SPIN 30502 // core bug spell attack caster :D -#define SPELL_SHADOW_FISSURE 30496 // Summon the ShadowFissure NPC - -#define SPELL_SHADOW_CLEAVE 30495 -#define H_SPELL_SHADOW_SLAM 35953 - -#define SPELL_HEMORRHAGE 30478 - -#define SPELL_CONSUMPTION 30497 -#define SPELL_TEMPORARY_VISUAL 39312 // this is wrong, a temporary solution. spell consumption already has the purple visual, but doesn't display as it should - -struct TRINITY_DLL_DECL boss_grand_warlock_nethekurseAI : public ScriptedAI -{ - boss_grand_warlock_nethekurseAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - bool IntroOnce; - bool IsIntroEvent; - bool IsMainEvent; - bool SpinOnce; - //bool HasTaunted; - bool Phase; - - uint32 PeonEngagedCount; - uint32 PeonKilledCount; - - uint32 IntroEvent_Timer; - uint32 DeathCoil_Timer; - uint32 ShadowFissure_Timer; - uint32 Cleave_Timer; - - void Reset() - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - IsIntroEvent = false; - IntroOnce = false; - IsMainEvent = false; - //HasTaunted = false; - SpinOnce = false; - Phase = false; - - PeonEngagedCount = 0; - PeonKilledCount = 0; - - IntroEvent_Timer = 90000; //how long before getting bored and kills his minions? - DeathCoil_Timer = 20000; - ShadowFissure_Timer = 8000; - Cleave_Timer = 5000; - } - - void DoYellForPeonAggro() - { - if (PeonEngagedCount >= 4) - return; - - DoScriptText(PeonAttacked[PeonEngagedCount].id, m_creature); - ++PeonEngagedCount; - } - - void DoYellForPeonDeath() - { - if (PeonKilledCount >= 4) - return; - - DoScriptText(PeonDies[PeonKilledCount].id, m_creature); - ++PeonKilledCount; - - if (PeonKilledCount == 4) - { - IsIntroEvent = false; - IsMainEvent = true; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - } - - void DoTauntPeons() - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_TAUNT_1, m_creature); break; - case 1: DoScriptText(SAY_TAUNT_2, m_creature); break; - case 2: DoScriptText(SAY_TAUNT_3, m_creature); break; - } - - //TODO: kill the peons first - IsIntroEvent = false; - PeonEngagedCount = 4; - PeonKilledCount = 4; - IsMainEvent = true; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - void AttackStart(Unit* who) - { - if (IsIntroEvent || !IsMainEvent) - return; - - if (m_creature->Attack(who, true)) - { - if (Phase) DoStartNoMovement(who); - else DoStartMovement(who); - } - } - - void MoveInLineOfSight(Unit *who) - { - if (!IntroOnce && m_creature->IsWithinDistInMap(who, 50.0f)) - { - if (who->GetTypeId() != TYPEID_PLAYER) - return; - - DoScriptText(SAY_INTRO, m_creature); - IntroOnce = true; - IsIntroEvent = true; - - if (pInstance) - pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); - } - - if (IsIntroEvent || !IsMainEvent) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustSummoned(Creature *summoned) - { - summoned->setFaction(16); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - //triggered spell of consumption does not properly show it's SpellVisual, wrong spellid? - summoned->CastSpell(summoned,SPELL_TEMPORARY_VISUAL,true); - summoned->CastSpell(summoned,SPELL_CONSUMPTION,false,0,0,m_creature->GetGUID()); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DIE, m_creature); - - if (!pInstance) - return; - - pInstance->SetData(TYPE_NETHEKURSE,DONE); - pInstance->HandleGameObject(pInstance->GetData64(DATA_NETHEKURSE_DOOR), true); - } - - void UpdateAI(const uint32 diff) - { - if (IsIntroEvent) - { - if (!pInstance) - return; - - if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) - { - if (IntroEvent_Timer < diff) - { - DoTauntPeons(); - }else IntroEvent_Timer -= diff; - } - } - - if (!UpdateVictim()) - return; - - if (!IsMainEvent) - return; - - if (Phase) - { - if (!SpinOnce) - { - DoCast(m_creature->getVictim(),SPELL_DARK_SPIN); - SpinOnce = true; - } - - if (Cleave_Timer < diff) - { - DoCast(m_creature->getVictim(),(HeroicMode ? H_SPELL_SHADOW_SLAM : SPELL_SHADOW_CLEAVE)); - Cleave_Timer = 6000+rand()%2500; - }else Cleave_Timer -= diff; - } - else - { - if (ShadowFissure_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_FISSURE); - ShadowFissure_Timer = 7500+rand()%7500; - }else ShadowFissure_Timer -= diff; - - if (DeathCoil_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_DEATH_COIL); - DeathCoil_Timer = 15000+rand()%5000; - }else DeathCoil_Timer -= diff; - - if ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 20) - Phase = true; - - DoMeleeAttackIfReady(); - } - } -}; - -struct TRINITY_DLL_DECL mob_fel_orc_convertAI : public ScriptedAI -{ - mob_fel_orc_convertAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - uint32 Hemorrhage_Timer; - - void Reset() - { - m_creature->SetNoCallAssistance(true); //we don't want any assistance (WE R HEROZ!) - Hemorrhage_Timer = 3000; - } - - void MoveInLineOfSight(Unit *who) - { - } - - void EnterCombat(Unit* who) - { - if (pInstance) - { - if (pInstance->GetData64(DATA_NETHEKURSE)) - { - Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE)); - if (pKurse && m_creature->IsWithinDist(pKurse, 45.0f)) - { - CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonAggro(); - - if (pInstance->GetData(TYPE_NETHEKURSE) == IN_PROGRESS) - return; - else pInstance->SetData(TYPE_NETHEKURSE,IN_PROGRESS); - } - } - } - } - - void JustDied(Unit* Killer) - { - if (pInstance) - { - if (pInstance->GetData(TYPE_NETHEKURSE) != IN_PROGRESS) - return; - if (pInstance->GetData64(DATA_NETHEKURSE)) - { - Creature *pKurse = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_NETHEKURSE)); - if (pKurse) - CAST_AI(boss_grand_warlock_nethekurseAI, pKurse->AI())->DoYellForPeonDeath(); - } - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Hemorrhage_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_HEMORRHAGE); - Hemorrhage_Timer = 15000; - }else Hemorrhage_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//NOTE: this Creature are also summoned by other spells, for different creatures -struct TRINITY_DLL_DECL mob_lesser_shadow_fissureAI : public ScriptedAI -{ - mob_lesser_shadow_fissureAI(Creature *c) : ScriptedAI(c) {} - - void Reset() { } - void MoveInLineOfSight(Unit *who) { } - void AttackStart(Unit* who) { } - void EnterCombat(Unit* who) { } -}; - -CreatureAI* GetAI_boss_grand_warlock_nethekurse(Creature* pCreature) -{ - return new boss_grand_warlock_nethekurseAI (pCreature); -} - -CreatureAI* GetAI_mob_fel_orc_convert(Creature* pCreature) -{ - return new mob_fel_orc_convertAI (pCreature); -} - -CreatureAI* GetAI_mob_lesser_shadow_fissure(Creature* pCreature) -{ - return new mob_lesser_shadow_fissureAI (pCreature); -} - -void AddSC_boss_grand_warlock_nethekurse() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_grand_warlock_nethekurse"; - newscript->GetAI = &GetAI_boss_grand_warlock_nethekurse; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_fel_orc_convert"; - newscript->GetAI = &GetAI_mob_fel_orc_convert; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_lesser_shadow_fissure"; - newscript->GetAI = &GetAI_mob_lesser_shadow_fissure; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp deleted file mode 100644 index 0681e94e2b0..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warbringer_omrogg.cpp +++ /dev/null @@ -1,408 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Warbringer_Omrogg -SD%Complete: 85 -SDComment: Heroic enabled. Spell timing may need additional tweaks -SDCategory: Hellfire Citadel, Shattered Halls -EndScriptData */ - -/* ContentData -mob_omrogg_heads -boss_warbringer_omrogg -EndContentData */ - -#include "precompiled.h" -#include "def_shattered_halls.h" - -enum -{ - YELL_DIE_L = -1540039, - YELL_DIE_R = -1540040, - EMOTE_ENRAGE = -1540041, - - SPELL_BLAST_WAVE = 30600, - SPELL_FEAR = 30584, - SPELL_THUNDERCLAP = 30633, - - SPELL_BURNING_MAUL = 30598, - H_SPELL_BURNING_MAUL = 36056, - - NPC_LEFT_HEAD = 19523, - NPC_RIGHT_HEAD = 19524 -}; - -struct Yell -{ - int32 id; - uint32 creature; -}; - -static Yell GoCombat[]= -{ - {-1540018, NPC_LEFT_HEAD}, - {-1540019, NPC_LEFT_HEAD}, - {-1540020, NPC_LEFT_HEAD}, -}; -static Yell GoCombatDelay[]= -{ - {-1540021, NPC_RIGHT_HEAD}, - {-1540022, NPC_RIGHT_HEAD}, - {-1540023, NPC_RIGHT_HEAD}, -}; - -static Yell Threat[]= -{ - {-1540024, NPC_LEFT_HEAD}, - {-1540025, NPC_RIGHT_HEAD}, - {-1540026, NPC_LEFT_HEAD}, - {-1540027, NPC_LEFT_HEAD}, -}; -static Yell ThreatDelay1[]= -{ - {-1540028, NPC_RIGHT_HEAD}, - {-1540029, NPC_LEFT_HEAD}, - {-1540030, NPC_RIGHT_HEAD}, - {-1540031, NPC_RIGHT_HEAD}, -}; -static Yell ThreatDelay2[]= -{ - {-1540032, NPC_LEFT_HEAD}, - {-1540033, NPC_RIGHT_HEAD}, - {-1540034, NPC_LEFT_HEAD}, - {-1540035, NPC_LEFT_HEAD}, -}; - -static Yell Killing[]= -{ - {-1540036, NPC_LEFT_HEAD}, - {-1540037, NPC_RIGHT_HEAD}, -}; -static Yell KillingDelay[]= -{ - {-1540038, NPC_RIGHT_HEAD}, - {-1000000, NPC_LEFT_HEAD}, -}; - -struct TRINITY_DLL_DECL mob_omrogg_headsAI : public ScriptedAI -{ - mob_omrogg_headsAI(Creature *c) : ScriptedAI(c) {} - - bool DeathYell; - uint32 Death_Timer; - - void Reset() - { - Death_Timer = 4000; - DeathYell = false; - } - void EnterCombat(Unit* who) { } - - void DoDeathYell() - { - DeathYell = true; - } - - void UpdateAI(const uint32 diff) - { - if (!DeathYell) - return; - - if (Death_Timer < diff) - { - DoScriptText(YELL_DIE_R, m_creature); - Death_Timer = false; - m_creature->setDeathState(JUST_DIED); - }else Death_Timer -= diff; - } -}; - -struct TRINITY_DLL_DECL boss_warbringer_omroggAI : public ScriptedAI -{ - boss_warbringer_omroggAI(Creature *c) : ScriptedAI(c) - { - LeftHeadGUID = 0; - RightHeadGUID = 0; - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - uint64 LeftHeadGUID; - uint64 RightHeadGUID; - int iaggro; - int ithreat; - int ikilling; - - bool AggroYell; - bool ThreatYell; - bool ThreatYell2; - bool KillingYell; - - uint32 Delay_Timer; - uint32 BlastWave_Timer; - uint32 BlastCount; - uint32 Fear_Timer; - uint32 BurningMaul_Timer; - uint32 ThunderClap_Timer; - uint32 ResetThreat_Timer; - - void Reset() - { - if (Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID)) - { - pLeftHead->setDeathState(JUST_DIED); - LeftHeadGUID = 0; - } - - if (Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID)) - { - pRightHead->setDeathState(JUST_DIED); - RightHeadGUID = 0; - } - - - AggroYell = false; - ThreatYell = false; - ThreatYell2 = false; - KillingYell = false; - - Delay_Timer = 4000; - BlastWave_Timer = 0; - BlastCount = 0; - Fear_Timer = 8000; - BurningMaul_Timer = 25000; - ThunderClap_Timer = 15000; - ResetThreat_Timer = 30000; - - if (pInstance) - pInstance->SetData(TYPE_OMROGG, NOT_STARTED); //End boss can use this later. O'mrogg must be defeated(DONE) or he will come to aid. - } - - void DoYellForThreat() - { - Unit *pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); - Unit *pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); - - if (!pLeftHead || !pRightHead) - return; - - ithreat = rand()%4; - - Unit *source = (pLeftHead->GetEntry() == Threat[ithreat].creature ? pLeftHead : pRightHead); - - DoScriptText(Threat[ithreat].id, source); - - Delay_Timer = 3500; - ThreatYell = true; - } - - void EnterCombat(Unit *who) - { - m_creature->SummonCreature(NPC_LEFT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); - m_creature->SummonCreature(NPC_RIGHT_HEAD, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_DEAD_DESPAWN, 0); - - if (Unit *pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID)) - { - iaggro = rand()%3; - - DoScriptText(GoCombat[iaggro].id, pLeftHead); - - Delay_Timer = 3500; - AggroYell = true; - } - - if (pInstance) - pInstance->SetData(TYPE_OMROGG, IN_PROGRESS); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == NPC_LEFT_HEAD) - LeftHeadGUID = summoned->GetGUID(); - - if (summoned->GetEntry() == NPC_RIGHT_HEAD) - RightHeadGUID = summoned->GetGUID(); - - //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - //summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - summoned->SetVisibility(VISIBILITY_OFF); - } - - void KilledUnit(Unit* victim) - { - Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); - Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); - - - if (!pLeftHead || !pRightHead) - return; - - ikilling = rand()%2; - - Unit *source = (pLeftHead->GetEntry() == Killing[ikilling].creature ? pLeftHead : pRightHead); - - switch(ikilling) - { - case 0: - DoScriptText(Killing[ikilling].id, source); - Delay_Timer = 3500; - KillingYell = true; - break; - case 1: - DoScriptText(Killing[ikilling].id, source); - KillingYell = false; - break; - } - } - - void JustDied(Unit* Killer) - { - Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); - Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); - - if (!pLeftHead || !pRightHead) - return; - - DoScriptText(YELL_DIE_L, pLeftHead); - - CAST_AI(mob_omrogg_headsAI, CAST_CRE(pRightHead)->AI())->DoDeathYell(); - - if (pInstance) - pInstance->SetData(TYPE_OMROGG, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (Delay_Timer < diff) - { - Delay_Timer = 3500; - - Unit* pLeftHead = Unit::GetUnit(*m_creature,LeftHeadGUID); - Unit* pRightHead = Unit::GetUnit(*m_creature,RightHeadGUID); - - if (!pLeftHead || !pRightHead) - return; - - if (AggroYell) - { - DoScriptText(GoCombatDelay[iaggro].id, pRightHead); - AggroYell = false; - } - - if (ThreatYell2) - { - Unit *source = (pLeftHead->GetEntry() == ThreatDelay2[ithreat].creature ? pLeftHead : pRightHead); - - DoScriptText(ThreatDelay2[ithreat].id, source); - ThreatYell2 = false; - } - - if (ThreatYell) - { - Unit *source = (pLeftHead->GetEntry() == ThreatDelay1[ithreat].creature ? pLeftHead : pRightHead); - - DoScriptText(ThreatDelay1[ithreat].id, source); - ThreatYell = false; - ThreatYell2 = true; - } - - if (KillingYell) - { - Unit *source = (pLeftHead->GetEntry() == KillingDelay[ikilling].creature ? pLeftHead : pRightHead); - - DoScriptText(KillingDelay[ikilling].id, source); - KillingYell = false; - } - }else Delay_Timer -= diff; - - if (!UpdateVictim()) - return; - - if (BlastCount && BlastWave_Timer <= diff) - { - DoCast(m_creature,SPELL_BLAST_WAVE); - BlastWave_Timer = 5000; - ++BlastCount; - - if (BlastCount == 3) - BlastCount = 0; - }else BlastWave_Timer -= diff; - - if (BurningMaul_Timer < diff) - { - DoScriptText(EMOTE_ENRAGE, m_creature); - DoCast(m_creature,HeroicMode ? H_SPELL_BURNING_MAUL : SPELL_BURNING_MAUL); - BurningMaul_Timer = 40000; - BlastWave_Timer = 16000; - BlastCount = 1; - }else BurningMaul_Timer -= diff; - - if (ResetThreat_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - DoYellForThreat(); - DoResetThreat(); - m_creature->AddThreat(target, 0.0f); - } - ResetThreat_Timer = 25000+rand()%15000; - }else ResetThreat_Timer -= diff; - - if (Fear_Timer < diff) - { - DoCast(m_creature,SPELL_FEAR); - Fear_Timer = 15000+rand()%20000; - }else Fear_Timer -= diff; - - if (ThunderClap_Timer < diff) - { - DoCast(m_creature,SPELL_THUNDERCLAP); - ThunderClap_Timer = 15000+rand()%15000; - }else ThunderClap_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_warbringer_omrogg(Creature* pCreature) -{ - return new boss_warbringer_omroggAI (pCreature); -} - -CreatureAI* GetAI_mob_omrogg_heads(Creature* pCreature) -{ - return new mob_omrogg_headsAI (pCreature); -} - -void AddSC_boss_warbringer_omrogg() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_warbringer_omrogg"; - newscript->GetAI = &GetAI_boss_warbringer_omrogg; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_omrogg_heads"; - newscript->GetAI = &GetAI_mob_omrogg_heads; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp deleted file mode 100644 index 4fa673f3560..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/boss_warchief_kargath_bladefist.cpp +++ /dev/null @@ -1,303 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Warchief_Kargath_Bladefist -SD%Complete: 90 -SDComment: -SDCategory: Hellfire Citadel, Shattered Halls -EndScriptData */ - -/* ContentData -boss_warchief_kargath_bladefist -EndContentData */ - -#include "precompiled.h" - -#define SAY_AGGRO1 -1540042 -#define SAY_AGGRO2 -1540043 -#define SAY_AGGRO3 -1540044 -#define SAY_SLAY1 -1540045 -#define SAY_SLAY2 -1540046 -#define SAY_DEATH -1540047 - -#define SPELL_BLADE_DANCE 30739 -#define H_SPELL_CHARGE 25821 - -#define TARGET_NUM 5 - -#define MOB_SHATTERED_ASSASSIN 17695 -#define MOB_HEARTHEN_GUARD 17621 -#define MOB_SHARPSHOOTER_GUARD 17622 -#define MOB_REAVER_GUARD 17623 - -float AssassEntrance[3] = {275.136,-84.29,2.3}; // y -8 -float AssassExit[3] = {184.233,-84.29,2.3}; // y -8 -float AddsEntrance[3] = {306.036,-84.29,1.93}; - -struct TRINITY_DLL_DECL boss_warchief_kargath_bladefistAI : public ScriptedAI -{ - boss_warchief_kargath_bladefistAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - std::vector adds; - std::vector assassins; - - uint32 Charge_timer; - uint32 Blade_Dance_Timer; - uint32 Summon_Assistant_Timer; - uint32 resetcheck_timer; - uint32 Wait_Timer; - - uint32 Assassins_Timer; - - uint32 summoned; - bool InBlade; - - uint32 target_num; - - void Reset() - { - removeAdds(); - - m_creature->SetSpeed(MOVE_RUN,2); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - - summoned = 2; - InBlade = false; - Wait_Timer = 0; - - Charge_timer = 0; - Blade_Dance_Timer = 45000; - Summon_Assistant_Timer = 30000; - Assassins_Timer = 5000; - resetcheck_timer = 5000; - } - - void EnterCombat(Unit *who) - { - switch (rand()%3) - { - case 0:DoScriptText(SAY_AGGRO1, m_creature);break; - case 1:DoScriptText(SAY_AGGRO2, m_creature);break; - case 2:DoScriptText(SAY_AGGRO3, m_creature);break; - } - } - - void JustSummoned(Creature *summoned) - { - switch(summoned->GetEntry()) - { - case MOB_HEARTHEN_GUARD: - case MOB_SHARPSHOOTER_GUARD: - case MOB_REAVER_GUARD: - summoned->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM,0)); - adds.push_back(summoned->GetGUID()); - break; - case MOB_SHATTERED_ASSASSIN: - assassins.push_back(summoned->GetGUID()); - break; - } - } - - void KilledUnit(Unit *victim) - { - if (victim->GetTypeId() == TYPEID_PLAYER) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - removeAdds(); - } - - void MovementInform(uint32 type, uint32 id) - { - if (InBlade) - { - if (type != POINT_MOTION_TYPE) - return; - - if (id != 1) - return; - - if (target_num > 0) // to prevent loops - { - Wait_Timer = 1; - DoCast(m_creature,SPELL_BLADE_DANCE,true); - target_num--; - } - } - } - - void removeAdds() - { - for(std::vector::iterator itr = adds.begin(); itr!= adds.end(); ++itr) - { - Unit* temp = Unit::GetUnit((*m_creature),*itr); - if (temp && temp->isAlive()) - { - (*temp).GetMotionMaster()->Clear(true); - m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - CAST_CRE(temp)->RemoveCorpse(); - } - } - adds.clear(); - - for(std::vector::iterator itr = assassins.begin(); itr!= assassins.end(); ++itr) - { - Unit* temp = Unit::GetUnit((*m_creature),*itr); - if (temp && temp->isAlive()) - { - (*temp).GetMotionMaster()->Clear(true); - m_creature->DealDamage(temp,temp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - CAST_CRE(temp)->RemoveCorpse(); - } - } - assassins.clear(); - } - void SpawnAssassin() - { - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]+8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassEntrance[0],AssassEntrance[1]-8, AssassEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]+8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - m_creature->SummonCreature(MOB_SHATTERED_ASSASSIN,AssassExit[0],AssassExit[1]-8, AssassExit[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Assassins_Timer) - if (Assassins_Timer < diff) - { - SpawnAssassin(); - Assassins_Timer = 0; - }else Assassins_Timer -= diff; - - if (InBlade) - { - if (Wait_Timer) - if (Wait_Timer < diff) - { - if (target_num <= 0) - { - // stop bladedance - InBlade = false; - m_creature->SetSpeed(MOVE_RUN,2); - (*m_creature).GetMotionMaster()->MoveChase(m_creature->getVictim()); - Blade_Dance_Timer = 30000; - Wait_Timer = 0; - if (HeroicMode) - Charge_timer = 5000; - } - else - { - //move in bladedance - float x,y,randx,randy; - randx = (rand()%40); - randy = (rand()%40); - x = 210+ randx ; - y = -60- randy ; - (*m_creature).GetMotionMaster()->MovePoint(1,x,y,m_creature->GetPositionZ()); - Wait_Timer = 0; - } - }else Wait_Timer -= diff; - } - else - { - if (Blade_Dance_Timer) - if (Blade_Dance_Timer < diff) - { - target_num = TARGET_NUM; - Wait_Timer = 1; - InBlade = true; - Blade_Dance_Timer = 0; - m_creature->SetSpeed(MOVE_RUN,4); - return; - }else Blade_Dance_Timer -= diff; - - if (Charge_timer) - if (Charge_timer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM,0),H_SPELL_CHARGE); - Charge_timer = 0; - }else Charge_timer -= diff; - - if (Summon_Assistant_Timer < diff) - { - Unit* target = NULL; - - for(uint8 i = 0; i < summoned; ++i) - { - switch(rand()%3) - { - case 0: m_creature->SummonCreature(MOB_HEARTHEN_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; - case 1: m_creature->SummonCreature(MOB_SHARPSHOOTER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; - case 2: m_creature->SummonCreature(MOB_REAVER_GUARD,AddsEntrance[0],AddsEntrance[1], AddsEntrance[2], 0,TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT,30000); break; - } - } - if (rand()%100 < 20) summoned++; - Summon_Assistant_Timer = 25000 + (rand()%10000) ; - }else Summon_Assistant_Timer -= diff; - - DoMeleeAttackIfReady(); - } - - if (resetcheck_timer < diff) - { - uint32 tempx,tempy; - tempx = uint32(m_creature->GetPositionX()); - tempy = uint32(m_creature->GetPositionY()); - if (tempx > 255 || tempx < 205) - { - EnterEvadeMode(); - return; - } - resetcheck_timer = 5000; - }else resetcheck_timer -= diff; - } -}; - -CreatureAI* GetAI_boss_warchief_kargath_bladefist(Creature* pCreature) -{ - return new boss_warchief_kargath_bladefistAI (pCreature); -} - -void AddSC_boss_warchief_kargath_bladefist() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_warchief_kargath_bladefist"; - newscript->GetAI = &GetAI_boss_warchief_kargath_bladefist; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h deleted file mode 100644 index cbfa23ec4e0..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/def_shattered_halls.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SHATTERED_H -#define DEF_SHATTERED_H - -#define TYPE_NETHEKURSE 1 -#define DATA_NETHEKURSE 2 -#define DATA_NETHEKURSE_DOOR 3 - -#define TYPE_OMROGG 4 -#endif - diff --git a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp b/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp deleted file mode 100644 index 864a49a84ba..00000000000 --- a/src/bindings/scripts/scripts/zone/hellfire_citadel/shattered_halls/instance_shattered_halls.cpp +++ /dev/null @@ -1,114 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Shattered_Halls -SD%Complete: 50 -SDComment: currently missing info about door. instance not complete -SDCategory: Hellfire Citadel, Shattered Halls -EndScriptData */ - -#include "precompiled.h" -#include "def_shattered_halls.h" - -#define MAX_ENCOUNTER 2 - -#define DOOR_NETHEKURSE 1 - -struct TRINITY_DLL_DECL instance_shattered_halls : public ScriptedInstance -{ - instance_shattered_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint64 nethekurseGUID; - uint64 nethekurseDoorGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - nethekurseGUID = 0; - nethekurseDoorGUID = 0; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case DOOR_NETHEKURSE: nethekurseDoorGUID = pGo->GetGUID(); break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 16807: nethekurseGUID = pCreature->GetGUID(); break; - } - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_NETHEKURSE: - m_auiEncounter[0] = data; - break; - case TYPE_OMROGG: - m_auiEncounter[1] = data; - break; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_NETHEKURSE: - return m_auiEncounter[0]; - case TYPE_OMROGG: - return m_auiEncounter[1]; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_NETHEKURSE: - return nethekurseGUID; - case DATA_NETHEKURSE_DOOR: - return nethekurseDoorGUID; - } - return 0; - } -}; - -InstanceData* GetInstanceData_instance_shattered_halls(Map* pMap) -{ - return new instance_shattered_halls(pMap); -} - -void AddSC_instance_shattered_halls() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_shattered_halls"; - newscript->GetInstanceData = &GetInstanceData_instance_shattered_halls; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp deleted file mode 100644 index 835a5bfa2da..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_anubrekhan.cpp +++ /dev/null @@ -1,123 +0,0 @@ -/* Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -#define SAY_GREET RAND(-1533000,-1533004,-1533005,-1533006,-1533007) -#define SAY_AGGRO RAND(-1533001,-1533002,-1533003) -#define SAY_SLAY -1533008 - -#define SPELL_IMPALE HEROIC(28783,56090) -#define SPELL_LOCUSTSWARM HEROIC(28785,54021) - -#define SPELL_SELF_SPAWN_5 29105 //This spawns 5 corpse scarabs ontop of us (most likely the player casts this on death) - -#define EVENT_IMPALE 1 -#define EVENT_LOCUST 2 - -#define MOB_CRYPT_GUARD 16573 - -struct TRINITY_DLL_DECL boss_anubrekhanAI : public BossAI -{ - boss_anubrekhanAI(Creature *c) : BossAI(c, BOSS_ANUBREKHAN) { HasTaunted = false; } - - bool HasTaunted; - - void Prepare() - { - HasTaunted = false; - DoSpawnCreature(MOB_CRYPT_GUARD, 0, 10, 0, me->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); - if (HeroicMode) - DoSpawnCreature(MOB_CRYPT_GUARD, 0, -10, 0, me->GetOrientation(), TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); - } - - void InitializeAI() { Prepare(); } - void JustReachedHome() { Prepare(); _JustReachedHome(); } - - void KilledUnit(Unit* victim) - { - //Force the player to spawn corpse scarabs via spell - victim->CastSpell(victim, SPELL_SELF_SPAWN_5, true, NULL, NULL, me->GetGUID()); - - if (!(rand()%5)) - DoScriptText(SAY_SLAY, me); - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - DoScriptText(SAY_AGGRO, me); - events.ScheduleEvent(EVENT_IMPALE, 15000, 1); - events.ScheduleEvent(EVENT_LOCUST, 80000 + rand()%40000, 1); - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && me->IsWithinDistInMap(who, 60.0f)) - { - DoScriptText(SAY_GREET, me); - HasTaunted = true; - } - ScriptedAI::MoveInLineOfSight(who); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim() || !CheckInRoom()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_IMPALE: - //Cast Impale on a random target - //Do NOT cast it when we are afflicted by locust swarm - if (!me->HasAura(SPELL_LOCUSTSWARM)) - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_IMPALE); - events.ScheduleEvent(EVENT_IMPALE, 15000, 1); - events.DelayEvents(1500, 1); - return; - case EVENT_LOCUST: - DoCast(m_creature, SPELL_LOCUSTSWARM); - DoSpawnCreature(MOB_CRYPT_GUARD, 5, 5, 0, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 60000); - events.ScheduleEvent(EVENT_LOCUST, 90000, 1); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_anubrekhan(Creature* pCreature) -{ - return new boss_anubrekhanAI (pCreature); -} - -void AddSC_boss_anubrekhan() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_anubrekhan"; - newscript->GetAI = &GetAI_boss_anubrekhan; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp deleted file mode 100644 index 4be8f839e3d..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_faerlina.cpp +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -#define SAY_GREET -1533009 -#define SAY_AGGRO RAND(-1533010,-1533011,-1533012,-1533013) -#define SAY_SLAY RAND(-1533014,-1533015) -#define SAY_DEATH -1533016 - -//#define SOUND_RANDOM_AGGRO 8955 //soundId containing the 4 aggro sounds, we not using this - -#define SPELL_POSION_BOLT_VOLLEY HEROIC(28796,54098) -#define SPELL_RAIN_OF_FIRE HEROIC(28794,54099) -#define SPELL_FRENZY HEROIC(28798,54100) -#define SPELL_WIDOWS_EMBRACE HEROIC(28732,54097) - -enum Events -{ - EVENT_POSION = 1, - EVENT_FIRE, - EVENT_FRENZY, -}; - -struct TRINITY_DLL_DECL boss_faerlinaAI : public BossAI -{ - boss_faerlinaAI(Creature *c) : BossAI(c, BOSS_FAERLINA), greet(false) {} - - bool greet; - - void EnterCombat(Unit *who) - { - _EnterCombat(); - DoScriptText(SAY_AGGRO, me); - events.ScheduleEvent(EVENT_POSION, 10000 + rand()%15000); - events.ScheduleEvent(EVENT_FIRE, 5000 + rand()%15000); - events.ScheduleEvent(EVENT_FRENZY, 60000 + rand()%20000); - } - - void MoveInLineOfSight(Unit *who) - { - if (!greet) - { - DoScriptText(SAY_GREET, me); - greet = true; - } - BossAI::MoveInLineOfSight(who); - } - - void KilledUnit(Unit* victim) - { - if (!(rand()%3)) - DoScriptText(SAY_SLAY, me); - } - - void JustDied(Unit* Killer) - { - _JustDied(); - DoScriptText(SAY_DEATH, me); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_POSION: - if (!me->HasAura(SPELL_WIDOWS_EMBRACE)) - DoCastAOE(SPELL_POSION_BOLT_VOLLEY); - events.ScheduleEvent(EVENT_POSION, 10000 + rand()%15000); - return; - case EVENT_FIRE: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_RAIN_OF_FIRE); - events.ScheduleEvent(EVENT_FIRE, 5000 + rand()%15000); - return; - case EVENT_FRENZY: - DoCast(me,SPELL_FRENZY); - events.ScheduleEvent(EVENT_FRENZY, 60000 + rand()%20000); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_faerlina(Creature* pCreature) -{ - return new boss_faerlinaAI (pCreature); -} - -void AddSC_boss_faerlina() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_faerlina"; - newscript->GetAI = &GetAI_boss_faerlina; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp deleted file mode 100644 index 467f5ef62e9..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_four_horsemen.cpp +++ /dev/null @@ -1,167 +0,0 @@ -/* Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -enum Horsemen -{ - HORSEMEN_THANE, - HORSEMEN_LADY, - HORSEMEN_BARON, - HORSEMEN_SIR, -}; - -enum Events -{ - EVENT_MARK = 1, - EVENT_CAST, - EVENT_BERSERK, -}; - -const uint32 MOB_HORSEMEN[] = {16064, 16065, 30549, 16063}; -const uint32 SPELL_MARK[] = {28832, 28833, 28834, 28835}; -#define SPELL_PRIMARY(i) HEROIC(SPELL_PRIMARY_N[i],SPELL_PRIMARY_H[i]) -const uint32 SPELL_PRIMARY_N[] = {28884, 28863, 28882, 28883}; -const uint32 SPELL_PRIMARY_H[] = {57467, 57463, 57369, 57466}; -#define SPELL_SECONDARY(i) HEROIC(SPELL_SECONDARY_N[i],SPELL_SECONDARY_H[i]) -const uint32 SPELL_SECONDARY_N[]= {0, 57374, 0, 57376}; -const uint32 SPELL_SECONDARY_H[]= {0, 57464, 0, 57465}; -const uint32 SPELL_PUNISH[] = {0, 57381, 0, 57377}; -#define SPELL_BERSERK 26662 - -const int32 SAY_AGGRO[] = {-1533051, -1533044, -1533065, -1533058}; -const int32 SAY_TAUNT[3][4] ={ {-1533052, -1533045, -1533071, -1533059}, - {-1533053, -1533046, -1533072, -1533060}, - {-1533054, -1533047, -1533073, -1533061},}; -const int32 SAY_SPECIAL[] = {-1533055, -1533048, -1533070, -1533062}; -const int32 SAY_SLAY[] = {-1533056, -1533049, -1533068, -1533063}; -const int32 SAY_DEATH[] = {-1533057, -1533050, -1533074, -1533064}; - -#define SAY_BARON_AGGRO RAND(-1533065,-1533066,-1533067) -#define SAY_BARON_SLAY RAND(-1533068,-1533069) - -struct TRINITY_DLL_DECL boss_four_horsemenAI : public BossAI -{ - boss_four_horsemenAI(Creature *c) : BossAI(c, BOSS_HORSEMEN) - { - id = Horsemen(0); - for(uint8 i = 1; i < 4; ++i) - if (me->GetEntry() == MOB_HORSEMEN[i]) - id = Horsemen(i); - caster = (id == HORSEMEN_LADY || id == HORSEMEN_SIR); - } - - Horsemen id; - bool caster; - - void MoveInLineOfSight(Unit *who) - { - BossAI::MoveInLineOfSight(who); - if (caster) - SelectNearestTarget(who); - } - - void AttackStart(Unit *who) - { - if (caster) - AttackStartCaster(who, 20); - else - BossAI::AttackStart(who); - } - - void KilledUnit(Unit* victim) - { - if (!(rand()%5)) - { - if (id == HORSEMEN_BARON) - DoScriptText(SAY_BARON_SLAY, me); - else - DoScriptText(SAY_SLAY[id], me); - } - } - - void JustDied(Unit* killer) - { - _JustDied(); - DoScriptText(SAY_DEATH[id], me); - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - if (id == HORSEMEN_BARON) - DoScriptText(SAY_BARON_AGGRO, me); - else - DoScriptText(SAY_AGGRO[id], me); - events.ScheduleEvent(EVENT_MARK, 15000); - events.ScheduleEvent(EVENT_CAST, 20000+rand()%5000); - events.ScheduleEvent(EVENT_BERSERK, 15*100*1000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim() || !CheckInRoom()) - return; - - events.Update(diff); - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_MARK: - if (!(rand()%5)) - DoScriptText(SAY_SPECIAL[id], me); - DoCastAOE(SPELL_MARK[id]); - events.ScheduleEvent(EVENT_MARK, 15000); - return; - case EVENT_CAST: - if (!(rand()%5)) - DoScriptText(SAY_TAUNT[rand()%3][id], me); - DoCast(SPELL_PRIMARY(id)); - events.ScheduleEvent(EVENT_CAST, 15000); - return; - case EVENT_BERSERK: - DoScriptText(SAY_SPECIAL[id], me); - DoCast(me, EVENT_BERSERK); - return; - } - } - - if (!caster) - DoMeleeAttackIfReady(); - else if (!DoSpellAttackIfReady(SPELL_SECONDARY(id))) - DoCastAOE(SPELL_PUNISH[id]); - } -}; - -CreatureAI* GetAI_four_horsemen(Creature* pCreature) -{ - return new boss_four_horsemenAI (pCreature); -} - -void AddSC_boss_four_horsemen() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_four_horsemen"; - newscript->GetAI = &GetAI_four_horsemen; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp deleted file mode 100644 index a92c34a019c..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_gluth.cpp +++ /dev/null @@ -1,160 +0,0 @@ -/* Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -#define SPELL_MORTAL_WOUND 25646 -#define SPELL_ENRAGE HEROIC(28371,54427) -#define SPELL_DECIMATE HEROIC(28374,54426) -#define SPELL_BERSERK 26662 -#define SPELL_INFECTED_WOUND 29306 - -#define MOB_ZOMBIE 16360 - -const float PosSummon[3][4] = -{ - {3267.9, -3172.1, 297.42, 0.94}, - {3253.2, -3132.3, 297.42, 0}, - {3308.3, -3185.8, 297.42, 1.58}, -}; - -enum Events -{ - EVENT_WOUND = 1, - EVENT_ENRAGE, - EVENT_DECIMATE, - EVENT_BERSERK, - EVENT_SUMMON, -}; - -struct TRINITY_DLL_DECL boss_gluthAI : public BossAI -{ - boss_gluthAI(Creature *c) : BossAI(c, BOSS_GLUTH) - { - // Do not let Gluth be affected by zombies' debuff - me->ApplySpellImmune(0, IMMUNITY_ID, SPELL_INFECTED_WOUND, true); - } - - std::vector triggers; - - void Reset() - { - triggers.clear(); - _Reset(); - } - - void MoveInLineOfSight(Unit *who) - { - if (who->GetEntry() == MOB_ZOMBIE && me->IsWithinDistInMap(who, 20)) - { - SetGazeOn(who); - me->MonsterTextEmote(" spots a nearby zombie to devour!", 0, true); - } - else - BossAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit *who) - { - for(uint32 i = 0; i < 3; ++i) - if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummon[i])) - triggers.push_back(trigger); - if (triggers.size() < 3) - { - error_log("Script Gluth: cannot summon triggers!"); - EnterEvadeMode(); - return; - } - - _EnterCombat(); - events.ScheduleEvent(EVENT_WOUND, 10000); - events.ScheduleEvent(EVENT_ENRAGE, 30000); - events.ScheduleEvent(EVENT_DECIMATE, 105000); - events.ScheduleEvent(EVENT_BERSERK, 8*60000); - events.ScheduleEvent(EVENT_SUMMON, 10000); - } - - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == WORLD_TRIGGER) - summon->setActive(true); - else if (summon->GetEntry() == MOB_ZOMBIE) - summon->AI()->AttackStart(me); - summons.Summon(summon); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictimWithGaze() || !CheckInRoom()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_WOUND: - DoCast(me->getVictim(), SPELL_MORTAL_WOUND); - events.ScheduleEvent(EVENT_WOUND, 10000); - return; - case EVENT_ENRAGE: - DoCast(me, SPELL_ENRAGE); - events.ScheduleEvent(EVENT_ENRAGE, 30000); - return; - case EVENT_DECIMATE: - DoCastAOE(SPELL_DECIMATE); - events.ScheduleEvent(EVENT_DECIMATE, 105000); - return; - case EVENT_BERSERK: - DoCast(me, SPELL_BERSERK); - return; - case EVENT_SUMMON: - for(uint32 i = 0; i < HEROIC(1,2); ++i) - DoSummon(MOB_ZOMBIE, triggers[rand()%3]); - events.ScheduleEvent(EVENT_SUMMON, 10000); - return; - } - } - - if (me->getVictim()->GetEntry() == MOB_ZOMBIE) - { - if (me->IsWithinMeleeRange(me->getVictim())) - { - me->Kill(me->getVictim()); - me->ModifyHealth(me->GetMaxHealth() * 0.05f); - } - } - else - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_gluth(Creature* pCreature) -{ - return new boss_gluthAI (pCreature); -} - -void AddSC_boss_gluth() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_gluth"; - newscript->GetAI = &GetAI_boss_gluth; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp deleted file mode 100644 index f98e7667e6e..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_gothik.cpp +++ /dev/null @@ -1,347 +0,0 @@ -/* Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -#define SAY_SPEECH -1533040 -#define SAY_KILL -1533041 -#define SAY_DEATH -1533042 -#define SAY_TELEPORT -1533043 - -//Gothik -#define SPELL_HARVEST_SOUL 28679 -#define SPELL_SHADOW_BOLT HEROIC(29317,56405) - -#define SPELL_INFORM_LIVE_TRAINEE 27892 -#define SPELL_INFORM_LIVE_KNIGHT 27928 -#define SPELL_INFORM_LIVE_RIDER 27935 -#define SPELL_INFORM_DEAD_TRAINEE 27915 -#define SPELL_INFORM_DEAD_KNIGHT 27931 -#define SPELL_INFORM_DEAD_RIDER 27937 - -#define MOB_LIVE_TRAINEE 16124 -#define MOB_LIVE_KNIGHT 16125 -#define MOB_LIVE_RIDER 16126 -#define MOB_DEAD_TRAINEE 16127 -#define MOB_DEAD_KNIGHT 16148 -#define MOB_DEAD_RIDER 16150 -#define MOB_DEAD_HORSE 16149 - -const struct Waves { uint32 entry, number, time; } -waves[] = -{ - {MOB_LIVE_TRAINEE, 2, 20000}, - {MOB_LIVE_TRAINEE, 2, 20000}, - {MOB_LIVE_TRAINEE, 2, 10000}, - {MOB_LIVE_KNIGHT, 1, 10000}, - {MOB_LIVE_TRAINEE, 2, 15000}, - {MOB_LIVE_KNIGHT, 1, 10000}, - {MOB_LIVE_TRAINEE, 2, 15000}, - {MOB_LIVE_TRAINEE, 2, 0}, - {MOB_LIVE_KNIGHT, 1, 10000}, - {MOB_LIVE_RIDER, 1, 10000}, - {MOB_LIVE_TRAINEE, 2, 5000}, - {MOB_LIVE_KNIGHT, 1, 15000}, - {MOB_LIVE_TRAINEE, 2, 0}, - {MOB_LIVE_RIDER, 1, 10000}, - {MOB_LIVE_KNIGHT, 2, 10000}, - {MOB_LIVE_TRAINEE, 2, 10000}, - {MOB_LIVE_RIDER, 1, 5000}, - {MOB_LIVE_KNIGHT, 1, 5000}, - {MOB_LIVE_TRAINEE, 2, 20000}, - {MOB_LIVE_TRAINEE, 2, 0}, - {MOB_LIVE_KNIGHT, 1, 0}, - {MOB_LIVE_RIDER, 1, 15000}, - {MOB_LIVE_TRAINEE, 2, 29000}, - {0, 0, 0}, -}; - -#define POS_Y_GATE -3360.78f - -enum Events -{ - EVENT_SUMMON = 1, - EVENT_HARVEST, - EVENT_BOLT, -}; - -#define POS_LIVE 3 -#define POS_DEAD 5 - -const float PosSummonLive[POS_LIVE][4] = -{ - {2669.7, -3430.9, 268.56, 1.6}, - {2692.0, -3430.9, 268.56, 1.6}, - {2714.1, -3430.9, 268.56, 1.6}, -}; - -const float PosSummonDead[POS_DEAD][4] = -{ - {2725.1, -3310.0, 268.85, 3.4}, - {2699.3, -3322.8, 268.60, 3.3}, - {2733.1, -3348.5, 268.84, 3.1}, - {2682.8, -3304.2, 268.85, 3.9}, - {2664.8, -3340.7, 268.23, 3.7}, -}; - -const float PosGround[4] = {2691.2, -3362.7, 267.68, 1.7}; -const float PosPlatform[4] = {2640.5, -3360.6, 285.26, 0}; - -struct TRINITY_DLL_DECL boss_gothikAI : public BossAI -{ - boss_gothikAI(Creature *c) : BossAI(c, BOSS_GOTHIK) {} - - uint32 waveCount; - std::vector liveTrigger; - std::vector deadTrigger; - - void Reset() - { - liveTrigger.clear(); - deadTrigger.clear(); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - me->SetReactState(REACT_PASSIVE); - _Reset(); - } - - void EnterCombat(Unit *who) - { - for(uint32 i = 0; i < POS_LIVE; ++i) - if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummonLive[i])) - liveTrigger.push_back(trigger); - for(uint32 i = 0; i < POS_DEAD; ++i) - if (Creature *trigger = DoSummon(WORLD_TRIGGER, PosSummonDead[i])) - deadTrigger.push_back(trigger); - - if (liveTrigger.size() < POS_LIVE || deadTrigger.size() < POS_DEAD) - { - error_log("Script Gothik: cannot summon triggers!"); - EnterEvadeMode(); - return; - } - - _EnterCombat(); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - waveCount = 0; - events.ScheduleEvent(EVENT_SUMMON, 30000); - DoTeleportTo(PosPlatform); - DoScriptText(SAY_SPEECH, me); - if (instance) - instance->SetData(DATA_GOTHIK_GATE, 1); - } - - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == WORLD_TRIGGER) - summon->setActive(true); - else - { - summon->AI()->DoAction(me->HasReactState(REACT_PASSIVE) ? 1 : 0); - summon->AI()->EnterEvadeMode(); - } - summons.Summon(summon); - } - - void KilledUnit(Unit* victim) - { - if (!(rand()%5)) - DoScriptText(SAY_KILL, me); - } - - void JustDied(Unit* Killer) - { - _JustDied(); - DoScriptText(SAY_DEATH, me); - } - - void SpellHit(Unit *caster, const SpellEntry *spell) - { - uint32 spellId = 0; - switch(spell->Id) - { - case SPELL_INFORM_LIVE_TRAINEE: spellId = SPELL_INFORM_DEAD_TRAINEE; break; - case SPELL_INFORM_LIVE_KNIGHT: spellId = SPELL_INFORM_DEAD_KNIGHT; break; - case SPELL_INFORM_LIVE_RIDER: spellId = SPELL_INFORM_DEAD_RIDER; break; - } - if (spellId && me->isInCombat()) - { - me->HandleEmoteCommand(EMOTE_ONESHOT_SPELLCAST); - me->CastSpell(deadTrigger[rand()%POS_DEAD], spellId, true); - } - } - - void SpellHitTarget(Unit *target, const SpellEntry *spell) - { - if (!me->isInCombat()) - return; - - switch(spell->Id) - { - case SPELL_INFORM_DEAD_TRAINEE: DoSummon(MOB_DEAD_TRAINEE, target, 0); break; - case SPELL_INFORM_DEAD_KNIGHT: DoSummon(MOB_DEAD_KNIGHT, target, 0); break; - case SPELL_INFORM_DEAD_RIDER: DoSummon(MOB_DEAD_RIDER, target, 1.0f); - DoSummon(MOB_DEAD_HORSE, target, 1.0f); break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateCombatState() || !CheckInRoom()) - return; - - events.Update(diff); - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_SUMMON: - if (waves[waveCount].entry) - { - for(uint32 i = 0; i < waves[waveCount].number; ++i) - DoSummon(waves[waveCount].entry, liveTrigger[rand()%POS_LIVE], 1.0f); - events.ScheduleEvent(EVENT_SUMMON, waves[waveCount].time); - ++waveCount; - } - else - { - DoScriptText(SAY_TELEPORT, me); - DoTeleportTo(PosGround); - me->SetReactState(REACT_AGGRESSIVE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - if (instance) - instance->SetData(DATA_GOTHIK_GATE, 0); - summons.DoAction(0, 0); - summons.DoZoneInCombat(); - events.ScheduleEvent(EVENT_BOLT, 1000); - events.ScheduleEvent(EVENT_HARVEST, 15000); - } - break; - case EVENT_BOLT: - DoCast(me->getVictim(), SPELL_SHADOW_BOLT); - events.ScheduleEvent(EVENT_BOLT, 1000); - return; - case EVENT_HARVEST: - DoCast(me->getVictim(), SPELL_HARVEST_SOUL); - events.ScheduleEvent(EVENT_HARVEST, 15000); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL mob_gothik_minionAI : public SpellAI -{ - mob_gothik_minionAI(Creature *c) : SpellAI(c) - { - liveSide = me->GetPositionY() < POS_Y_GATE; - } - - bool liveSide; - bool gateClose; - -#define SIDE_CHECK(who) (liveSide == (who->GetPositionY() < POS_Y_GATE)) - - void DoAction(const int32 param) - { - gateClose = param; - } - - void DamageTaken(Unit *attacker, uint32 &damage) - { - if (gateClose && !SIDE_CHECK(attacker)) - damage = 0; - } - - void JustDied(Unit *killer) - { - if (me->isSummon()) - { - if (Unit *owner = CAST_SUM(me)->GetSummoner()) - SpellAI::JustDied(owner); - } - } - - void EnterEvadeMode() - { - if (!gateClose) - { - SpellAI::EnterEvadeMode(); - return; - } - - if (!_EnterEvadeMode()) - return; - - Map* pMap = me->GetMap(); - if (pMap->IsDungeon()) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()->isAlive() && SIDE_CHECK(i->getSource())) - { - AttackStart(i->getSource()); - return; - } - } - } - - me->GetMotionMaster()->MoveIdle(); - Reset(); - } - - void UpdateAI(const uint32 diff) - { - if (gateClose && (!SIDE_CHECK(me) || me->getVictim() && !SIDE_CHECK(me->getVictim()))) - { - EnterEvadeMode(); - return; - } - - SpellAI::UpdateAI(diff); - } -}; - -CreatureAI* GetAI_boss_gothik(Creature* pCreature) -{ - return new boss_gothikAI (pCreature); -} - -CreatureAI* GetAI_mob_gothik_minion(Creature* pCreature) -{ - return new mob_gothik_minionAI (pCreature); -} - -void AddSC_boss_gothik() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_gothik"; - newscript->GetAI = &GetAI_boss_gothik; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_gothik_minion"; - newscript->GetAI = &GetAI_mob_gothik_minion; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp deleted file mode 100644 index 9195e0e7828..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_grobbulus.cpp +++ /dev/null @@ -1,103 +0,0 @@ -/* Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -#define SPELL_BOMBARD_SLIME 28280 - -#define SPELL_POISON_CLOUD 28240 -#define SPELL_MUTATING_INJECTION 28169 -#define SPELL_SLIME_SPRAY HEROIC(28157,54364) -#define SPELL_BERSERK 26662 - -#define EVENT_BERSERK 1 -#define EVENT_CLOUD 2 -#define EVENT_INJECT 3 -#define EVENT_SPRAY 4 - -#define MOB_FALLOUT_SLIME 16290 - -struct TRINITY_DLL_DECL boss_grobbulusAI : public BossAI -{ - boss_grobbulusAI(Creature *c) : BossAI(c, BOSS_GROBBULUS) {} - - void EnterCombat(Unit *who) - { - _EnterCombat(); - events.ScheduleEvent(EVENT_CLOUD, 15000); - events.ScheduleEvent(EVENT_INJECT, 20000); - events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); //not sure - events.ScheduleEvent(EVENT_BERSERK, 12*60000); - } - - void SpellHitTarget(Unit *target, const SpellEntry *spell) - { - if (spell->Id == SPELL_SLIME_SPRAY) - { - if (TempSummon *slime = me->SummonCreature(MOB_FALLOUT_SLIME, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 0)) - DoZoneInCombat(slime); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_CLOUD: - DoCastAOE(SPELL_POISON_CLOUD); - events.ScheduleEvent(EVENT_CLOUD, 15000); - return; - case EVENT_BERSERK: - DoCastAOE(SPELL_BERSERK); - return; - case EVENT_SPRAY: - DoCastAOE(SPELL_SLIME_SPRAY); - events.ScheduleEvent(EVENT_SPRAY, 15000+rand()%15000); - return; - case EVENT_INJECT: - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - if (!target->HasAura(SPELL_MUTATING_INJECTION)) - DoCast(target, SPELL_MUTATING_INJECTION); - events.ScheduleEvent(EVENT_INJECT, 8000 + 12000 * ((float)me->GetHealth() / me->GetMaxHealth())); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_grobbulus(Creature* pCreature) -{ - return new boss_grobbulusAI (pCreature); -} - -void AddSC_boss_grobbulus() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_grobbulus"; - newscript->GetAI = &GetAI_boss_grobbulus; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp deleted file mode 100644 index 8491ab95703..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_heigan.cpp +++ /dev/null @@ -1,150 +0,0 @@ -/* Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -#define SAY_AGGRO RAND(-1533109,-1533110,-1533111) -#define SAY_SLAY -1533112 -#define SAY_TAUNT RAND(-1533113,-1533114,-1533115,-1533116,-1533117) -#define SAY_DEATH -1533118 - -#define SPELL_SPELL_DISRUPTION 29310 -#define SPELL_DECREPIT_FEVER HEROIC(29998,55011) -#define SPELL_PLAGUE_CLOUD 29350 - -enum Events -{ - EVENT_DISRUPT = 1, - EVENT_FEVER, - EVENT_ERUPT, - EVENT_PHASE, -}; - -enum Phases -{ - PHASE_FIGHT = 1, - PHASE_DANCE, -}; - -//Spell by eye stalks -#define SPELL_MIND_FLAY 26143 - -struct TRINITY_DLL_DECL boss_heiganAI : public BossAI -{ - boss_heiganAI(Creature *c) : BossAI(c, BOSS_HEIGAN) {} - - uint32 eruptSection; - bool eruptDirection; - Phases phase; - - void KilledUnit(Unit* Victim) - { - if (!(rand()%5)) - DoScriptText(SAY_SLAY, me); - } - - void JustDied(Unit* Killer) - { - _JustDied(); - DoScriptText(SAY_DEATH, me); - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - DoScriptText(SAY_AGGRO, me); - EnterPhase(PHASE_FIGHT); - } - - void EnterPhase(Phases newPhase) - { - phase = newPhase; - events.Reset(); - eruptSection = 3; - if (phase == PHASE_FIGHT) - { - events.ScheduleEvent(EVENT_DISRUPT, 0); - events.ScheduleEvent(EVENT_FEVER, 20000); - events.ScheduleEvent(EVENT_PHASE, 85000); - events.ScheduleEvent(EVENT_ERUPT, 10000); - } - else - { - float x, y, z, o; - me->GetHomePosition(x, y, z, o); - me->NearTeleportTo(x, y, z, o); - DoCastAOE(SPELL_PLAGUE_CLOUD); - events.ScheduleEvent(EVENT_PHASE, 45000); - events.ScheduleEvent(EVENT_ERUPT, 5000); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim() || !CheckInRoom()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_DISRUPT: - DoCastAOE(SPELL_SPELL_DISRUPTION); - events.ScheduleEvent(EVENT_DISRUPT, 5000); - return; - case EVENT_FEVER: - DoCastAOE(SPELL_DECREPIT_FEVER); - events.ScheduleEvent(EVENT_FEVER, 20000); - return; - case EVENT_PHASE: - EnterPhase(phase == PHASE_FIGHT ? PHASE_DANCE : PHASE_FIGHT); - return; - case EVENT_ERUPT: - instance->SetData(DATA_HEIGAN_ERUPT, eruptSection); - TeleportCheaters(); - - if (eruptSection == 0) - eruptDirection = true; - else if (eruptSection == 3) - eruptDirection = false; - - eruptDirection ? ++eruptSection : --eruptSection; - - events.ScheduleEvent(EVENT_ERUPT, phase == PHASE_FIGHT ? 10000 : 3000); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_heigan(Creature* pCreature) -{ - return new boss_heiganAI (pCreature); -} - -void AddSC_boss_heigan() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_heigan"; - newscript->GetAI = &GetAI_boss_heigan; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_highlord_mograine.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_highlord_mograine.cpp deleted file mode 100644 index 9bef8ebd3f9..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_highlord_mograine.cpp +++ /dev/null @@ -1,179 +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_Highlord_Mograine -SD%Complete: 100 -SDComment: SCRIPT OBSOLETE -SDCategory: Naxxramas -EndScriptData */ - -#include "precompiled.h" - -//All horsemen -#define SPELL_SHIELDWALL 29061 -#define SPELL_BESERK 26662 - -// highlord mograine -#define SPELL_MARK_OF_MOGRAINE 28834 -#define SPELL_RIGHTEOUS_FIRE 28882 // Applied as a 25% chance on melee hit to proc. m_creature->GetVictim() - -#define SAY_TAUNT1 "Enough prattling. Let them come! We shall grind their bones to dust." -#define SAY_TAUNT2 "Conserve your anger! Harness your rage! You will all have outlets for your frustration soon enough." -#define SAY_TAUNT3 "Life is meaningless. It is in death that we are truly tested." -#define SAY_AGGRO1 "You seek death?" -#define SAY_AGGRO2 "None shall pass!" -#define SAY_AGGRO3 "Be still!" -#define SAY_SLAY1 "You will find no peace in death." -#define SAY_SLAY2 "The master's will is done." -#define SAY_SPECIAL "Bow to the might of the Highlord!" -#define SAY_DEATH "I... am... released! Perhaps it's not too late to - noo! I need... more time..." - -#define SOUND_TAUNT1 8842 -#define SOUND_TAUNT2 8843 -#define SOUND_TAUNT3 8844 -#define SOUND_AGGRO1 8835 -#define SOUND_AGGRO2 8836 -#define SOUND_AGGRO3 8837 -#define SOUND_SLAY1 8839 -#define SOUND_SLAY2 8840 -#define SOUND_SPECIAL 8841 -#define SOUND_DEATH 8838 - -#define SPIRIT_OF_MOGRAINE 16775 - -struct TRINITY_DLL_DECL boss_highlord_mograineAI : public ScriptedAI -{ - boss_highlord_mograineAI(Creature *c) : ScriptedAI(c) {} - - uint32 Mark_Timer; - uint32 RighteousFire_Timer; - bool ShieldWall1; - bool ShieldWall2; - - void Reset() - { - Mark_Timer = 20000; // First Horsemen Mark is applied at 20 sec. - RighteousFire_Timer = 2000; // applied approx 1 out of 4 attacks - ShieldWall1 = true; - ShieldWall2 = true; - } - - void InitialYell() - { - if (!m_creature->isInCombat()) - { - switch(rand()%3) - { - case 0: - DoYell(SAY_AGGRO1,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO1); - break; - case 1: - DoYell(SAY_AGGRO2,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO2); - break; - case 2: - DoYell(SAY_AGGRO3,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_AGGRO3); - break; - } - } - } - - void KilledUnit() - { - switch(rand()%2) - { - case 0: - DoYell(SAY_SLAY1,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SLAY1); - break; - case 1: - DoYell(SAY_SLAY2,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature,SOUND_SLAY2); - break; - } - } - - void JustDied(Unit* Killer) - { - DoYell(SAY_DEATH,LANG_UNIVERSAL,NULL); - DoPlaySoundToSet(m_creature, SOUND_DEATH); - } - - void Aggro(Unit *who) - { - InitialYell(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - // Mark of Mograine - if (Mark_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MARK_OF_MOGRAINE); - Mark_Timer = 12000; - }else Mark_Timer -= diff; - - // Shield Wall - All 4 horsemen will shield wall at 50% hp and 20% hp for 20 seconds - if (ShieldWall1 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) - { - if (ShieldWall1) - { - DoCast(m_creature,SPELL_SHIELDWALL); - ShieldWall1 = false; - } - } - if (ShieldWall2 && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20) - { - if (ShieldWall2) - { - DoCast(m_creature,SPELL_SHIELDWALL); - ShieldWall2 = false; - } - } - - // Righteous Fire - if (RighteousFire_Timer < diff) - { - if (rand()%4 == 1) // 1/4 - { - DoCast(m_creature->getVictim(),SPELL_RIGHTEOUS_FIRE); - } - RighteousFire_Timer = 2000; - }else RighteousFire_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_highlord_mograine(Creature* pCreature) -{ - return new boss_highlord_mograineAI (pCreature); -} - -void AddSC_boss_highlord_mograine() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_highlord_mograine"; - newscript->GetAI = &GetAI_boss_highlord_mograine; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp deleted file mode 100644 index a93ff572ab0..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_kelthuzad.cpp +++ /dev/null @@ -1,294 +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_KelThuzud -SD%Complete: 0 -SDComment: VERIFY SCRIPT -SDCategory: Naxxramas -EndScriptData */ - -#include "precompiled.h" -#include "def_naxxramas.h" - -//when shappiron dies. dialog between kel and lich king (in this order) -#define SAY_SAPP_DIALOG1 -1533084 -#define SAY_SAPP_DIALOG2_LICH -1533085 -#define SAY_SAPP_DIALOG3 -1533086 -#define SAY_SAPP_DIALOG4_LICH -1533087 -#define SAY_SAPP_DIALOG5 -1533088 - -//when cat dies -#define SAY_CAT_DIED -1533089 - -//when each of the 4 wing bosses dies -#define SAY_TAUNT1 -1533090 -#define SAY_TAUNT2 -1533091 -#define SAY_TAUNT3 -1533092 -#define SAY_TAUNT4 -1533093 - -#define SAY_SUMMON_MINIONS -1533105 //start of phase 1 - -#define SAY_AGGRO RAND(-1533094,-1533095,-1533096) //start of phase 2 -#define SAY_SLAY RAND(-1533097,-1533098) -#define SAY_DEATH -1533099 -#define SAY_CHAIN RAND(-1533100,-1533101) -#define SAY_FROST_BLAST -1533102 -#define SAY_SPECIAL RAND(-1533106,-1533107,-1533108) - -#define SAY_REQUEST_AID -1533103 //start of phase 3 -#define SAY_ANSWER_REQUEST -1533104 //lich king answer - -enum Event -{ - EVENT_BOLT = 1, - EVENT_NOVA, - EVENT_CHAIN, - EVENT_DETONATE, - EVENT_FISSURE, - EVENT_BLAST, - - EVENT_WASTE, - EVENT_ABOMIN, - EVENT_WEAVER, - EVENT_ICECROWN, - - EVENT_PHASE, -}; - -#define SPELL_FROST_BOLT HEROIC(28478,55802) -#define SPELL_FROST_BOLT_AOE HEROIC(28479,55807) -#define SPELL_SHADOW_FISURE 27810 -#define SPELL_VOID_BLAST 27812 -#define SPELL_MANA_DETONATION 27819 -#define SPELL_FROST_BLAST 27808 -#define SPELL_CHAINS_OF_KELTHUZAD 28410 //28408 script effect -#define SPELL_BERSERK 28498 - -#define MOB_WASTE 16427 // Soldiers of the Frozen Wastes -#define MOB_ABOMINATION 16428 // Unstoppable Abominations -#define MOB_WEAVER 16429 // Soul Weavers -#define MOB_ICECROWN 16441 // Guardians of Icecrown - -float Pos[12][4] = -{ - {3783.272705, -5062.697266, 143.711203,3.617599},//LEFT_FAR - {3730.291260, -5027.239258,143.956909,4.461900},//LEFT_MIDDLE - {3683.868652,-5057.281250,143.183884,5.237086},//LEFT_NEAR - {3759.355225,-5174.128418,143.802383,2.170104},//RIGHT_FAR - {3700.724365,-5185.123047,143.928024,1.309310},//RIGHT_MIDDLE - {3665.121094,-5138.679199,143.183212,0.604023},//RIGHT_NEAR - {3754.431396,-5080.727734,142.036316,3.736189},//LEFT_FAR - {3724.396484, -5061.330566,142.032700, 4.564785},//LEFT_MIDDLE - {3687.158424,-5076.834473,142.017319,5.237086},//LEFT_NEAR - {3687.571777,-5126.831055,142.017807,0.604023},//RIGHT_FAR - {3707.990733,-5151.450195,142.032562,1.376855},//RIGHT_MIDDLE - {3739.500000,-5141.883989,142.0141130, 2.121412}//RIGHT_NEAR -}; - -struct TRINITY_DLL_DECL boss_kelthuzadAI : public BossAI -{ - boss_kelthuzadAI(Creature* c) : BossAI(c, BOSS_KELTHUZAD) {} - - uint32 GuardiansOfIcecrown_Count; - - uint32 Phase; - uint32 GuardiansOfIcecrown_Timer; - - void Reset() - { - _Reset(); - me->SetReactState(REACT_AGGRESSIVE); - GuardiansOfIcecrown_Count = 0; - - GuardiansOfIcecrown_Timer = 5000; //5 seconds for summoning each Guardian of Icecrown in phase 3 - - Phase=0; - } - - void KilledUnit() - { - DoScriptText(SAY_SLAY, m_creature); - } - - void JustDied(Unit* Killer) - { - _JustDied(); - DoScriptText(SAY_DEATH, m_creature); - } - - void EnterCombat(Unit* who) - { - _EnterCombat(); - DoScriptText(SAY_AGGRO, me); - Phase=1; - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_PASSIVE); - events.ScheduleEvent(EVENT_WASTE, 3000); - events.ScheduleEvent(EVENT_ABOMIN, 25000); - events.ScheduleEvent(EVENT_WEAVER, 20000); - events.ScheduleEvent(EVENT_PHASE, 228000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateCombatState()) - return; - - events.Update(diff); - - if (Phase == 1) - { - while(uint32 eventId = events.GetEvent()) - { - switch(eventId) - { - case EVENT_WASTE: - DoSummon(MOB_WASTE, Pos[RAND(0,3,6,9)]); - events.RepeatEvent(3000); - break; - case EVENT_ABOMIN: - DoSummon(MOB_ABOMINATION, Pos[RAND(1,4,7,10)]); - events.RepeatEvent(25000); - break; - case EVENT_WEAVER: - DoSummon(MOB_WEAVER, Pos[RAND(0,3,6,9)]); - events.RepeatEvent(20000); - break; - case EVENT_PHASE: - events.Reset(); - events.ScheduleEvent(EVENT_BOLT, 2000); - events.ScheduleEvent(EVENT_NOVA, 15000); - events.ScheduleEvent(EVENT_DETONATE, 20000); - events.ScheduleEvent(EVENT_FISSURE, 25000); - events.ScheduleEvent(EVENT_BLAST, (rand()%30+30)*1000); - if (HeroicMode) - events.ScheduleEvent(EVENT_CHAIN, (rand()%30+30)*1000); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_AGGRESSIVE); - Phase = 2; - return; - default: - events.PopEvent(); - break; - } - } - } - else - { - //start phase 3 when we are 40% health - if (Phase != 3) - { - if (HealthBelowPct(40)) - { - Phase = 3 ; - DoScriptText(SAY_REQUEST_AID, m_creature); - //here Lich King should respond to KelThuzad but I don't know which Creature to make talk - //so for now just make Kelthuzad says it. - DoScriptText(SAY_ANSWER_REQUEST, m_creature); - } - } - else if (GuardiansOfIcecrown_Count < HEROIC(2,5)) - { - if (GuardiansOfIcecrown_Timer < diff) - { - DoSummon(MOB_ICECROWN, Pos[RAND(2,5,8)]); - ++GuardiansOfIcecrown_Count; - GuardiansOfIcecrown_Timer = 5000; - } - else GuardiansOfIcecrown_Timer -= diff; - } - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - if (uint32 eventId = events.GetEvent()) - { - switch(eventId) - { - case EVENT_BOLT: - DoCast(m_creature->getVictim(),SPELL_FROST_BOLT); - events.RepeatEvent(2000); - return; - case EVENT_NOVA: - DoCastAOE(SPELL_FROST_BOLT_AOE); - events.RepeatEvent(15000); - return; - case EVENT_CHAIN: - if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) - DoCast(target, SPELL_CHAINS_OF_KELTHUZAD); - DoScriptText(SAY_CHAIN, me); - events.RepeatEvent((rand()%30+30)*1000); - return; - case EVENT_DETONATE: - { - std::vector unitList; - std::list *threatList = &me->getThreatManager().getThreatList(); - for(std::list::const_iterator itr = threatList->begin(); itr != threatList->end(); ++itr) - { - if ((*itr)->getTarget()->GetTypeId() == TYPEID_PLAYER - && (*itr)->getTarget()->getPowerType() == POWER_MANA - && (*itr)->getTarget()->GetPower(POWER_MANA)) - unitList.push_back((*itr)->getTarget()); - } - - if (!unitList.empty()) - { - std::vector::iterator itr = unitList.begin(); - advance(itr, rand()%unitList.size()); - DoCast(*itr, SPELL_MANA_DETONATION); - DoScriptText(SAY_SPECIAL, me); - } - - events.RepeatEvent(20000); - return; - } - case EVENT_FISSURE: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target, SPELL_SHADOW_FISURE); - events.RepeatEvent(25000); - return; - case EVENT_BLAST: - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM, 0, 0, true)) - DoCast(target, SPELL_FROST_BLAST); - if (rand()%2) - DoScriptText(SAY_FROST_BLAST, m_creature); - events.RepeatEvent((rand()%30+30)*1000); - return; - default: - events.PopEvent(); - return; - } - } - - DoMeleeAttackIfReady(); - } - } -}; - -CreatureAI* GetAI_boss_kelthuzadAI(Creature* pCreature) -{ - return new boss_kelthuzadAI (pCreature); -} - -void AddSC_boss_kelthuzad() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_kelthuzad"; - newscript->GetAI = &GetAI_boss_kelthuzadAI; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp deleted file mode 100644 index eb53583752f..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_loatheb.cpp +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -#define SPELL_NECROTIC_AURA 55593 -#define SPELL_SUMMON_SPORE 29234 -#define SPELL_DEATHBLOOM HEROIC(29865,55053) -#define SPELL_INEVITABLE_DOOM HEROIC(29204,55052) - -enum Events -{ - EVENT_AURA = 1, - EVENT_BLOOM, - EVENT_DOOM, -}; - -struct TRINITY_DLL_DECL boss_loathebAI : public BossAI -{ - boss_loathebAI(Creature *c) : BossAI(c, BOSS_LOATHEB) {} - - void EnterCombat(Unit *who) - { - _EnterCombat(); - events.ScheduleEvent(EVENT_AURA, 0); - events.ScheduleEvent(EVENT_BLOOM, 30000); - events.ScheduleEvent(EVENT_DOOM, 120000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_AURA: - DoCastAOE(SPELL_NECROTIC_AURA); - events.ScheduleEvent(EVENT_AURA, 20000); - return; - case EVENT_BLOOM: - DoCastAOE(SPELL_SUMMON_SPORE, true); - DoCastAOE(SPELL_DEATHBLOOM); - events.ScheduleEvent(EVENT_BLOOM, 30000); - return; - case EVENT_DOOM: - DoCastAOE(SPELL_INEVITABLE_DOOM); - events.ScheduleEvent(EVENT_DOOM, events.GetTimer() < 5*60000 ? 30000 : 15000); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_loatheb(Creature* pCreature) -{ - return new boss_loathebAI (pCreature); -} - -void AddSC_boss_loatheb() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_loatheb"; - newscript->GetAI = &GetAI_boss_loatheb; - newscript->RegisterSelf(); - - // Fungal Creep - GetAISpellInfo(29232)->condition = AICOND_DIE; -} - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp deleted file mode 100644 index 63ffb995cd5..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_maexxna.cpp +++ /dev/null @@ -1,140 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -#define SPELL_WEB_WRAP 28622 -#define SPELL_WEB_SPRAY HEROIC(29484,54125) -#define SPELL_POISON_SHOCK HEROIC(28741,54122) -#define SPELL_NECROTIC_POISON HEROIC(54121,28776) -#define SPELL_FRENZY HEROIC(54123,54124) - -#define MOB_WEB_WRAP 16486 -#define MOB_SPIDERLING 17055 - -#define MAX_POS_WRAP 3 -const float PosWrap[MAX_POS_WRAP][3] = -{ - {3546.796, -3869.082, 296.450+20}, - {3531.271, -3847.424, 299.450+20}, - {3497.067, -3843.384, 302.384+20}, -}; - -enum Events -{ - EVENT_SPRAY = 1, - EVENT_SHOCK, - EVENT_POISON, - EVENT_WRAP, - EVENT_SUMMON, -}; - -struct TRINITY_DLL_DECL boss_maexxnaAI : public BossAI -{ - boss_maexxnaAI(Creature *c) : BossAI(c, BOSS_MAEXXNA) {} - - bool enraged; - - void EnterCombat(Unit *who) - { - _EnterCombat(); - enraged = false; - events.ScheduleEvent(EVENT_WRAP, 20000); - events.ScheduleEvent(EVENT_SPRAY, 40000); - events.ScheduleEvent(EVENT_SHOCK, 10000); - events.ScheduleEvent(EVENT_POISON, 5000); - events.ScheduleEvent(EVENT_SUMMON, 40000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim() || !CheckInRoom()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_WRAP: - for(uint32 i = 0; i < HEROIC(1,2); ++i) - { - if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 1, 0, true, -SPELL_WEB_WRAP)) - { - target->RemoveAura(SPELL_WEB_SPRAY); - uint32 pos = rand()%MAX_POS_WRAP; - target->GetMotionMaster()->MoveJump(PosWrap[pos][0], PosWrap[pos][1], PosWrap[pos][2], 20, 20); - if (Creature *wrap = DoSummon(MOB_WEB_WRAP, target, 0, 60000)) - { - wrap->AI()->SetGUID(target->GetGUID()); - wrap->GetMotionMaster()->MoveJump(PosWrap[pos][0], PosWrap[pos][1], PosWrap[pos][2], 20, 20); - } - } - } - events.ScheduleEvent(EVENT_WRAP, 40000); - return; - case EVENT_SPRAY: - DoCastAOE(SPELL_WEB_SPRAY); - events.ScheduleEvent(EVENT_SPRAY, 40000); - return; - case EVENT_SHOCK: - DoCastAOE(SPELL_POISON_SHOCK); - events.ScheduleEvent(EVENT_SHOCK, 10000); - return; - case EVENT_POISON: - DoCast(me->getVictim(), SPELL_NECROTIC_POISON); - events.ScheduleEvent(EVENT_POISON, 30000); - return; - case EVENT_SUMMON: - { - uint32 amount = 8+rand()%2; - for(uint32 i = 0; i < amount; ++i) - DoSummon(MOB_SPIDERLING, me); - events.ScheduleEvent(EVENT_SUMMON, 40000); - break; - } - } - } - - if (!enraged && HealthBelowPct(30)) - { - DoCast(me, SPELL_FRENZY); - enraged = true; - } - else - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_maexxna(Creature* pCreature) -{ - return new boss_maexxnaAI (pCreature); -} - -void AddSC_boss_maexxna() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_maexxna"; - newscript->GetAI = &GetAI_boss_maexxna; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp deleted file mode 100644 index 87f9a96ad61..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_noth.cpp +++ /dev/null @@ -1,210 +0,0 @@ -/* Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -#define SAY_AGGRO RAND(-1533075,-1533076,-1533077) -#define SAY_SUMMON -1533078 -#define SAY_SLAY RAND(-1533079,-1533080) -#define SAY_DEATH -1533081 - -#define SOUND_DEATH 8848 - -#define SPELL_CURSE_PLAGUEBRINGER HEROIC(29213,54835) -#define SPELL_BLINK RAND(29208,29209,29210,29211) -#define SPELL_CRIPPLE HEROIC(29212,54814) -#define SPELL_TELEPORT 29216 - -#define MOB_WARRIOR 16984 -#define MOB_CHAMPION 16983 -#define MOB_GUARDIAN 16981 - -// Teleport position of Noth on his balcony -#define TELE_X 2631.370 -#define TELE_Y -3529.680 -#define TELE_Z 274.040 -#define TELE_O 6.277 - -#define MAX_SUMMON_POS 5 - -const float SummonPos[MAX_SUMMON_POS][4] = -{ - {2728.12, -3544.43, 261.91, 6.04}, - {2729.05, -3544.47, 261.91, 5.58}, - {2728.24, -3465.08, 264.20, 3.56}, - {2704.11, -3456.81, 265.53, 4.51}, - {2663.56, -3464.43, 262.66, 5.20}, -}; - -enum Events -{ - EVENT_BERSERK = 1, - EVENT_CURSE, - EVENT_BLINK, - EVENT_WARRIOR, - EVENT_BALCONY, - EVENT_WAVE, - EVENT_GROUND, -}; - -struct TRINITY_DLL_DECL boss_nothAI : public BossAI -{ - boss_nothAI(Creature *c) : BossAI(c, BOSS_NOTH) {} - - uint32 waveCount, balconyCount; - - void Reset() - { - me->SetReactState(REACT_AGGRESSIVE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - _Reset(); - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - DoScriptText(SAY_AGGRO, me); - balconyCount = 0; - EnterPhaseGround(); - } - - void EnterPhaseGround() - { - me->SetReactState(REACT_AGGRESSIVE); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - DoZoneInCombat(); - if (me->getThreatManager().isThreatListEmpty()) - EnterEvadeMode(); - else - { - events.ScheduleEvent(EVENT_BALCONY, 110000); - events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000); - events.ScheduleEvent(EVENT_WARRIOR, 30000); - if (HeroicMode) - events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000); - } - } - - void KilledUnit(Unit* victim) - { - if (!(rand()%5)) - DoScriptText(SAY_SLAY, me); - } - - void JustSummoned(Creature *summon) - { - summons.Summon(summon); - summon->setActive(true); - summon->AI()->DoZoneInCombat(); - } - - void JustDied(Unit* Killer) - { - _JustDied(); - DoScriptText(SAY_DEATH, me); - } - - void SummonUndead(uint32 entry, uint32 num) - { - for(uint32 i = 0; i < num; ++i) - { - uint32 pos = rand()%MAX_SUMMON_POS; - me->SummonCreature(entry, SummonPos[pos][0], SummonPos[pos][1], SummonPos[pos][2], - SummonPos[pos][3], TEMPSUMMON_CORPSE_DESPAWN, 60000); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateCombatState() || !CheckInRoom()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_CURSE: - DoCastAOE(SPELL_CURSE_PLAGUEBRINGER); - events.ScheduleEvent(EVENT_CURSE, 20000+rand()%10000); - return; - case EVENT_WARRIOR: - DoScriptText(SAY_SUMMON, me); - SummonUndead(MOB_WARRIOR, HEROIC(2,3)); - events.ScheduleEvent(EVENT_WARRIOR, 30000); - return; - case EVENT_BLINK: - DoCastAOE(SPELL_CRIPPLE, true); - DoCastAOE(SPELL_BLINK); - DoResetThreat(); - events.ScheduleEvent(EVENT_BLINK, 20000+rand()%10000); - return; - case EVENT_BALCONY: - me->SetReactState(REACT_PASSIVE); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - me->AttackStop(); - me->RemoveAllAuras(); - me->NearTeleportTo(TELE_X, TELE_Y, TELE_Z, TELE_O); - events.Reset(); - events.ScheduleEvent(EVENT_WAVE, 2000); - waveCount = 0; - return; - case EVENT_WAVE: - DoScriptText(SAY_SUMMON, me); - switch(balconyCount) - { - case 0: SummonUndead(MOB_CHAMPION, HEROIC(2,4)); break; - case 1: SummonUndead(MOB_CHAMPION, HEROIC(1,2)); - SummonUndead(MOB_GUARDIAN, HEROIC(1,2)); break; - case 2: SummonUndead(MOB_GUARDIAN, HEROIC(2,4)); break; - default:SummonUndead(MOB_CHAMPION, HEROIC(5,10)); - SummonUndead(MOB_GUARDIAN, HEROIC(5,10));break; - } - ++waveCount; - events.ScheduleEvent(waveCount < 2 ? EVENT_WAVE : EVENT_GROUND, 34000); - return; - case EVENT_GROUND: - { - ++balconyCount; - float x, y, z, o; - me->GetHomePosition(x, y, z, o); - me->NearTeleportTo(x, y, z, o); - EnterPhaseGround(); - return; - } - } - } - - if (me->HasReactState(REACT_AGGRESSIVE)) - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_noth(Creature* pCreature) -{ - return new boss_nothAI (pCreature); -} - -void AddSC_boss_noth() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_noth"; - newscript->GetAI = &GetAI_boss_noth; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp deleted file mode 100644 index d50c72d8fa6..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_patchwerk.cpp +++ /dev/null @@ -1,133 +0,0 @@ -/* Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -#define SAY_AGGRO RAND(-1533017,-1533018) -#define SAY_SLAY -1533019 -#define SAY_DEATH -1533020 - -#define EMOTE_BERSERK -1533021 -#define EMOTE_ENRAGE -1533022 - -#define SPELL_HATEFULSTRIKE HEROIC(41926,59192) -#define SPELL_FRENZY 28131 -#define SPELL_BERSERK 26662 -#define SPELL_SLIMEBOLT 32309 - -#define EVENT_BERSERK 1 -#define EVENT_HATEFUL 2 -#define EVENT_SLIME 3 - -struct TRINITY_DLL_DECL boss_patchwerkAI : public BossAI -{ - boss_patchwerkAI(Creature *c) : BossAI(c, BOSS_PATCHWERK) {} - - bool Enraged; - - void KilledUnit(Unit* Victim) - { - if (!(rand()%5)) - DoScriptText(SAY_SLAY, me); - } - - void JustDied(Unit* Killer) - { - _JustDied(); - DoScriptText(SAY_DEATH, me); - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - Enraged = false; - DoScriptText(SAY_AGGRO, me); - events.ScheduleEvent(EVENT_HATEFUL, 1200); - events.ScheduleEvent(EVENT_BERSERK, 360000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_HATEFUL: - { - //Cast Hateful strike on the player with the highest - //amount of HP within melee distance - uint32 MostHP = 0; - Unit* pMostHPTarget = NULL; - std::list::iterator i = me->getThreatManager().getThreatList().begin(); - for(; i != me->getThreatManager().getThreatList().end(); ++i) - { - Unit* target = (*i)->getTarget(); - if (target->isAlive() && target->GetHealth() > MostHP && me->IsWithinMeleeRange(target)) - { - MostHP = target->GetHealth(); - pMostHPTarget = target; - } - } - - if (pMostHPTarget) - DoCast(pMostHPTarget, SPELL_HATEFULSTRIKE, true); - - events.ScheduleEvent(EVENT_HATEFUL, 1200); - return; - } - case EVENT_BERSERK: - DoCast(m_creature, SPELL_BERSERK); - DoScriptText(EMOTE_BERSERK, m_creature); - events.ScheduleEvent(EVENT_SLIME, 2000); - return; - case EVENT_SLIME: - DoCast(m_creature->getVictim(), SPELL_SLIMEBOLT); - events.ScheduleEvent(EVENT_SLIME, 2000); - return; - } - } - - if (!Enraged && HealthBelowPct(5)) - { - DoCast(m_creature, SPELL_FRENZY); - DoScriptText(EMOTE_ENRAGE, NULL); - Enraged = true; - return; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_patchwerk(Creature* pCreature) -{ - return new boss_patchwerkAI (pCreature); -} - -void AddSC_boss_patchwerk() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_patchwerk"; - newscript->GetAI = &GetAI_boss_patchwerk; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp deleted file mode 100644 index 2ade34b6e6d..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_razuvious.cpp +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -//Razuvious - NO TEXT sound only -//8852 aggro01 - Hah hah, I'm just getting warmed up! -//8853 aggro02 Stand and fight! -//8854 aggro03 Show me what you've got! -//8861 slay1 - You should've stayed home! -//8863 slay2- -//8858 cmmnd3 - You disappoint me, students! -//8855 cmmnd1 - Do as I taught you! -//8856 cmmnd2 - Show them no mercy! -//8859 cmmnd4 - The time for practice is over! Show me what you've learned! -//8861 Sweep the leg! Do you have a problem with that? -//8860 death - An honorable... death... -//8947 - Aggro Mixed? - ? - -#define SOUND_AGGRO RAND(8852,8853,8854) -#define SOUND_SLAY RAND(8861,8863) -#define SOUND_COMMND RAND(8855,8856,8858,8859,8861) -#define SOUND_DEATH 8860 -#define SOUND_AGGROMIX 8847 - -#define SPELL_UNBALANCING_STRIKE 26613 -#define SPELL_DISRUPTING_SHOUT HEROIC(29107,55543) -#define SPELL_JAGGED_KNIFE 55550 -#define SPELL_HOPELESS 29125 - -enum Events -{ - EVENT_STRIKE, - EVENT_SHOUT, - EVENT_KNIFE, - EVENT_COMMAND, -}; - -struct TRINITY_DLL_DECL boss_razuviousAI : public BossAI -{ - boss_razuviousAI(Creature *c) : BossAI(c, BOSS_RAZUVIOUS) {} - - void KilledUnit(Unit* victim) - { - if (!(rand()%3)) - DoPlaySoundToSet(me, SOUND_SLAY); - } - - void JustDied(Unit* killer) - { - _JustDied(); - DoPlaySoundToSet(me, SOUND_DEATH); - me->CastSpell(me, SPELL_HOPELESS, true); // TODO: this may affect other creatures - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - DoPlaySoundToSet(m_creature, SOUND_AGGRO); - events.ScheduleEvent(EVENT_STRIKE, 30000); - events.ScheduleEvent(EVENT_SHOUT, 25000); - events.ScheduleEvent(EVENT_COMMAND, 40000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_STRIKE: - DoCast(me->getVictim(), SPELL_UNBALANCING_STRIKE); - events.ScheduleEvent(EVENT_STRIKE, 30000); - return; - case EVENT_SHOUT: - DoCastAOE(SPELL_DISRUPTING_SHOUT); - events.ScheduleEvent(EVENT_SHOUT, 25000); - return; - case EVENT_KNIFE: - if (Unit *target = SelectTarget(SELECT_TARGET_RANDOM, 0, 45)) - DoCast(target, SPELL_JAGGED_KNIFE); - events.ScheduleEvent(EVENT_KNIFE, 25000); - return; - case EVENT_COMMAND: - DoPlaySoundToSet(me, SOUND_COMMND); - events.ScheduleEvent(EVENT_COMMAND, 40000); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_razuvious(Creature* pCreature) -{ - return new boss_razuviousAI (pCreature); -} - -void AddSC_boss_razuvious() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_razuvious"; - newscript->GetAI = &GetAI_boss_razuvious; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp deleted file mode 100644 index f0dd9e735cb..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_sapphiron.cpp +++ /dev/null @@ -1,350 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -#define EMOTE_BREATH -1533082 -#define EMOTE_ENRAGE -1533083 - -#define SPELL_FROST_AURA HEROIC(28531,55799) -#define SPELL_CLEAVE 19983 -#define SPELL_TAIL_SWEEP HEROIC(55697,55696) -#define SPELL_SUMMON_BLIZZARD 28560 -#define SPELL_LIFE_DRAIN HEROIC(28542,55665) -#define SPELL_ICEBOLT 28522 -#define SPELL_FROST_BREATH 29318 -#define SPELL_FROST_EXPLOSION 28524 -#define SPELL_FROST_MISSILE 30101 -#define SPELL_BERSERK 26662 -#define SPELL_DIES 29357 - -#define SPELL_CHILL HEROIC(28547,55699) - -#define MOB_BLIZZARD 16474 -#define GO_ICEBLOCK 181247 - -enum Phases -{ - PHASE_NULL = 0, - PHASE_BIRTH, - PHASE_GROUND, - PHASE_FLIGHT, -}; - -enum Events -{ - EVENT_BERSERK = 1, - EVENT_CLEAVE, - EVENT_TAIL, - EVENT_DRAIN, - EVENT_BLIZZARD, - EVENT_FLIGHT, - EVENT_LIFTOFF, - EVENT_ICEBOLT, - EVENT_BREATH, - EVENT_EXPLOSION, - EVENT_LAND, - EVENT_GROUND, - EVENT_BIRTH, -}; - -typedef std::map IceBlockMap; - -struct TRINITY_DLL_DECL boss_sapphironAI : public BossAI -{ - boss_sapphironAI(Creature* c) : BossAI(c, BOSS_SAPPHIRON) - , phase(PHASE_NULL) - {} - - Phases phase; - uint32 iceboltCount; - IceBlockMap iceblocks; - - void InitializeAI() - { - float x, y, z; - me->GetPosition(x, y, z); - me->SummonGameObject(GO_BIRTH, x, y, z, 0, 0, 0, 0, 0, 0); - me->SetVisibility(VISIBILITY_OFF); - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_PASSIVE); - - Reset(); - } - - void Reset() - { - _Reset(); - - if (phase = PHASE_FLIGHT) - ClearIceBlock(); - - phase = PHASE_NULL; - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - - me->CastSpell(me, SPELL_FROST_AURA, true); - - events.ScheduleEvent(EVENT_BERSERK, 15*60000); - EnterPhaseGround(); - } - - void SpellHitTarget(Unit *target, const SpellEntry *spell) - { - if (spell->Id == SPELL_ICEBOLT) - { - IceBlockMap::iterator itr = iceblocks.find(target->GetGUID()); - if (itr != iceblocks.end() && !itr->second) - { - if (GameObject *iceblock = me->SummonGameObject(GO_ICEBLOCK, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, 0, 0, 0, 0, 25000)) - itr->second = iceblock->GetGUID(); - } - } - } - - void JustDied(Unit* who) - { - _JustDied(); - me->CastSpell(me, SPELL_DIES, true); - } - - void MovementInform(uint32, uint32 id) - { - if (id == 1) - events.ScheduleEvent(EVENT_LIFTOFF, 0); - } - - void DoAction(const int32 param) - { - if (param == DATA_SAPPHIRON_BIRTH) - { - phase = PHASE_BIRTH; - events.ScheduleEvent(EVENT_BIRTH, 23000); - } - } - - void EnterPhaseGround() - { - phase = PHASE_GROUND; - me->SetReactState(REACT_AGGRESSIVE); - events.SetPhase(PHASE_GROUND); - events.ScheduleEvent(EVENT_CLEAVE, 5000+rand()%10000, 0, PHASE_GROUND); - events.ScheduleEvent(EVENT_TAIL, 5000+rand()%10000, 0, PHASE_GROUND); - events.ScheduleEvent(EVENT_DRAIN, 24000, 0, PHASE_GROUND); - events.ScheduleEvent(EVENT_BLIZZARD, 5000+rand()%5000, 0, PHASE_GROUND); - events.ScheduleEvent(EVENT_FLIGHT, 45000); - } - - void ClearIceBlock() - { - for(IceBlockMap::iterator itr = iceblocks.begin(); itr != iceblocks.end(); ++itr) - { - if (Player* pPlayer = Unit::GetPlayer(itr->first)) - pPlayer->RemoveAura(SPELL_ICEBOLT); - if (GameObject* pGo = GameObject::GetGameObject(*me, itr->second)) - pGo->DeleteObjectWithOwner(); - } - iceblocks.clear(); - } - - void UpdateAI(const uint32 diff) - { - if (!phase) - return; - - events.Update(diff); - - if (phase != PHASE_BIRTH && !UpdateCombatState() || !CheckInRoom()) - return; - - if (phase == PHASE_GROUND) - { - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_BERSERK: - DoScriptText(EMOTE_ENRAGE, m_creature); - DoCast(me, SPELL_BERSERK); - return; - case EVENT_CLEAVE: - DoCast(me->getVictim(), SPELL_CLEAVE); - events.ScheduleEvent(EVENT_CLEAVE, 5000+rand()%10000, 0, PHASE_GROUND); - return; - case EVENT_TAIL: - DoCastAOE(SPELL_TAIL_SWEEP); - events.ScheduleEvent(EVENT_TAIL, 5000+rand()%10000, 0, PHASE_GROUND); - return; - case EVENT_DRAIN: - DoCastAOE(SPELL_LIFE_DRAIN); - events.ScheduleEvent(EVENT_DRAIN, 24000, 0, PHASE_GROUND); - return; - case EVENT_BLIZZARD: - { - //DoCastAOE(SPELL_SUMMON_BLIZZARD); - float x, y, z; - me->GetGroundPointAroundUnit(x, y, z, rand_norm()*20, rand_norm()*2*M_PI); - if (Creature *summon = me->SummonCreature(MOB_BLIZZARD, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN, 25000+rand()%5000)) - summon->GetMotionMaster()->MoveRandom(40); - events.ScheduleEvent(EVENT_BLIZZARD, HEROIC(20000,7000), 0, PHASE_GROUND); - break; - } - case EVENT_FLIGHT: - phase = PHASE_FLIGHT; - events.SetPhase(PHASE_FLIGHT); - me->SetReactState(REACT_PASSIVE); - me->AttackStop(); - float x, y, z, o; - me->GetHomePosition(x, y, z, o); - me->GetMotionMaster()->MovePoint(1, x, y, z); - return; - } - } - - DoMeleeAttackIfReady(); - } - else - { - if (uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_LIFTOFF: - me->HandleEmoteCommand(EMOTE_ONESHOT_LIFTOFF); - me->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SendMovementFlagUpdate(); - events.ScheduleEvent(EVENT_ICEBOLT, 1500); - iceboltCount = HEROIC(2,3); - return; - case EVENT_ICEBOLT: - { - std::vector targets; - std::list::iterator i = me->getThreatManager().getThreatList().begin(); - for(; i != me->getThreatManager().getThreatList().end(); ++i) - if ((*i)->getTarget()->GetTypeId() == TYPEID_PLAYER && !(*i)->getTarget()->HasAura(SPELL_ICEBOLT)) - targets.push_back((*i)->getTarget()); - - if (targets.empty()) - iceboltCount = 0; - else - { - std::vector::iterator itr = targets.begin(); - advance(itr, rand()%targets.size()); - iceblocks.insert(std::make_pair((*itr)->GetGUID(), 0)); - DoCast(*itr, SPELL_ICEBOLT); - --iceboltCount; - } - - if (iceboltCount) - events.ScheduleEvent(EVENT_ICEBOLT, 1000); - else - events.ScheduleEvent(EVENT_BREATH, 1000); - return; - } - case EVENT_BREATH: - { - DoScriptText(EMOTE_BREATH, me); - DoCastAOE(SPELL_FROST_MISSILE); - events.ScheduleEvent(EVENT_EXPLOSION, 8000); - return; - } - case EVENT_EXPLOSION: - CastExplosion(); - ClearIceBlock(); - events.ScheduleEvent(EVENT_LAND, 3000); - return; - case EVENT_LAND: - me->HandleEmoteCommand(EMOTE_ONESHOT_LAND); - me->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - me->SendMovementFlagUpdate(); - events.ScheduleEvent(EVENT_GROUND, 1500); - return; - case EVENT_GROUND: - EnterPhaseGround(); - return; - case EVENT_BIRTH: - me->SetVisibility(VISIBILITY_ON); - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - me->SetReactState(REACT_AGGRESSIVE); - return; - } - }//if (uint32 eventId = events.ExecuteEvent()) - }//if (phase == PHASE_GROUND) - } - - void CastExplosion() - { - DoZoneInCombat(); // make sure everyone is in threatlist - std::vector targets; - std::list::iterator i = me->getThreatManager().getThreatList().begin(); - for(; i != me->getThreatManager().getThreatList().end(); ++i) - { - Unit *target = (*i)->getTarget(); - if (target->GetTypeId() != TYPEID_PLAYER) - continue; - - if (target->HasAura(SPELL_ICEBOLT)) - { - target->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, true); - targets.push_back(target); - continue; - } - - for(IceBlockMap::iterator itr = iceblocks.begin(); itr != iceblocks.end(); ++itr) - { - if (GameObject* pGo = GameObject::GetGameObject(*me, itr->second)) - { - if (pGo->IsInBetween(me, target, 2.0f) - && me->GetExactDistance2d(target->GetPositionX(), target->GetPositionY()) - me->GetExactDistance2d(pGo->GetPositionX(), pGo->GetPositionY()) < 5.0f) - { - target->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, true); - targets.push_back(target); - break; - } - } - } - } - - me->CastSpell(me, SPELL_FROST_EXPLOSION, true); - - for(std::vector::iterator itr = targets.begin(); itr != targets.end(); ++itr) - (*itr)->ApplySpellImmune(0, IMMUNITY_ID, SPELL_FROST_EXPLOSION, false); - } -}; - -CreatureAI* GetAI_boss_sapphiron(Creature* pCreature) -{ - return new boss_sapphironAI (pCreature); -} - -void AddSC_boss_sapphiron() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_sapphiron"; - newscript->GetAI = &GetAI_boss_sapphiron; - newscript->RegisterSelf(); - - // Chill - GetAISpellInfo(28547)->cooldown = 1000; - GetAISpellInfo(55699)->cooldown = 1000; -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp b/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp deleted file mode 100644 index b40b5aca876..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/boss_thaddius.cpp +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -//Stalagg -#define SAY_STAL_AGGRO -1533023 -#define SAY_STAL_SLAY -1533024 -#define SAY_STAL_DEATH -1533025 - -#define SPELL_POWERSURGE 28134 - -//Feugen -#define SAY_FEUG_AGGRO -1533026 -#define SAY_FEUG_SLAY -1533027 -#define SAY_FEUG_DEATH -1533028 - -#define SPELL_MANABURN 28135 - -//both -#define SPELL_WARSTOMP 28125 - - - //generic -#define C_TESLA_COIL 16218 //the coils (emotes "Tesla Coil overloads!") - - -//Thaddus -#define SAY_GREET -1533029 -#define SAY_AGGRO RAND(-1533030,-1533031,-1533032) -#define SAY_SLAY -1533033 -#define SAY_ELECT -1533034 -#define SAY_DEATH -1533035 -#define SAY_SCREAM1 -1533036 -#define SAY_SCREAM2 -1533037 -#define SAY_SCREAM3 -1533038 -#define SAY_SCREAM4 -1533039 - -#define SPELL_POLARITY_SHIFT 28089 -#define SPELL_BALL_LIGHTNING 28299 -#define SPELL_CHAIN_LIGHTNING HEROIC(28167,54531) -#define SPELL_BERSERK 27680 - -enum Events -{ - EVENT_SHIFT = 1, - EVENT_CHAIN, - EVENT_BERSERK, -}; - -struct TRINITY_DLL_DECL boss_thaddiusAI : public BossAI -{ - boss_thaddiusAI(Creature *c) : BossAI(c, BOSS_THADDIUS) - { - // temp - me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2 | UNIT_FLAG_NOT_SELECTABLE | UNIT_FLAG_STUNNED); - } - - void KilledUnit(Unit* victim) - { - if (!(rand()%5)) - DoScriptText(SAY_SLAY, me); - } - - void JustDied(Unit* Killer) - { - _JustDied(); - DoScriptText(SAY_DEATH, me); - } - - void EnterCombat(Unit *who) - { - _EnterCombat(); - DoScriptText(SAY_AGGRO, me); - events.ScheduleEvent(EVENT_SHIFT, 30000); - events.ScheduleEvent(EVENT_CHAIN, 10000+rand()%10000); - events.ScheduleEvent(EVENT_BERSERK, 6*60000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_SHIFT: - DoCastAOE(SPELL_POLARITY_SHIFT); - events.ScheduleEvent(EVENT_SHIFT, 30000); - return; - case EVENT_CHAIN: - DoCast(me->getVictim(), SPELL_CHAIN_LIGHTNING); - events.ScheduleEvent(EVENT_CHAIN, 10000+rand()%10000); - return; - case EVENT_BERSERK: - DoCast(me, SPELL_BERSERK); - return; - } - } - - if (events.GetTimer() > 15000 && !me->IsWithinMeleeRange(me->getVictim())) - DoCast(me->getVictim(), SPELL_BALL_LIGHTNING); - else - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_thaddius(Creature* pCreature) -{ - return new boss_thaddiusAI (pCreature); -} - -void AddSC_boss_thaddius() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_thaddius"; - newscript->GetAI = &GetAI_boss_thaddius; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/naxxramas/def_naxxramas.h b/src/bindings/scripts/scripts/zone/naxxramas/def_naxxramas.h deleted file mode 100644 index 383200d4600..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/def_naxxramas.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (C) 2008 - 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 - */ - -#ifndef DEF_NAXXRAMAS_H -#define DEF_NAXXRAMAS_H - -enum Encounter -{ - BOSS_ANUBREKHAN, - BOSS_FAERLINA, - BOSS_MAEXXNA, - BOSS_NOTH, - BOSS_HEIGAN, - BOSS_LOATHEB, - BOSS_PATCHWERK, - BOSS_GROBBULUS, - BOSS_GLUTH, - BOSS_THADDIUS, - BOSS_RAZUVIOUS, - BOSS_GOTHIK, - BOSS_HORSEMEN, - BOSS_SAPPHIRON, - BOSS_KELTHUZAD, - MAX_BOSS_NUMBER -}; - -enum Data -{ - DATA_HEIGAN_ERUPT, - DATA_GOTHIK_GATE, - DATA_SAPPHIRON_BIRTH, -}; - -#define GO_BIRTH 181356 - -#endif - diff --git a/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp b/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp deleted file mode 100644 index f6121c18ef5..00000000000 --- a/src/bindings/scripts/scripts/zone/naxxramas/instance_naxxramas.cpp +++ /dev/null @@ -1,217 +0,0 @@ -/* Copyright (C) 2008 - 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 "precompiled.h" -#include "def_naxxramas.h" - -const DoorData doorData[] = -{ - {181126, BOSS_ANUBREKHAN,DOOR_TYPE_ROOM, BOUNDARY_S}, - {181195, BOSS_ANUBREKHAN,DOOR_TYPE_PASSAGE, 0}, - {194022, BOSS_FAERLINA, DOOR_TYPE_PASSAGE, 0}, - {181209, BOSS_FAERLINA, DOOR_TYPE_PASSAGE, 0}, - {181209, BOSS_MAEXXNA, DOOR_TYPE_ROOM, BOUNDARY_SW}, - {181200, BOSS_NOTH, DOOR_TYPE_ROOM, BOUNDARY_N}, - {181201, BOSS_NOTH, DOOR_TYPE_PASSAGE, BOUNDARY_E}, - {181202, BOSS_NOTH, DOOR_TYPE_PASSAGE, 0}, - {181202, BOSS_HEIGAN, DOOR_TYPE_ROOM, BOUNDARY_N}, - {181203, BOSS_HEIGAN, DOOR_TYPE_PASSAGE, BOUNDARY_E}, - {181241, BOSS_HEIGAN, DOOR_TYPE_PASSAGE, 0}, - {181241, BOSS_LOATHEB, DOOR_TYPE_ROOM, BOUNDARY_W}, - {181123, BOSS_PATCHWERK, DOOR_TYPE_PASSAGE, 0}, - {181123, BOSS_GROBBULUS, DOOR_TYPE_ROOM, 0}, - {181120, BOSS_GLUTH, DOOR_TYPE_PASSAGE, BOUNDARY_NW}, - {181121, BOSS_GLUTH, DOOR_TYPE_PASSAGE, 0}, - {181121, BOSS_THADDIUS, DOOR_TYPE_ROOM, 0}, - {181124, BOSS_RAZUVIOUS, DOOR_TYPE_PASSAGE, 0}, - {181124, BOSS_GOTHIK, DOOR_TYPE_ROOM, BOUNDARY_N}, - {181125, BOSS_GOTHIK, DOOR_TYPE_PASSAGE, BOUNDARY_S}, - {181119, BOSS_GOTHIK, DOOR_TYPE_PASSAGE, 0}, - {181119, BOSS_HORSEMEN, DOOR_TYPE_ROOM, BOUNDARY_NE}, - {181225, BOSS_SAPPHIRON, DOOR_TYPE_PASSAGE, BOUNDARY_W}, - {0, 0, DOOR_TYPE_ROOM, 0}, // EOF -}; - -const MinionData minionData[] = -{ - //{16573, BOSS_ANUBREKHAN}, there is no spawn point in db, so we do not add them here - {16506, BOSS_FAERLINA}, - {16803, BOSS_RAZUVIOUS}, - {16063, BOSS_HORSEMEN}, - {16064, BOSS_HORSEMEN}, - {16065, BOSS_HORSEMEN}, - {30549, BOSS_HORSEMEN}, - {0, 0,} -}; - -enum -{ - GO_HORSEMEN_CHEST_HERO = 193426, - GO_HORSEMEN_CHEST = 181366, //four horsemen event, DoRespawnGameObject() when event == DONE - GO_GOTHIK_GATE = 181170, - - SPELL_ERUPTION = 29371 -}; - -const float HeiganPos[2] = {2796, -3707}; -const float HeiganEruptionSlope[3] = -{ - (-3685 - HeiganPos[1]) /(2724 - HeiganPos[0]), - (-3647 - HeiganPos[1]) /(2749 - HeiganPos[0]), - (-3637 - HeiganPos[1]) /(2771 - HeiganPos[0]), -}; - -// 0 H x -// 1 ^ -// 2 | -// 3 y<--o -inline uint32 GetEruptionSection(float x, float y) -{ - y -= HeiganPos[1]; - if (y < 1.0f) - return 0; - - x -= HeiganPos[0]; - if (x > -1.0f) - return 3; - - float slope = y/x; - for(uint32 i = 0; i < 3; ++i) - if (slope > HeiganEruptionSlope[i]) - return i; - return 3; -} - -struct TRINITY_DLL_DECL instance_naxxramas : public InstanceData -{ - instance_naxxramas(Map* pMap) : InstanceData(pMap) - , Sapphiron(NULL), pGothikGate(NULL), HorsemenChest(NULL), HorsemenNum(0) - { - SetBossNumber(MAX_BOSS_NUMBER); - LoadDoorData(doorData); - LoadMinionData(minionData); - } - - std::set HeiganEruption[4]; - GameObject* pGothikGate, *HorsemenChest; - Creature* Sapphiron; - uint32 HorsemenNum; - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 15989: Sapphiron = add ? pCreature : NULL; return; - } - - AddMinion(pCreature, add); - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - if (pGo->GetGOInfo()->displayId == 6785 || pGo->GetGOInfo()->displayId == 1287) - { - uint32 section = GetEruptionSection(pGo->GetPositionX(), pGo->GetPositionY()); - if (add) - HeiganEruption[section].insert(pGo); - else - HeiganEruption[section].erase(pGo); - return; - } - - switch(pGo->GetEntry()) - { - case GO_BIRTH: if (!add && Sapphiron) Sapphiron->AI()->DoAction(DATA_SAPPHIRON_BIRTH); return; - case GO_GOTHIK_GATE: pGothikGate = add ? pGo : NULL; break; - case GO_HORSEMEN_CHEST: HorsemenChest = add ? pGo : NULL; break; - } - - AddDoor(pGo, add); - } - - void SetData(uint32 id, uint32 value) - { - switch(id) - { - case DATA_HEIGAN_ERUPT: - HeiganErupt(value); - break; - case DATA_GOTHIK_GATE: - if (pGothikGate) - pGothikGate->SetGoState(GOState(value)); - break; - } - } - - bool SetBossState(uint32 id, EncounterState state) - { - if (!InstanceData::SetBossState(id, state)) - return false; - - if (id == BOSS_HORSEMEN && state == DONE && HorsemenChest) - HorsemenChest->SetRespawnTime(HorsemenChest->GetRespawnDelay()); - - return true; - } - - void HeiganErupt(uint32 section) - { - for(uint32 i = 0; i < 4; ++i) - { - if (i == section) - continue; - - for(std::set::iterator itr = HeiganEruption[i].begin(); itr != HeiganEruption[i].end(); ++itr) - { - (*itr)->SendCustomAnim(); - (*itr)->CastSpell(NULL, SPELL_ERUPTION); - } - } - } -}; - -bool AreaTrigger_at_naxxramas_frostwyrm_wing(Player* pPlayer, AreaTriggerEntry *at) -{ - if (pPlayer->isGameMaster()) - return false; - - InstanceData *data = pPlayer->GetInstanceData(); - if (data) - for(uint32 i = BOSS_ANUBREKHAN; i < BOSS_SAPPHIRON; ++i) - if (data->GetBossState(i) != DONE) - return true; - - return false; -} - -InstanceData* GetInstanceData_instance_naxxramas(Map* pMap) -{ - return new instance_naxxramas(pMap); -} - -void AddSC_instance_naxxramas() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_naxxramas"; - newscript->GetInstanceData = &GetInstanceData_instance_naxxramas; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "at_naxxramas_frostwyrm_wing"; - newscript->pAreaTrigger = &AreaTrigger_at_naxxramas_frostwyrm_wing; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp deleted file mode 100644 index b187fa10656..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/boss_malygos.cpp +++ /dev/null @@ -1,170 +0,0 @@ -/* Script Data Start -SDName: Boss malygos -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ARCANE_BREATH_N 56272 -#define SPELL_ARCANE_BREATH_H 60072 -#define SPELL_ARCANE_PULSE 57432 -#define SPELL_ARCANE_STORM_1 57459 -#define SPELL_ARCANE_STORM_2 61693 -#define SPELL_ARCANE_STORM_3 61694 -#define SPELL_STATIC_FIELD 57430 -#define SPELL_SURGE_OF_POWER_1 56505 -#define SPELL_SURGE_OF_POWER_2 57407 -#define SPELL_SURGE_OF_POWER_3 60936 -#define SPELL_VORTEX 56105 - -//Dragon "mounts" spells in Phase3 -//they use Rugelike energy -#define SPELL_DMOUNT_FLAME_SPIKE 56091 //maybe not accurate -#define SPELL_DMOUNT_ENGULF_IN_FLAMES 61621 -#define SPELL_DMOUNT_REVIVIFY 57090 -#define SPELL_DMOUNT_LIFE_BURST 57143 -#define SPELL_DMOUNT_FLAME_SHIELD 57108 -//#define SPELL_DMOUNT_UNKNOWN XYZ //Increases your drake's flight speed by 500%. - - -//Yell -//-->Other -#define SAY_ANTI_MAGIC_SHELL -1616000 -#define SAY_BREATH_ATTACK -1616001 -#define SAY_HIGH_DAMAGE_MODE -1616002 -#define SAY_MAGIC_BLAST -1616003 -//--> Generic Spells -#define SAY_GENERIC_SPELL_1 -1616004 -#define SAY_GENERIC_SPELL_2 -1616005 -#define SAY_GENERIC_SPELL_3 -1616006 -#define SAY_DEATH -1616007 -//--> Prefight -#define SAY_PREFIGHT_1 -1616008 -#define SAY_PREFIGHT_2 -1616009 -#define SAY_PREFIGHT_3 -1616010 -#define SAY_PREFIGHT_4 -1616011 -#define SAY_PREFIGHT_5 -1616012 -//--> Phase1 -#define SAY_PHASE1_AGGRO -1616013 -#define SAY_PHASE1_END -1616014 -#define SAY_PHASE1_SLAY_1 -1616015 -#define SAY_PHASE1_SLAY_2 -1616016 -#define SAY_PHASE1_SLAY_3 -1616017 - -//--> Phase2 at 50% HP, - -/*Malygos himself is not targetable during this phase, it will end when the adds he spawns are all killed. However, he does continue to play a part in the encounter. -During this phase he drops anti-magic zones onto the ground the raid MUST stand inside of, it reduces magical damage taken by 50%. They shrink over time, so it's important that your raid moves to each new one he drops. -Throughout the phase, he will deep breath doing ~4k damage per second, unless you are standing inside of the anti-magic zone. -The way the fight works during this phase is there are NPCs riding around on disks in the room. There are two types of mobs, Lords and Scions. -The Lords will move down onto the group, and need to be tanked (They will one-shot a non-tank). After they die, they drop a disk that a raid member can mount onto, which allows them to fly, to attack the Scions that do not come down to the ground. -It is recommended to let melee take the first disks, then ranged. As those mobs die, they also drop disks, which allows the rest of your dps to get onto them. -The Scions will continually cast Arcane Blast on random targets on the floor, which is mitigated by the anti-magic zones. While mounted on a disk, you will not take damage. -After all of the NPCs riding on the disks die, the players on the disks need to dismount as Phase 3 is about to begin.*/ - -#define SAY_PHASE2_AGGRO -1616018 -#define SAY_PHASE2_END -1616019 -#define SAY_PHASE2_SLAY_1 -1616020 -#define SAY_PHASE2_SLAY_2 -1616021 -#define SAY_PHASE2_SLAY_3 -1616022 -//--> Phase3 Malygos destroys the floor, encounter continues on dragon "mounts" -#define SAY_PHASE3_INTRO -1616023 -#define SAY_PHASE3_AGGRO -1616024 -#define SAY_PHASE3_SLAY_1 -1616025 -#define SAY_PHASE3_SLAY_2 -1616026 -#define SAY_PHASE3_SLAY_3 -1616027 -#define SAY_PHASE3_BIG_ATTACK -1616028 - -struct TRINITY_DLL_DECL boss_malygosAI : public ScriptedAI -{ - boss_malygosAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase, - enrage; - - void Reset() - { - //Source Deadly Boss Mod - enrage = 615000; //10 min - } - void EnterCombat(Unit* who) - { - if (phase == 1) - DoScriptText(SAY_PHASE1_AGGRO, m_creature); - if (phase == 2) - DoScriptText(SAY_PHASE1_AGGRO, m_creature); - if (phase == 3) - DoScriptText(SAY_PHASE1_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - phase =1; - //Return since we have no target - if (!UpdateVictim()) - return; - - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 50){ - phase = 2; - //spawn adds - //set malygos unatackable untill all adds spawned dead - //start phase3 - } - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - if (phase ==1) - switch(rand()%3) - { - case 0: DoScriptText(SAY_PHASE1_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_PHASE1_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_PHASE1_SLAY_3, m_creature);break; - } - if (phase ==2) - switch(rand()%3) - { - case 0: DoScriptText(SAY_PHASE2_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_PHASE2_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_PHASE2_SLAY_3, m_creature);break; - } - if (phase ==3) - switch(rand()%3) - { - case 0: DoScriptText(SAY_PHASE3_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_PHASE3_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_PHASE3_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_malygos(Creature* pCreature) -{ - return new boss_malygosAI (pCreature); -} - -void AddSC_boss_malygos() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_malygos"; - newscript->GetAI = &GetAI_boss_malygos; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h deleted file mode 100644 index caa82a92e95..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/def_eye_of_eternity.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_EYE_OF_ETERNITY_H -#define DEF_EYE_OF_ETERNITY_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp b/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp deleted file mode 100644 index 7c89a117d92..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/eye_of_eternity/instance_eye_of_eternity.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_eye_of_eternity.h" - -struct TRINITY_DLL_DECL instance_eye_of_eternity : public ScriptedInstance -{ - instance_eye_of_eternity(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_eye_of_eternity(Map* pMap) -{ - return new instance_eye_of_eternity(pMap); -} - -void AddSC_instance_eye_of_eternity() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_eye_of_eternity"; - newscript->GetInstanceData = &GetInstanceData_instance_eye_of_eternity; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp deleted file mode 100644 index 832dc9274e2..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_anomalus.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Anomalus -SD%Complete: -SDComment: -SDCategory: The Nexus, The Nexus -EndScriptData */ - -#include "precompiled.h" -#include "def_nexus.h" - -bool DeadChaoticRift; // needed for achievement: Chaos Theory(2037) - -enum -{ - ACHIEVEMENT_CHAOS_THEORY = 2037, - - //Spells - SPELL_SPARK_N = 47751, - SPELL_SPARK_H = 57062, - SPELL_RIFT_SHIELD = 47748, - SPELL_CHARGE_RIFT = 47747, //Works wrong (affect players, not rifts) - SPELL_CREATE_RIFT = 47743, //Don't work, using WA - SPELL_ARCANE_ATTRACTION = 57063, //No idea, when it's used - - MOB_CRAZED_MANA_WRAITH = 26746, - MOB_CHAOTIC_RIFT = 26918, - SPELL_CHAOTIC_ENERGY_BURST = 47688, - SPELL_CHARGED_CHAOTIC_ENERGY_BURST = 47737, - SPELL_ARCANEFORM = 48019, //Chaotic Rift visual - - //Yell - SAY_AGGRO = -1576010, - SAY_DEATH = -1576011, - SAY_RIFT = -1576012, - SAY_SHIELD = -1576013 -}; - -float RiftLocation[6][3]= -{ - {652.64, -273.70, -8.75}, - {634.45, -265.94, -8.44}, - {620.73, -281.17, -9.02}, - {626.10, -304.67, -9.44}, - {639.87, -314.11, -9.49}, - {651.72, -297.44, -9.37} -}; - -struct TRINITY_DLL_DECL boss_anomalusAI : public ScriptedAI -{ - boss_anomalusAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - uint8 Phase; - uint32 SPELL_SPARK_Timer; - uint32 SPELL_CREATE_RIFT_Timer; - uint64 ChaoticRiftGUID; - - void Reset() - { - Phase = 0; - SPELL_SPARK_Timer = 5000; - SPELL_CREATE_RIFT_Timer = 25000; - ChaoticRiftGUID = 0; - - DeadChaoticRift = false; - - if (pInstance) - pInstance->SetData(DATA_ANOMALUS_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_ANOMALUS_EVENT, IN_PROGRESS); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (HeroicMode && !DeadChaoticRift) - { - AchievementEntry const *AchievChaosTheory = GetAchievementStore()->LookupEntry(ACHIEVEMENT_CHAOS_THEORY); - if (AchievChaosTheory) - { - Map* pMap = m_creature->GetMap(); - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &players = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - itr->getSource()->CompletedAchievement(AchievChaosTheory); - } - } - } - - if (pInstance) - pInstance->SetData(DATA_ANOMALUS_EVENT, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (m_creature->HasAura(SPELL_RIFT_SHIELD)) - { - if (ChaoticRiftGUID) - { - Unit* Rift = Unit::GetUnit((*m_creature), ChaoticRiftGUID); - if (Rift && Rift->isDead()) - { - m_creature->RemoveAurasDueToSpell(SPELL_RIFT_SHIELD); - ChaoticRiftGUID = 0; - } - return; - } - } else - ChaoticRiftGUID = 0; - - if ((Phase == 0) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.75)) - { - Phase = 1; - DoScriptText(SAY_SHIELD, m_creature); - DoCast(m_creature, SPELL_RIFT_SHIELD); - - int tmp = rand()%(2); - Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (Rift) - { - //DoCast(Rift, SPELL_CHARGE_RIFT); - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Rift->AI()->AttackStart(target); - ChaoticRiftGUID = Rift->GetGUID(); - DoScriptText(SAY_RIFT , m_creature); - } - } - - if ((Phase == 1) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.50)) - { - Phase = 2; - DoScriptText(SAY_SHIELD , m_creature); - DoCast(m_creature,SPELL_RIFT_SHIELD); - - int tmp = rand()%(2); - Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (Rift) - { - //DoCast(Rift, SPELL_CHARGE_RIFT); - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Rift->AI()->AttackStart(target); - ChaoticRiftGUID = Rift->GetGUID(); - DoScriptText(SAY_RIFT , m_creature); - } - } - - if ((Phase == 2) && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) - { - Phase = 3; - DoScriptText(SAY_SHIELD , m_creature); - DoCast(m_creature,SPELL_RIFT_SHIELD); - - int tmp = rand()%(2); - Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (Rift) - { - //DoCast(Rift, SPELL_CHARGE_RIFT); - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Rift->AI()->AttackStart(target); - ChaoticRiftGUID = Rift->GetGUID(); - DoScriptText(SAY_RIFT , m_creature); - } - } - - if (SPELL_SPARK_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, HeroicMode ? SPELL_SPARK_H : SPELL_SPARK_N); - SPELL_SPARK_Timer = 5000; - }else SPELL_SPARK_Timer -=diff; - - if (SPELL_CREATE_RIFT_Timer < diff) - { - DoScriptText(SAY_RIFT , m_creature); - - int tmp = rand()%(2); - Creature* Rift = m_creature->SummonCreature(MOB_CHAOTIC_RIFT, RiftLocation[tmp][0], RiftLocation[tmp][1], RiftLocation[tmp][2], 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (Rift) - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Rift->AI()->AttackStart(target); - SPELL_CREATE_RIFT_Timer = 25000; - }else SPELL_CREATE_RIFT_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_anomalus(Creature* pCreature) -{ - return new boss_anomalusAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_chaotic_riftAI : public Scripted_NoMovementAI -{ - mob_chaotic_riftAI(Creature *c) : Scripted_NoMovementAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 SPELL_CHAOTIC_ENERGY_BURST_Timer; - uint32 SUMMON_CRAZED_MANA_WRAITH_Timer; - - void Reset() - { - SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000; - SUMMON_CRAZED_MANA_WRAITH_Timer = 5000; - m_creature->SetDisplayId(25206); //For some reason in DB models for ally and horde are different. - //Model for ally (1126) does not show auras. Horde model works perfect. - //Set model to horde number - DoCast(m_creature, SPELL_ARCANEFORM, false); - } - - void JustDied(Unit *killer) - { - DeadChaoticRift = true; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (SPELL_CHAOTIC_ENERGY_BURST_Timer < diff) - { - Unit* Anomalus = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANOMALUS)); - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD)) - DoCast(target, SPELL_CHARGED_CHAOTIC_ENERGY_BURST); - else - DoCast(target, SPELL_CHAOTIC_ENERGY_BURST); - SPELL_CHAOTIC_ENERGY_BURST_Timer = 1000; - }else SPELL_CHAOTIC_ENERGY_BURST_Timer -=diff; - - if (SUMMON_CRAZED_MANA_WRAITH_Timer < diff) - { - Creature* Wraith = m_creature->SummonCreature(MOB_CRAZED_MANA_WRAITH, m_creature->GetPositionX()+1, m_creature->GetPositionY()+1, m_creature->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (Wraith) - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Wraith->AI()->AttackStart(target); - Unit* Anomalus = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ANOMALUS)); - if (Anomalus && Anomalus->HasAura(SPELL_RIFT_SHIELD)) - SUMMON_CRAZED_MANA_WRAITH_Timer = 5000; - else - SUMMON_CRAZED_MANA_WRAITH_Timer = 10000; - }else SUMMON_CRAZED_MANA_WRAITH_Timer -=diff; - } -}; - -CreatureAI* GetAI_mob_chaotic_rift(Creature* pCreature) -{ - return new mob_chaotic_riftAI (pCreature); -} - -void AddSC_boss_anomalus() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_anomalus"; - newscript->GetAI = &GetAI_boss_anomalus; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_chaotic_rift"; - newscript->GetAI = &GetAI_mob_chaotic_rift; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp deleted file mode 100644 index 072e6db1a1f..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_keristrasza.cpp +++ /dev/null @@ -1,258 +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_Keristrasza -SD%Complete: -SDComment: -SDCategory: The Nexus, The Nexus -EndScriptData */ - -#include "precompiled.h" -#include "def_nexus.h" - -enum -{ - CONTAINMENT_SPHERES = 3, - - ACHIEVEMENT_INTENSE_COLD = 2036, - - //Spells - SPELL_FROZEN_PRISON = 47854, - SPELL_TAIL_SWEEP = 50155, - SPELL_CRYSTAL_CHAINS = 50997, - SPELL_ENRAGE = 8599, - SPELL_CRYSTALFIRE_BREATH_N = 48096, - SPELL_CRYSTALFIRE_BREATH_H = 57091, - SPELL_CRYSTALIZE = 48179, - SPELL_INTENSE_COLD = 48094, - SPELL_INTENSE_COLD_TRIGGERED = 48095, - - //Yell - SAY_AGGRO = -1576040, - SAY_SLAY = -1576041, - SAY_ENRAGE = -1576042, - SAY_DEATH = -1576043, - SAY_CRYSTAL_NOVA = -1576044 -}; - -struct TRINITY_DLL_DECL boss_keristraszaAI : public ScriptedAI -{ - boss_keristraszaAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - uint32 CRYSTALFIRE_BREATH_Timer; - uint32 CRYSTAL_CHAINS_CRYSTALIZE_Timer; - uint32 TAIL_SWEEP_Timer; - bool Enrage; - - uint64 ContainmentSphereGUIDs[CONTAINMENT_SPHERES]; - - uint32 CheckIntenseColdTimer; - bool MoreThanTwoIntenseCold; // needed for achievement: Intense Cold(2036) - - void Reset() - { - CRYSTALFIRE_BREATH_Timer = 14000; - CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000; - TAIL_SWEEP_Timer = 5000; - Enrage = false; - - CheckIntenseColdTimer = 2000; - MoreThanTwoIntenseCold = false; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_STUNNED); - - RemovePrison(CheckContainmentSpheres()); - - if (pInstance) - pInstance->SetData(DATA_KERISTRASZA_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - DoCastAOE(SPELL_INTENSE_COLD); - - if (pInstance) - pInstance->SetData(DATA_KERISTRASZA_EVENT, IN_PROGRESS); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (HeroicMode && !MoreThanTwoIntenseCold) - { - AchievementEntry const *AchievIntenseCold = GetAchievementStore()->LookupEntry(ACHIEVEMENT_INTENSE_COLD); - if (AchievIntenseCold) - { - Map* pMap = m_creature->GetMap(); - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &players = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - itr->getSource()->CompletedAchievement(AchievIntenseCold); - } - } - } - - if (pInstance) - pInstance->SetData(DATA_KERISTRASZA_EVENT, DONE); - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_SLAY, m_creature); - } - - bool CheckContainmentSpheres(bool remove_prison = false) - { - ContainmentSphereGUIDs[0] = pInstance->GetData64(ANOMALUS_CONTAINMET_SPHERE); - ContainmentSphereGUIDs[1] = pInstance->GetData64(ORMOROKS_CONTAINMET_SPHERE); - ContainmentSphereGUIDs[2] = pInstance->GetData64(TELESTRAS_CONTAINMET_SPHERE); - - GameObject *ContainmentSpheres[CONTAINMENT_SPHERES]; - - for(uint8 i = 0; i < CONTAINMENT_SPHERES; ++i) - { - ContainmentSpheres[i] = pInstance->instance->GetGameObject(ContainmentSphereGUIDs[i]); - if (!ContainmentSpheres[i]) - return false; - if (ContainmentSpheres[i]->GetGoState() != GO_STATE_ACTIVE) - return false; - } - if (remove_prison) - RemovePrison(true); - return true; - } - - void RemovePrison(bool remove) - { - if (remove) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - if (m_creature->HasAura(SPELL_FROZEN_PRISON)) - m_creature->RemoveAurasDueToSpell(SPELL_FROZEN_PRISON); - } - else - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->CastSpell(m_creature, SPELL_FROZEN_PRISON, false); - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (CheckIntenseColdTimer < diff && !MoreThanTwoIntenseCold) - { - std::list ThreatList = m_creature->getThreatManager().getThreatList(); - for(std::list::const_iterator itr = ThreatList.begin(); itr != ThreatList.end(); itr++) - { - Unit *target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (!target || target->GetTypeId() != TYPEID_PLAYER) - continue; - - Aura *AuraIntenseCold = target->GetAura(SPELL_INTENSE_COLD_TRIGGERED); - if (AuraIntenseCold && AuraIntenseCold->GetStackAmount() > 2) - { - MoreThanTwoIntenseCold = true; - break; - } - } - CheckIntenseColdTimer = 2000; - }else CheckIntenseColdTimer -= diff; - - if (!Enrage && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) - { - DoScriptText(SAY_ENRAGE , m_creature); - DoCast(m_creature, SPELL_ENRAGE); - Enrage = true; - } - - if (CRYSTALFIRE_BREATH_Timer < diff) - { - DoCast(m_creature->getVictim(), HeroicMode ? SPELL_CRYSTALFIRE_BREATH_H : SPELL_CRYSTALFIRE_BREATH_N); - CRYSTALFIRE_BREATH_Timer = 14000; - }else CRYSTALFIRE_BREATH_Timer -=diff; - - if (TAIL_SWEEP_Timer < diff) - { - DoCast(m_creature, SPELL_TAIL_SWEEP); - TAIL_SWEEP_Timer = 5000; - }else TAIL_SWEEP_Timer -=diff; - - if (CRYSTAL_CHAINS_CRYSTALIZE_Timer < diff) - { - DoScriptText(SAY_CRYSTAL_NOVA , m_creature); - if (HeroicMode) - DoCast(m_creature, SPELL_CRYSTALIZE); - else - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CRYSTAL_CHAINS); - CRYSTAL_CHAINS_CRYSTALIZE_Timer = HeroicMode ? 30000 : 11000; - }else CRYSTAL_CHAINS_CRYSTALIZE_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_keristrasza(Creature* pCreature) -{ - return new boss_keristraszaAI (pCreature); -} - -bool GOHello_containment_sphere(Player *pPlayer, GameObject *pGO) -{ - ScriptedInstance *pInstance = pGO->GetInstanceData(); - - Creature *Keristrasza = Unit::GetCreature(*pGO, pInstance->GetData64(DATA_KERISTRASZA)); - if (Keristrasza && Keristrasza->isAlive()) - { - // maybe these are hacks :( - pGO->SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); - pGO->SetGoState(GO_STATE_ACTIVE); - - CAST_AI(boss_keristraszaAI, Keristrasza->AI())->CheckContainmentSpheres(true); - } - return true; -} - -void AddSC_boss_keristrasza() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_keristrasza"; - newscript->GetAI = &GetAI_boss_keristrasza; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "containment_sphere"; - newscript->pGOHello = &GOHello_containment_sphere; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp deleted file mode 100644 index 2fe856cea05..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_magus_telestra.cpp +++ /dev/null @@ -1,317 +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_Magus_Telestra -SD%Complete: -SDComment: -SDCategory: The Nexus, The Nexus -EndScriptData */ - -#include "precompiled.h" -#include "def_nexus.h" - -enum -{ -//Spells - SPELL_ICE_NOVA_N = 47772, - SPELL_ICE_NOVA_H = 56935, - SPELL_FIREBOMB_N = 47773, - SPELL_FIREBOMB_H = 56934, - SPELL_GRAVITY_WELL = 47756, - SPELL_TELESTRA_BACK = 47714, - -//At 50% HP - 3 clones, Frost, Fire, Arcane (and in 10% HP in Heroic) - MOB_FIRE_MAGUS = 26928, - MOB_FROST_MAGUS = 26930, - MOB_ARCANE_MAGUS = 26929, - - SPELL_FIRE_MAGUS_VISUAL = 47705, - SPELL_FROST_MAGUS_VISUAL = 47706, - SPELL_ARCANE_MAGUS_VISUAL = 47704, - -//Yell - SAY_AGGRO = -1576000, - SAY_KILL = -1576001, - SAY_DEATH = -1576002, - SAY_MERGE = -1576003, - SAY_SPLIT_1 = -1576004, - SAY_SPLIT_2 = -1576005 -}; - -float CenterOfRoom[1][4] = -{ - {504.80, 89.07, -16.12, 6.27} -}; - -struct TRINITY_DLL_DECL boss_magus_telestraAI : public ScriptedAI -{ - boss_magus_telestraAI(Creature* c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - - uint64 FireMagusGUID; - uint64 FrostMagusGUID; - uint64 ArcaneMagusGUID; - bool FireMagusDead; - bool FrostMagusDead; - bool ArcaneMagusDead; - - uint32 AppearDelay_Timer; - bool AppearDelay; - - uint8 Phase; - - uint32 SPELL_ICE_NOVA_Timer; - uint32 SPELL_FIREBOMB_Timer; - uint32 SPELL_GRAVITY_WELL_Timer; - uint32 Cooldown; - - void Reset() - { - Phase = 0; - //These times are probably wrong - SPELL_ICE_NOVA_Timer = 7000; - SPELL_FIREBOMB_Timer = 0; - SPELL_GRAVITY_WELL_Timer = 15000; - Cooldown = 0; - - FireMagusGUID = 0; - FrostMagusGUID = 0; - ArcaneMagusGUID = 0; - - AppearDelay = false; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_ON); - - if (pInstance) - pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, IN_PROGRESS); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_MAGUS_TELESTRA_EVENT, DONE); - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_KILL, m_creature); - } - - uint64 SplitPersonality(uint32 entry) - { - Creature* Summoned = m_creature->SummonCreature(entry, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (Summoned) - { - switch (entry) - { - case MOB_FIRE_MAGUS: - { - Summoned->CastSpell(Summoned, SPELL_FIRE_MAGUS_VISUAL, false); - break; - } - case MOB_FROST_MAGUS: - { - Summoned->CastSpell(Summoned, SPELL_FROST_MAGUS_VISUAL, false); - break; - } - case MOB_ARCANE_MAGUS: - { - Summoned->CastSpell(Summoned, SPELL_ARCANE_MAGUS_VISUAL, false); - break; - } - } - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Summoned->AI()->AttackStart(target); - return Summoned->GetGUID(); - } - return 0; - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - { - return; - } - - if (AppearDelay) - { - m_creature->StopMoving(); - m_creature->AttackStop(); - if (AppearDelay_Timer < diff) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - AppearDelay = false; - }else AppearDelay_Timer -= diff; - return; - } - - - if ((Phase == 1)||(Phase == 3)) - { - Unit* FireMagus; - Unit* FrostMagus; - Unit* ArcaneMagus; - if (FireMagusGUID) - FireMagus = Unit::GetUnit((*m_creature), FireMagusGUID); - if (FrostMagusGUID) - FrostMagus = Unit::GetUnit((*m_creature), FrostMagusGUID); - if (ArcaneMagusGUID) - ArcaneMagus = Unit::GetUnit((*m_creature), ArcaneMagusGUID); - if (FireMagus && FireMagus->isDead()) - FireMagusDead = true; - if (FrostMagus && FrostMagus->isDead()) - FrostMagusDead = true; - if (ArcaneMagus && ArcaneMagus->isDead()) - ArcaneMagusDead = true; - if (FireMagusDead && FrostMagusDead && ArcaneMagusDead) - { - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMap()->CreatureRelocation(m_creature, CenterOfRoom[0][0], CenterOfRoom[0][1], CenterOfRoom[0][2], CenterOfRoom[0][3]); - DoCast(m_creature, SPELL_TELESTRA_BACK); - m_creature->SetVisibility(VISIBILITY_ON); - if (Phase == 1) - Phase = 2; - if (Phase == 3) - Phase = 4; - FireMagusGUID = 0; - FrostMagusGUID = 0; - ArcaneMagusGUID = 0; - AppearDelay = true; - AppearDelay_Timer = 4000; - DoScriptText(SAY_MERGE, m_creature); - }else - return; - } - - if ((Phase == 0) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.5))) - { - Phase = 1; - m_creature->CastStop(); - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS); - FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS); - ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS); - FireMagusDead = false; - FrostMagusDead = false; - ArcaneMagusDead = false; - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPLIT_1, m_creature); break; - case 1: DoScriptText(SAY_SPLIT_2, m_creature); break; - } - return; - } - - if (HeroicMode && (Phase == 2) && (m_creature->GetHealth() <= (m_creature->GetMaxHealth() * 0.1))) - { - Phase = 3; - m_creature->CastStop(); - m_creature->SetVisibility(VISIBILITY_OFF); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - FireMagusGUID = SplitPersonality(MOB_FIRE_MAGUS); - FrostMagusGUID = SplitPersonality(MOB_FROST_MAGUS); - ArcaneMagusGUID = SplitPersonality(MOB_ARCANE_MAGUS); - FireMagusDead = false; - FrostMagusDead = false; - ArcaneMagusDead = false; - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPLIT_1, m_creature); break; - case 1: DoScriptText(SAY_SPLIT_2, m_creature); break; - } - return; - } - - if (Cooldown) - { - if (Cooldown < diff) - Cooldown = 0; - else - { - Cooldown -= diff; - return; - } - } - - if (SPELL_ICE_NOVA_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, HeroicMode ? SPELL_ICE_NOVA_H : SPELL_ICE_NOVA_N); - Cooldown = 1500; - } - SPELL_ICE_NOVA_Timer = 15000; - }else SPELL_ICE_NOVA_Timer -=diff; - - if (SPELL_GRAVITY_WELL_Timer < diff) - { - if (Unit* target = m_creature->getVictim()) - { - DoCast(target, SPELL_GRAVITY_WELL); - Cooldown = 6000; - } - SPELL_GRAVITY_WELL_Timer = 15000; - }else SPELL_GRAVITY_WELL_Timer -=diff; - - if (SPELL_FIREBOMB_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target, HeroicMode ? SPELL_FIREBOMB_H : SPELL_FIREBOMB_N); - Cooldown = 2000; - } - SPELL_FIREBOMB_Timer = 2000; - }else SPELL_FIREBOMB_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_magus_telestra(Creature* pCreature) -{ - return new boss_magus_telestraAI (pCreature); -} - -void AddSC_boss_magus_telestra() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_magus_telestra"; - newscript->GetAI = &GetAI_boss_magus_telestra; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp deleted file mode 100644 index d55e8514cc6..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/boss_ormorok.cpp +++ /dev/null @@ -1,311 +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_Ormorok -SD%Complete: -SDComment: -SDCategory: The Nexus, The Nexus -EndScriptData */ - -#include "precompiled.h" -#include "def_nexus.h" - -enum -{ -//Spells - SPELL_CRYSTAL_SPIKES_N = 47958, //Don't work, using walkaround - SPELL_CRYSTAL_SPIKES_H = 57082, //Don't work, using walkaround -//Walkaround for spells Crystal Spikes ----------------- - SPELL_CRYSTALL_SPIKE_DAMAGE_N = 47944, - SPELL_CRYSTALL_SPIKE_DAMAGE_H = 57067, - SPELL_CRYSTAL_SPIKE_PREVISUAL = 50442, - MOB_CRYSTAL_SPIKE = 27099, -//------------------------------------------------------ - SPELL_SPELL_REFLECTION = 47981, - SPELL_TRAMPLE_N = 48016, - SPELL_TRAMPLE_H = 57066, - SPELL_FRENZY = 48017, - SPELL_SUMMON_CRYSTALLINE_TANGLER = 61564, //summons npc 32665 - MOB_CRYSTALLINE_TANGLER = 32665, - SPELL_ROOTS = 28858, //proper spell id is unknown - -//Yell - SAY_AGGRO = -1576020, - SAY_DEATH = -1576021, - SAY_REFLECT = -1576022, - SAY_CRYSTAL_SPIKES = -1576023, - SAY_KILL = -1576024 -}; - -#define SPIKE_DISTANCE 5.0f - -struct TRINITY_DLL_DECL boss_ormorokAI : public ScriptedAI -{ - boss_ormorokAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - bool HeroicMode; - bool Frenzy; - bool CrystalSpikes; - uint8 CrystalSpikes_Count; - float BaseX; - float BaseY; - float BaseZ; - float BaseO; - float SpikeXY[4][2]; - - uint32 SPELL_CRYSTAL_SPIKES_Timer; - uint32 CRYSTAL_SPIKES_Timer; - uint32 SPELL_TRAMPLE_Timer; - uint32 SPELL_FRENZY_Timer; - uint32 SPELL_SPELL_REFLECTION_Timer; - uint32 SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer; - - void Reset() - { - SPELL_CRYSTAL_SPIKES_Timer = 12000; - SPELL_TRAMPLE_Timer = 10000; - SPELL_SPELL_REFLECTION_Timer = 30000; - SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000; - Frenzy = false; - CrystalSpikes = false; - - if (pInstance) - pInstance->SetData(DATA_ORMOROK_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_ORMOROK_EVENT, IN_PROGRESS); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_ORMOROK_EVENT, DONE); - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_KILL, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - return; - } - if (CrystalSpikes) - if (CRYSTAL_SPIKES_Timer < diff) - { - SpikeXY[0][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO)); - SpikeXY[0][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO)); - SpikeXY[1][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO)); - SpikeXY[1][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO)); - SpikeXY[2][0] = BaseX+(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2))); - SpikeXY[2][1] = BaseY+(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2))); - SpikeXY[3][0] = BaseX-(SPIKE_DISTANCE*CrystalSpikes_Count*cos(BaseO-(M_PI/2))); - SpikeXY[3][1] = BaseY-(SPIKE_DISTANCE*CrystalSpikes_Count*sin(BaseO-(M_PI/2))); - for (uint8 i = 0; i < 4; ++i) - Creature* Spike = m_creature->SummonCreature(MOB_CRYSTAL_SPIKE, SpikeXY[i][0], SpikeXY[i][1], BaseZ, 0, TEMPSUMMON_TIMED_DESPAWN, 7000); - if (++CrystalSpikes_Count >= 13) - CrystalSpikes = false; - CRYSTAL_SPIKES_Timer = 200; - }else CRYSTAL_SPIKES_Timer -= diff; - - if (!Frenzy && (m_creature->GetHealth() < m_creature->GetMaxHealth() * 0.25)) - { - DoCast(m_creature, SPELL_FRENZY); - Frenzy = true; - } - - if (SPELL_TRAMPLE_Timer < diff) - { - DoCast(m_creature, HeroicMode ? SPELL_TRAMPLE_H : SPELL_TRAMPLE_N); - SPELL_TRAMPLE_Timer = 10000; - }else SPELL_TRAMPLE_Timer -= diff; - - if (SPELL_SPELL_REFLECTION_Timer < diff) - { - DoScriptText(SAY_REFLECT, m_creature); - DoCast(m_creature, SPELL_SPELL_REFLECTION); - SPELL_SPELL_REFLECTION_Timer = 30000; - }else SPELL_SPELL_REFLECTION_Timer -= diff; - - if (SPELL_CRYSTAL_SPIKES_Timer < diff) - { - DoScriptText(SAY_CRYSTAL_SPIKES, m_creature); - CrystalSpikes = true; - CrystalSpikes_Count = 1; - CRYSTAL_SPIKES_Timer = 0; - BaseX = m_creature->GetPositionX(); - BaseY = m_creature->GetPositionY(); - BaseZ = m_creature->GetPositionZ(); - BaseO = m_creature->GetOrientation(); - SPELL_CRYSTAL_SPIKES_Timer = 20000; - }else SPELL_CRYSTAL_SPIKES_Timer -=diff; - - if (HeroicMode && (SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer < diff)) - { - Creature* Crystalline_Tangler = m_creature->SummonCreature(MOB_CRYSTALLINE_TANGLER, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(), m_creature->GetOrientation(), TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 1000); - if (Crystalline_Tangler) - { - Unit* target = NULL; - uint8 Healer = 0; - for (uint8 j = 1; j<=4; j++) - { - switch (j) - { - case 1: Healer = CLASS_PRIEST; break; - case 2: Healer = CLASS_PALADIN; break; - case 3: Healer = CLASS_DRUID; break; - case 4: Healer = CLASS_SHAMAN; break; - } - std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); - for (; i != m_creature->getThreatManager().getThreatList().end(); ++i) - { - Unit* pTemp = Unit::GetUnit((*m_creature),(*i)->getUnitGuid()); - if (pTemp && pTemp->GetTypeId() == TYPEID_PLAYER && pTemp->getClass() == Healer) - { - target = pTemp; - break; - } - } - if (target) - break; - } - if (!target) - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - { - Crystalline_Tangler->AI()->AttackStart(target); - Crystalline_Tangler->getThreatManager().addThreat(target, 1000000000.0f); - } - } - SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer = 17000; - }else SPELL_SUMMON_CRYSTALLINE_TANGLER_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL mob_crystal_spikeAI : public Scripted_NoMovementAI -{ - mob_crystal_spikeAI(Creature *c) : Scripted_NoMovementAI(c) - { - HeroicMode = c->GetMap()->IsHeroic(); - } - - bool HeroicMode; - - uint32 SPELL_CRYSTALL_SPIKE_DAMAGE_Timer; - uint32 SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer; - - void Reset() - { - SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 3700; - SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 1000; - m_creature->SetLevel(80); // - m_creature->setFaction(16); //Walkaround to be independent from data in DB - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); // - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); // - } - - void UpdateAI(const uint32 diff) - { - if (SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer < diff) - { - DoCast(m_creature, SPELL_CRYSTAL_SPIKE_PREVISUAL); - SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer = 10000; - }else SPELL_CRYSTAL_SPIKE_PREVISUAL_Timer -=diff; - - if (SPELL_CRYSTALL_SPIKE_DAMAGE_Timer < diff) - { - DoCast(m_creature, HeroicMode ? SPELL_CRYSTALL_SPIKE_DAMAGE_H : SPELL_CRYSTALL_SPIKE_DAMAGE_N); - SPELL_CRYSTALL_SPIKE_DAMAGE_Timer = 10000; - }else SPELL_CRYSTALL_SPIKE_DAMAGE_Timer -=diff; - } -}; - -struct TRINITY_DLL_DECL mob_crystalline_tanglerAI : public ScriptedAI -{ - mob_crystalline_tanglerAI(Creature *c) : ScriptedAI(c) {} - - uint32 SPELL_ROOTS_Timer; - - void Reset() - { - SPELL_ROOTS_Timer = 1000; - } - - void UpdateAI(const uint32 diff) - { - if (SPELL_ROOTS_Timer < diff) - { - if (m_creature->IsWithinDist(m_creature->getVictim(), 5.0f, false)) - { - DoCast(m_creature->getVictim(), SPELL_ROOTS); - SPELL_ROOTS_Timer = 15000; - } - }else SPELL_ROOTS_Timer -=diff; - } -}; - -CreatureAI* GetAI_mob_crystal_spike(Creature* pCreature) -{ - return new mob_crystal_spikeAI (pCreature); -} - -CreatureAI* GetAI_mob_crystalline_tangler(Creature* pCreature) -{ - return new mob_crystalline_tanglerAI (pCreature); -} - -CreatureAI* GetAI_boss_ormorok(Creature* pCreature) -{ - return new boss_ormorokAI (pCreature); -} - -void AddSC_boss_ormorok() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_ormorok"; - newscript->GetAI = &GetAI_boss_ormorok; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_crystal_spike"; - newscript->GetAI = &GetAI_mob_crystal_spike; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_crystalline_tangler"; - newscript->GetAI = &GetAI_mob_crystalline_tangler; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp deleted file mode 100644 index a28deb89264..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/commander_kolurg.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/* Script Data Start -SDName: Boss Commander Kolurg -SDAuthor: LordVanMartin -SD%Complete: -SDComment: Only Alliance Heroic -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_commander_kolurg' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -#define SPELL_BATTLE_SHOUT 31403 -#define SPELL_CHARGE 60067 -#define SPELL_FRIGHTENING_SHOUT 19134 -#define SPELL_WHIRLWIND_1 38619 -#define SPELL_WHIRLWIND_2 38618 - -//Yell -#define SAY_AGGRO 1576024 -#define SAY_KILL 1576025 -#define SAY_DEATH 1576026 - -struct TRINITY_DLL_DECL boss_commander_kolurgAI : public ScriptedAI -{ - boss_commander_kolurgAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; - -CreatureAI* GetAI_boss_commander_kolurg(Creature* pCreature) -{ - return new boss_commander_kolurgAI (pCreature); -} - -void AddSC_boss_commander_kolurg() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_commander_kolurg"; - newscript->GetAI = &GetAI_boss_commander_kolurg; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp deleted file mode 100644 index 1bacd679e25..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/commander_stoutbeard.cpp +++ /dev/null @@ -1,63 +0,0 @@ -/* Script Data Start -SDName: Boss Commander Stoutbeard -SDAuthor: LordVanMartin -SD%Complete: -SDComment: Only Horde Heroic -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_commander_stoutbeard' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -#define SPELL_BATTLE_SHOUT 31403 -#define SPELL_CHARGE 60067 -#define SPELL_FRIGHTENING_SHOUT 19134 -#define SPELL_WHIRLWIND_1 38619 -#define SPELL_WHIRLWIND_2 38618 - -//Yell -#define SAY_AGGRO 1576021 -#define SAY_KILL 1576022 -#define SAY_DEATH 1576023 - -struct TRINITY_DLL_DECL boss_commander_stoutbeardAI : public ScriptedAI -{ - boss_commander_stoutbeardAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } -}; - -CreatureAI* GetAI_boss_commander_stoutbeard(Creature* pCreature) -{ - return new boss_commander_stoutbeardAI (pCreature); -} - -void AddSC_boss_commander_stoutbeard() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_commander_stoutbeard"; - newscript->GetAI = &GetAI_boss_commander_stoutbeard; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h b/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h deleted file mode 100644 index 678e44e5bbe..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/def_nexus.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef DEF_NEXUS_H -#define DEF_NEXUS_H - -enum -{ - DATA_MAGUS_TELESTRA_EVENT, - DATA_ANOMALUS_EVENT, - DATA_ORMOROK_EVENT, - DATA_KERISTRASZA_EVENT, - - DATA_ANOMALUS, - DATA_KERISTRASZA, - - ANOMALUS_CONTAINMET_SPHERE, - ORMOROKS_CONTAINMET_SPHERE, - TELESTRAS_CONTAINMET_SPHERE -}; - -#endif diff --git a/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp b/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp deleted file mode 100644 index 169eda90d2a..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/nexus/instance_nexus.cpp +++ /dev/null @@ -1,258 +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_Nexus -SD%Complete: -SDComment: -SDCategory: The Nexus, The Nexus -EndScriptData */ - -#include "precompiled.h" -#include "def_nexus.h" - -#define NUMBER_OF_ENCOUNTERS 4 - -struct TRINITY_DLL_DECL instance_nexus : public ScriptedInstance -{ - instance_nexus(Map* pMap) : ScriptedInstance(pMap) { Initialize(); } - - uint32 m_auiEncounter[NUMBER_OF_ENCOUNTERS]; - - uint64 Anomalus; - uint64 Keristrasza; - - uint64 AnomalusContainmentSphere; - uint64 OrmoroksContainmentSphere; - uint64 TelestrasContainmentSphere; - - std::string strInstData; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - Anomalus = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - Map::PlayerList const& players = instance->GetPlayers(); - uint32 TeamInInstance = 0; - - if (!players.isEmpty()) - { - if (Player* pPlayer = players.begin()->getSource()) - { - TeamInInstance = pPlayer->GetTeam(); - } - } - switch(pCreature->GetEntry()) - { - case 26763: Anomalus = pCreature->GetGUID(); break; - case 26723: Keristrasza = pCreature->GetGUID(); break; - case 26800: - { - //26799 - pCreature->setFaction(16); - if (TeamInInstance == ALLIANCE) - pCreature->SetDisplayId(24358); - break; - } - case 26802: - { - //26801 - pCreature->setFaction(16); - if (TeamInInstance == ALLIANCE) - pCreature->SetDisplayId(24354); - break; - } - case 26805: - { - //26803 - pCreature->setFaction(16); - if (TeamInInstance == ALLIANCE) - pCreature->SetDisplayId(24357); - break; - } - case 27949: - { - //27947 - pCreature->setFaction(16); - if (TeamInInstance == ALLIANCE) - pCreature->SetDisplayId(24352); - break; - } - case 26796: - { - //26798 - pCreature->setFaction(16); - if (TeamInInstance == ALLIANCE) - pCreature->SetDisplayId(24352); - break; - } - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case 188527: - { - AnomalusContainmentSphere = pGo->GetGUID(); - if (m_auiEncounter[1] == DONE) - pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); - break; - } - case 188528: - { - OrmoroksContainmentSphere = pGo->GetGUID(); - if (m_auiEncounter[2] == DONE) - pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); - break; - } - case 188526: - { - TelestrasContainmentSphere = pGo->GetGUID(); - if (m_auiEncounter[0] == DONE) - pGo->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); - break; - } - } - } - - uint32 GetData(uint32 identifier) - { - switch(identifier) - { - case DATA_MAGUS_TELESTRA_EVENT: return m_auiEncounter[0]; - case DATA_ANOMALUS_EVENT: return m_auiEncounter[1]; - case DATA_ORMOROK_EVENT: return m_auiEncounter[2]; - case DATA_KERISTRASZA_EVENT: return m_auiEncounter[3]; - } - return 0; - } - - void SetData(uint32 identifier, uint32 data) - { - switch(identifier) - { - case DATA_MAGUS_TELESTRA_EVENT: - { - if (data == DONE) - { - GameObject *Sphere = instance->GetGameObject(TelestrasContainmentSphere); - if (Sphere) - Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); - } - m_auiEncounter[0] = data; - break; - } - case DATA_ANOMALUS_EVENT: - { - if (data == DONE) - { - GameObject *Sphere = instance->GetGameObject(AnomalusContainmentSphere); - if (Sphere) - Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); - } - m_auiEncounter[1] = data; - break; - } - case DATA_ORMOROK_EVENT: - { - if (data == DONE) - { - GameObject *Sphere = instance->GetGameObject(OrmoroksContainmentSphere); - if (Sphere) - Sphere->RemoveFlag(GAMEOBJECT_FLAGS, GO_FLAG_UNK1); - } - m_auiEncounter[2] = data; - break; - } - case DATA_KERISTRASZA_EVENT: 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]; - - strInstData = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint64 GetData64(uint32 uiIdentifier) - { - switch(uiIdentifier) - { - case DATA_ANOMALUS: return Anomalus; - case DATA_KERISTRASZA: return Keristrasza; - case ANOMALUS_CONTAINMET_SPHERE: return AnomalusContainmentSphere; - case ORMOROKS_CONTAINMET_SPHERE: return OrmoroksContainmentSphere; - case TELESTRAS_CONTAINMET_SPHERE: return TelestrasContainmentSphere; - } - return 0; - } - - std::string GetSaveData() - { - return strInstData; - } - - 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]; - - for(uint8 i = 1; i < NUMBER_OF_ENCOUNTERS; ++i) - { - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - } - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_nexus(Map* pMap) -{ - return new instance_nexus(pMap); -} - -void AddSC_instance_nexus() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_nexus"; - newscript->GetInstanceData = &GetInstanceData_instance_nexus; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp deleted file mode 100644 index bde90bf021e..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_drakos.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* Script Data Start -SDName: Boss drakos -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_MAGIC_PULL 51336 -#define SPELL_THUNDERING_STOMP 50774 -#define SPELL_THUNDERING_STOMP_2 59370 - -//Yell -#define SAY_AGGRO -1578000 -#define SAY_KILL_1 -1578001 -#define SAY_KILL_2 -1578002 -#define SAY_KILL_3 -1578003 -#define SAY_DEATH -1578004 -#define SAY_PULL_1 -1578005 -#define SAY_PULL_2 -1578006 -#define SAY_PULL_3 -1578007 -#define SAY_PULL_4 -1578008 -#define SAY_STOMP_1 -1578009 -#define SAY_STOMP_2 -1578010 -#define SAY_STOMP_3 -1578011 - -struct TRINITY_DLL_DECL boss_drakosAI : public ScriptedAI -{ - boss_drakosAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_KILL_1, m_creature);break; - case 1: DoScriptText(SAY_KILL_2, m_creature);break; - case 2: DoScriptText(SAY_KILL_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_drakos(Creature* pCreature) -{ - return new boss_drakosAI (pCreature); -} - -void AddSC_boss_drakos() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_drakos"; - newscript->GetAI = &GetAI_boss_drakos; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp deleted file mode 100644 index cc3fa3b3043..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_eregos.cpp +++ /dev/null @@ -1,104 +0,0 @@ -/* Script Data Start -SDName: Boss eregos -SDAuthor: LordVanMartin -SD%Complete: -SDComment: Encounter is done entirely on drake vehicles -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Types of drake mounts: Ruby(Tank), Amber(DPS), Emerald(Healer) -//Two Repeating phases - -//Spells -#define SPELL_ARCANE_BARRAGE 50804 -#define SPELL_ARCANE_VOLLEY 51153 -#define SPELL_ENRAGED_ASSAULT 51170 -#define SPELL_PLANAR_ANOMALIES 57959 -#define SPELL_PLANAR_SHIFT 51162 - -//Heroic -#define SPELL_ARCANE_BARRAGE_H 59381 -#define SPELL_ARCANE_VOLLEY_H 59382 - -/*Ruby Drake , -(npc 27756) (item 37860) -(summoned by spell Ruby Essence = 37860 ---> Call Amber Drake == 49462 ---> Summon 27756) -*/ -#define NPC_RUBY_DRAKE_VEHICLE 27756 -#define SPELL_RIDE_RUBY_DRAKE_QUE 49463 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49464 -#define SPELL_RUBY_DRAKE_SADDLE 49464 //Allows you to ride on the back of an Amber Drake. ---> Dummy - -#define SPELL_RUBY_SEARING_WRATH 50232 //(60 yds) - Instant - Breathes a stream of fire at an enemy dragon, dealing 6800 to 9200 Fire damage and then jumping to additional dragons within 30 yards. Each jump increases the damage by 50%. Affects up to 5 total targets -#define SPELL_RUBY_EVASIVE_AURA 50248 //Instant - Allows the Ruby Drake to generate Evasive Charges when hit by hostile attacks and spells. -#define SPELL_RUBY_EVASIVE_MANEUVERS 50240 //Instant - 5 sec. cooldown - Allows your drake to dodge all incoming attacks and spells. Requires Evasive Charges to use. Each attack or spell dodged while this ability is active burns one Evasive Charge. Lasts 30 sec. or until all charges are exhausted. -//you do not have acces to until you kill Mage-Lord Urom -#define SPELL_RUBY_MARTYR 50253 //Instant - 10 sec. cooldown - Redirect all harmful spells cast at friendly drakes to yourself for 10 sec. - -/*Amber Drake, -(npc 27755) (item 37859) -(summoned by spell Amber Essence = 37859 ---> Call Amber Drake == 49461 ---> Summon 27755) -*/ -#define NPC_AMBER_DRAKE_VEHICLE 27755 -#define SPELL_RIDE_AMBER_DRAKE_QUE 49459 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49460 -#define SPELL_AMBER_DRAKE_SADDLE 49460 //Allows you to ride on the back of an Amber Drake. ---> Dummy - -#define SPELL_AMBER_SHOCK_LANCE 49840 //(60 yds) - Instant - Deals 4822 to 5602 Arcane damage and detonates all Shock Charges on an enemy dragon. Damage is increased by 6525 for each detonated. -#define SPELL_AMBER_STOP_TIME //Instant - 1 min cooldown - Halts the passage of time, freezing all enemy dragons in place for 10 sec. This attack applies 5 Shock Charges to each affected target. -//you do not have access to until you kill the Mage-Lord Urom. -#define SPELL_AMBER_TEMPORAL_RIFT 49592 //(60 yds) - Channeled - Channels a temporal rift on an enemy dragon for 10 sec. While trapped in the rift, all damage done to the target is increased by 100%. In addition, for every 15,000 damage done to a target affected by Temporal Rift, 1 Shock Charge is generated. - -/*Emerald Drake, -(npc 27692) (item 37815), - (summoned by spell Emerald Essence = 37815 ---> Call Emerald Drake == 49345 ---> Summon 27692) -*/ -#define NPC_EMERALD_DRAKE_VEHICLE 27692 -#define SPELL_RIDE_EMERALD_DRAKE_QUE 49427 //Apply Aura: Periodic Trigger, Interval: 3 seconds ---> 49346 -#define SPELL_EMERALD_DRAKE_SADDLE 49346 //Allows you to ride on the back of an Amber Drake. ---> Dummy - -#define SPELL_EMERALD_LEECHING_POISON 50328 //(60 yds) - Instant - Poisons the enemy dragon, leeching 1300 to the caster every 2 sec. for 12 sec. Stacks up to 3 times. -#define SPELL_EMERALD_TOUCH_THE_NIGHTMARE 50341 //(60 yds) - Instant - Consumes 30% of the caster's max health to inflict 25,000 nature damage to an enemy dragon and reduce the damage it deals by 25% for 30 sec. -// you do not have access to until you kill the Mage-Lord Urom -#define SPELL_EMERALD_DREAM_FUNNEL 50344 //(60 yds) - Channeled - Transfers 5% of the caster's max health to a friendly drake every second for 10 seconds as long as the caster channels. - -struct TRINITY_DLL_DECL boss_eregosAI : public ScriptedAI -{ - boss_eregosAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase; - - void Reset() {} - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - phase =1; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; - -CreatureAI* GetAI_boss_eregos(Creature* pCreature) -{ - return new boss_eregosAI (pCreature); -} - -void AddSC_boss_eregos() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_eregos"; - newscript->GetAI = &GetAI_boss_eregos; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp deleted file mode 100644 index 1f34ecefbbd..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_urom.cpp +++ /dev/null @@ -1,87 +0,0 @@ -/* Script Data Start -SDName: Boss urom -SDAuthor: LordVanMartin -SD%Complete: 1% -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ARCANE_SHIELD 53813 //Dummy --> Channeled, shields the caster from damage. -#define SPELL_EMPOWERED_ARCANE_EXPLOSION 51110 -#define SPELL_EMPOWERED_ARCANE_EXPLOSION_2 59377 -#define SPELL_FROSTBOMB 51103 //Urom throws a bomb, hitting its target with the highest aggro which inflict directly 650 frost damage and drops a frost zone on the ground. This zone deals 650 frost damage per second and reduce the movement speed by 35%. Lasts 1 minute. -#define SPELL_SUMMON_MENAGERIE 50476 //Summons an assortment of creatures and teleports the caster to safety. -#define SPELL_SUMMON_MENAGERIE_2 50495 -#define SPELL_SUMMON_MENAGERIE_3 50496 -#define SPELL_TELEPORT 51112 //Teleports to the center of Oculus -#define SPELL_TIME_BOMB 51121 //Deals arcane damage to a random player, and after 6 seconds, deals zone damage to nearby equal to the health missing of the target afflicted by the debuff. -#define SPELL_TIME_BOMB_2 59376 - -//Yell -#define SAY_AGGRO -1578012 -#define SAY_KILL_1 -1578013 -#define SAY_KILL_2 -1578014 -#define SAY_KILL_3 -1578015 -#define SAY_DEATH -1578016 -#define SAY_EXPLOSION_1 -1578017 -#define SAY_EXPLOSION_2 -1578018 -#define SAY_SUMMON_1 -1578019 -#define SAY_SUMMON_2 -1578020 -#define SAY_SUMMON_3 -1578021 - -struct TRINITY_DLL_DECL boss_uromAI : public ScriptedAI -{ - boss_uromAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_KILL_1, m_creature);break; - case 1: DoScriptText(SAY_KILL_2, m_creature);break; - case 2: DoScriptText(SAY_KILL_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_urom(Creature* pCreature) -{ - return new boss_uromAI (pCreature); -} - -void AddSC_boss_urom() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_urom"; - newscript->GetAI = &GetAI_boss_urom; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp deleted file mode 100644 index 299c54dd8dc..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/oculus/boss_varos.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* Script Data Start -SDName: Boss varos -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ENERGIZE_CORES 50785 //Damage 5938 to 6562, effec2 Triggers 54069, effect3 Triggers 56251 -#define SPELL_ENERGIZE_CORES_TRIGGER_1 54069 -#define SPELL_ENERGIZE_CORES_TRIGGER_2 56251 -#define SPELL_ENERGIZE_CORES_2 59372 //Damage 9025 to 9975, effect2 Triggers 54069, effect 56251 -#define SPELL_CALL_AZURE_RING_CAPTAIN 51002 //Effect Send Event (12229) -#define SPELL_CALL_AZURE_RING_CAPTAIN_2 51006 //Effect Send Event (10665) -#define SPELL_CALL_AZURE_RING_CAPTAIN_3 51007 //Effect Send Event (18454) -#define SPELL_CALL_AZURE_RING_CAPTAIN_4 51008 //Effect Send Event (18455) -#define SPELL_CALL_AMPLIFY_MAGIC 51054 -#define SPELL_CALL_AMPLIFY_MAGIC_2 59371 - -//Yell -#define SAY_AGGRO -1578022 -#define SAY_KILL_1 -1578023 -#define SAY_KILL_2 -1578024 -#define SAY_DEATH -1578025 -#define SAY_STRIKE_1 -1578026 -#define SAY_STRIKE_2 -1578027 -#define SAY_STRIKE_3 -1578028 -#define SAY_SPAWN -1578029 - - -struct TRINITY_DLL_DECL boss_varosAI : public ScriptedAI -{ - boss_varosAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature);break; - case 1: DoScriptText(SAY_KILL_2, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_varos(Creature* pCreature) -{ - return new boss_varosAI (pCreature); -} - -void AddSC_boss_varos() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_varos"; - newscript->GetAI = &GetAI_boss_varos; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h b/src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h deleted file mode 100644 index 0b63a52d866..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/oculus/def_oculus.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_OCULUS_H -#define DEF_OCULUS_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp b/src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp deleted file mode 100644 index b5ceee9e5ed..00000000000 --- a/src/bindings/scripts/scripts/zone/nexus/oculus/instance_oculus.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_oculus.h" - -struct TRINITY_DLL_DECL instance_oculus : public ScriptedInstance -{ - instance_oculus(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_oculus(Map* pMap) -{ - return new instance_oculus(pMap); -} - -void AddSC_instance_oculus() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_oculus"; - newscript->GetInstanceData = &GetInstanceData_instance_oculus; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp b/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp deleted file mode 100644 index 01ba351ff99..00000000000 --- a/src/bindings/scripts/scripts/zone/obsidian_sanctum/boss_sartharion.cpp +++ /dev/null @@ -1,1153 +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 Sartharion -SD%Complete: 70% -SDComment: Flame wave, achievement and portal events need to be implemented -SDCategory: Obsidian Sanctum -EndScriptData */ - -#include "precompiled.h" -#include "def_obsidian_sanctum.h" - -enum -{ - //Sartharion Yell - SAY_SARTHARION_AGGRO = -1615018, - SAY_SARTHARION_BERSERK = -1615019, - SAY_SARTHARION_BREATH = -1615020, - SAY_SARTHARION_CALL_SHADRON = -1615021, - SAY_SARTHARION_CALL_TENEBRON = -1615022, - SAY_SARTHARION_CALL_VESPERON = -1615023, - SAY_SARTHARION_DEATH = -1615024, - SAY_SARTHARION_SPECIAL_1 = -1615025, - SAY_SARTHARION_SPECIAL_2 = -1615026, - SAY_SARTHARION_SPECIAL_3 = -1615027, - SAY_SARTHARION_SPECIAL_4 = -1615028, - SAY_SARTHARION_SLAY_1 = -1615029, - SAY_SARTHARION_SLAY_2 = -1615030, - SAY_SARTHARION_SLAY_3 = -1615031, - - WHISPER_LAVA_CHURN = -1615032, - - WHISPER_SHADRON_DICIPLE = -1615008, - WHISPER_VESPERON_DICIPLE = -1615041, - WHISPER_HATCH_EGGS = -1615017, - WHISPER_OPEN_PORTAL = -1615042, // whisper, shared by two dragons - - //Sartharion Spells - SPELL_BERSERK = 61632, // Increases the caster's attack speed by 150% and all damage it deals by 500% for 5 min. - SPELL_CLEAVE = 56909, // Inflicts 35% weapon damage to an enemy and its nearest allies, affecting up to 10 targets. - SPELL_FLAME_BREATH = 56908, // Inflicts 8750 to 11250 Fire damage to enemies in a cone in front of the caster. - SPELL_FLAME_BREATH_H = 58956, // Inflicts 10938 to 14062 Fire damage to enemies in a cone in front of the caster. - SPELL_TAIL_LASH = 56910, // A sweeping tail strike hits all enemies behind the caster, inflicting 3063 to 3937 damage and stunning them for 2 sec. - SPELL_TAIL_LASH_H = 58957, // A sweeping tail strike hits all enemies behind the caster, inflicting 4375 to 5625 damage and stunning them for 2 sec. - SPELL_WILL_OF_SARTHARION = 61254, // Sartharion's presence bolsters the resolve of the Twilight Drakes, increasing their total health by 25%. This effect also increases Sartharion's health by 25%. - SPELL_LAVA_STRIKE = 57571, // (Real spell casted should be 57578) 57571 then trigger visual missile, then summon Lava Blaze on impact(spell 57572) - SPELL_TWILIGHT_REVENGE = 60639, - - SPELL_PYROBUFFET = 56916, // currently used for hard enrage after 15 minutes - SPELL_PYROBUFFET_RANGE = 58907, // possibly used when player get too far away from dummy creatures (2x Creature entry 30494) - - SPELL_TWILIGHT_SHIFT_ENTER = 57620, // enter phase. Player get this when click GO - SPELL_TWILIGHT_SHIFT_REMOVAL = 61187, // leave phase - SPELL_TWILIGHT_SHIFT_REMOVAL_ALL = 61190, // leave phase (probably version to make all leave) - - //Mini bosses common spells - SPELL_TWILIGHT_RESIDUE = 61885, // makes immune to shadow damage, applied when leave phase - - //Miniboses (Vesperon, Shadron, Tenebron) - SPELL_SHADOW_BREATH_H = 59126, // Inflicts 8788 to 10212 Fire damage to enemies in a cone in front of the caster. - SPELL_SHADOW_BREATH = 57570, // Inflicts 6938 to 8062 Fire damage to enemies in a cone in front of the caster. - - SPELL_SHADOW_FISSURE_H = 59127, // Deals 9488 to 13512 Shadow damage to any enemy within the Shadow fissure after 5 sec. - SPELL_SHADOW_FISSURE = 57579, // Deals 6188 to 8812 Shadow damage to any enemy within the Shadow fissure after 5 sec. - - //Vesperon - //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal open multiple times - NPC_ACOLYTE_OF_VESPERON = 31219, // Acolyte of Vesperon - SPELL_POWER_OF_VESPERON = 61251, // Vesperon's presence decreases the maximum health of all enemies by 25%. - SPELL_TWILIGHT_TORMENT_VESP = 57948, // (Shadow only) trigger 57935 then 57988 - SPELL_TWILIGHT_TORMENT_VESP_ACO = 58853, // (Fire and Shadow) trigger 58835 then 57988 - - //Shadron - //In portal is a disciple, when disciple killed remove Power_of_vesperon, portal open multiple times - NPC_ACOLYTE_OF_SHADRON = 31218, // Acolyte of Shadron - SPELL_POWER_OF_SHADRON = 58105, // Shadron's presence increases Fire damage taken by all enemies by 100%. - SPELL_GIFT_OF_TWILIGTH_SHA = 57835, // TARGET_SCRIPT shadron - SPELL_GIFT_OF_TWILIGTH_SAR = 58766, // TARGET_SCRIPT sartharion - - //Tenebron - //in the portal spawns 6 eggs, if not killed in time (approx. 20s) they will hatch, whelps can cast 60708 - SPELL_POWER_OF_TENEBRON = 61248, // Tenebron's presence increases Shadow damage taken by all enemies by 100%. - //Tenebron, dummy spell - SPELL_SUMMON_TWILIGHT_WHELP = 58035, // doesn't work, will spawn NPC_TWILIGHT_WHELP - SPELL_SUMMON_SARTHARION_TWILIGHT_WHELP = 58826, // doesn't work, will spawn NPC_SHARTHARION_TWILIGHT_WHELP - - SPELL_HATCH_EGGS_H = 59189, - SPELL_HATCH_EGGS = 58542, - SPELL_HATCH_EGGS_EFFECT_H = 59190, - SPELL_HATCH_EGGS_EFFECT = 58685, - - //Whelps - NPC_TWILIGHT_WHELP = 30890, - NPC_SHARTHARION_TWILIGHT_WHELP = 31214, - SPELL_FADE_ARMOR = 60708, // Reduces the armor of an enemy by 1500 for 15s - - //flame tsunami - SPELL_FLAME_TSUNAMI = 57494, // the visual dummy - SPELL_FLAME_TSUNAMI_LEAP = 60241, // SPELL_EFFECT_138 some leap effect, causing caster to move in direction - SPELL_FLAME_TSUNAMI_DMG_AURA = 57492, // periodic damage, npc has this aura - - NPC_FLAME_TSUNAMI = 30616, // for the flame waves - NPC_LAVA_BLAZE = 30643, // adds spawning from flame strike - - //using these custom points for dragons start and end - POINT_ID_INIT = 100, - POINT_ID_LAND = 200 -}; - -struct Waypoint -{ - float m_fX, m_fY, m_fZ; -}; - -//each dragons special points. First where fly to before connect to connon, second where land point is. -Waypoint m_aTene[]= -{ - {3212.854, 575.597, 109.856}, //init - {3246.425, 565.367, 61.249} //end -}; - -Waypoint m_aShad[]= -{ - {3293.238, 472.223, 106.968}, - {3271.669, 526.907, 61.931} -}; - -Waypoint m_aVesp[]= -{ - {3193.310, 472.861, 102.697}, - {3227.268, 533.238, 59.995} -}; - -//points around raid "isle", counter clockwise. should probably be adjusted to be more alike -Waypoint m_aDragonCommon[]= -{ - {3214.012, 468.932, 98.652}, - {3244.950, 468.427, 98.652}, - {3283.520, 496.869, 98.652}, - {3287.316, 555.875, 98.652}, - {3250.479, 585.827, 98.652}, - {3209.969, 566.523, 98.652} -}; - -/*###### -## Boss Sartharion -######*/ - -struct TRINITY_DLL_DECL boss_sartharionAI : public ScriptedAI -{ - boss_sartharionAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - } - - ScriptedInstance* m_pInstance; - bool m_bIsHeroic; - - bool m_bIsBerserk; - bool m_bIsSoftEnraged; - - uint32 m_uiEnrageTimer; - bool m_bIsHardEnraged; - - uint32 m_uiTenebronTimer; - uint32 m_uiShadronTimer; - uint32 m_uiVesperonTimer; - - uint32 m_uiFlameTsunamiTimer; - uint32 m_uiFlameBreathTimer; - uint32 m_uiTailSweepTimer; - uint32 m_uiCleaveTimer; - uint32 m_uiLavaStrikeTimer; - - bool m_bHasCalledTenebron; - bool m_bHasCalledShadron; - bool m_bHasCalledVesperon; - - void Reset() - { - m_bIsBerserk = false; - m_bIsSoftEnraged = false; - - m_uiEnrageTimer = MINUTE*15*IN_MILISECONDS; - m_bIsHardEnraged = false; - - m_uiTenebronTimer = 30000; - m_uiShadronTimer = 75000; - m_uiVesperonTimer = 120000; - - m_uiFlameTsunamiTimer = 30000; - m_uiFlameBreathTimer = 20000; - m_uiTailSweepTimer = 20000; - m_uiCleaveTimer = 7000; - m_uiLavaStrikeTimer = 5000; - - m_bHasCalledTenebron = false; - m_bHasCalledShadron = false; - m_bHasCalledVesperon = false; - - if (m_creature->HasAura(SPELL_TWILIGHT_REVENGE)) - m_creature->RemoveAurasDueToSpell(SPELL_TWILIGHT_REVENGE); - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_SARTHARION_EVENT, NOT_STARTED); - } - - void Aggro(Unit* pWho) - { - DoScriptText(SAY_SARTHARION_AGGRO,m_creature); - DoZoneInCombat(); - - if (m_pInstance) - { - m_pInstance->SetData(TYPE_SARTHARION_EVENT, IN_PROGRESS); - FetchDragons(); - } - } - - void JustDied(Unit* pKiller) - { - DoScriptText(SAY_SARTHARION_DEATH,m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_SARTHARION_EVENT, DONE); - } - - void KilledUnit(Unit* pVictim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SARTHARION_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SARTHARION_SLAY_2, m_creature); break; - case 2: DoScriptText(SAY_SARTHARION_SLAY_3, m_creature); break; - } - } - - void FetchDragons() - { - Unit* pTene = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_TENEBRON)); - Unit* pShad = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_SHADRON)); - Unit* pVesp = Unit::GetUnit(*m_creature,m_pInstance->GetData64(DATA_VESPERON)); - - //if at least one of the dragons are alive and are being called - bool bCanUseWill = false; - - if (pTene && pTene->isAlive() && !pTene->getVictim()) - { - bCanUseWill = true; - pTene->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aTene[0].m_fX, m_aTene[0].m_fY, m_aTene[0].m_fZ); - - if (!pTene->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - pTene->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - if (pShad && pShad->isAlive() && !pShad->getVictim()) - { - bCanUseWill = true; - pShad->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aShad[0].m_fX, m_aShad[0].m_fY, m_aShad[0].m_fZ); - - if (!pShad->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - pShad->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - if (pVesp && pVesp->isAlive() && !pVesp->getVictim()) - { - bCanUseWill = true; - pVesp->GetMotionMaster()->MovePoint(POINT_ID_INIT, m_aVesp[0].m_fX, m_aVesp[0].m_fY, m_aVesp[0].m_fZ); - - if (!pVesp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - pVesp->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - if (bCanUseWill) - DoCast(m_creature, SPELL_WILL_OF_SARTHARION); - } - - void CallDragon(uint32 uiDataId) - { - if (m_pInstance) - { - Creature* pTemp = Unit::GetCreature((*m_creature),m_pInstance->GetData64(uiDataId)); - - if (pTemp && pTemp->isAlive() && !pTemp->getVictim()) - { - if (pTemp->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) - pTemp->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - - if (pTemp->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - pTemp->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - int32 iTextId = 0; - - switch(pTemp->GetEntry()) - { - case NPC_TENEBRON: - iTextId = SAY_SARTHARION_CALL_TENEBRON; - pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aTene[1].m_fX, m_aTene[1].m_fY, m_aTene[1].m_fZ); - break; - case NPC_SHADRON: - iTextId = SAY_SARTHARION_CALL_SHADRON; - pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aShad[1].m_fX, m_aShad[1].m_fY, m_aShad[1].m_fZ); - break; - case NPC_VESPERON: - iTextId = SAY_SARTHARION_CALL_VESPERON; - pTemp->GetMotionMaster()->MovePoint(POINT_ID_LAND, m_aVesp[1].m_fX, m_aVesp[1].m_fY, m_aVesp[1].m_fZ); - break; - } - - DoScriptText(iTextId, m_creature); - } - } - } - - void SendFlameTsunami() - { - Map* pMap = m_creature->GetMap(); - - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - - if (!PlayerList.isEmpty()) - { - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()->isAlive()) - DoScriptText(WHISPER_LAVA_CHURN,m_creature,i->getSource()); - } - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //spell will target dragons, if they are still alive at 35% - if (!m_bIsBerserk && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 35) - { - DoScriptText(SAY_SARTHARION_BERSERK,m_creature); - DoCast(m_creature,SPELL_BERSERK); - m_bIsBerserk = true; - } - - //soft enrage - if (!m_bIsSoftEnraged && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) <= 10) - { - // TODO - m_bIsSoftEnraged = true; - } - - // hard enrage - if (!m_bIsHardEnraged) - { - if (m_uiEnrageTimer < uiDiff) - { - DoCast(m_creature, SPELL_PYROBUFFET, true); - m_bIsHardEnraged = true; - } - else - m_uiEnrageTimer -= uiDiff; - } - - // flame tsunami - if (m_uiFlameTsunamiTimer < uiDiff) - { - SendFlameTsunami(); - m_uiFlameTsunamiTimer = 30000; - } - else - m_uiFlameTsunamiTimer -= uiDiff; - - // flame breath - if (m_uiFlameBreathTimer < uiDiff) - { - DoScriptText(SAY_SARTHARION_BREATH, m_creature); - DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_FLAME_BREATH_H : SPELL_FLAME_BREATH); - m_uiFlameBreathTimer = 25000 + rand()%10000; - } - else - m_uiFlameBreathTimer -= uiDiff; - - // Tail Sweep - if (m_uiTailSweepTimer < uiDiff) - { - DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_TAIL_LASH_H : SPELL_TAIL_LASH); - m_uiTailSweepTimer = 15000 + rand()%5000; - } - else - m_uiTailSweepTimer -= uiDiff; - - // Cleave - if (m_uiCleaveTimer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_CLEAVE); - m_uiCleaveTimer = 7000 + rand()%3000; - } - else - m_uiCleaveTimer -= uiDiff; - - // Lavas Strike - if (m_uiLavaStrikeTimer < uiDiff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(pTarget, SPELL_LAVA_STRIKE); - - switch(rand()%15) - { - case 0: DoScriptText(SAY_SARTHARION_SPECIAL_1, m_creature); break; - case 1: DoScriptText(SAY_SARTHARION_SPECIAL_2, m_creature); break; - case 2: DoScriptText(SAY_SARTHARION_SPECIAL_3, m_creature); break; - } - } - m_uiLavaStrikeTimer = 5000 + rand()%15000; - } - else - m_uiLavaStrikeTimer -= uiDiff; - - // call tenebron - if (!m_bHasCalledTenebron && m_uiTenebronTimer < uiDiff) - { - CallDragon(DATA_TENEBRON); - m_bHasCalledTenebron = true; - } - else - m_uiTenebronTimer -= uiDiff; - - // call shadron - if (!m_bHasCalledShadron && m_uiShadronTimer < uiDiff) - { - CallDragon(DATA_SHADRON); - m_bHasCalledShadron = true; - } - else - m_uiShadronTimer -= uiDiff; - - // call vesperon - if (!m_bHasCalledVesperon && m_uiVesperonTimer < uiDiff) - { - CallDragon(DATA_VESPERON); - m_bHasCalledVesperon = true; - } - else - m_uiVesperonTimer -= uiDiff; - - DoMeleeAttackIfReady(); - - EnterEvadeIfOutOfCombatArea(uiDiff); - } -}; - -CreatureAI* GetAI_boss_sartharion(Creature* pCreature) -{ - return new boss_sartharionAI(pCreature); -} - -enum TeneText -{ - SAY_TENEBRON_AGGRO = -1615009, - SAY_TENEBRON_SLAY_1 = -1615010, - SAY_TENEBRON_SLAY_2 = -1615011, - SAY_TENEBRON_DEATH = -1615012, - SAY_TENEBRON_BREATH = -1615013, - SAY_TENEBRON_RESPOND = -1615014, - SAY_TENEBRON_SPECIAL_1 = -1615015, - SAY_TENEBRON_SPECIAL_2 = -1615016 -}; - -enum ShadText -{ - SAY_SHADRON_AGGRO = -1615000, - SAY_SHADRON_SLAY_1 = -1615001, - SAY_SHADRON_SLAY_2 = -1615002, - SAY_SHADRON_DEATH = -1615003, - SAY_SHADRON_BREATH = -1615004, - SAY_SHADRON_RESPOND = -1615005, - SAY_SHADRON_SPECIAL_1 = -1615006, - SAY_SHADRON_SPECIAL_2 = -1615007 -}; - -enum VespText -{ - SAY_VESPERON_AGGRO = -1615033, - SAY_VESPERON_SLAY_1 = -1615034, - SAY_VESPERON_SLAY_2 = -1615035, - SAY_VESPERON_DEATH = -1615036, - SAY_VESPERON_BREATH = -1615037, - SAY_VESPERON_RESPOND = -1615038, - SAY_VESPERON_SPECIAL_1 = -1615039, - SAY_VESPERON_SPECIAL_2 = -1615040 -}; - -//to control each dragons common abilities -struct TRINITY_DLL_DECL dummy_dragonAI : public ScriptedAI -{ - dummy_dragonAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - } - - ScriptedInstance* m_pInstance; - bool m_bIsHeroic; - - uint32 m_uiWaypointId; - uint32 m_uiMoveNextTimer; - int32 m_iPortalRespawnTime; - bool m_bCanMoveFree; - - void Reset() - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - m_uiWaypointId = 0; - m_uiMoveNextTimer = 500; - m_iPortalRespawnTime = 30000; - m_bCanMoveFree = false; - } - - void MovementInform(uint32 uiType, uint32 uiPointId) - { - if (!m_pInstance || uiType != POINT_MOTION_TYPE) - return; - - debug_log("dummy_dragonAI: %s reached point %u", m_creature->GetName(), uiPointId); - - //if healers messed up the raid and we was already initialized - if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) - { - EnterEvadeMode(); - return; - } - - //this is end, if we reach this, don't do much - if (uiPointId == POINT_ID_LAND) - { - m_creature->GetMotionMaster()->Clear(); - m_bCanMoveFree = false; - return; - } - - //get amount of common points - uint32 uiCommonWPCount = sizeof(m_aDragonCommon)/sizeof(Waypoint); - - //increase - m_uiWaypointId = uiPointId+1; - - //if we have reached a point bigger or equal to count, it mean we must reset to point 0 - if (m_uiWaypointId >= uiCommonWPCount) - { - if (!m_bCanMoveFree) - m_bCanMoveFree = true; - - m_uiWaypointId = 0; - } - - m_uiMoveNextTimer = 500; - } - - //used when open portal and spawn mobs in phase - void DoRaidWhisper(int32 iTextId) - { - Map* pMap = m_creature->GetMap(); - - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - - if (!PlayerList.isEmpty()) - { - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - DoScriptText(iTextId, m_creature, i->getSource()); - } - } - } - - //"opens" the portal and does the "opening" whisper - void OpenPortal() - { - int32 iTextId = 0; - - //there are 4 portal spawn locations, each are expected to be spawned with negative spawntimesecs in database - - //using a grid search here seem to be more efficient than caching all four guids - //in instance script and calculate range to each. - GameObject* pPortal = m_creature->FindNearestGameObject(GO_TWILIGHT_PORTAL,50.0f); - - switch(m_creature->GetEntry()) - { - case NPC_TENEBRON: - iTextId = WHISPER_HATCH_EGGS; - break; - case NPC_SHADRON: - case NPC_VESPERON: - iTextId = WHISPER_OPEN_PORTAL; - break; - } - - DoRaidWhisper(iTextId); - - //By using SetRespawnTime() we will actually "spawn" the object with our defined time. - //Once time is up, portal will disappear again. - if (pPortal && !pPortal->isSpawned()) - pPortal->SetRespawnTime(m_iPortalRespawnTime); - - //Unclear what are expected to happen if one drake has a portal open already - //Refresh respawnTime so time again are set to 30secs? - } - - //Removes each drakes unique debuff from players - void RemoveDebuff(uint32 uiSpellId) - { - Map* pMap = m_creature->GetMap(); - - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - - if (PlayerList.isEmpty()) - return; - - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - { - if (i->getSource()->isAlive() && i->getSource()->HasAura(uiSpellId)) - i->getSource()->RemoveAurasDueToSpell(uiSpellId); - } - } - } - - void JustDied(Unit* pKiller) - { - int32 iTextId = 0; - uint32 uiSpellId = 0; - - switch(m_creature->GetEntry()) - { - case NPC_TENEBRON: - iTextId = SAY_TENEBRON_DEATH; - uiSpellId = SPELL_POWER_OF_TENEBRON; - break; - case NPC_SHADRON: - iTextId = SAY_SHADRON_DEATH; - uiSpellId = SPELL_POWER_OF_SHADRON; - break; - case NPC_VESPERON: - iTextId = SAY_VESPERON_DEATH; - uiSpellId = SPELL_POWER_OF_VESPERON; - break; - } - - DoScriptText(iTextId, m_creature); - - RemoveDebuff(uiSpellId); - - if (m_pInstance) - { - // not if solo mini-boss fight - if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) != IN_PROGRESS) - return; - - // Twilight Revenge to main boss - if (Unit* pSartharion = Unit::GetUnit((*m_creature), m_pInstance->GetData64(DATA_SARTHARION))) - { - if (pSartharion->isAlive()) - m_creature->CastSpell(pSartharion,SPELL_TWILIGHT_REVENGE,true); - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (m_bCanMoveFree && m_uiMoveNextTimer) - { - if (m_uiMoveNextTimer < uiDiff) - { - m_creature->GetMotionMaster()->MovePoint(m_uiWaypointId, - m_aDragonCommon[m_uiWaypointId].m_fX, m_aDragonCommon[m_uiWaypointId].m_fY, m_aDragonCommon[m_uiWaypointId].m_fZ); - - debug_log("dummy_dragonAI: %s moving to point %u", m_creature->GetName(), m_uiWaypointId); - m_uiMoveNextTimer = 0; - } - else - m_uiMoveNextTimer -= uiDiff; - } - } -}; - -/*###### -## Mob Tenebron -######*/ - -struct TRINITY_DLL_DECL mob_tenebronAI : public dummy_dragonAI -{ - mob_tenebronAI(Creature* pCreature) : dummy_dragonAI(pCreature) { } - - uint32 m_uiShadowBreathTimer; - uint32 m_uiShadowFissureTimer; - uint32 m_uiHatchEggTimer; - - void Reset() - { - m_uiShadowBreathTimer = 20000; - m_uiShadowFissureTimer = 5000; - m_uiHatchEggTimer = 30000; - } - - void Aggro(Unit* pWho) - { - DoScriptText(SAY_TENEBRON_AGGRO, m_creature); - DoZoneInCombat(); - DoCast(m_creature, SPELL_POWER_OF_TENEBRON); - } - - void KilledUnit(Unit* pVictim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_TENEBRON_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_TENEBRON_SLAY_2, m_creature); break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - //if no target, update dummy and return - if (!UpdateVictim()) - { - dummy_dragonAI::UpdateAI(uiDiff); - return; - } - - // shadow fissure - if (m_uiShadowFissureTimer < uiDiff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, m_bIsHeroic ? SPELL_SHADOW_FISSURE_H : SPELL_SHADOW_FISSURE); - - m_uiShadowFissureTimer = 15000 + rand()%5000; - } - else - m_uiShadowFissureTimer -= uiDiff; - - // shadow breath - if (m_uiShadowBreathTimer < uiDiff) - { - DoScriptText(SAY_TENEBRON_BREATH, m_creature); - DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_SHADOW_BREATH_H : SPELL_SHADOW_BREATH); - m_uiShadowBreathTimer = 20000 + rand()%5000; - } - else - m_uiShadowBreathTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_tenebron(Creature* pCreature) -{ - return new mob_tenebronAI(pCreature); -} - -/*###### -## Mob Shadron -######*/ - -struct TRINITY_DLL_DECL mob_shadronAI : public dummy_dragonAI -{ - mob_shadronAI(Creature* pCreature) : dummy_dragonAI(pCreature) { } - - uint32 m_uiShadowBreathTimer; - uint32 m_uiShadowFissureTimer; - uint32 m_uiAcolyteShadronTimer; - - void Reset() - { - m_uiShadowBreathTimer = 20000; - m_uiShadowFissureTimer = 5000; - m_uiAcolyteShadronTimer = 60000; - - if (m_creature->HasAura(SPELL_TWILIGHT_TORMENT_VESP)) - m_creature->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP); - - if (m_creature->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) - m_creature->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); - } - - void Aggro(Unit* pWho) - { - DoScriptText(SAY_SHADRON_AGGRO,m_creature); - DoZoneInCombat(); - DoCast(m_creature, SPELL_POWER_OF_SHADRON); - } - - void KilledUnit(Unit* pVictim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SHADRON_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SHADRON_SLAY_2, m_creature); break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - //if no target, update dummy and return - if (!UpdateVictim()) - { - dummy_dragonAI::UpdateAI(uiDiff); - return; - } - - // shadow fissure - if (m_uiShadowFissureTimer < uiDiff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, m_bIsHeroic ? SPELL_SHADOW_FISSURE_H : SPELL_SHADOW_FISSURE); - - m_uiShadowFissureTimer = 15000 + rand()%5000; - } - else - m_uiShadowFissureTimer -= uiDiff; - - // shadow breath - if (m_uiShadowBreathTimer < uiDiff) - { - DoScriptText(SAY_SHADRON_BREATH, m_creature); - DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_SHADOW_BREATH_H : SPELL_SHADOW_BREATH); - m_uiShadowBreathTimer = 20000 + rand()%5000; - } - else - m_uiShadowBreathTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_shadron(Creature* pCreature) -{ - return new mob_shadronAI(pCreature); -} - -/*###### -## Mob Vesperon -######*/ - -struct TRINITY_DLL_DECL mob_vesperonAI : public dummy_dragonAI -{ - mob_vesperonAI(Creature* pCreature) : dummy_dragonAI(pCreature) { } - - uint32 m_uiShadowBreathTimer; - uint32 m_uiShadowFissureTimer; - uint32 m_uiAcolyteVesperonTimer; - - void Reset() - { - m_uiShadowBreathTimer = 20000; - m_uiShadowFissureTimer = 5000; - m_uiAcolyteVesperonTimer = 60000; - } - - void Aggro(Unit* pWho) - { - DoScriptText(SAY_VESPERON_AGGRO,m_creature); - DoZoneInCombat(); - DoCast(m_creature, SPELL_POWER_OF_VESPERON); - } - - void KilledUnit(Unit* pVictim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_VESPERON_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_VESPERON_SLAY_2, m_creature); break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - //if no target, update dummy and return - if (!UpdateVictim()) - { - dummy_dragonAI::UpdateAI(uiDiff); - return; - } - - // shadow fissure - if (m_uiShadowFissureTimer < uiDiff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, m_bIsHeroic ? SPELL_SHADOW_FISSURE_H : SPELL_SHADOW_FISSURE); - - m_uiShadowFissureTimer = 15000 + rand()%5000; - } - else - m_uiShadowFissureTimer -= uiDiff; - - // shadow breath - if (m_uiShadowBreathTimer < uiDiff) - { - DoScriptText(SAY_VESPERON_BREATH, m_creature); - DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_SHADOW_BREATH_H : SPELL_SHADOW_BREATH); - m_uiShadowBreathTimer = 20000 + rand()%5000; - } - else - m_uiShadowBreathTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_vesperon(Creature* pCreature) -{ - return new mob_vesperonAI(pCreature); -} - -/*###### -## Mob Acolyte of Shadron -######*/ - -struct TRINITY_DLL_DECL mob_acolyte_of_shadronAI : public ScriptedAI -{ - mob_acolyte_of_shadronAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - } - - ScriptedInstance* m_pInstance; - - void Reset() - { - if (m_pInstance) - { - //if not solo figth, buff main boss, else place debuff on mini-boss. both spells TARGET_SCRIPT - if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) - DoCast(m_creature, SPELL_GIFT_OF_TWILIGTH_SAR); - else - DoCast(m_creature, SPELL_GIFT_OF_TWILIGTH_SHA); - } - } - - void JustDied(Unit* killer) - { - if (m_pInstance) - { - Creature* pDebuffTarget = NULL; - - if (m_pInstance->GetData(TYPE_SARTHARION_EVENT) == IN_PROGRESS) - { - //not solo fight, so main boss has deduff - pDebuffTarget = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SARTHARION)); - - if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SAR)) - pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SAR); - } - else - { - //event not in progress, then solo fight and must remove debuff mini-boss - pDebuffTarget = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_SHADRON)); - - if (pDebuffTarget && pDebuffTarget->isAlive() && pDebuffTarget->HasAura(SPELL_GIFT_OF_TWILIGTH_SHA)) - pDebuffTarget->RemoveAurasDueToSpell(SPELL_GIFT_OF_TWILIGTH_SHA); - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_acolyte_of_shadron(Creature* pCreature) -{ - return new mob_acolyte_of_shadronAI(pCreature); -} - -/*###### -## Mob Acolyte of Vesperon -######*/ - -struct TRINITY_DLL_DECL mob_acolyte_of_vesperonAI : public ScriptedAI -{ - mob_acolyte_of_vesperonAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - } - - ScriptedInstance* m_pInstance; - - void Reset() - { - DoCast(m_creature, SPELL_TWILIGHT_TORMENT_VESP_ACO); - } - - void JustDied(Unit* pKiller) - { - // remove twilight torment on Vesperon - if (m_pInstance) - { - Creature* pVesperon = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_VESPERON)); - - if (pVesperon && pVesperon->isAlive() && pVesperon->HasAura(SPELL_TWILIGHT_TORMENT_VESP)) - pVesperon->RemoveAurasDueToSpell(SPELL_TWILIGHT_TORMENT_VESP); - } - } - - void UpdateAI(const uint32 uiDiff) - { - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_acolyte_of_vesperon(Creature* pCreature) -{ - return new mob_acolyte_of_vesperonAI(pCreature); -} - -/*###### -## Mob Twilight Eggs -######*/ - -struct TRINITY_DLL_DECL mob_twilight_eggsAI : public ScriptedAI -{ - mob_twilight_eggsAI(Creature* pCreature) : ScriptedAI(pCreature) { } - - uint32 m_uiFadeArmorTimer; - - void Reset() - { - m_uiFadeArmorTimer = 1000; - } - - void AttackStart(Unit* pWho) { } - void MoveInLineOfSight(Unit* pWho) { } -}; - -CreatureAI* GetAI_mob_twilight_eggs(Creature* pCreature) -{ - return new mob_twilight_eggsAI(pCreature); -} - -/*###### -## Mob Twilight Whelps -######*/ - -struct TRINITY_DLL_DECL mob_twilight_whelpAI : public ScriptedAI -{ - mob_twilight_whelpAI(Creature* pCreature) : ScriptedAI(pCreature) { } - - uint32 m_uiFadeArmorTimer; - - void Reset() - { - m_uiFadeArmorTimer = 1000; - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - // twilight torment - if (m_uiFadeArmorTimer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_FADE_ARMOR); - m_uiFadeArmorTimer = 5000 + rand()%5000; - } - else - m_uiFadeArmorTimer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_twilight_whelp(Creature* pCreature) -{ - return new mob_twilight_whelpAI(pCreature); -} - -void AddSC_boss_sartharion() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_sartharion"; - newscript->GetAI = &GetAI_boss_sartharion; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_vesperon"; - newscript->GetAI = &GetAI_mob_vesperon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_shadron"; - newscript->GetAI = &GetAI_mob_shadron; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_tenebron"; - newscript->GetAI = &GetAI_mob_tenebron; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_acolyte_of_shadron"; - newscript->GetAI = &GetAI_mob_acolyte_of_shadron; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_acolyte_of_vesperon"; - newscript->GetAI = &GetAI_mob_acolyte_of_vesperon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_twilight_eggs"; - newscript->GetAI = &GetAI_mob_twilight_eggs; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_twilight_whelp"; - newscript->GetAI = &GetAI_mob_twilight_whelp; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h b/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h deleted file mode 100644 index 461834a2386..00000000000 --- a/src/bindings/scripts/scripts/zone/obsidian_sanctum/def_obsidian_sanctum.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef DEF_OBSIDIAN_SANCTUM_H -#define DEF_OBSIDIAN_SANCTUM_H - -enum -{ - TYPE_SARTHARION_EVENT = 1, - - DATA_SARTHARION = 10, - DATA_TENEBRON = 11, - DATA_SHADRON = 12, - DATA_VESPERON = 13, - - NPC_SARTHARION = 28860, - NPC_TENEBRON = 30452, - NPC_SHADRON = 30451, - NPC_VESPERON = 30449, - GO_TWILIGHT_PORTAL = 193988 -}; - -#endif diff --git a/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp b/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp deleted file mode 100644 index 5dd3e06e585..00000000000 --- a/src/bindings/scripts/scripts/zone/obsidian_sanctum/instance_obsidian_sanctum.cpp +++ /dev/null @@ -1,97 +0,0 @@ -#include "precompiled.h" -#include "def_obsidian_sanctum.h" - -#define MAX_ENCOUNTER 1 - -/* Obsidian Sanctum encounters: -0 - Sartharion -*/ - -struct TRINITY_DLL_DECL instance_obsidian_sanctum : public ScriptedInstance -{ - instance_obsidian_sanctum(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - uint64 m_uiSartharionGUID; - uint64 m_uiTenebronGUID; - uint64 m_uiShadronGUID; - uint64 m_uiVesperonGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiSartharionGUID = 0; - m_uiTenebronGUID = 0; - m_uiShadronGUID = 0; - m_uiVesperonGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case NPC_SARTHARION: - m_uiSartharionGUID = pCreature->GetGUID(); - break; - //three dragons below set to active state once created. - //we must expect bigger raid to encounter main boss, and then three dragons must be active due to grid differences - case NPC_TENEBRON: - m_uiTenebronGUID = pCreature->GetGUID(); - pCreature->setActive(true); - break; - case NPC_SHADRON: - m_uiShadronGUID = pCreature->GetGUID(); - pCreature->setActive(true); - break; - case NPC_VESPERON: - m_uiVesperonGUID = pCreature->GetGUID(); - pCreature->setActive(true); - break; - } - } - - void SetData(uint32 uiType, uint32 uiData) - { - if (uiType == TYPE_SARTHARION_EVENT) - m_auiEncounter[0] = uiData; - } - - uint32 GetData(uint32 uiType) - { - if (uiType == TYPE_SARTHARION_EVENT) - return m_auiEncounter[0]; - - return 0; - } - - uint64 GetData64(uint32 uiData) - { - switch(uiData) - { - case DATA_SARTHARION: - return m_uiSartharionGUID; - case DATA_TENEBRON: - return m_uiTenebronGUID; - case DATA_SHADRON: - return m_uiShadronGUID; - case DATA_VESPERON: - return m_uiVesperonGUID; - } - return 0; - } -}; - -InstanceData* GetInstanceData_instance_obsidian_sanctum(Map* pMap) -{ - return new instance_obsidian_sanctum(pMap); -} - -void AddSC_instance_obsidian_sanctum() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_obsidian_sanctum"; - newscript->GetInstanceData = &GetInstanceData_instance_obsidian_sanctum; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp deleted file mode 100644 index fc855b74bd9..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/arcatraz.cpp +++ /dev/null @@ -1,521 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Arcatraz -SD%Complete: 60 -SDComment: Warden Mellichar, event controller for Skyriss event. Millhouse Manastorm. TODO: make better combatAI for Millhouse. -SDCategory: Tempest Keep, The Arcatraz -EndScriptData */ - -/* ContentData -npc_millhouse_manastorm -npc_warden_mellichar -mob_zerekethvoidzone -EndContentData */ - -#include "precompiled.h" -#include "def_arcatraz.h" - -/*##### -# npc_millhouse_manastorm -#####*/ - -#define SAY_INTRO_1 -1552010 -#define SAY_INTRO_2 -1552011 -#define SAY_WATER -1552012 -#define SAY_BUFFS -1552013 -#define SAY_DRINK -1552014 -#define SAY_READY -1552015 -#define SAY_KILL_1 -1552016 -#define SAY_KILL_2 -1552017 -#define SAY_PYRO -1552018 -#define SAY_ICEBLOCK -1552019 -#define SAY_LOWHP -1552020 -#define SAY_DEATH -1552021 -#define SAY_COMPLETE -1552022 - -#define SPELL_CONJURE_WATER 36879 -#define SPELL_ARCANE_INTELLECT 36880 -#define SPELL_ICE_ARMOR 36881 - -#define SPELL_ARCANE_MISSILES 33833 -#define SPELL_CONE_OF_COLD 12611 -#define SPELL_FIRE_BLAST 13341 -#define SPELL_FIREBALL 14034 -#define SPELL_FROSTBOLT 15497 -#define SPELL_PYROBLAST 33975 - -struct TRINITY_DLL_DECL npc_millhouse_manastormAI : public ScriptedAI -{ - npc_millhouse_manastormAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 EventProgress_Timer; - uint32 Phase; - bool Init; - bool LowHp; - - uint32 Pyroblast_Timer; - uint32 Fireball_Timer; - - void Reset() - { - EventProgress_Timer = 2000; - LowHp = false; - Init = false; - Phase = 1; - - Pyroblast_Timer = 1000; - Fireball_Timer = 2500; - - if (pInstance) - { - if (pInstance->GetData(TYPE_WARDEN_2) == DONE) - Init = true; - - if (pInstance->GetData(TYPE_HARBINGERSKYRISS) == DONE) - { - DoScriptText(SAY_COMPLETE, m_creature); - } - } - } - - void AttackStart(Unit* pWho) - { - if (m_creature->Attack(pWho, true)) - { - m_creature->AddThreat(pWho, 0.0f); - m_creature->SetInCombatWith(pWho); - pWho->SetInCombatWith(m_creature); - - m_creature->GetMotionMaster()->MoveChase(pWho, 25.0f); - } - } - - void EnterCombat(Unit *who) - { - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - /*for questId 10886 (heroic mode only) - if (pInstance && pInstance->GetData(TYPE_HARBINGERSKYRISS) != DONE) - ->FailQuest();*/ - } - - void UpdateAI(const uint32 diff) - { - if (!Init) - { - if (EventProgress_Timer < diff) - { - if (Phase < 8) - { - switch(Phase) - { - case 1: - DoScriptText(SAY_INTRO_1, m_creature); - EventProgress_Timer = 18000; - break; - case 2: - DoScriptText(SAY_INTRO_2, m_creature); - EventProgress_Timer = 18000; - break; - case 3: - DoScriptText(SAY_WATER, m_creature); - DoCast(m_creature,SPELL_CONJURE_WATER); - EventProgress_Timer = 7000; - break; - case 4: - DoScriptText(SAY_BUFFS, m_creature); - DoCast(m_creature,SPELL_ICE_ARMOR); - EventProgress_Timer = 7000; - break; - case 5: - DoScriptText(SAY_DRINK, m_creature); - DoCast(m_creature,SPELL_ARCANE_INTELLECT); - EventProgress_Timer = 7000; - break; - case 6: - DoScriptText(SAY_READY, m_creature); - EventProgress_Timer = 6000; - break; - case 7: - if (pInstance) - pInstance->SetData(TYPE_WARDEN_2,DONE); - Init = true; - break; - } - ++Phase; - } - } else EventProgress_Timer -= diff; - } - - if (!UpdateVictim()) - return; - - if (!LowHp && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 20)) - { - DoScriptText(SAY_LOWHP, m_creature); - LowHp = true; - } - - if (Pyroblast_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - DoScriptText(SAY_PYRO, m_creature); - - DoCast(m_creature->getVictim(),SPELL_PYROBLAST); - Pyroblast_Timer = 40000; - }else Pyroblast_Timer -=diff; - - if (Fireball_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FIREBALL); - Fireball_Timer = 4000; - }else Fireball_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_millhouse_manastorm(Creature* pCreature) -{ - return new npc_millhouse_manastormAI (pCreature); -} - -/*##### -# npc_warden_mellichar -#####*/ - -#define YELL_INTRO1 -1552023 -#define YELL_INTRO2 -1552024 -#define YELL_RELEASE1 -1552025 -#define YELL_RELEASE2A -1552026 -#define YELL_RELEASE2B -1552027 -#define YELL_RELEASE3 -1552028 -#define YELL_RELEASE4 -1552029 -#define YELL_WELCOME -1552030 - -//phase 2(acid mobs) -#define ENTRY_TRICKSTER 20905 -#define ENTRY_PH_HUNTER 20906 -//phase 3 -#define ENTRY_MILLHOUSE 20977 -//phase 4(acid mobs) -#define ENTRY_AKKIRIS 20908 -#define ENTRY_SULFURON 20909 -//phase 5(acid mobs) -#define ENTRY_TW_DRAK 20910 -#define ENTRY_BL_DRAK 20911 -//phase 6 -#define ENTRY_SKYRISS 20912 - -//TARGET_SCRIPT -#define SPELL_TARGET_ALPHA 36856 -#define SPELL_TARGET_BETA 36854 -#define SPELL_TARGET_DELTA 36857 -#define SPELL_TARGET_GAMMA 36858 -#define SPELL_TARGET_OMEGA 36852 -#define SPELL_BUBBLE_VISUAL 36849 - -struct TRINITY_DLL_DECL npc_warden_mellicharAI : public ScriptedAI -{ - npc_warden_mellicharAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - bool IsRunning; - bool CanSpawn; - - uint32 EventProgress_Timer; - uint32 Phase; - - void Reset() - { - IsRunning = false; - CanSpawn = false; - - EventProgress_Timer = 22000; - Phase = 1; - - m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); - DoCast(m_creature,SPELL_TARGET_OMEGA); - - if (pInstance) - pInstance->SetData(TYPE_HARBINGERSKYRISS,NOT_STARTED); - } - - void AttackStart(Unit* who) { } - - void MoveInLineOfSight(Unit *who) - { - if (IsRunning) - return; - - if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) - { - if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - if (who->GetTypeId() != TYPEID_PLAYER) - return; - - float attackRadius = m_creature->GetAttackDistance(who)/10; - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - EnterCombat(who); - } - } - - void EnterCombat(Unit *who) - { - DoScriptText(YELL_INTRO1, m_creature); - DoCast(m_creature,SPELL_BUBBLE_VISUAL); - - if (pInstance) - { - pInstance->SetData(TYPE_HARBINGERSKYRISS,IN_PROGRESS); - pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), false); - IsRunning = true; - } - } - - bool CanProgress() - { - if (pInstance) - { - if (Phase == 7 && pInstance->GetData(TYPE_WARDEN_4) == DONE) - return true; - if (Phase == 6 && pInstance->GetData(TYPE_WARDEN_3) == DONE) - return true; - if (Phase == 5 && pInstance->GetData(TYPE_WARDEN_2) == DONE) - return true; - if (Phase == 4) - return true; - if (Phase == 3 && pInstance->GetData(TYPE_WARDEN_1) == DONE) - return true; - if (Phase == 2 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS) - return true; - if (Phase == 1 && pInstance->GetData(TYPE_HARBINGERSKYRISS) == IN_PROGRESS) - return true; - return false; - } - return false; - } - - void DoPrepareForPhase() - { - if (pInstance) - { - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAurasByType(SPELL_AURA_DUMMY); - - switch(Phase) - { - case 2: - DoCast(m_creature,SPELL_TARGET_ALPHA); - pInstance->SetData(TYPE_WARDEN_1,IN_PROGRESS); - pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), false); - break; - case 3: - DoCast(m_creature,SPELL_TARGET_BETA); - pInstance->SetData(TYPE_WARDEN_2,IN_PROGRESS); - break; - case 5: - DoCast(m_creature,SPELL_TARGET_DELTA); - pInstance->SetData(TYPE_WARDEN_3,IN_PROGRESS); - break; - case 6: - DoCast(m_creature,SPELL_TARGET_GAMMA); - pInstance->SetData(TYPE_WARDEN_4,IN_PROGRESS); - break; - case 7: - pInstance->SetData(TYPE_WARDEN_5,IN_PROGRESS); - break; - } - CanSpawn = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!IsRunning) - return; - - if (EventProgress_Timer < diff) - { - if (pInstance) - { - if (pInstance->GetData(TYPE_HARBINGERSKYRISS) == FAIL) - Reset(); - } - - if (CanSpawn) - { - //continue beam omega pod, unless we are about to summon skyriss - if (Phase != 7) - DoCast(m_creature,SPELL_TARGET_OMEGA); - - switch(Phase) - { - case 2: - switch(rand()%2) - { - case 0: m_creature->SummonCreature(ENTRY_TRICKSTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - case 1: m_creature->SummonCreature(ENTRY_PH_HUNTER,478.326,-148.505,42.56,3.19,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - } - break; - case 3: - m_creature->SummonCreature(ENTRY_MILLHOUSE,413.292,-148.378,42.56,6.27,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); - break; - case 4: - DoScriptText(YELL_RELEASE2B, m_creature); - break; - case 5: - switch(rand()%2) - { - case 0: m_creature->SummonCreature(ENTRY_AKKIRIS,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - case 1: m_creature->SummonCreature(ENTRY_SULFURON,420.179,-174.396,42.58,0.02,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - } - break; - case 6: - switch(rand()%2) - { - case 0: m_creature->SummonCreature(ENTRY_TW_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - case 1: m_creature->SummonCreature(ENTRY_BL_DRAK,471.795,-174.58,42.58,3.06,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); break; - } - break; - case 7: - m_creature->SummonCreature(ENTRY_SKYRISS,445.763,-191.639,44.64,1.60,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,600000); - DoScriptText(YELL_WELCOME, m_creature); - break; - } - CanSpawn = false; - ++Phase; - } - if (CanProgress()) - { - switch(Phase) - { - case 1: - DoScriptText(YELL_INTRO2, m_creature); - EventProgress_Timer = 10000; - ++Phase; - break; - case 2: - DoScriptText(YELL_RELEASE1, m_creature); - DoPrepareForPhase(); - EventProgress_Timer = 7000; - break; - case 3: - DoScriptText(YELL_RELEASE2A, m_creature); - DoPrepareForPhase(); - EventProgress_Timer = 10000; - break; - case 4: - DoPrepareForPhase(); - EventProgress_Timer = 15000; - break; - case 5: - DoScriptText(YELL_RELEASE3, m_creature); - DoPrepareForPhase(); - EventProgress_Timer = 15000; - break; - case 6: - DoScriptText(YELL_RELEASE4, m_creature); - DoPrepareForPhase(); - EventProgress_Timer = 15000; - break; - case 7: - DoPrepareForPhase(); - EventProgress_Timer = 15000; - break; - } - } - } else EventProgress_Timer -= diff; - } -}; -CreatureAI* GetAI_npc_warden_mellichar(Creature* pCreature) -{ - return new npc_warden_mellicharAI (pCreature); -} - -/*##### -# mob_zerekethvoidzone (this script probably not needed in future -> `creature_template_addon`.`auras`='36120 0') -#####*/ - -#define SPELL_VOID_ZONE_DAMAGE 36120 - -struct TRINITY_DLL_DECL mob_zerekethvoidzoneAI : public ScriptedAI -{ - mob_zerekethvoidzoneAI(Creature *c) : ScriptedAI(c) {} - - void Reset() - { - m_creature->SetUInt32Value(UNIT_NPC_FLAGS,0); - m_creature->setFaction(16); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - DoCast(m_creature,SPELL_VOID_ZONE_DAMAGE); - } - - void EnterCombat(Unit* who) {} -}; -CreatureAI* GetAI_mob_zerekethvoidzoneAI(Creature* pCreature) -{ - return new mob_zerekethvoidzoneAI (pCreature); -} - -void AddSC_arcatraz() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_millhouse_manastorm"; - newscript->GetAI = &GetAI_npc_millhouse_manastorm; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="npc_warden_mellichar"; - newscript->GetAI = &GetAI_npc_warden_mellichar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_zerekethvoidzone"; - newscript->GetAI = &GetAI_mob_zerekethvoidzoneAI; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp deleted file mode 100644 index bcab1a6257f..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/boss_harbinger_skyriss.cpp +++ /dev/null @@ -1,312 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Harbinger_Skyriss -SD%Complete: 45 -SDComment: CombatAI not fully implemented. Timers will need adjustments. Need more docs on how event fully work. Reset all event and force start over if fail at one point? -SDCategory: Tempest Keep, The Arcatraz -EndScriptData */ - -/* ContentData -boss_harbinger_skyriss -boss_harbinger_skyriss_illusion -EndContentData */ - -#include "precompiled.h" -#include "def_arcatraz.h" - -#define SAY_INTRO -1552000 -#define SAY_AGGRO -1552001 -#define SAY_KILL_1 -1552002 -#define SAY_KILL_2 -1552003 -#define SAY_MIND_1 -1552004 -#define SAY_MIND_2 -1552005 -#define SAY_FEAR_1 -1552006 -#define SAY_FEAR_2 -1552007 -#define SAY_IMAGE -1552008 -#define SAY_DEATH -1552009 - -#define SPELL_FEAR 39415 - -#define SPELL_MIND_REND 36924 -#define H_SPELL_MIND_REND 39017 - -#define SPELL_DOMINATION 37162 -#define H_SPELL_DOMINATION 39019 - -#define H_SPELL_MANA_BURN 39020 - -#define SPELL_66_ILLUSION 36931 //entry 21466 -#define SPELL_33_ILLUSION 36932 //entry 21467 - -struct TRINITY_DLL_DECL boss_harbinger_skyrissAI : public ScriptedAI -{ - boss_harbinger_skyrissAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - Intro = false; - } - - ScriptedInstance *pInstance; - bool HeroicMode; - - bool Intro; - bool IsImage33; - bool IsImage66; - - uint32 Intro_Phase; - uint32 Intro_Timer; - uint32 MindRend_Timer; - uint32 Fear_Timer; - uint32 Domination_Timer; - uint32 ManaBurn_Timer; - - void Reset() - { - if (!Intro) - m_creature->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); - - IsImage33 = false; - IsImage66 = false; - - Intro_Phase = 1; - Intro_Timer = 5000; - MindRend_Timer = 3000; - Fear_Timer = 15000; - Domination_Timer = 30000; - ManaBurn_Timer = 25000; - } - - void MoveInLineOfSight(Unit *who) - { - if (!Intro) - { - return; - } - ScriptedAI::MoveInLineOfSight(who); - } - - void EnterCombat(Unit *who) {} - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - if (pInstance) - pInstance->SetData(TYPE_HARBINGERSKYRISS,DONE); - } - - void JustSummoned(Creature *summon) - { - if (!summon) - return; - if (IsImage66) - summon->SetHealth((summon->GetMaxHealth()*33)/100); - else - summon->SetHealth((summon->GetMaxHealth()*66)/100); - if (m_creature->getVictim()) - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - summon->AI()->AttackStart(target); - } - - void KilledUnit(Unit* victim) - { - //won't yell killing pet/other unit - if (victim->GetEntry() == 21436) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void DoSplit(uint32 val) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - DoScriptText(SAY_IMAGE, m_creature); - - if (val == 66) - DoCast(m_creature, SPELL_66_ILLUSION); - else - DoCast(m_creature, SPELL_33_ILLUSION); - } - - void UpdateAI(const uint32 diff) - { - if (!Intro) - { - if (!pInstance) - return; - - if (Intro_Timer < diff) - { - switch(Intro_Phase) - { - case 1: - DoScriptText(SAY_INTRO, m_creature); - pInstance->HandleGameObject(pInstance->GetData64(DATA_SPHERE_SHIELD), true); - ++Intro_Phase; - Intro_Timer = 25000; - break; - case 2: - DoScriptText(SAY_AGGRO, m_creature); - if (Unit *mellic = Unit::GetUnit(*m_creature,pInstance->GetData64(DATA_MELLICHAR))) - { - //should have a better way to do this. possibly spell exist. - mellic->setDeathState(JUST_DIED); - mellic->SetHealth(0); - pInstance->SetData(TYPE_SHIELD_OPEN,IN_PROGRESS); - } - ++Intro_Phase; - Intro_Timer = 3000; - break; - case 3: - m_creature->RemoveFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NOT_ATTACKABLE_2); - Intro = true; - break; - } - }else Intro_Timer -=diff; - } - - if (!UpdateVictim()) - return; - - if (!IsImage66 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 66)) - { - DoSplit(66); - IsImage66 = true; - } - if (!IsImage33 && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() <= 33)) - { - DoSplit(33); - IsImage33 = true; - } - - if (MindRend_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,HeroicMode ? H_SPELL_MIND_REND : SPELL_MIND_REND); - else - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_MIND_REND : SPELL_MIND_REND); - - MindRend_Timer = 8000; - }else MindRend_Timer -=diff; - - if (Fear_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_FEAR_1, m_creature); break; - case 1: DoScriptText(SAY_FEAR_2, m_creature); break; - } - - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,SPELL_FEAR); - else - DoCast(m_creature->getVictim(),SPELL_FEAR); - - Fear_Timer = 25000; - }else Fear_Timer -=diff; - - if (Domination_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_MIND_1, m_creature); break; - case 1: DoScriptText(SAY_MIND_2, m_creature); break; - } - - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,HeroicMode ? H_SPELL_DOMINATION : SPELL_DOMINATION); - else - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_DOMINATION : SPELL_DOMINATION); - - Domination_Timer = 16000+rand()%16000; - }else Domination_Timer -=diff; - - if (HeroicMode) - { - if (ManaBurn_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,H_SPELL_MANA_BURN); - - ManaBurn_Timer = 16000+rand()%16000; - }else ManaBurn_Timer -=diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_harbinger_skyriss(Creature* pCreature) -{ - return new boss_harbinger_skyrissAI (pCreature); -} - -#define SPELL_MIND_REND_IMAGE 36929 -#define H_SPELL_MIND_REND_IMAGE 39021 - -struct TRINITY_DLL_DECL boss_harbinger_skyriss_illusionAI : public ScriptedAI -{ - boss_harbinger_skyriss_illusionAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - bool HeroicMode; - - void Reset() { } - - void EnterCombat(Unit *who) { } -}; - -CreatureAI* GetAI_boss_harbinger_skyriss_illusion(Creature* pCreature) -{ - return new boss_harbinger_skyriss_illusionAI (pCreature); -} - -void AddSC_boss_harbinger_skyriss() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_harbinger_skyriss"; - newscript->GetAI = &GetAI_boss_harbinger_skyriss; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_harbinger_skyriss_illusion"; - newscript->GetAI = &GetAI_boss_harbinger_skyriss_illusion; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h deleted file mode 100644 index 3f8dee8bbd0..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/def_arcatraz.h +++ /dev/null @@ -1,21 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_ARCATRAZ_H -#define DEF_ARCATRAZ_H - -#define TYPE_ZEREKETH 1 -#define TYPE_DALLIAH 2 -#define TYPE_SOCCOTHRATES 3 -#define TYPE_HARBINGERSKYRISS 4 -#define TYPE_WARDEN_1 5 -#define TYPE_WARDEN_2 6 -#define TYPE_WARDEN_3 7 -#define TYPE_WARDEN_4 8 -#define TYPE_WARDEN_5 9 -#define DATA_MELLICHAR 10 -#define TYPE_SHIELD_OPEN 11 -#define DATA_SPHERE_SHIELD 12 -#endif - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp deleted file mode 100644 index 081c80c56e5..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/arcatraz/instance_arcatraz.cpp +++ /dev/null @@ -1,238 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Arcatraz -SD%Complete: 80 -SDComment: Mainly Harbringer Skyriss event -SDCategory: Tempest Keep, The Arcatraz -EndScriptData */ - -#include "precompiled.h" -#include "def_arcatraz.h" - -#define MAX_ENCOUNTER 9 - -#define CONTAINMENT_CORE_SECURITY_FIELD_ALPHA 184318 //door opened when Wrath-Scryer Soccothrates dies -#define CONTAINMENT_CORE_SECURITY_FIELD_BETA 184319 //door opened when Dalliah the Doomsayer dies -#define POD_ALPHA 183961 //pod first boss wave -#define POD_BETA 183963 //pod second boss wave -#define POD_DELTA 183964 //pod third boss wave -#define POD_GAMMA 183962 //pod fourth boss wave -#define POD_OMEGA 183965 //pod fifth boss wave -#define WARDENS_SHIELD 184802 // warden shield -#define SEAL_SPHERE 184802 //shield 'protecting' mellichar - -#define MELLICHAR 20904 //skyriss will kill this unit - - -/* Arcatraz encounters: -1 - Zereketh the Unbound event -2 - Dalliah the Doomsayer event -3 - Wrath-Scryer Soccothrates event -4 - Harbinger Skyriss event, 5 sub-events -*/ - -struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance -{ - instance_arcatraz(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - GameObject *Containment_Core_Security_Field_Alpha; - GameObject *Containment_Core_Security_Field_Beta; - GameObject *Pod_Alpha; - GameObject *Pod_Gamma; - GameObject *Pod_Beta; - GameObject *Pod_Delta; - GameObject *Pod_Omega; - GameObject *Wardens_Shield; - - uint64 GoSphereGUID; - uint64 MellicharGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - Containment_Core_Security_Field_Alpha = NULL; - Containment_Core_Security_Field_Beta = NULL; - Pod_Alpha = NULL; - Pod_Beta = NULL; - Pod_Delta = NULL; - Pod_Gamma = NULL; - Pod_Omega = NULL; - Wardens_Shield = NULL; - - GoSphereGUID = 0; - MellicharGUID = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - return true; - - return false; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case CONTAINMENT_CORE_SECURITY_FIELD_ALPHA: Containment_Core_Security_Field_Alpha = pGo; break; - case CONTAINMENT_CORE_SECURITY_FIELD_BETA: Containment_Core_Security_Field_Beta = pGo; break; - case SEAL_SPHERE: GoSphereGUID = pGo->GetGUID(); break; - case POD_ALPHA: Pod_Alpha = pGo; break; - case POD_BETA: Pod_Beta = pGo; break; - case POD_DELTA: Pod_Delta = pGo; break; - case POD_GAMMA: Pod_Gamma = pGo; break; - case POD_OMEGA: Pod_Omega = pGo; break; - //case WARDENS_SHIELD: Wardens_Shield = pGo; break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (pCreature->GetEntry() == MELLICHAR) - MellicharGUID = pCreature->GetGUID(); - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case TYPE_ZEREKETH: - m_auiEncounter[0] = data; - break; - - case TYPE_DALLIAH: - if (data == DONE) - if (Containment_Core_Security_Field_Beta) - Containment_Core_Security_Field_Beta->UseDoorOrButton(); - m_auiEncounter[1] = data; - break; - - case TYPE_SOCCOTHRATES: - if (data == DONE) - if (Containment_Core_Security_Field_Alpha) - Containment_Core_Security_Field_Alpha->UseDoorOrButton(); - m_auiEncounter[2] = data; - break; - - case TYPE_HARBINGERSKYRISS: - if (data == NOT_STARTED || data == FAIL) - { - m_auiEncounter[4] = NOT_STARTED; - m_auiEncounter[5] = NOT_STARTED; - m_auiEncounter[6] = NOT_STARTED; - m_auiEncounter[7] = NOT_STARTED; - m_auiEncounter[8] = NOT_STARTED; - } - m_auiEncounter[3] = data; - break; - - case TYPE_WARDEN_1: - if (data == IN_PROGRESS) - if (Pod_Alpha) - Pod_Alpha->UseDoorOrButton(); - m_auiEncounter[4] = data; - break; - - case TYPE_WARDEN_2: - if (data == IN_PROGRESS) - if (Pod_Beta) - Pod_Beta->UseDoorOrButton(); - m_auiEncounter[5] = data; - break; - - case TYPE_WARDEN_3: - if (data == IN_PROGRESS) - if (Pod_Delta) - Pod_Delta->UseDoorOrButton(); - m_auiEncounter[6] = data; - break; - - case TYPE_WARDEN_4: - if (data == IN_PROGRESS) - if (Pod_Gamma) - Pod_Gamma->UseDoorOrButton(); - m_auiEncounter[7] = data; - break; - - case TYPE_WARDEN_5: - if (data == IN_PROGRESS) - if (Pod_Omega) - Pod_Omega->UseDoorOrButton(); - m_auiEncounter[8] = data; - break; - - case TYPE_SHIELD_OPEN: - if (data == IN_PROGRESS) - if (Wardens_Shield) - Wardens_Shield->UseDoorOrButton(); - break; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_HARBINGERSKYRISS: - return m_auiEncounter[3]; - case TYPE_WARDEN_1: - return m_auiEncounter[4]; - case TYPE_WARDEN_2: - return m_auiEncounter[5]; - case TYPE_WARDEN_3: - return m_auiEncounter[6]; - case TYPE_WARDEN_4: - return m_auiEncounter[7]; - case TYPE_WARDEN_5: - return m_auiEncounter[8]; - } - return 0; - } - - uint64 GetData64(uint32 data) - { - switch(data) - { - case DATA_MELLICHAR: - return MellicharGUID; - case DATA_SPHERE_SHIELD: - return GoSphereGUID; - } - return 0; - } -}; - -InstanceData* GetInstanceData_instance_arcatraz(Map* pMap) -{ - return new instance_arcatraz(pMap); -} - -void AddSC_instance_arcatraz() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_arcatraz"; - newscript->GetInstanceData = &GetInstanceData_instance_arcatraz; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.cpp deleted file mode 100644 index c63fb1b8d58..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_high_botanist_freywinn.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_High_Botanist_Freywinn -SD%Complete: 90 -SDComment: some strange visual related to tree form(if aura lost before normal duration end). possible make summon&transform -process smoother(transform after delay) -SDCategory: Tempest Keep, The Botanica -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1553000 -#define SAY_KILL_1 -1553001 -#define SAY_KILL_2 -1553002 -#define SAY_TREE_1 -1553003 -#define SAY_TREE_2 -1553004 -#define SAY_DEATH -1553005 - -#define SPELL_TRANQUILITY 34550 -#define SPELL_TREE_FORM 34551 - -#define SPELL_SUMMON_FRAYER 34557 -#define ENTRY_FRAYER 19953 - -#define SPELL_PLANT_WHITE 34759 -#define SPELL_PLANT_GREEN 34761 -#define SPELL_PLANT_BLUE 34762 -#define SPELL_PLANT_RED 34763 - -struct TRINITY_DLL_DECL boss_high_botanist_freywinnAI : public ScriptedAI -{ - boss_high_botanist_freywinnAI(Creature *c) : ScriptedAI(c) {} - - std::list Adds_List; - - uint32 SummonSeedling_Timer; - uint32 TreeForm_Timer; - uint32 MoveCheck_Timer; - uint32 DeadAddsCount; - bool MoveFree; - - void Reset() - { - Adds_List.clear(); - - SummonSeedling_Timer = 6000; - TreeForm_Timer = 30000; - MoveCheck_Timer = 1000; - DeadAddsCount = 0; - MoveFree = true; - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == ENTRY_FRAYER) - Adds_List.push_back(summoned->GetGUID()); - } - - void DoSummonSeedling() - { - switch(rand()%4) - { - case 0: DoCast(m_creature,SPELL_PLANT_WHITE); break; - case 1: DoCast(m_creature,SPELL_PLANT_GREEN); break; - case 2: DoCast(m_creature,SPELL_PLANT_BLUE); break; - case 3: DoCast(m_creature,SPELL_PLANT_RED); break; - } - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (TreeForm_Timer < diff) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_TREE_1, m_creature); break; - case 1: DoScriptText(SAY_TREE_2, m_creature); break; - } - - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - m_creature->RemoveAllAuras(); - - DoCast(m_creature,SPELL_SUMMON_FRAYER,true); - DoCast(m_creature,SPELL_TRANQUILITY,true); - DoCast(m_creature,SPELL_TREE_FORM,true); - - m_creature->GetMotionMaster()->MoveIdle(); - MoveFree = false; - - TreeForm_Timer = 75000; - }else TreeForm_Timer -= diff; - - if (!MoveFree) - { - if (MoveCheck_Timer < diff) - { - if (!Adds_List.empty()) - { - for(std::list::iterator itr = Adds_List.begin(); itr != Adds_List.end(); ++itr) - { - if (Unit *temp = Unit::GetUnit(*m_creature,*itr)) - { - if (!temp->isAlive()) - { - Adds_List.erase(itr); - ++DeadAddsCount; - break; - } - } - } - } - - if (DeadAddsCount < 3 && TreeForm_Timer-30000 < diff) - DeadAddsCount = 3; - - if (DeadAddsCount >= 3) - { - Adds_List.clear(); - DeadAddsCount = 0; - - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - MoveFree = true; - } - MoveCheck_Timer = 500; - } - else MoveCheck_Timer -= diff; - - return; - } - - /*if (m_creature->HasAura(SPELL_TREE_FORM,0) || m_creature->HasAura(SPELL_TRANQUILITY,0)) - return;*/ - - //one random seedling every 5 secs, but not in tree form - if (SummonSeedling_Timer < diff) - { - DoSummonSeedling(); - SummonSeedling_Timer = 6000; - }else SummonSeedling_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_high_botanist_freywinn(Creature* pCreature) -{ - return new boss_high_botanist_freywinnAI (pCreature); -} - -void AddSC_boss_high_botanist_freywinn() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_high_botanist_freywinn"; - newscript->GetAI = &GetAI_boss_high_botanist_freywinn; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp deleted file mode 100644 index ddd5745f93c..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_laj.cpp +++ /dev/null @@ -1,205 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Laj -SD%Complete: 90 -SDComment: Immunities are wrong, must be adjusted to use resistance from creature_templates. Most spells require database support. -SDCategory: Tempest Keep, The Botanica -EndScriptData */ - -#include "precompiled.h" - -#define EMOTE_SUMMON -1553006 - -#define SPELL_ALLERGIC_REACTION 34697 -#define SPELL_TELEPORT_SELF 34673 - -#define SPELL_SUMMON_LASHER_1 34681 -#define SPELL_SUMMON_FLAYER_1 34682 -#define SPELL_SUMMON_LASHER_2 34684 -#define SPELL_SUMMON_FLAYER_2 34685 -#define SPELL_SUMMON_LASHER_3 34686 -#define SPELL_SUMMON_FLAYER_4 34687 -#define SPELL_SUMMON_LASHER_4 34688 -#define SPELL_SUMMON_FLAYER_3 34690 - -#define MODEL_DEFAULT 13109 -#define MODEL_ARCANE 14213 -#define MODEL_FIRE 13110 -#define MODEL_FROST 14112 -#define MODEL_NATURE 14214 - -struct TRINITY_DLL_DECL boss_lajAI : public ScriptedAI -{ - boss_lajAI(Creature *c) : ScriptedAI(c) {} - - bool CanSummon; - uint32 Teleport_Timer; - uint32 Summon_Timer; - uint32 Transform_Timer; - uint32 Allergic_Timer; - - void Reset() - { - m_creature->SetDisplayId(MODEL_DEFAULT); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - - CanSummon = false; - Teleport_Timer = 20000; - Summon_Timer = 2500; - Transform_Timer = 30000; - Allergic_Timer = 5000; - } - - void DoTransform() - { - switch(rand()%5) - { - case 0: - m_creature->SetDisplayId(MODEL_DEFAULT); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 1: - m_creature->SetDisplayId(MODEL_ARCANE); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 2: - m_creature->SetDisplayId(MODEL_FIRE); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 3: - m_creature->SetDisplayId(MODEL_FROST); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, false); - break; - case 4: - m_creature->SetDisplayId(MODEL_NATURE); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, false); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_NATURE, true); - break; - } - } - - void DoSummons() - { - switch(rand()%4) - { - case 0: - DoCast(m_creature,SPELL_SUMMON_LASHER_1,true); - DoCast(m_creature,SPELL_SUMMON_FLAYER_1,true); - break; - case 1: - DoCast(m_creature,SPELL_SUMMON_LASHER_2,true); - DoCast(m_creature,SPELL_SUMMON_FLAYER_2,true); - break; - case 2: - DoCast(m_creature,SPELL_SUMMON_LASHER_3,true); - DoCast(m_creature,SPELL_SUMMON_FLAYER_3,true); - break; - case 3: - DoCast(m_creature,SPELL_SUMMON_LASHER_4,true); - DoCast(m_creature,SPELL_SUMMON_FLAYER_4,true); - break; - } - CanSummon = false; - } - - void EnterCombat(Unit *who) - { - } - - void JustSummoned(Creature *summon) - { - if (summon && m_creature->getVictim()) - summon->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (CanSummon) - { - if (Summon_Timer < diff) - { - DoScriptText(EMOTE_SUMMON, m_creature); - DoSummons(); - Summon_Timer = 2500; - }else Summon_Timer -= diff; - } - - if (Allergic_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ALLERGIC_REACTION); - Allergic_Timer = 25000+rand()%15000; - }else Allergic_Timer -= diff; - - if (Teleport_Timer < diff) - { - DoCast(m_creature,SPELL_TELEPORT_SELF); - Teleport_Timer = 30000+rand()%10000; - CanSummon = true; - }else Teleport_Timer -= diff; - - if (Transform_Timer < diff) - { - DoTransform(); - Transform_Timer = 25000+rand()%15000; - }else Transform_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_laj(Creature* pCreature) -{ - return new boss_lajAI (pCreature); -} - -void AddSC_boss_laj() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_laj"; - newscript->GetAI = &GetAI_boss_laj; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.cpp deleted file mode 100644 index a9b111be839..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/botanica/boss_warp_splinter.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_Warp_Splinter -SD%Complete: 80 -SDComment: Includes Sapling (need some better control with these). -SDCategory: Tempest Keep, The Botanica -EndScriptData */ - -#include "precompiled.h" - -/*##### -# mob_treant (Sapling) -#####*/ - -#define SPELL_HEAL_FATHER 6262 - -struct TRINITY_DLL_DECL mob_treantAI : public ScriptedAI -{ - mob_treantAI (Creature *c) : ScriptedAI(c) - { - WarpGuid = 0; - } - - uint64 WarpGuid; - uint32 check_Timer; - - void Reset() - { - check_Timer = 0; - } - - void EnterCombat(Unit *who) {} - - void MoveInLineOfSight(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - { - if (WarpGuid && check_Timer < diff) - { - if (Unit *Warp = Unit::GetUnit(*m_creature, WarpGuid)) - { - if (m_creature->IsWithinMeleeRange(Warp,2.5f)) - { - int32 CurrentHP_Treant = (int32)m_creature->GetHealth(); - Warp->CastCustomSpell(Warp,SPELL_HEAL_FATHER,&CurrentHP_Treant, 0, 0, true,0 ,0, m_creature->GetGUID()); - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - m_creature->GetMotionMaster()->MoveFollow(Warp,0,0); - } - check_Timer = 1000; - }else check_Timer -= diff; - return; - } - - if (m_creature->getVictim()->GetGUID() != WarpGuid) - DoMeleeAttackIfReady(); - } -}; - -/*##### -# boss_warp_splinter -#####*/ - -#define SAY_AGGRO -1553007 -#define SAY_SLAY_1 -1553008 -#define SAY_SLAY_2 -1553009 -#define SAY_SUMMON_1 -1553010 -#define SAY_SUMMON_2 -1553011 -#define SAY_DEATH -1553012 - -#define WAR_STOMP 34716 -#define SUMMON_TREANTS 34727 // DBC: 34727, 34731, 34733, 34734, 34736, 34739, 34741 (with Ancestral Life spell 34742) // won't work (guardian summon) -#define ARCANE_VOLLEY (HeroicMode?39133:36705) - -#define CREATURE_TREANT 19949 - -#define TREANT_SPAWN_DIST 50 //50 yards from Warp Splinter's spawn point - -float treant_pos[6][3] = -{ - {24.301233, 427.221100, -27.060635}, - {16.795492, 359.678802, -27.355425}, - {53.493484, 345.381470, -26.196192}, - {61.867096, 439.362732, -25.921030}, - {109.861877, 423.201630, -27.356019}, - {106.780159, 355.582581, -27.593357} -}; - -struct TRINITY_DLL_DECL boss_warp_splinterAI : public ScriptedAI -{ - boss_warp_splinterAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = c->GetMap()->IsHeroic(); - Treant_Spawn_Pos_X = c->GetPositionX(); - Treant_Spawn_Pos_Y = c->GetPositionY(); - } - - uint32 War_Stomp_Timer; - uint32 Summon_Treants_Timer; - uint32 Arcane_Volley_Timer; - bool HeroicMode; - - float Treant_Spawn_Pos_X; - float Treant_Spawn_Pos_Y; - - void Reset() - { - War_Stomp_Timer = 25000 + rand()%15000; - Summon_Treants_Timer = 45000; - Arcane_Volley_Timer = 8000 + rand()%12000; - - m_creature->SetSpeed(MOVE_RUN, 0.7f, true); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void SummonTreants() - { - for(uint8 i = 0; i < 6; ++i) - { - float angle = (M_PI / 3) * i; - - float X = Treant_Spawn_Pos_X + TREANT_SPAWN_DIST * cos(angle); - float Y = Treant_Spawn_Pos_Y + TREANT_SPAWN_DIST * sin(angle); - float O = - m_creature->GetAngle(X,Y); - - if (Creature *pTreant = m_creature->SummonCreature(CREATURE_TREANT,treant_pos[i][0],treant_pos[i][1],treant_pos[i][2],O,TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN,25000)) - CAST_AI(mob_treantAI, pTreant->AI())->WarpGuid = m_creature->GetGUID(); - } - switch(rand()%2) - { - case 0: DoScriptText(SAY_SUMMON_1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON_2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Check for War Stomp - if (War_Stomp_Timer < diff) - { - DoCast(m_creature->getVictim(),WAR_STOMP); - War_Stomp_Timer = 25000 + rand()%15000; - }else War_Stomp_Timer -= diff; - - //Check for Arcane Volley - if (Arcane_Volley_Timer < diff) - { - DoCast(m_creature->getVictim(),ARCANE_VOLLEY); - Arcane_Volley_Timer = 20000 + rand()%15000; - }else Arcane_Volley_Timer -= diff; - - //Check for Summon Treants - if (Summon_Treants_Timer < diff) - { - SummonTreants(); - Summon_Treants_Timer = 45000; - }else Summon_Treants_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_warp_splinter(Creature* pCreature) -{ - return new boss_warp_splinterAI (pCreature); -} - -CreatureAI* GetAI_mob_treant(Creature* pCreature) -{ - return new mob_treantAI (pCreature); -} - -void AddSC_boss_warp_splinter() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_warp_splinter"; - newscript->GetAI = &GetAI_boss_warp_splinter; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_warp_splinter_treant"; - newscript->GetAI = &GetAI_mob_treant; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp deleted file mode 100644 index e57f3294a55..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_alar.cpp +++ /dev/null @@ -1,525 +0,0 @@ -/* Copyright(C) 2006 - 2008 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -*(at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: boss_alar -SD%Complete: 95 -SDComment: -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "precompiled.h" -#include "def_the_eye.h" - -#define SPELL_FLAME_BUFFET 34121 // Flame Buffet - every 1,5 secs in phase 1 if there is no victim in melee range and after Dive Bomb in phase 2 with same conditions -#define SPELL_FLAME_QUILLS 34229 // Randomly after changing position in phase after watching tonns of movies, set probability 20% -#define SPELL_REBIRTH 34342 // Rebirth - beginning of second phase(after loose all health in phase 1) -#define SPELL_REBIRTH_2 35369 // Rebirth(another, without healing to full HP) - after Dive Bomb in phase 2 -#define SPELL_MELT_ARMOR 35410 // Melt Armor - every 60 sec in phase 2 -#define SPELL_CHARGE 35412 // Charge - 30 sec cooldown -#define SPELL_DIVE_BOMB_VISUAL 35367 // Bosskillers says 30 sec cooldown, wowwiki says 30 sec colldown, DBM and BigWigs addons says ~47 sec -#define SPELL_DIVE_BOMB 35181 // after watching tonns of movies, set cooldown to 40+rand()%5. -#define SPELL_BERSERK 45078 // 10 minutes after phase 2 starts(id is wrong, but proper id is unknown) - -#define CREATURE_EMBER_OF_ALAR 19551 // Al'ar summons one Ember of Al'ar every position change in phase 1 and two after Dive Bomb. Also in phase 2 when Ember of Al'ar dies, boss loose 3% health. -#define SPELL_EMBER_BLAST 34133 // When Ember of Al'ar dies, it casts Ember Blast - -#define CREATURE_FLAME_PATCH_ALAR 20602 // Flame Patch - every 30 sec in phase 2 -#define SPELL_FLAME_PATCH 35380 // - -static float waypoint[6][3] = -{ - {340.15, 58.65, 17.71}, - {388.09, 31.54, 20.18}, - {388.18, -32.85, 20.18}, - {340.29, -60.19, 17.72}, - {332, 0.01, 39}, // better not use the same xy coord - {331, 0.01, -2.39} -}; - -enum WaitEventType -{ - WE_NONE = 0, - WE_DUMMY = 1, - WE_PLATFORM = 2, - WE_QUILL = 3, - WE_DIE = 4, - WE_REVIVE = 5, - WE_CHARGE = 6, - WE_METEOR = 7, - WE_DIVE = 8, - WE_LAND = 9, - WE_SUMMON = 10 -}; - -struct TRINITY_DLL_DECL boss_alarAI : public ScriptedAI -{ - boss_alarAI(Creature *c) : ScriptedAI(c) - { - pInstance =c->GetInstanceData(); - DefaultMoveSpeedRate = m_creature->GetSpeedRate(MOVE_RUN); - } - - ScriptedInstance *pInstance; - - WaitEventType WaitEvent; - uint32 WaitTimer; - - bool AfterMoving; - - uint32 Platforms_Move_Timer; - uint32 DiveBomb_Timer; - uint32 MeltArmor_Timer; - uint32 Charge_Timer; - uint32 FlamePatch_Timer; - uint32 Berserk_Timer; - - float DefaultMoveSpeedRate; - - bool Phase1; - bool ForceMove; - uint32 ForceTimer; - - int8 cur_wp; - - void Reset() - { - if (pInstance) - pInstance->SetData(DATA_ALAREVENT, NOT_STARTED); - - Berserk_Timer = 1200000; - Platforms_Move_Timer = 0; - - Phase1 = true; - WaitEvent = WE_NONE; - WaitTimer = 0; - AfterMoving = false; - ForceMove = false; - ForceTimer = 5000; - - cur_wp = 4; - - m_creature->SetDisplayId(m_creature->GetNativeDisplayId()); - m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate); - //m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); - //m_creature->SetFloatValue(UNIT_FIELD_COMBATREACH, 10); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->setActive(false); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_ALAREVENT, IN_PROGRESS); - - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); // after enterevademode will be set walk movement - DoZoneInCombat(); - m_creature->setActive(true); - } - - void JustDied(Unit *victim) - { - if (pInstance) - pInstance->SetData(DATA_ALAREVENT, DONE); - } - - void JustSummoned(Creature *summon) - { - if (summon->GetEntry() == CREATURE_EMBER_OF_ALAR) - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - summon->AI()->AttackStart(target); - } - - void MoveInLineOfSight(Unit *who) {} - - void AttackStart(Unit* who) - { - if (Phase1) - AttackStartNoMove(who); - else - ScriptedAI::AttackStart(who); - } - - void DamageTaken(Unit* pKiller, uint32 &damage) - { - if (damage >= m_creature->GetHealth() && Phase1) - { - damage = 0; - if (!WaitEvent) - { - WaitEvent = WE_DIE; - WaitTimer = 0; - m_creature->SetHealth(0); - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->AttackStop(); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, 0); - m_creature->SetSpeed(MOVE_RUN, 5.0f); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MovePoint(0, waypoint[5][0], waypoint[5][1], waypoint[5][2]); - } - } - } - - void SpellHit(Unit*, const SpellEntry *spell) - { - if (spell->Id == SPELL_DIVE_BOMB_VISUAL) - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - m_creature->SetDisplayId(11686); - //m_creature->SendUpdateObjectToAllExcept(NULL); - } - } - - void MovementInform(uint32 type, uint32 id) - { - if (type == POINT_MOTION_TYPE) - { - WaitTimer = 1; - AfterMoving = true; - ForceMove = false; - } - } - - void UpdateAI(const uint32 diff) - { - if (!m_creature->isInCombat()) // sometimes isincombat but !incombat, faction bug? - return; - - if (Berserk_Timer < diff) - { - m_creature->CastSpell(m_creature, SPELL_BERSERK, true); - Berserk_Timer = 60000; - }else Berserk_Timer -= diff; - - if (ForceMove) - { - if (ForceTimer < diff) - { - m_creature->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]); - ForceTimer = 5000; - }else ForceTimer -= diff; - - } - if (WaitEvent) - { - if (WaitTimer) - { - if (WaitTimer <= diff) - { - if (AfterMoving) - { - m_creature->GetMotionMaster()->MoveIdle(); - AfterMoving = false; - } - - switch(WaitEvent) - { - case WE_PLATFORM: - Platforms_Move_Timer = 30000+rand()%5000; - break; - case WE_QUILL: - m_creature->CastSpell(m_creature, SPELL_FLAME_QUILLS, true); - Platforms_Move_Timer = 1; - WaitTimer = 10000; - WaitEvent = WE_DUMMY; - return; - case WE_DIE: - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_DEAD); - WaitTimer = 5000; - WaitEvent = WE_REVIVE; - return; - case WE_REVIVE: - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, UNIT_STAND_STATE_STAND); - m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->SetSpeed(MOVE_RUN, DefaultMoveSpeedRate); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - DoResetThreat(); - DoZoneInCombat(); - m_creature->CastSpell(m_creature, SPELL_REBIRTH, true); - MeltArmor_Timer = 60000; - Charge_Timer = 7000; - DiveBomb_Timer = 40000+rand()%5000; - FlamePatch_Timer = 30000; - Phase1 = false; - break; - case WE_METEOR: - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, false); - m_creature->CastSpell(m_creature, SPELL_DIVE_BOMB_VISUAL, false); - WaitEvent = WE_DIVE; - WaitTimer = 4000; - return; - case WE_DIVE: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - m_creature->RemoveAurasDueToSpell(SPELL_DIVE_BOMB_VISUAL); - m_creature->CastSpell(target, SPELL_DIVE_BOMB, true); - float dist; - if (m_creature->IsWithinDist3d(target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 5.0f)) dist = 5.0f; - WaitTimer = 1000 + floor(dist / 80 * 1000.0f); - m_creature->GetMap()->CreatureRelocation(m_creature, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(),0.0f); - m_creature->StopMoving(); - WaitEvent = WE_LAND; - } - else - { - EnterEvadeMode(); - return; - } - case WE_LAND: - WaitEvent = WE_SUMMON; - WaitTimer = 2000; - return; - case WE_SUMMON: - for(uint8 i = 0; i < 2; ++i) - DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 10); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetDisplayId(m_creature->GetNativeDisplayId()); - m_creature->CastSpell(m_creature, SPELL_REBIRTH_2, true); - break; - case WE_DUMMY: - default: - break; - } - - WaitEvent = WE_NONE; - WaitTimer = 0; - }else WaitTimer -= diff; - } - return; - } - - if (Phase1) - { - if (m_creature->getThreatManager().getThreatList().empty()) - { - EnterEvadeMode(); - return; - } - - if (Platforms_Move_Timer < diff) - { - if (cur_wp == 4) - { - cur_wp = 0; - WaitEvent = WE_PLATFORM; - } - else - { - if (rand()%5) // next platform - { - DoSpawnCreature(CREATURE_EMBER_OF_ALAR, 0, 0, 0, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (cur_wp == 3) - cur_wp = 0; - else - cur_wp++; - WaitEvent = WE_PLATFORM; - } - else // flame quill - { - cur_wp = 4; - WaitEvent = WE_QUILL; - } - } - ForceMove = true; - ForceTimer = 5000; - m_creature->GetMotionMaster()->MovePoint(0, waypoint[cur_wp][0], waypoint[cur_wp][1], waypoint[cur_wp][2]); - WaitTimer = 0; - return; - }else Platforms_Move_Timer -= diff; - } - else - { - if (!UpdateVictim()) - return; - - if (Charge_Timer < diff) - { - Unit *target= SelectTarget(SELECT_TARGET_RANDOM, 1, 100, true); - if (target) - DoCast(target, SPELL_CHARGE); - Charge_Timer = 30000; - }else Charge_Timer -= diff; - - if (MeltArmor_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_MELT_ARMOR); - MeltArmor_Timer = 60000; - }else MeltArmor_Timer -= diff; - - if (DiveBomb_Timer < diff) - { - m_creature->AttackStop(); - m_creature->GetMotionMaster()->MovePoint(6, waypoint[4][0], waypoint[4][1], waypoint[4][2]); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFloatValue(UNIT_FIELD_BOUNDINGRADIUS, 50); - WaitEvent = WE_METEOR; - WaitTimer = 0; - DiveBomb_Timer = 40000+rand()%5000; - return; - }else DiveBomb_Timer -= diff; - - if (FlamePatch_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - Creature* Summoned = m_creature->SummonCreature(CREATURE_FLAME_PATCH_ALAR, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_DESPAWN, 120000); - if (Summoned) - { - Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Summoned->SetFloatValue(OBJECT_FIELD_SCALE_X, Summoned->GetFloatValue(OBJECT_FIELD_SCALE_X)*2.5f); - Summoned->SetDisplayId(11686); - Summoned->setFaction(m_creature->getFaction()); - Summoned->SetLevel(m_creature->getLevel()); - Summoned->CastSpell(Summoned, SPELL_FLAME_PATCH, false); - } - } - FlamePatch_Timer = 30000; - }else FlamePatch_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } - - void DoMeleeAttackIfReady() - { - if (m_creature->isAttackReady() && !m_creature->IsNonMeleeSpellCasted(false)) - { - if (m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - m_creature->AttackerStateUpdate(m_creature->getVictim()); - m_creature->resetAttackTimer(); - } - else - { - Unit *target = NULL; - target = m_creature->SelectNearestTarget(5); - if (Phase1 && target) - m_creature->AI()->AttackStart(target); - else - { - m_creature->CastSpell(m_creature, SPELL_FLAME_BUFFET, true); - m_creature->setAttackTimer(BASE_ATTACK, 1500); - } - } - } - } -}; - -CreatureAI* GetAI_boss_alar(Creature* pCreature) -{ - return new boss_alarAI(pCreature); -} - -struct TRINITY_DLL_DECL mob_ember_of_alarAI : public ScriptedAI -{ - mob_ember_of_alarAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - m_creature->SetUnitMovementFlags(MOVEMENTFLAG_LEVITATING); - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - } - - ScriptedInstance *pInstance; - bool toDie; - - void Reset() {toDie = false;} - void EnterCombat(Unit *who) {DoZoneInCombat();} - void EnterEvadeMode() {m_creature->setDeathState(JUST_DIED);} - - void DamageTaken(Unit* pKiller, uint32 &damage) - { - if (damage >= m_creature->GetHealth() && pKiller != m_creature && !toDie) - { - damage = 0; - m_creature->CastSpell(m_creature, SPELL_EMBER_BLAST, true); - m_creature->SetDisplayId(11686); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - if (pInstance && pInstance->GetData(DATA_ALAREVENT) == 2) - { - if (Unit* Alar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ALAR))) - { - int AlarHealth = Alar->GetHealth() - Alar->GetMaxHealth()*0.03; - if (AlarHealth > 0) - Alar->SetHealth(AlarHealth); - else - Alar->SetHealth(1); - } - } - toDie = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (toDie) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - //m_creature->SetVisibility(VISIBILITY_OFF); - } - - DoMeleeAttackIfReady(); - } - -}; - -CreatureAI* GetAI_mob_ember_of_alar(Creature* pCreature) -{ - return new mob_ember_of_alarAI(pCreature); -} - -struct TRINITY_DLL_DECL mob_flame_patch_alarAI : public ScriptedAI -{ - mob_flame_patch_alarAI(Creature *c) : ScriptedAI(c) {} - void Reset() {} - void EnterCombat(Unit *who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) {} -}; - -CreatureAI* GetAI_mob_flame_patch_alar(Creature* pCreature) -{ - return new mob_flame_patch_alarAI(pCreature); -} - -void AddSC_boss_alar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_alar"; - newscript->GetAI = &GetAI_boss_alar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ember_of_alar"; - newscript->GetAI = &GetAI_mob_ember_of_alar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_flame_patch_alar"; - newscript->GetAI = &GetAI_mob_flame_patch_alar; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp deleted file mode 100644 index 81f3c619bac..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_astromancer.cpp +++ /dev/null @@ -1,474 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Astromancer -SD%Complete: 80 -SDComment: -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "precompiled.h" -#include "def_the_eye.h" - -enum -{ - SAY_AGGRO = -1550007, - SAY_SUMMON1 = -1550008, - SAY_SUMMON2 = -1550009, - SAY_KILL1 = -1550010, - SAY_KILL2 = -1550011, - SAY_KILL3 = -1550012, - SAY_DEATH = -1550013, - SAY_VOIDA = -1550014, - SAY_VOIDB = -1550015, - - SPELL_ARCANE_MISSILES = 33031, - SPELL_WRATH_OF_THE_ASTROMANCER = 42783, - SPELL_BLINDING_LIGHT = 33009, - SPELL_FEAR = 34322, - SPELL_VOID_BOLT = 39329, - - SPELL_SPOTLIGHT = 25824, - NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT = 18928, - - NPC_SOLARIUM_AGENT = 18925, - NPC_SOLARIUM_PRIEST = 18806, - - MODEL_HUMAN = 18239, - MODEL_VOIDWALKER = 18988, - - SPELL_SOLARIUM_GREAT_HEAL = 33387, - SPELL_SOLARIUM_HOLY_SMITE = 25054, - SPELL_SOLARIUM_ARCANE_TORRENT = 33390, - - WV_ARMOR = 31000 -}; - -const float CENTER_X = 432.909f; -const float CENTER_Y = -373.424f; -const float CENTER_Z = 17.9608f; -const float CENTER_O = 1.06421f; -const float SMALL_PORTAL_RADIUS = 12.6f; -const float LARGE_PORTAL_RADIUS = 26.0f; -const float PORTAL_Z = 17.005f; - - // x, y, z, o -static float SolarianPos[4] = {432.909, -373.424, 17.9608, 1.06421}; - -struct TRINITY_DLL_DECL boss_high_astromancer_solarianAI : public ScriptedAI -{ - boss_high_astromancer_solarianAI(Creature *c) : ScriptedAI(c), Summons(m_creature) - { - pInstance = c->GetInstanceData(); - - defaultarmor = m_creature->GetArmor(); - defaultsize = m_creature->GetFloatValue(OBJECT_FIELD_SCALE_X); - } - - ScriptedInstance *pInstance; - SummonList Summons; - - uint8 Phase; - - uint32 ArcaneMissiles_Timer; - uint32 m_uiWrathOfTheAstromancer_Timer; - uint32 BlindingLight_Timer; - uint32 Fear_Timer; - uint32 VoidBolt_Timer; - uint32 Phase1_Timer; - uint32 Phase2_Timer; - uint32 Phase3_Timer; - uint32 AppearDelay_Timer; - uint32 defaultarmor; - uint32 Wrath_Timer; - - float defaultsize; - float Portals[3][3]; - - bool AppearDelay; - bool BlindingLight; - - void Reset() - { - ArcaneMissiles_Timer = 2000; - m_uiWrathOfTheAstromancer_Timer = 15000; - BlindingLight_Timer = 41000; - Fear_Timer = 20000; - VoidBolt_Timer = 10000; - Phase1_Timer = 50000; - Phase2_Timer = 10000; - Phase3_Timer = 15000; - AppearDelay_Timer = 2000; - BlindingLight = false; - AppearDelay = false; - Wrath_Timer = 20000+rand()%5000;//twice in phase one - Phase = 1; - Wrath_Timer = 20000+rand()%5000;//twice in phase one - - if (pInstance) - pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, NOT_STARTED); - - m_creature->SetArmor(defaultarmor); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); - m_creature->SetDisplayId(MODEL_HUMAN); - - Summons.DespawnAll(); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_KILL1, m_creature); break; - case 1: DoScriptText(SAY_KILL2, m_creature); break; - case 2: DoScriptText(SAY_KILL3, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize); - m_creature->SetDisplayId(MODEL_HUMAN); - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, DONE); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - - if (pInstance) - pInstance->SetData(DATA_HIGHASTROMANCERSOLARIANEVENT, IN_PROGRESS); - } - - void SummonMinion(uint32 entry, float x, float y, float z) - { - Creature* Summoned = m_creature->SummonCreature(entry, x, y, z, 0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - if (Summoned) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - Summoned->AI()->AttackStart(target); - - Summons.Summon(Summoned); - } - } - - float Portal_X(float radius) - { - if ((rand()%2)==1) - radius = -radius; - - return (radius * (float)(rand()%100)/100.0f + CENTER_X); - } - - float Portal_Y(float x, float radius) - { - float z = 0.0f; - - switch(rand()%2) - { - case 0: z = 1; break; - case 1: z = -1; break; - } - return (z*sqrt(radius*radius - (x - CENTER_X)*(x - CENTER_X)) + CENTER_Y); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (AppearDelay) - { - m_creature->StopMoving(); - m_creature->AttackStop(); - if (AppearDelay_Timer < diff) - { - AppearDelay = false; - if (Phase == 2) - { - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_OFF); - } - AppearDelay_Timer = 2000; - }else AppearDelay_Timer -= diff; - } - - if (Phase == 1) - { - if (BlindingLight_Timer < diff){ - BlindingLight = true; - BlindingLight_Timer = 45000; - }else BlindingLight_Timer -= diff; - - if (Wrath_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(SelectTarget(SELECT_TARGET_RANDOM,1,100,true), SPELL_WRATH_OF_THE_ASTROMANCER, true); - Wrath_Timer = 20000+rand()%5000; - }else Wrath_Timer -= diff; - - if (ArcaneMissiles_Timer < diff) - { - if (BlindingLight) - { - DoCast(m_creature->getVictim(), SPELL_BLINDING_LIGHT); - BlindingLight = false; - }else{ - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (!m_creature->HasInArc(2.5f, target)) - target = m_creature->getVictim(); - - if (target) - DoCast(target, SPELL_ARCANE_MISSILES); - } - ArcaneMissiles_Timer = 3000; - }else ArcaneMissiles_Timer -= diff; - - if (m_uiWrathOfTheAstromancer_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - - //Target the tank ? - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 1)) - if (pTarget->GetTypeId() == TYPEID_PLAYER) - { - DoCast(pTarget, SPELL_WRATH_OF_THE_ASTROMANCER); - m_uiWrathOfTheAstromancer_Timer = 25000; - } - else - m_uiWrathOfTheAstromancer_Timer = 1000; - }else m_uiWrathOfTheAstromancer_Timer -= diff; - - //Phase1_Timer - if (Phase1_Timer < diff) - { - Phase = 2; - Phase1_Timer = 50000; - //After these 50 seconds she portals to the middle of the room and disappears, leaving 3 light portals behind. - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMap()->CreatureRelocation(m_creature, CENTER_X, CENTER_Y, CENTER_Z, CENTER_O); - for(uint8 i=0; i<=2; ++i) - { - if (!i) - { - Portals[i][0] = Portal_X(SMALL_PORTAL_RADIUS); - Portals[i][1] = Portal_Y(Portals[i][0], SMALL_PORTAL_RADIUS); - Portals[i][2] = CENTER_Z; - } - else - { - Portals[i][0] = Portal_X(LARGE_PORTAL_RADIUS); - Portals[i][1] = Portal_Y(Portals[i][0], LARGE_PORTAL_RADIUS); - Portals[i][2] = PORTAL_Z; - } - } - if ((abs(Portals[2][0] - Portals[1][0]) < 7) && (abs(Portals[2][1] - Portals[1][1]) < 7)) - { - int i=1; - if (abs(CENTER_X + 26.0f - Portals[2][0]) < 7) - i = -1; - Portals[2][0] = Portals[2][0]+7*i; - Portals[2][1] = Portal_Y(Portals[2][0], LARGE_PORTAL_RADIUS); - } - for (int i=0; i<=2; ++i) - { - if (Creature* Summoned = m_creature->SummonCreature(NPC_ASTROMANCER_SOLARIAN_SPOTLIGHT, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O, TEMPSUMMON_TIMED_DESPAWN, Phase2_Timer+Phase3_Timer+AppearDelay_Timer+1700)) - { - Summoned->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - Summoned->CastSpell(Summoned, SPELL_SPOTLIGHT, false); - } - } - AppearDelay = true; - }else Phase1_Timer-=diff; - } - else if (Phase == 2) - { - //10 seconds after Solarian disappears, 12 mobs spawn out of the three portals. - m_creature->AttackStop(); - m_creature->StopMoving(); - if (Phase2_Timer < diff) - { - Phase = 3; - for (int i=0; i<=2; ++i) - for (int j=1; j<=4; j++) - SummonMinion(NPC_SOLARIUM_AGENT, Portals[i][0], Portals[i][1], Portals[i][2]); - - DoScriptText(SAY_SUMMON1, m_creature); - Phase2_Timer = 10000; - } else Phase2_Timer -= diff; - } - else if (Phase == 3) - { - m_creature->AttackStop(); - m_creature->StopMoving(); - - //Check Phase3_Timer - if (Phase3_Timer < diff) - { - Phase = 1; - - //15 seconds later Solarian reappears out of one of the 3 portals. Simultaneously, 2 healers appear in the two other portals. - int i = rand()%3; - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMap()->CreatureRelocation(m_creature, Portals[i][0], Portals[i][1], Portals[i][2], CENTER_O); - - for (int j=0; j<=2; j++) - if (j!=i) - SummonMinion(NPC_SOLARIUM_PRIEST, Portals[j][0], Portals[j][1], Portals[j][2]); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_ON); - - DoScriptText(SAY_SUMMON2, m_creature); - AppearDelay = true; - Phase3_Timer = 15000; - }else Phase3_Timer -= diff; - } - else if (Phase == 4) - { - //Fear_Timer - if (Fear_Timer < diff) - { - DoCast(m_creature, SPELL_FEAR); - Fear_Timer = 20000; - }else Fear_Timer -= diff; - - //VoidBolt_Timer - if (VoidBolt_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_VOID_BOLT); - VoidBolt_Timer = 10000; - }else VoidBolt_Timer -= diff; - } - - //When Solarian reaches 20% she will transform into a huge void walker. - if (Phase != 4 && ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth())<20)) - { - Phase = 4; - - //To make sure she wont be invisible or not selecatble - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetVisibility(VISIBILITY_ON); - DoScriptText(SAY_VOIDA, m_creature); - DoScriptText(SAY_VOIDB, m_creature); - m_creature->SetArmor(WV_ARMOR); - m_creature->SetDisplayId(MODEL_VOIDWALKER); - m_creature->SetFloatValue(OBJECT_FIELD_SCALE_X, defaultsize*2.5f); - } - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL mob_solarium_priestAI : public ScriptedAI -{ - mob_solarium_priestAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - uint32 healTimer; - uint32 holysmiteTimer; - uint32 aoesilenceTimer; - - void Reset() - { - healTimer = 9000; - holysmiteTimer = 1; - aoesilenceTimer = 15000; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (healTimer < diff) - { - Unit* target = NULL; - - switch(rand()%2) - { - case 0: - if (pInstance) - target = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_ASTROMANCER)); - break; - case 1: - target = m_creature; - break; - } - - if (target) - { - DoCast(target,SPELL_SOLARIUM_GREAT_HEAL); - healTimer = 9000; - } - } else healTimer -= diff; - - if (holysmiteTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SOLARIUM_HOLY_SMITE); - holysmiteTimer = 4000; - } else holysmiteTimer -= diff; - - if (aoesilenceTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SOLARIUM_ARCANE_TORRENT); - aoesilenceTimer = 13000; - } else aoesilenceTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_solarium_priest(Creature* pCreature) -{ - return new mob_solarium_priestAI (pCreature); -} - -CreatureAI* GetAI_boss_high_astromancer_solarian(Creature* pCreature) -{ - return new boss_high_astromancer_solarianAI (pCreature); -} - -void AddSC_boss_high_astromancer_solarian() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_high_astromancer_solarian"; - newscript->GetAI = &GetAI_boss_high_astromancer_solarian; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_solarium_priest"; - newscript->GetAI = &GetAI_mob_solarium_priest; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp deleted file mode 100644 index d341e52ae06..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_kaelthas.cpp +++ /dev/null @@ -1,1515 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Kaelthas -SD%Complete: 60 -SDComment: SQL, weapon scripts, mind control, need correct spells(interruptible/uninterruptible), phoenix spawn location & animation, phoenix behaviour & spawn during gravity lapse -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "precompiled.h" -#include "def_the_eye.h" -#include "WorldPacket.h" - -enum -{ - //kael'thas Speech - SAY_INTRO = -1550016, - SAY_INTRO_CAPERNIAN = -1550017, - SAY_INTRO_TELONICUS = -1550018, - SAY_INTRO_THALADRED = -1550019, - SAY_INTRO_SANGUINAR = -1550020, - SAY_PHASE2_WEAPON = -1550021, - SAY_PHASE3_ADVANCE = -1550022, - SAY_PHASE4_INTRO2 = -1550023, - SAY_PHASE5_NUTS = -1550024, - SAY_SLAY1 = -1550025, - SAY_SLAY2 = -1550026, - SAY_SLAY3 = -1550027, - SAY_MINDCONTROL1 = -1550028, - SAY_MINDCONTROL2 = -1550029, - SAY_GRAVITYLAPSE1 = -1550030, - SAY_GRAVITYLAPSE2 = -1550031, - SAY_SUMMON_PHOENIX1 = -1550032, - SAY_SUMMON_PHOENIX2 = -1550033, - SAY_DEATH = -1550034, - - //Thaladred the Darkener speech - SAY_THALADRED_AGGRO = -1550035, - SAY_THALADRED_DEATH = -1550036, - EMOTE_THALADRED_GAZE = -1550037, - - //Lord Sanguinar speech - SAY_SANGUINAR_AGGRO = -1550038, - SAY_SANGUINAR_DEATH = -1550039, - - //Grand Astromancer Capernian speech - SAY_CAPERNIAN_AGGRO = -1550040, - SAY_CAPERNIAN_DEATH = -1550041, - - //Master Engineer Telonicus speech - SAY_TELONICUS_AGGRO = -1550042, - SAY_TELONICUS_DEATH = -1550043, - - //Phase 2 spells - SPELL_SUMMON_WEAPONS = 36976, - SPELL_SUMMON_WEAPONA = 36958, - SPELL_SUMMON_WEAPONB = 36959, - SPELL_SUMMON_WEAPONC = 36960, - SPELL_SUMMON_WEAPOND = 36961, - SPELL_SUMMON_WEAPONE = 36962, - SPELL_SUMMON_WEAPONF = 36963, - SPELL_SUMMON_WEAPONG = 36964, - SPELL_RES_VISUAL = 24171, - - //Phase 4 spells - SPELL_FIREBALL = 22088, //wrong but works with CastCustomSpell - SPELL_PYROBLAST = 36819, - SPELL_FLAME_STRIKE = 36735, - SPELL_FLAME_STRIKE_VIS = 36730, - SPELL_FLAME_STRIKE_DMG = 36731, - SPELL_ARCANE_DISRUPTION = 36834, - SPELL_SHOCK_BARRIER = 36815, - SPELL_PHOENIX_ANIMATION = 36723, - SPELL_MIND_CONTROL = 32830, - - //Phase 5 spells - SPELL_EXPLODE = 36092, - SPELL_FULLPOWER = 36187, - SPELL_KNOCKBACK = 11027, - SPELL_GRAVITY_LAPSE = 34480, - SPELL_GRAVITY_LAPSE_AURA = 39432, - SPELL_NETHER_BEAM = 35873, - - //Thaladred the Darkener spells - SPELL_PSYCHIC_BLOW = 10689, - SPELL_SILENCE = 30225, - //Lord Sanguinar spells - SPELL_BELLOWING_ROAR = 40636, - //Grand Astromancer Capernian spells - - SPELL_CAPERNIAN_FIREBALL = 36971, - SPELL_CONFLAGRATION = 37018, - SPELL_ARCANE_EXPLOSION = 36970, - //Master Engineer Telonicus spells - SPELL_BOMB = 37036, - SPELL_REMOTE_TOY = 37027, - //Nether Vapor spell - SPELL_NETHER_VAPOR = 35859, - //Phoenix spell - SPELL_BURN = 36720, - SPELL_EMBER_BLAST = 34341, - SPELL_REBIRTH = 41587, - - //Creature IDs - NPC_PHOENIX = 21362, - NPC_PHOENIX_EGG = 21364, - - //Phoenix egg and phoenix model - MODEL_ID_PHOENIX = 19682, - MODEL_ID_PHOENIX_EGG = 20245, - - MAX_ADVISORS = 4 -}; - -uint32 m_auiSpellSummonWeapon[]= -{ - SPELL_SUMMON_WEAPONA, SPELL_SUMMON_WEAPONB, SPELL_SUMMON_WEAPONC, SPELL_SUMMON_WEAPOND, - SPELL_SUMMON_WEAPONE, SPELL_SUMMON_WEAPONF, SPELL_SUMMON_WEAPONG -}; - -const float CAPERNIAN_DISTANCE = 20.0f; //she casts away from the target -const float KAEL_VISIBLE_RANGE = 50.0f; - -const float afGravityPos[3] = {795.0f, 0.0f, 70.0f}; - -#define TIME_PHASE_2_3 120000 -#define TIME_PHASE_3_4 180000 - -//Base AI for Advisors -struct TRINITY_DLL_DECL advisorbase_ai : public ScriptedAI -{ - advisorbase_ai(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bDoubled_Health = false; - } - - ScriptedInstance* m_pInstance; - bool FakeDeath; - bool m_bDoubled_Health; - uint32 DelayRes_Timer; - uint64 DelayRes_Target; - - void Reset() - { - if (m_bDoubled_Health) - { - m_creature->SetMaxHealth(m_creature->GetMaxHealth() / 2); - m_bDoubled_Health = false; - } - - FakeDeath = false; - DelayRes_Timer = 0; - DelayRes_Target = 0; - - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - - //reset encounter - if (m_pInstance && (m_pInstance->GetData(DATA_KAELTHASEVENT) == 1 || m_pInstance->GetData(DATA_KAELTHASEVENT) == 3)) - { - if (Creature *Kaelthas = Unit::GetCreature((*m_creature), m_pInstance->GetData64(DATA_KAELTHAS))) - Kaelthas->AI()->EnterEvadeMode(); - } - } - - void MoveInLineOfSight(Unit *who) - { - if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::MoveInLineOfSight(who); - } - - void AttackStart(Unit* who) - { - if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - ScriptedAI::AttackStart(who); - } - - void Revive(Unit* Target) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - // double health for phase 3 - m_creature->SetMaxHealth(m_creature->GetMaxHealth() * 2); - m_bDoubled_Health = true; - m_creature->SetHealth(m_creature->GetMaxHealth()); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - - DoCast(m_creature, SPELL_RES_VISUAL, false); - DelayRes_Timer = 2000; - } - - void DamageTaken(Unit* pKiller, uint32 &damage) - { - if (damage < m_creature->GetHealth()) - return; - - //Prevent glitch if in fake death - if (FakeDeath && m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) != 0) - { - damage = 0; - return; - } - - //Don't really die in phase 1 & 3, only die after that - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) != 0) - { - //prevent death - damage = 0; - FakeDeath = true; - - m_creature->InterruptNonMeleeSpells(false); - m_creature->SetHealth(0); - m_creature->StopMoving(); - m_creature->ClearComboPointHolders(); - m_creature->RemoveAllAurasOnDeath(); - m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_20_PERCENT, false); - m_creature->ModifyAuraState(AURA_STATE_HEALTHLESS_35_PERCENT, false); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->ClearAllReactives(); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET,0); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); - JustDied(pKiller); - } - } - - void UpdateAI(const uint32 diff) - { - if (DelayRes_Timer) - { - if (DelayRes_Timer <= diff) - { - DelayRes_Timer = 0; - FakeDeath = false; - - Unit* Target = Unit::GetUnit((*m_creature), DelayRes_Target); - if (!Target) - Target = m_creature->getVictim(); - - DoResetThreat(); - AttackStart(Target); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveChase(Target); - m_creature->AddThreat(Target, 0.0f); - }else DelayRes_Timer -= diff; - } - } - -}; - -//Kael'thas AI -struct TRINITY_DLL_DECL boss_kaelthasAI : public ScriptedAI -{ - boss_kaelthasAI(Creature* pCreature) : ScriptedAI(pCreature), summons(m_creature) - { - m_pInstance = pCreature->GetInstanceData(); - memset(&m_auiAdvisorGuid, 0, sizeof(m_auiAdvisorGuid)); - } - - ScriptedInstance* m_pInstance; - - uint32 Fireball_Timer; - uint32 ArcaneDisruption_Timer; - uint32 Phoenix_Timer; - uint32 ShockBarrier_Timer; - uint32 GravityLapse_Timer; - uint32 GravityLapse_Phase; - uint32 NetherBeam_Timer; - uint32 NetherVapor_Timer; - uint32 FlameStrike_Timer; - uint32 MindControl_Timer; - uint32 Phase; - uint32 PhaseSubphase; //generic - uint32 Phase_Timer; //generic timer - uint32 PyrosCasted; - - bool InGravityLapse; - bool IsCastingFireball; - bool ChainPyros; - - SummonList summons; - - uint64 m_auiAdvisorGuid[MAX_ADVISORS]; - - void Reset() - { - Fireball_Timer = 5000+rand()%10000; - ArcaneDisruption_Timer = 45000; - MindControl_Timer = 40000; - Phoenix_Timer = 50000; - ShockBarrier_Timer = 60000; - FlameStrike_Timer = 30000; - GravityLapse_Timer = 20000; - GravityLapse_Phase = 0; - NetherBeam_Timer = 8000; - NetherVapor_Timer = 10000; - PyrosCasted = 0; - Phase = 0; - InGravityLapse = false; - IsCastingFireball = false; - ChainPyros = false; - - if (m_creature->isInCombat()) - PrepareAdvisors(); - - summons.DespawnAll(); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - if (m_pInstance) - m_pInstance->SetData(DATA_KAELTHASEVENT, 0); - } - - void PrepareAdvisors() - { - for(uint8 i = 0; i < MAX_ADVISORS; ++i) - { - if (Creature *pCreature = Unit::GetCreature((*m_creature), m_auiAdvisorGuid[i])) - { - pCreature->Respawn(); - pCreature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - pCreature->setFaction(m_creature->getFaction()); - pCreature->AI()->EnterEvadeMode(); - } - } - } - - void StartEvent() - { - if (!m_pInstance) - return; - - m_auiAdvisorGuid[0] = m_pInstance->GetData64(DATA_THALADREDTHEDARKENER); - m_auiAdvisorGuid[1] = m_pInstance->GetData64(DATA_LORDSANGUINAR); - m_auiAdvisorGuid[2] = m_pInstance->GetData64(DATA_GRANDASTROMANCERCAPERNIAN); - m_auiAdvisorGuid[3] = m_pInstance->GetData64(DATA_MASTERENGINEERTELONICUS); - - if (!m_auiAdvisorGuid[0] || !m_auiAdvisorGuid[1] || !m_auiAdvisorGuid[2] || !m_auiAdvisorGuid[3]) - { - error_log("TSCR: Kael'Thas One or more advisors missing, Skipping Phases 1-3"); - - DoScriptText(SAY_PHASE4_INTRO2, m_creature); - - Phase = 4; - - m_pInstance->SetData(DATA_KAELTHASEVENT, 4); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - AttackStart(target); - - } - else - { - PrepareAdvisors(); - - DoScriptText(SAY_INTRO, m_creature); - - m_pInstance->SetData(DATA_KAELTHASEVENT, 1); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - PhaseSubphase = 0; - Phase_Timer = 23000; - Phase = 1; - } - } - - void MoveInLineOfSight(Unit *who) - { - if (!m_creature->hasUnitState(UNIT_STAT_STUNNED) && who->isTargetableForAttack() && - m_creature->IsHostileTo(who) && who->isInAccessiblePlaceFor(m_creature)) - { - if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - { - if (!m_creature->getVictim() && Phase >= 4) - { - who->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - else if (m_creature->GetMap()->IsDungeon()) - { - if (m_pInstance && !m_pInstance->GetData(DATA_KAELTHASEVENT) && !Phase) - StartEvent(); - - who->SetInCombatWith(m_creature); - m_creature->AddThreat(who, 0.0f); - } - } - } - } - - void Aggro(Unit *who) - { - if (m_pInstance && !m_pInstance->GetData(DATA_KAELTHASEVENT) && !Phase) - StartEvent(); - } - - void KilledUnit() - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustSummoned(Creature* pSummoned) - { - // if not phoenix, then it's one of the 7 weapons - if (pSummoned->GetEntry() != NPC_PHOENIX) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - pSummoned->AI()->AttackStart(pTarget); - - summons.Summon(pSummoned); - } - } - - void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} - - void JustDied(Unit* Killer) - { - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - DoScriptText(SAY_DEATH, m_creature); - - summons.DespawnAll(); - - if (m_pInstance) - m_pInstance->SetData(DATA_KAELTHASEVENT, 0); - - for(uint8 i = 0; i < MAX_ADVISORS; ++i) - { - if (Unit* pAdvisor = Unit::GetUnit((*m_creature), m_auiAdvisorGuid[i])) - pAdvisor->DealDamage(pAdvisor, pAdvisor->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - void UpdateAI(const uint32 diff) - { - //Phase 1 - switch (Phase) - { - case 1: - { - Unit *target = NULL; - Creature* Advisor = NULL; - - //Subphase switch - switch(PhaseSubphase) - { - //Subphase 1 - Start - case 0: - if (Phase_Timer < diff) - { - DoScriptText(SAY_INTRO_THALADRED, m_creature); - - //start advisor within 7 seconds - Phase_Timer = 7000; - PhaseSubphase++; - }else Phase_Timer -= diff; - break; - - //Subphase 1 - Unlock advisor - case 1: - if (Phase_Timer < diff) - { - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[0])); - - if (Advisor) - { - Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Advisor->setFaction(m_creature->getFaction()); - - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - Advisor->AI()->AttackStart(target); - } - - PhaseSubphase++; - }else Phase_Timer -= diff; - break; - - //Subphase 2 - Start - case 2: - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[0])); - - if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - DoScriptText(SAY_INTRO_SANGUINAR, m_creature); - - //start advisor within 12.5 seconds - Phase_Timer = 12500; - PhaseSubphase++; - } - break; - - //Subphase 2 - Unlock advisor - case 3: - if (Phase_Timer < diff) - { - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[1])); - - if (Advisor) - { - Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Advisor->setFaction(m_creature->getFaction()); - - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - Advisor->AI()->AttackStart(target); - } - - PhaseSubphase++; - }else Phase_Timer -= diff; - break; - - //Subphase 3 - Start - case 4: - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[1])); - - if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - DoScriptText(SAY_INTRO_CAPERNIAN, m_creature); - - //start advisor within 7 seconds - Phase_Timer = 7000; - PhaseSubphase++; - } - break; - - //Subphase 3 - Unlock advisor - case 5: - if (Phase_Timer < diff) - { - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[2])); - - if (Advisor) - { - Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Advisor->setFaction(m_creature->getFaction()); - - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - Advisor->AI()->AttackStart(target); - } - - PhaseSubphase++; - }else Phase_Timer -= diff; - break; - - //Subphase 4 - Start - case 6: - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[2])); - - if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - DoScriptText(SAY_INTRO_TELONICUS, m_creature); - - //start advisor within 8.4 seconds - Phase_Timer = 8400; - PhaseSubphase++; - } - break; - - //Subphase 4 - Unlock advisor - case 7: - if (Phase_Timer < diff) - { - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[3])); - - if (Advisor) - { - Advisor->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Advisor->setFaction(m_creature->getFaction()); - - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - if (target) - Advisor->AI()->AttackStart(target); - } - - Phase_Timer = 3000; - PhaseSubphase++; - }else Phase_Timer -= diff; - break; - - //End of phase 1 - case 8: - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[3])); - - if (Advisor && (Advisor->getStandState() == UNIT_STAND_STATE_DEAD)) - { - Phase = 2; - m_pInstance->SetData(DATA_KAELTHASEVENT, 2); - - DoScriptText(SAY_PHASE2_WEAPON, m_creature); - - PhaseSubphase = 0; - Phase_Timer = 3500; - DoCast(m_creature, SPELL_SUMMON_WEAPONS); - } - break; - } - }break; - - case 2: - { - if (PhaseSubphase == 0) - { - if (Phase_Timer < diff) - { - PhaseSubphase = 1; - }else Phase_Timer -= diff; - } - - //Spawn weapons - if (PhaseSubphase == 1) - { - m_creature->CastSpell(m_creature, SPELL_SUMMON_WEAPONS, false); - - uint8 uiMaxWeapon = sizeof(m_auiSpellSummonWeapon)/sizeof(uint32); - - for (uint32 i = 0; i < uiMaxWeapon; ++i) - m_creature->CastSpell(m_creature,m_auiSpellSummonWeapon[i],true); - - PhaseSubphase = 2; - Phase_Timer = TIME_PHASE_2_3; - } - - if (PhaseSubphase == 2) - { - if (Phase_Timer < diff) - { - DoScriptText(SAY_PHASE3_ADVANCE, m_creature); - m_pInstance->SetData(DATA_KAELTHASEVENT, 3); - Phase = 3; - PhaseSubphase = 0; - }else Phase_Timer -= diff; - } - }break; - - case 3: - { - if (PhaseSubphase == 0) - { - //Respawn advisors - Unit* Target = SelectUnit(SELECT_TARGET_RANDOM, 0); - - Creature* Advisor; - for (uint32 i = 0; i < MAX_ADVISORS; ++i) - { - Advisor = (Unit::GetCreature((*m_creature), m_auiAdvisorGuid[i])); - - if (!Advisor) - error_log("SD2: Kael'Thas Advisor %u does not exist. Possibly despawned? Incorrectly Killed?", i); - else - CAST_AI(advisorbase_ai, Advisor->AI())->Revive(Target); - } - - PhaseSubphase = 1; - Phase_Timer = TIME_PHASE_3_4; - } - - if (Phase_Timer < diff) - { - DoScriptText(SAY_PHASE4_INTRO2, m_creature); - Phase = 4; - - m_pInstance->SetData(DATA_KAELTHASEVENT, 4); - - // Sometimes people can collect Aggro in Phase 1-3. Reset threat before releasing Kael. - DoResetThreat(); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - AttackStart(target); - - Phase_Timer = 30000; - }else Phase_Timer -= diff; - } - break; - - case 4: - case 5: - case 6: - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Fireball_Timer - if (!InGravityLapse && !ChainPyros && Phase != 5) - { - if (Fireball_Timer < diff) - { - if (!IsCastingFireball) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - //interruptable - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, false); - int32 dmg = 20000+rand()%5000; - m_creature->CastCustomSpell(m_creature->getVictim(), SPELL_FIREBALL, &dmg, 0, 0, false); - IsCastingFireball = true; - Fireball_Timer = 2500; - } - } - else - { - //apply resistance - m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_INTERRUPT_CAST, true); - IsCastingFireball = false; - Fireball_Timer = 5000+rand()%10000; - } - }else Fireball_Timer -= diff; - - //ArcaneDisruption_Timer - if (ArcaneDisruption_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCANE_DISRUPTION, true); - ArcaneDisruption_Timer = 60000; - }else ArcaneDisruption_Timer -= diff; - - if (FlameStrike_Timer < diff) - { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_FLAME_STRIKE); - - FlameStrike_Timer = 30000; - }FlameStrike_Timer -= diff; - - if (MindControl_Timer < diff) - { - if (m_creature->getThreatManager().getThreatList().size() >= 2) - for (uint32 i = 0; i < 3; ++i) - { - debug_log("SD2: Kael'Thas mind control not supported."); - //DoCast(pUnit, SPELL_MIND_CONTROL); - } - - MindControl_Timer = 60000; - }MindControl_Timer -= diff; - } - - //Phoenix_Timer - if (Phoenix_Timer < diff) - { - DoCast(m_creature, SPELL_PHOENIX_ANIMATION); - - if (Creature* pPhoenix = m_creature->SummonCreature(NPC_PHOENIX, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 45000)) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - pPhoenix->AI()->AttackStart(pTarget); - } - else - error_log("SD2: Kael'Thas Phoenix could not be spawned"); - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SUMMON_PHOENIX1, m_creature); break; - case 1: DoScriptText(SAY_SUMMON_PHOENIX2, m_creature); break; - } - - Phoenix_Timer = 60000; - }else Phoenix_Timer -= diff; - - //Phase 4 specific spells - if (Phase == 4) - { - if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 50) - { - m_pInstance->SetData(DATA_KAELTHASEVENT, 4); - Phase = 5; - Phase_Timer = 10000; - - DoScriptText(SAY_PHASE5_NUTS, m_creature); - - m_creature->StopMoving(); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->GetMap()->CreatureRelocation(m_creature, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); - m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, 0, 0); - - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_FULLPOWER); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - } - - //ShockBarrier_Timer - if (ShockBarrier_Timer < diff) - { - DoCast(m_creature, SPELL_SHOCK_BARRIER); - ChainPyros = true; - PyrosCasted = 0; - ShockBarrier_Timer = 60000; - }else ShockBarrier_Timer -= diff; - - //Chain Pyros (3 of them max) - if (ChainPyros && !m_creature->IsNonMeleeSpellCasted(false)) - { - if (PyrosCasted < 3) - { - DoCast(m_creature->getVictim(), SPELL_PYROBLAST); - PyrosCasted++; - - } - else - { - ChainPyros = false; - Fireball_Timer = 2500; - ArcaneDisruption_Timer = 60000; - } - } - } - - if (Phase == 5) - { - if (Phase_Timer < diff) - { - m_creature->InterruptNonMeleeSpells(false); - m_creature->RemoveAurasDueToSpell(SPELL_FULLPOWER); - - DoCast(m_creature, SPELL_EXPLODE); - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - Phase = 6; - AttackStart(m_creature->getVictim()); - }else Phase_Timer -= diff; - } - - //Phase 5 - if (Phase == 6) - { - - //GravityLapse_Timer - if (GravityLapse_Timer < diff) - { - std::list::iterator i = m_creature->getThreatManager().getThreatList().begin(); - switch(GravityLapse_Phase) - { - case 0: - m_creature->StopMoving(); - m_creature->GetMotionMaster()->Clear(); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->GetMap()->CreatureRelocation(m_creature, afGravityPos[0], afGravityPos[1], afGravityPos[2], 0); - m_creature->SendMonsterMove(afGravityPos[0], afGravityPos[1], afGravityPos[2], 0, MOVEMENTFLAG_NONE, 0); - - // 1) Kael'thas will portal the whole raid right into his body - for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - if (pUnit && (pUnit->GetTypeId() == TYPEID_PLAYER)) - { - //Use work around packet to prevent player from being dropped from combat - DoTeleportPlayer(pUnit, afGravityPos[0], afGravityPos[1], afGravityPos[2], pUnit->GetOrientation()); - } - } - - GravityLapse_Timer = 500; - ++GravityLapse_Phase; - InGravityLapse = true; - ShockBarrier_Timer = 1000; - NetherBeam_Timer = 5000; - break; - - case 1: - switch(rand()%2) - { - case 0: DoScriptText(SAY_GRAVITYLAPSE1, m_creature); break; - case 1: DoScriptText(SAY_GRAVITYLAPSE2, m_creature); break; - } - - // 2) At that point he will put a Gravity Lapse debuff on everyone - for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) - { - if (Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid())) - { - m_creature->CastSpell(pUnit, SPELL_KNOCKBACK, true); - //Gravity lapse - needs an exception in Spell system to work - - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE, true, 0, 0, m_creature->GetGUID()); - pUnit->CastSpell(pUnit, SPELL_GRAVITY_LAPSE_AURA, true, 0, 0, m_creature->GetGUID()); - - //Using packet workaround - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_SET_CAN_FLY); - data.append(pUnit->GetPackGUID()); - data << uint32(0); - pUnit->SendMessageToSet(&data, true); - } - } - GravityLapse_Timer = 10000; - GravityLapse_Phase++; - break; - - case 2: - //Cast nether vapor aura on self - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_NETHER_VAPOR); - - GravityLapse_Timer = 20000; - GravityLapse_Phase++; - break; - - case 3: - //Remove flight - for (i = m_creature->getThreatManager().getThreatList().begin(); i!= m_creature->getThreatManager().getThreatList().end(); ++i) - { - if (Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid())) - { - //Using packet workaround - WorldPacket data(12); - data.SetOpcode(SMSG_MOVE_UNSET_CAN_FLY); - data.append(pUnit->GetPackGUID()); - data << uint32(0); - pUnit->SendMessageToSet(&data, true); - } - } - - m_creature->RemoveAurasDueToSpell(SPELL_NETHER_VAPOR); - InGravityLapse = false; - GravityLapse_Timer = 60000; - GravityLapse_Phase = 0; - AttackStart(m_creature->getVictim()); - break; - } - }else GravityLapse_Timer -= diff; - - if (InGravityLapse) - { - //ShockBarrier_Timer - if (ShockBarrier_Timer < diff) - { - DoCast(m_creature, SPELL_SHOCK_BARRIER); - ShockBarrier_Timer = 20000; - }else ShockBarrier_Timer -= diff; - - //NetherBeam_Timer - if (NetherBeam_Timer < diff) - { - if (Unit* pUnit = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pUnit, SPELL_NETHER_BEAM); - - NetherBeam_Timer = 4000; - }else NetherBeam_Timer -= diff; - } - } - - if (!InGravityLapse) - DoMeleeAttackIfReady(); - } - } - } -}; - -//Thaladred the Darkener AI -struct TRINITY_DLL_DECL boss_thaladred_the_darkenerAI : public advisorbase_ai -{ - boss_thaladred_the_darkenerAI(Creature* pCreature) : advisorbase_ai(pCreature) {} - - uint32 Gaze_Timer; - uint32 Silence_Timer; - uint32 PsychicBlow_Timer; - - void Reset() - { - Gaze_Timer = 100; - Silence_Timer = 20000; - PsychicBlow_Timer = 10000; - - advisorbase_ai::Reset(); - } - - void Aggro(Unit *who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!who || FakeDeath) - return; - - DoScriptText(SAY_THALADRED_AGGRO, m_creature); - m_creature->AddThreat(who, 5000000.0f); - } - - void JustDied(Unit* pKiller) - { - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_THALADRED_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - advisorbase_ai::UpdateAI(diff); - - //Faking death, don't do anything - if (FakeDeath) - return; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Gaze_Timer - if (Gaze_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoResetThreat(); - m_creature->AddThreat(target, 5000000.0f); - DoScriptText(EMOTE_THALADRED_GAZE, m_creature, target); - Gaze_Timer = 8500; - } - }else Gaze_Timer -= diff; - - //Silence_Timer - if (Silence_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_SILENCE); - Silence_Timer = 20000; - }else Silence_Timer -= diff; - - //PsychicBlow_Timer - if (PsychicBlow_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_PSYCHIC_BLOW); - PsychicBlow_Timer = 20000+rand()%5000; - }else PsychicBlow_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Lord Sanguinar AI -struct TRINITY_DLL_DECL boss_lord_sanguinarAI : public advisorbase_ai -{ - boss_lord_sanguinarAI(Creature* pCreature) : advisorbase_ai(pCreature) {} - - uint32 Fear_Timer; - - void Reset() - { - Fear_Timer = 20000; - advisorbase_ai::Reset(); - } - - void Aggro(Unit *who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!who || FakeDeath) - return; - - DoScriptText(SAY_SANGUINAR_AGGRO, m_creature); - } - - void JustDied(Unit* Killer) - { - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_SANGUINAR_DEATH, m_creature); - } - - void UpdateAI(const uint32 diff) - { - advisorbase_ai::UpdateAI(diff); - - //Faking death, don't do anything - if (FakeDeath) - return; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Fear_Timer - if (Fear_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BELLOWING_ROAR); - Fear_Timer = 25000+rand()%10000; //approximately every 30 seconds - }else Fear_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Grand Astromancer Capernian AI -struct TRINITY_DLL_DECL boss_grand_astromancer_capernianAI : public advisorbase_ai -{ - boss_grand_astromancer_capernianAI(Creature* pCreature) : advisorbase_ai(pCreature) {} - - uint32 Fireball_Timer; - uint32 Conflagration_Timer; - uint32 ArcaneExplosion_Timer; - uint32 Yell_Timer; - bool Yell; - - void Reset() - { - Fireball_Timer = 2000; - Conflagration_Timer = 20000; - ArcaneExplosion_Timer = 5000; - Yell_Timer = 2000; - Yell = false; - - advisorbase_ai::Reset(); - } - - void JustDied(Unit* pKiller) - { - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_CAPERNIAN_DEATH, m_creature); - } - - void AttackStart(Unit* who) - { - if (!who || FakeDeath || m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (m_creature->Attack(who, true)) - { - m_creature->AddThreat(who, 0.0f); - m_creature->SetInCombatWith(who); - who->SetInCombatWith(m_creature); - - m_creature->GetMotionMaster()->MoveChase(who, CAPERNIAN_DISTANCE); - } - } - - void Aggro(Unit *who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!who || FakeDeath) - return; - } - - void UpdateAI(const uint32 diff) - { - advisorbase_ai::UpdateAI(diff); - - //Faking Death, don't do anything - if (FakeDeath) - return; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Yell_Timer - if (!Yell) - { - if (Yell_Timer < diff) - { - DoScriptText(SAY_CAPERNIAN_AGGRO, m_creature); - Yell = true; - }else Yell_Timer -= diff; - } - - //Fireball_Timer - if (Fireball_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_CAPERNIAN_FIREBALL); - Fireball_Timer = 4000; - }else Fireball_Timer -= diff; - - //Conflagration_Timer - if (Conflagration_Timer < diff) - { - Unit *target = NULL; - target = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (target && m_creature->IsWithinDistInMap(target, 30)) - DoCast(target, SPELL_CONFLAGRATION); - else - DoCast(m_creature->getVictim(), SPELL_CONFLAGRATION); - - Conflagration_Timer = 10000+rand()%5000; - }else Conflagration_Timer -= diff; - - //ArcaneExplosion_Timer - if (ArcaneExplosion_Timer < diff) - { - bool InMeleeRange = false; - Unit *target = NULL; - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - for (std::list::iterator i = m_threatlist.begin(); i!= m_threatlist.end(); ++i) - { - Unit* pUnit = Unit::GetUnit((*m_creature), (*i)->getUnitGuid()); - //if in melee range - if (pUnit && pUnit->IsWithinDistInMap(m_creature, 5)) - { - InMeleeRange = true; - target = pUnit; - break; - } - } - - if (InMeleeRange) - DoCast(target, SPELL_ARCANE_EXPLOSION); - - ArcaneExplosion_Timer = 4000+rand()%2000; - }else ArcaneExplosion_Timer -= diff; - - //Do NOT deal any melee damage. - } -}; - -//Master Engineer Telonicus AI -struct TRINITY_DLL_DECL boss_master_engineer_telonicusAI : public advisorbase_ai -{ - boss_master_engineer_telonicusAI(Creature* pCreature) : advisorbase_ai(pCreature) {} - - uint32 Bomb_Timer; - uint32 RemoteToy_Timer; - - void Reset() - { - Bomb_Timer = 10000; - RemoteToy_Timer = 5000; - - advisorbase_ai::Reset(); - } - - void JustDied(Unit* pKiller) - { - if (m_pInstance && m_pInstance->GetData(DATA_KAELTHASEVENT) == 3) - DoScriptText(SAY_TELONICUS_DEATH, m_creature); - } - - void Aggro(Unit *who) - { - if (m_creature->HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE)) - return; - - if (!who || FakeDeath) - return; - - DoScriptText(SAY_TELONICUS_AGGRO, m_creature); - } - - void UpdateAI(const uint32 diff) - { - advisorbase_ai::UpdateAI(diff); - - //Faking Death, do nothing - if (FakeDeath) - return; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Bomb_Timer - if (Bomb_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BOMB); - Bomb_Timer = 25000; - }else Bomb_Timer -= diff; - - //RemoteToy_Timer - if (RemoteToy_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_REMOTE_TOY); - - RemoteToy_Timer = 10000+rand()%5000; - }else RemoteToy_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Flame Strike AI -struct TRINITY_DLL_DECL mob_kael_flamestrikeAI : public ScriptedAI -{ - mob_kael_flamestrikeAI(Creature* pCreature) : ScriptedAI(pCreature) {} - - uint32 Timer; - bool Casting; - bool KillSelf; - - void Reset() - { - Timer = 5000; - Casting = false; - KillSelf = false; - - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); - m_creature->setFaction(14); - } - - void MoveInLineOfSight(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!Casting) - { - DoCast(m_creature, SPELL_FLAME_STRIKE_VIS); - Casting = true; - } - - //Timer - if (Timer < diff) - { - if (!KillSelf) - { - m_creature->InterruptNonMeleeSpells(false); - DoCast(m_creature, SPELL_FLAME_STRIKE_DMG); - }else m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - - KillSelf = true; - Timer = 1000; - }else Timer -= diff; - } -}; - -//Phoenix AI -struct TRINITY_DLL_DECL mob_phoenix_tkAI : public ScriptedAI -{ - mob_phoenix_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {} - - uint32 Cycle_Timer; - - void Reset() - { - Cycle_Timer = 2000; - m_creature->CastSpell(m_creature,SPELL_BURN,true); - } - - void JustDied(Unit* killer) - { - //is this spell in use anylonger? - //m_creature->CastSpell(m_creature,SPELL_EMBER_BLAST,true); - m_creature->SummonCreature(NPC_PHOENIX_EGG,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_TIMED_DESPAWN,16000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Cycle_Timer < diff) - { - //spell Burn should possible do this, but it doesn't, so do this for now. - uint32 dmg = urand(4500,5500); - if (m_creature->GetHealth() > dmg) - m_creature->SetHealth(uint32(m_creature->GetHealth()-dmg)); - Cycle_Timer = 2000; - }else Cycle_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -//Phoenix Egg AI -struct TRINITY_DLL_DECL mob_phoenix_egg_tkAI : public ScriptedAI -{ - mob_phoenix_egg_tkAI(Creature* pCreature) : ScriptedAI(pCreature) {} - - uint32 Rebirth_Timer; - - void Reset() - { - Rebirth_Timer = 15000; - } - - //ignore any - void MoveInLineOfSight(Unit* who) { return; } - - void AttackStart(Unit* who) - { - if (m_creature->Attack(who, false)) - { - m_creature->SetInCombatWith(who); - who->SetInCombatWith(m_creature); - - DoStartNoMovement(who); - } - } - - void JustSummoned(Creature* summoned) - { - summoned->AddThreat(m_creature->getVictim(), 0.0f); - summoned->CastSpell(summoned,SPELL_REBIRTH,false); - } - - void UpdateAI(const uint32 diff) - { - if (!Rebirth_Timer) - return; - - if (Rebirth_Timer <= diff) - { - m_creature->SummonCreature(NPC_PHOENIX,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),m_creature->GetOrientation(),TEMPSUMMON_CORPSE_DESPAWN,5000); - Rebirth_Timer = 0; - }else Rebirth_Timer -= diff; - } -}; - -CreatureAI* GetAI_boss_kaelthas(Creature* pCreature) -{ - return new boss_kaelthasAI(pCreature); -} - -CreatureAI* GetAI_boss_thaladred_the_darkener(Creature* pCreature) -{ - return new boss_thaladred_the_darkenerAI(pCreature); -} - -CreatureAI* GetAI_boss_lord_sanguinar(Creature* pCreature) -{ - return new boss_lord_sanguinarAI(pCreature); -} - -CreatureAI* GetAI_boss_grand_astromancer_capernian(Creature* pCreature) -{ - return new boss_grand_astromancer_capernianAI(pCreature); -} - -CreatureAI* GetAI_boss_master_engineer_telonicus(Creature* pCreature) -{ - return new boss_master_engineer_telonicusAI(pCreature); -} - -CreatureAI* GetAI_mob_kael_flamestrike(Creature* pCreature) -{ - return new mob_kael_flamestrikeAI(pCreature); -} - -CreatureAI* GetAI_mob_phoenix_tk(Creature* pCreature) -{ - return new mob_phoenix_tkAI(pCreature); -} - -CreatureAI* GetAI_mob_phoenix_egg_tk(Creature* pCreature) -{ - return new mob_phoenix_egg_tkAI(pCreature); -} - -void AddSC_boss_kaelthas() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "boss_kaelthas"; - newscript->GetAI = &GetAI_boss_kaelthas; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_thaladred_the_darkener"; - newscript->GetAI = &GetAI_boss_thaladred_the_darkener; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_lord_sanguinar"; - newscript->GetAI = &GetAI_boss_lord_sanguinar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_grand_astromancer_capernian"; - newscript->GetAI = &GetAI_boss_grand_astromancer_capernian; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "boss_master_engineer_telonicus"; - newscript->GetAI = &GetAI_boss_master_engineer_telonicus; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name= "mob_kael_flamestrike"; - newscript->GetAI = &GetAI_mob_kael_flamestrike; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_phoenix_tk"; - newscript->GetAI = &GetAI_mob_phoenix_tk; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_phoenix_egg_tk"; - newscript->GetAI = &GetAI_mob_phoenix_egg_tk; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp deleted file mode 100644 index 60cfaf1609d..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/boss_void_reaver.cpp +++ /dev/null @@ -1,185 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Void_Reaver -SD%Complete: 90 -SDComment: Should reset if raid are out of room. -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "precompiled.h" -#include "def_the_eye.h" - -enum -{ - SAY_AGGRO = -1550000, - SAY_SLAY1 = -1550001, - SAY_SLAY2 = -1550002, - SAY_SLAY3 = -1550003, - SAY_DEATH = -1550004, - SAY_POUNDING1 = -1550005, - SAY_POUNDING2 = -1550006, - - SPELL_POUNDING = 34162, - SPELL_ARCANE_ORB = 34172, - SPELL_KNOCK_AWAY = 25778, - SPELL_BERSERK = 27680 -}; - -struct TRINITY_DLL_DECL boss_void_reaverAI : public ScriptedAI -{ - boss_void_reaverAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - uint32 Pounding_Timer; - uint32 ArcaneOrb_Timer; - uint32 KnockAway_Timer; - uint32 Berserk_Timer; - - bool Enraged; - - void Reset() - { - Pounding_Timer = 15000; - ArcaneOrb_Timer = 3000; - KnockAway_Timer = 30000; - Berserk_Timer = 600000; - - Enraged = false; - - if (pInstance && m_creature->isAlive()) - pInstance->SetData(DATA_VOIDREAVEREVENT, NOT_STARTED); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - case 2: DoScriptText(SAY_SLAY3, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - DoZoneInCombat(); - - if (pInstance) - pInstance->SetData(DATA_VOIDREAVEREVENT, DONE); - } - - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (pInstance) - pInstance->SetData(DATA_VOIDREAVEREVENT, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - // Pounding - if (Pounding_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_POUNDING); - - switch(rand()%2) - { - case 0: DoScriptText(SAY_POUNDING1, m_creature); break; - case 1: DoScriptText(SAY_POUNDING2, m_creature); break; - } - Pounding_Timer = 15000; //cast time(3000) + cooldown time(12000) - }else Pounding_Timer -= diff; - - // Arcane Orb - if (ArcaneOrb_Timer < diff) - { - Unit *target = NULL; - std::list t_list = m_creature->getThreatManager().getThreatList(); - std::vector target_list; - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - // exclude pets & totems - if (target->GetTypeId() != TYPEID_PLAYER) - continue; - - //18 yard radius minimum - if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive() && !target->IsWithinDist(m_creature, 18, false)) - target_list.push_back(target); - target = NULL; - } - - if (target_list.size()) - target = *(target_list.begin()+rand()%target_list.size()); - else - target = m_creature->getVictim(); - - if (target) - m_creature->CastSpell(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(), SPELL_ARCANE_ORB, false, NULL, NULL, NULL, target); - - ArcaneOrb_Timer = 3000; - }else ArcaneOrb_Timer -= diff; - - // Single Target knock back, reduces aggro - if (KnockAway_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KNOCK_AWAY); - - //Drop 25% aggro - if (DoGetThreat(m_creature->getVictim())) - DoModifyThreatPercent(m_creature->getVictim(),-25); - - KnockAway_Timer = 30000; - }else KnockAway_Timer -= diff; - - //Berserk - if (Berserk_Timer < diff && !Enraged) - { - DoCast(m_creature,SPELL_BERSERK); - Enraged = true; - }else Berserk_Timer -= diff; - - DoMeleeAttackIfReady(); - - EnterEvadeIfOutOfCombatArea(diff); - } -}; - -CreatureAI* GetAI_boss_void_reaver(Creature* pCreature) -{ - return new boss_void_reaverAI (pCreature); -} - -void AddSC_boss_void_reaver() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_void_reaver"; - newscript->GetAI = &GetAI_boss_void_reaver; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h deleted file mode 100644 index d0d3ea09061..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/def_the_eye.h +++ /dev/null @@ -1,20 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_THE_EYE_H -#define DEF_THE_EYE_H - -#define DATA_ALAREVENT 1 -#define DATA_ASTROMANCER 2 -#define DATA_GRANDASTROMANCERCAPERNIAN 3 -#define DATA_HIGHASTROMANCERSOLARIANEVENT 4 -#define DATA_KAELTHAS 5 -#define DATA_KAELTHASEVENT 6 -#define DATA_LORDSANGUINAR 7 -#define DATA_MASTERENGINEERTELONICUS 8 -#define DATA_THALADREDTHEDARKENER 10 -#define DATA_VOIDREAVEREVENT 11 -#define DATA_ALAR 12 -#endif - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp deleted file mode 100644 index f973f96c1ff..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/instance_the_eye.cpp +++ /dev/null @@ -1,176 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_The_Eye -SD%Complete: 100 -SDComment: -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -#include "precompiled.h" -#include "def_the_eye.h" - -#define MAX_ENCOUNTER 5 - -/* The Eye encounters: -0 - Kael'thas event -1 - Al' ar event -2 - Solarian Event -3 - Void Reaver event -*/ - -struct TRINITY_DLL_DECL instance_the_eye : public ScriptedInstance -{ - instance_the_eye(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 ThaladredTheDarkener; - uint64 LordSanguinar; - uint64 GrandAstromancerCapernian; - uint64 MasterEngineerTelonicus; - uint64 Kaelthas; - uint64 Astromancer; - uint64 Alar; - - uint8 KaelthasEventPhase; - uint8 AlarEventPhase; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - ThaladredTheDarkener = 0; - LordSanguinar = 0; - GrandAstromancerCapernian = 0; - MasterEngineerTelonicus = 0; - Kaelthas = 0; - Astromancer = 0; - Alar = 0; - - KaelthasEventPhase = 0; - AlarEventPhase = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 20064: ThaladredTheDarkener = pCreature->GetGUID(); break; - case 20063: MasterEngineerTelonicus = pCreature->GetGUID(); break; - case 20062: GrandAstromancerCapernian = pCreature->GetGUID(); break; - case 20060: LordSanguinar = pCreature->GetGUID(); break; - case 19622: Kaelthas = pCreature->GetGUID(); break; - case 18805: Astromancer = pCreature->GetGUID(); break; - case 19514: Alar = pCreature->GetGUID(); break; - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_THALADREDTHEDARKENER: return ThaladredTheDarkener; - case DATA_LORDSANGUINAR: return LordSanguinar; - case DATA_GRANDASTROMANCERCAPERNIAN: return GrandAstromancerCapernian; - case DATA_MASTERENGINEERTELONICUS: return MasterEngineerTelonicus; - case DATA_KAELTHAS: return Kaelthas; - case DATA_ASTROMANCER: return Astromancer; - case DATA_ALAR: return Alar; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_ALAREVENT: AlarEventPhase = data; m_auiEncounter[0] = data; break; - case DATA_HIGHASTROMANCERSOLARIANEVENT: m_auiEncounter[1] = data; break; - case DATA_VOIDREAVEREVENT: m_auiEncounter[2] = data; break; - case DATA_KAELTHASEVENT: KaelthasEventPhase = data; m_auiEncounter[3] = data; break; - } - if (data == DONE) - SaveToDB(); - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_ALAREVENT: return AlarEventPhase; - case DATA_HIGHASTROMANCERSOLARIANEVENT: return m_auiEncounter[1]; - case DATA_VOIDREAVEREVENT: return m_auiEncounter[2]; - case DATA_KAELTHASEVENT: return KaelthasEventPhase; - } - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " << m_auiEncounter[2] << " " << m_auiEncounter[3]; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if (out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - return NULL; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - OUT_LOAD_INST_DATA(in); - std::istringstream stream(in); - stream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3]; - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) // Do not load an encounter as "In Progress" - reset it instead. - m_auiEncounter[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_the_eye(Map* pMap) -{ - return new instance_the_eye(pMap); -} - -void AddSC_instance_the_eye() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_the_eye"; - newscript->GetInstanceData = &GetInstanceData_instance_the_eye; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.cpp deleted file mode 100644 index 2dfff45796f..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_eye/the_eye.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: The_Eye -SD%Complete: 100 -SDComment: -SDCategory: Tempest Keep, The Eye -EndScriptData */ - -/* ContentData -mob_crystalcore_devastator -EndContentData */ - -#include "precompiled.h" -#include "def_the_eye.h" - -#define SPELL_COUNTERCHARGE 35035 -#define SPELL_KNOCKAWAY 22893 - -struct TRINITY_DLL_DECL mob_crystalcore_devastatorAI : public ScriptedAI -{ - mob_crystalcore_devastatorAI(Creature *c) : ScriptedAI(c) {} - - uint32 Knockaway_Timer; - uint32 Countercharge_Timer; - - void Reset() - { - Countercharge_Timer = 9000; - Knockaway_Timer = 25000; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - //Check if we have a current target - //Knockaway_Timer - if (Knockaway_Timer < diff) - { - m_creature->CastSpell(m_creature->getVictim(),SPELL_KNOCKAWAY, true); - - // current aggro target is knocked away pick new target - Unit* Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); - - if (!Target || Target == m_creature->getVictim()) - Target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); - - if (Target) - m_creature->TauntApply(Target); - - Knockaway_Timer = 23000; - } - else Knockaway_Timer -= diff; - - //Countercharge_Timer - if (Countercharge_Timer < diff) - { - DoCast(this->m_creature,SPELL_COUNTERCHARGE); - Countercharge_Timer = 45000; - }else Countercharge_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_crystalcore_devastator(Creature* pCreature) -{ - return new mob_crystalcore_devastatorAI (pCreature); -} - -void AddSC_the_eye() -{ - Script *newscript; - newscript = new Script; - newscript->Name="mob_crystalcore_devastator"; - newscript->GetAI = &GetAI_mob_crystalcore_devastator; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp deleted file mode 100644 index 268cfeb2918..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_gyrokill.cpp +++ /dev/null @@ -1,38 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Gatewatcher_Gyrokill -SD%Complete: 0 -SDComment: Place Holder -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1554000 -#define SAY_SAW_ATTACK1 -1554001 -#define SAY_SAW_ATTACK2 -1554002 -#define SAY_SLAY1 -1554003 -#define SAY_SLAY2 -1554004 -#define SAY_DEATH -1554005 - -#define SPELL_STREAM_OF_MACHINE_FLUID 35311 -#define SPELL_SAW_BLADE 35318 -#define H_SPELL_SAW_BLADE 39192 -#define SPELL_SHADOW_POWER 35322 -#define H_SPELL_SHADOW_POWER 39193 - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp deleted file mode 100644 index a1ca31c3e5e..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_gatewatcher_ironhand.cpp +++ /dev/null @@ -1,148 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Gatewatcher_Ironhand -SD%Complete: 75 -SDComment: -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO_1 -1554006 -#define SAY_HAMMER_1 -1554007 -#define SAY_HAMMER_2 -1554008 -#define SAY_SLAY_1 -1554009 -#define SAY_SLAY_2 -1554010 -#define SAY_DEATH_1 -1554011 -#define EMOTE_HAMMER -1554012 - -// Spells to be casted -#define SPELL_SHADOW_POWER 35322 -#define H_SPELL_SHADOW_POWER 39193 -#define SPELL_HAMMER_PUNCH 35326 -#define SPELL_JACKHAMMER 35327 -#define H_SPELL_JACKHAMMER 39194 -#define SPELL_STREAM_OF_MACHINE_FLUID 35311 - -// Gatewatcher Iron-Hand AI -struct TRINITY_DLL_DECL boss_gatewatcher_iron_handAI : public ScriptedAI -{ - boss_gatewatcher_iron_handAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - - bool HeroicMode; - - uint32 Shadow_Power_Timer; - uint32 Jackhammer_Timer; - uint32 Stream_of_Machine_Fluid_Timer; - - void Reset() - { - Shadow_Power_Timer = 25000; - Jackhammer_Timer = 45000; - Stream_of_Machine_Fluid_Timer = 55000; - - } - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO_1, m_creature); - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH_1, m_creature); - - if (!pInstance) - return; - - //TODO: Add door check/open code - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Shadow Power - if (Shadow_Power_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_SHADOW_POWER : SPELL_SHADOW_POWER); - Shadow_Power_Timer = 20000 + rand()%8000; - }else Shadow_Power_Timer -= diff; - - //Jack Hammer - if (Jackhammer_Timer < diff) - { - //TODO: expect cast this about 5 times in a row (?), announce it by emote only once - DoScriptText(EMOTE_HAMMER, m_creature); - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_JACKHAMMER : SPELL_JACKHAMMER); - - //chance to yell, but not same time as emote (after spell in fact casted) - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_HAMMER_1, m_creature); break; - case 1: DoScriptText(SAY_HAMMER_2, m_creature); break; - } - Jackhammer_Timer = 30000; - }else Jackhammer_Timer -= diff; - - //Stream of Machine Fluid - if (Stream_of_Machine_Fluid_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_STREAM_OF_MACHINE_FLUID); - Stream_of_Machine_Fluid_Timer = 35000 + rand()%15000; - }else Stream_of_Machine_Fluid_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_gatewatcher_iron_hand(Creature* pCreature) -{ - return new boss_gatewatcher_iron_handAI (pCreature); -} - -void AddSC_boss_gatewatcher_iron_hand() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_gatewatcher_iron_hand"; - newscript->GetAI = &GetAI_boss_gatewatcher_iron_hand; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp deleted file mode 100644 index da6c613d794..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_nethermancer_sepethrea.cpp +++ /dev/null @@ -1,258 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss_Nethermancer_Sepethrea -SD%Complete: 90 -SDComment: Need adjustments to initial summons -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "precompiled.h" -#include "def_mechanar.h" - -#define SAY_AGGRO -1554013 -#define SAY_SUMMON -1554014 -#define SAY_DRAGONS_BREATH_1 -1554015 -#define SAY_DRAGONS_BREATH_2 -1554016 -#define SAY_SLAY1 -1554017 -#define SAY_SLAY2 -1554018 -#define SAY_DEATH -1554019 - -#define SPELL_SUMMON_RAGIN_FLAMES 35275 -#define H_SPELL_SUMMON_RAGIN_FLAMES 39084 - -#define SPELL_FROST_ATTACK 35263 -#define SPELL_ARCANE_BLAST 35314 -#define SPELL_DRAGONS_BREATH 35250 -#define SPELL_KNOCKBACK 37317 -#define SPELL_SOLARBURN 35267 - -struct TRINITY_DLL_DECL boss_nethermancer_sepethreaAI : public ScriptedAI -{ - boss_nethermancer_sepethreaAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - - bool HeroicMode; - - uint32 frost_attack_Timer; - uint32 arcane_blast_Timer; - uint32 dragons_breath_Timer; - uint32 knockback_Timer; - uint32 solarburn_Timer; - - void Reset() - { - frost_attack_Timer = 7000 + rand()%3000; - arcane_blast_Timer = 12000 + rand()%6000; - dragons_breath_Timer = 18000 + rand()%4000; - knockback_Timer = 22000 + rand()%6000; - solarburn_Timer = 30000; - - if (pInstance) - pInstance->SetData(DATA_NETHERMANCER_EVENT, NOT_STARTED); - } - - void EnterCombat(Unit *who) - { - if (pInstance) - pInstance->SetData(DATA_NETHERMANCER_EVENT, IN_PROGRESS); - - DoScriptText(SAY_AGGRO, m_creature); - DoCast(who, HeroicMode ? H_SPELL_SUMMON_RAGIN_FLAMES : SPELL_SUMMON_RAGIN_FLAMES); - DoScriptText(SAY_SUMMON, m_creature); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_NETHERMANCER_EVENT, DONE); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //Frost Attack - if (frost_attack_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROST_ATTACK); - frost_attack_Timer = 7000 + rand()%3000; - }else frost_attack_Timer -= diff; - - //Arcane Blast - if (arcane_blast_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_ARCANE_BLAST); - arcane_blast_Timer = 15000; - }else arcane_blast_Timer -= diff; - - //Dragons Breath - if (dragons_breath_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_DRAGONS_BREATH); - { - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_DRAGONS_BREATH_1, m_creature); break; - case 1: DoScriptText(SAY_DRAGONS_BREATH_2, m_creature); break; - } - } - dragons_breath_Timer = 12000 + rand()%10000; - }else dragons_breath_Timer -= diff; - - //Knockback - if (knockback_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_KNOCKBACK); - knockback_Timer = 15000 + rand()%10000; - }else knockback_Timer -= diff; - - //Solarburn - if (solarburn_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SOLARBURN); - solarburn_Timer = 30000; - }else solarburn_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_nethermancer_sepethrea(Creature* pCreature) -{ - return new boss_nethermancer_sepethreaAI (pCreature); -} - -#define SPELL_INFERNO 35268 -#define H_SPELL_INFERNO 39346 -#define SPELL_FIRE_TAIL 35278 - -struct TRINITY_DLL_DECL mob_ragin_flamesAI : public ScriptedAI -{ - mob_ragin_flamesAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance *pInstance; - - bool HeroicMode; - - uint32 inferno_Timer; - uint32 flame_timer; - uint32 Check_Timer; - - bool onlyonce; - - void Reset() - { - inferno_Timer = 10000; - flame_timer = 500; - Check_Timer = 2000; - onlyonce = false; - m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_MAGIC, true); - m_creature->ApplySpellImmune(0, IMMUNITY_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, true); - m_creature->SetSpeed(MOVE_RUN, HeroicMode ? 0.7f : 0.5f); - } - - void EnterCombat(Unit* who) - { - } - - void UpdateAI(const uint32 diff) - { - //Check_Timer - if (Check_Timer < diff) - { - if (pInstance) - { - if (pInstance->GetData(DATA_NETHERMANCER_EVENT) != IN_PROGRESS) - { - //remove - m_creature->setDeathState(JUST_DIED); - m_creature->RemoveCorpse(); - } - } - Check_Timer = 1000; - }else Check_Timer -= diff; - - if (!UpdateVictim()) - return; - - if (!onlyonce) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - m_creature->GetMotionMaster()->MoveChase(target); - onlyonce = true; - } - - if (inferno_Timer < diff) - { - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_INFERNO : SPELL_INFERNO); - m_creature->TauntApply(m_creature->getVictim()); - inferno_Timer = 10000; - }else inferno_Timer -= diff; - - if (flame_timer < diff) - { - DoCast(m_creature,SPELL_FIRE_TAIL); - flame_timer = 500; - }else flame_timer -=diff; - - DoMeleeAttackIfReady(); - } - -}; -CreatureAI* GetAI_mob_ragin_flames(Creature* pCreature) -{ - return new mob_ragin_flamesAI (pCreature); -} -void AddSC_boss_nethermancer_sepethrea() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_nethermancer_sepethrea"; - newscript->GetAI = &GetAI_boss_nethermancer_sepethrea; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ragin_flames"; - newscript->GetAI = &GetAI_mob_ragin_flames; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp deleted file mode 100644 index 1e06232c9b6..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/boss_pathaleon_the_calculator.cpp +++ /dev/null @@ -1,257 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -/* ScriptData -SDName: Boss Pathaleon the Calculator -SD%Complete: 50 -SDComment: Event missing. Script for himself 99% blizzlike. -SDCategory: Tempest Keep, The Mechanar -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO -1554020 -#define SAY_DOMINATION_1 -1554021 -#define SAY_DOMINATION_2 -1554022 -#define SAY_SUMMON -1554023 -#define SAY_ENRAGE -1554024 -#define SAY_SLAY_1 -1554025 -#define SAY_SLAY_2 -1554026 -#define SAY_DEATH -1554027 - -// Spells to be casted -#define SPELL_MANA_TAP 36021 -#define SPELL_ARCANE_TORRENT 36022 -#define SPELL_DOMINATION 35280 -#define H_SPELL_ARCANE_EXPLOSION 15453 -#define SPELL_FRENZY 36992 - -#define SPELL_SUMMON_NETHER_WRAITH_1 35285 //Spells work, but not implemented -#define SPELL_SUMMON_NETHER_WRAITH_2 35286 -#define SPELL_SUMMON_NETHER_WRAITH_3 35287 -#define SPELL_SUMMON_NETHER_WRAITH_4 35288 - -// Add Spells -#define SPELL_DETONATION 35058 -#define SPELL_ARCANE_MISSILES 35034 - -struct TRINITY_DLL_DECL boss_pathaleon_the_calculatorAI : public ScriptedAI -{ - boss_pathaleon_the_calculatorAI(Creature *c) : ScriptedAI(c), summons(m_creature) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 Summon_Timer; - SummonList summons; - uint32 ManaTap_Timer; - uint32 ArcaneTorrent_Timer; - uint32 Domination_Timer; - uint32 ArcaneExplosion_Timer; - bool HeroicMode; - bool Enraged; - - uint32 Counter; - - void Reset() - { - Summon_Timer = 30000; - ManaTap_Timer = 12000 + rand()%8000; - ArcaneTorrent_Timer = 16000 + rand()%9000; - Domination_Timer = 25000 + rand()%15000; - ArcaneExplosion_Timer = 8000 + rand()%5000; - - Enraged = false; - - Counter = 0; - summons.DespawnAll(); - } - void EnterCombat(Unit *who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - summons.DespawnAll(); - } - - void JustSummoned(Creature *summon) {summons.Summon(summon);} - void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (Summon_Timer < diff) - { - for(uint8 i = 0; i < 3; ++i) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0); - Creature* Wraith = m_creature->SummonCreature(21062,m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ(),0, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000); - if (target && Wraith) - Wraith->AI()->AttackStart(target); - } - DoScriptText(SAY_SUMMON, m_creature); - Summon_Timer = 30000 + rand()%15000; - }else Summon_Timer -= diff; - - if (ManaTap_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_MANA_TAP); - ManaTap_Timer = 14000 + rand()%8000; - }else ManaTap_Timer -= diff; - - if (ArcaneTorrent_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ARCANE_TORRENT); - ArcaneTorrent_Timer = 12000 + rand()%6000; - }else ArcaneTorrent_Timer -= diff; - - if (Domination_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_DOMINATION_1, m_creature); break; - case 1: DoScriptText(SAY_DOMINATION_2, m_creature); break; - } - - DoCast(target,SPELL_DOMINATION); - } - Domination_Timer = 25000 + rand()%5000; - }else Domination_Timer -= diff; - - //Only casting if Heroic Mode is used - if (HeroicMode) - { - if (ArcaneExplosion_Timer < diff) - { - DoCast(m_creature->getVictim(),H_SPELL_ARCANE_EXPLOSION); - ArcaneExplosion_Timer = 10000 + rand()%4000; - }else ArcaneExplosion_Timer -= diff; - } - - if (!Enraged && m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 21) - { - DoCast(m_creature, SPELL_FRENZY); - DoScriptText(SAY_ENRAGE, m_creature); - Enraged = true; - - } - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_pathaleon_the_calculator(Creature* pCreature) -{ - return new boss_pathaleon_the_calculatorAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_nether_wraithAI : public ScriptedAI -{ - mob_nether_wraithAI(Creature *c) : ScriptedAI(c) {} - - ScriptedInstance *pInstance; - - uint32 ArcaneMissiles_Timer; - uint32 Detonation_Timer; - uint32 Die_Timer; - bool Detonation; - - void Reset() - { - ArcaneMissiles_Timer = 1000 + rand()%3000; - Detonation_Timer = 20000; - Die_Timer = 2200; - Detonation = false; - - } - - void EnterCombat(Unit* who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ArcaneMissiles_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,1)) - DoCast(target,SPELL_ARCANE_MISSILES); - else - DoCast(m_creature->getVictim(),SPELL_ARCANE_MISSILES); - - ArcaneMissiles_Timer = 5000 + rand()%5000; - }else ArcaneMissiles_Timer -=diff; - - if (!Detonation) - { - if (Detonation_Timer < diff) - { - DoCast(m_creature,SPELL_DETONATION); - Detonation = true; - }else Detonation_Timer -= diff; - } - - if (Detonation) - { - if (Die_Timer < diff) - { - m_creature->setDeathState(JUST_DIED); - m_creature->RemoveCorpse(); - }else Die_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } - -}; -CreatureAI* GetAI_mob_nether_wraith(Creature* pCreature) -{ - return new mob_nether_wraithAI (pCreature); -} - -void AddSC_boss_pathaleon_the_calculator() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_pathaleon_the_calculator"; - newscript->GetAI = &GetAI_boss_pathaleon_the_calculator; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_nether_wraith"; - newscript->GetAI = &GetAI_mob_nether_wraith; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/def_mechanar.h b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/def_mechanar.h deleted file mode 100644 index d1b53eebf53..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/def_mechanar.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef DEF_MECHANAR_H -#define DEF_MECHANAR_H - -#define DATA_NETHERMANCER_EVENT 1 -#endif - diff --git a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp b/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.cpp deleted file mode 100644 index e43190620d9..00000000000 --- a/src/bindings/scripts/scripts/zone/tempest_keep/the_mechanar/instance_mechanar.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: Instance_Mechanar -SD%Complete: 100 -SDComment: -SDCategory: Mechanar -EndScriptData */ - -#include "precompiled.h" -#include "def_mechanar.h" - -#define MAX_ENCOUNTER 1 - -struct TRINITY_DLL_DECL instance_mechanar : public ScriptedInstance -{ - instance_mechanar(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - return true; - - return false; - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_NETHERMANCER_EVENT: return m_auiEncounter[0]; - } - - return false; - } - - uint64 GetData64 (uint32 identifier) - { - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_NETHERMANCER_EVENT: m_auiEncounter[0] = data; break; - } - } -}; - -InstanceData* GetInstanceData_instance_mechanar(Map* pMap) -{ - return new instance_mechanar(pMap); -} - -void AddSC_instance_mechanar() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_mechanar"; - newscript->GetInstanceData = &GetInstanceData_instance_mechanar; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp deleted file mode 100644 index 5b6301019a5..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_bjarngrim.cpp +++ /dev/null @@ -1,440 +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 Bjarngrim -SD%Complete: 70% -SDComment: Waypoint needed, we expect boss to always have 2x Stormforged Lieutenant following -SDCategory: Halls of Lightning -EndScriptData */ - -#include "precompiled.h" -#include "def_halls_of_lightning.h" - -enum -{ - //Yell - SAY_AGGRO = -1602000, - SAY_SLAY_1 = -1602001, - SAY_SLAY_2 = -1602002, - SAY_SLAY_3 = -1602003, - SAY_DEATH = -1602004, - SAY_BATTLE_STANCE = -1602005, - EMOTE_BATTLE_STANCE = -1602006, - SAY_BERSEKER_STANCE = -1602007, - EMOTE_BERSEKER_STANCE = -1602008, - SAY_DEFENSIVE_STANCE = -1602009, - EMOTE_DEFENSIVE_STANCE = -1602010, - - SPELL_DEFENSIVE_STANCE = 53790, - //SPELL_DEFENSIVE_AURA = 41105, - SPELL_SPELL_REFLECTION = 36096, - SPELL_PUMMEL = 12555, - SPELL_KNOCK_AWAY = 52029, - SPELL_IRONFORM = 52022, - - SPELL_BERSEKER_STANCE = 53791, - //SPELL_BERSEKER_AURA = 41107, - SPELL_INTERCEPT = 58769, - SPELL_WHIRLWIND = 52027, - SPELL_CLEAVE = 15284, - - SPELL_BATTLE_STANCE = 53792, - //SPELL_BATTLE_AURA = 41106, - SPELL_MORTAL_STRIKE = 16856, - SPELL_SLAM = 52026, - - //OTHER SPELLS - //SPELL_CHARGE_UP = 52098, // only used when starting walk from one platform to the other - //SPELL_TEMPORARY_ELECTRICAL_CHARGE = 52092, // triggered part of above - - NPC_STORMFORGED_LIEUTENANT = 29240, - SPELL_ARC_WELD = 59085, - SPELL_RENEW_STEEL_N = 52774, - SPELL_RENEW_STEEL_H = 59160, - - EQUIP_SWORD = 37871, - EQUIP_SHIELD = 35642, - EQUIP_MACE = 43623, - - STANCE_DEFENSIVE = 0, - STANCE_BERSERKER = 1, - STANCE_BATTLE = 2 -}; - -/*###### -## boss_bjarngrim -######*/ - -struct TRINITY_DLL_DECL boss_bjarngrimAI : public ScriptedAI -{ - boss_bjarngrimAI(Creature *pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - m_uiStance = STANCE_DEFENSIVE; - } - - ScriptedInstance* m_pInstance; - - bool m_bIsHeroic; - bool m_bIsChangingStance; - - uint8 m_uiChargingStatus; - uint8 m_uiStance; - - uint32 m_uiCharge_Timer; - uint32 m_uiChangeStance_Timer; - - uint32 m_uiReflection_Timer; - uint32 m_uiKnockAway_Timer; - uint32 m_uiPummel_Timer; - uint32 m_uiIronform_Timer; - - uint32 m_uiIntercept_Timer; - uint32 m_uiWhirlwind_Timer; - uint32 m_uiCleave_Timer; - - uint32 m_uiMortalStrike_Timer; - uint32 m_uiSlam_Timer; - - uint64 m_uiStormforgedLieutenantGUID[2]; - - void Reset() - { - m_bIsChangingStance = false; - - m_uiChargingStatus = 0; - m_uiCharge_Timer = 1000; - - m_uiChangeStance_Timer = 20000 + rand()%5000; - - m_uiReflection_Timer = 8000; - m_uiKnockAway_Timer = 20000; - m_uiPummel_Timer = 10000; - m_uiIronform_Timer = 25000; - - m_uiIntercept_Timer = 5000; - m_uiWhirlwind_Timer = 10000; - m_uiCleave_Timer = 8000; - - m_uiMortalStrike_Timer = 8000; - m_uiSlam_Timer = 10000; - - for(uint8 i = 0; i < 2; ++i) - { - if (Creature* pStormforgedLieutenant = (Unit::GetCreature((*m_creature), m_uiStormforgedLieutenantGUID[i]))) - { - if (!pStormforgedLieutenant->isAlive()) - pStormforgedLieutenant->Respawn(); - } - } - - if (m_uiStance != STANCE_DEFENSIVE) - { - DoRemoveStanceAura(m_uiStance); - DoCast(m_creature, SPELL_DEFENSIVE_STANCE); - m_uiStance = STANCE_DEFENSIVE; - } - - SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE); - - if (m_pInstance) - m_pInstance->SetData(TYPE_BJARNGRIM, NOT_STARTED); - } - - void EnterCombat(Unit* pWho) - { - DoScriptText(SAY_AGGRO, m_creature); - - //must get both lieutenants here and make sure they are with him - m_creature->CallForHelp(30.0f); - - if (m_pInstance) - m_pInstance->SetData(TYPE_BJARNGRIM, IN_PROGRESS); - } - - void KilledUnit(Unit* pVictim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - case 2: DoScriptText(SAY_SLAY_3, m_creature); break; - } - } - - void JustDied(Unit* pKiller) - { - DoScriptText(SAY_DEATH, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_BJARNGRIM, DONE); - } - - //TODO: remove when removal is done by mangos - void DoRemoveStanceAura(uint8 uiStance) - { - switch(uiStance) - { - case STANCE_DEFENSIVE: - m_creature->RemoveAurasDueToSpell(SPELL_DEFENSIVE_STANCE); - break; - case STANCE_BERSERKER: - m_creature->RemoveAurasDueToSpell(SPELL_BERSEKER_STANCE); - break; - case STANCE_BATTLE: - m_creature->RemoveAurasDueToSpell(SPELL_BATTLE_STANCE); - break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - // Change stance - if (m_uiChangeStance_Timer < uiDiff) - { - //wait for current spell to finish before change stance - if (m_creature->IsNonMeleeSpellCasted(false)) - return; - - DoRemoveStanceAura(m_uiStance); - - int uiTempStance = rand()%(3-1); - - if (uiTempStance >= m_uiStance) - ++uiTempStance; - - m_uiStance = uiTempStance; - - switch(m_uiStance) - { - case STANCE_DEFENSIVE: - DoScriptText(SAY_DEFENSIVE_STANCE, m_creature); - DoScriptText(EMOTE_DEFENSIVE_STANCE, m_creature); - DoCast(m_creature, SPELL_DEFENSIVE_STANCE); - SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SHIELD, EQUIP_NO_CHANGE); - break; - case STANCE_BERSERKER: - DoScriptText(SAY_BERSEKER_STANCE, m_creature); - DoScriptText(EMOTE_BERSEKER_STANCE, m_creature); - DoCast(m_creature, SPELL_BERSEKER_STANCE); - SetEquipmentSlots(false, EQUIP_SWORD, EQUIP_SWORD, EQUIP_NO_CHANGE); - break; - case STANCE_BATTLE: - DoScriptText(SAY_BATTLE_STANCE, m_creature); - DoScriptText(EMOTE_BATTLE_STANCE, m_creature); - DoCast(m_creature, SPELL_BATTLE_STANCE); - SetEquipmentSlots(false, EQUIP_MACE, EQUIP_UNEQUIP, EQUIP_NO_CHANGE); - break; - } - - m_uiChangeStance_Timer = 20000 + rand()%5000; - return; - } - else - m_uiChangeStance_Timer -= uiDiff; - - switch(m_uiStance) - { - case STANCE_DEFENSIVE: - { - if (m_uiReflection_Timer < uiDiff) - { - DoCast(m_creature, SPELL_SPELL_REFLECTION); - m_uiReflection_Timer = 8000 + rand()%1000; - } - else - m_uiReflection_Timer -= uiDiff; - - if (m_uiKnockAway_Timer < uiDiff) - { - DoCast(m_creature, SPELL_KNOCK_AWAY); - m_uiKnockAway_Timer = 20000 + rand()%1000; - } - else - m_uiKnockAway_Timer -= uiDiff; - - if (m_uiPummel_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_PUMMEL); - m_uiPummel_Timer = 10000 + rand()%1000; - } - else - m_uiPummel_Timer -= uiDiff; - - if (m_uiIronform_Timer < uiDiff) - { - DoCast(m_creature, SPELL_IRONFORM); - m_uiIronform_Timer = 25000 + rand()%1000; - } - else - m_uiIronform_Timer -= uiDiff; - - break; - } - case STANCE_BERSERKER: - { - if (m_uiIntercept_Timer < uiDiff) - { - //not much point is this, better random target and more often? - DoCast(m_creature->getVictim(), SPELL_INTERCEPT); - m_uiIntercept_Timer = 45000 + rand()%1000; - } - else - m_uiIntercept_Timer -= uiDiff; - - if (m_uiWhirlwind_Timer < uiDiff) - { - DoCast(m_creature, SPELL_WHIRLWIND); - m_uiWhirlwind_Timer = 10000 + rand()%1000; - } - else - m_uiWhirlwind_Timer -= uiDiff; - - if (m_uiCleave_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_CLEAVE); - m_uiCleave_Timer = 8000 + rand()%1000; - } - else - m_uiCleave_Timer -= uiDiff; - - break; - } - case STANCE_BATTLE: - { - if (m_uiMortalStrike_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); - m_uiMortalStrike_Timer = 20000 + rand()%1000; - } - else - m_uiMortalStrike_Timer -= uiDiff; - - if (m_uiSlam_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_SLAM); - m_uiSlam_Timer = 15000 + rand()%1000; - } - else - m_uiSlam_Timer -= uiDiff; - - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -/*###### -## mob_stormforged_lieutenant -######*/ - -struct TRINITY_DLL_DECL mob_stormforged_lieutenantAI : public ScriptedAI -{ - mob_stormforged_lieutenantAI(Creature *pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - } - - ScriptedInstance* m_pInstance; - bool m_bIsHeroic; - - uint32 m_uiArcWeld_Timer; - uint32 m_uiRenewSteel_Timer; - - void Reset() - { - m_uiArcWeld_Timer = 20000 + rand()%1000; - m_uiRenewSteel_Timer = 10000 + rand()%1000; - } - - void EnterCombat(Unit* pWho) - { - if (m_pInstance) - { - if (Creature* pBjarngrim = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_BJARNGRIM))) - { - if (pBjarngrim->isAlive() && !pBjarngrim->getVictim()) - pBjarngrim->AI()->AttackStart(pWho); - } - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (m_uiArcWeld_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), SPELL_ARC_WELD); - m_uiArcWeld_Timer = 20000 + rand()%1000; - } - else - m_uiArcWeld_Timer -= uiDiff; - - if (m_uiRenewSteel_Timer < uiDiff) - { - if (m_pInstance) - { - if (Creature* pBjarngrim = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_BJARNGRIM))) - { - if (pBjarngrim->isAlive()) - DoCast(pBjarngrim, m_bIsHeroic ? SPELL_RENEW_STEEL_H : SPELL_RENEW_STEEL_N); - } - } - m_uiRenewSteel_Timer = 10000 + rand()%4000; - } - else - m_uiRenewSteel_Timer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_bjarngrim(Creature* pCreature) -{ - return new boss_bjarngrimAI(pCreature); -} - -CreatureAI* GetAI_mob_stormforged_lieutenant(Creature* pCreature) -{ - return new mob_stormforged_lieutenantAI(pCreature); -} - -void AddSC_boss_bjarngrim() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_bjarngrim"; - newscript->GetAI = &GetAI_boss_bjarngrim; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_stormforged_lieutenant"; - newscript->GetAI = &GetAI_mob_stormforged_lieutenant; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp deleted file mode 100644 index 227d23b154a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_ionar.cpp +++ /dev/null @@ -1,399 +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 Ionar -SD%Complete: 80% -SDComment: Timer check -SDCategory: Halls of Lightning -EndScriptData */ - -#include "precompiled.h" -#include "def_halls_of_lightning.h" - -enum -{ - SAY_AGGRO = -1602011, - SAY_SLAY_1 = -1602012, - SAY_SLAY_2 = -1602013, - SAY_SLAY_3 = -1602014, - SAY_DEATH = -1602015, - SAY_SPLIT_1 = -1602016, - SAY_SPLIT_2 = -1602017, - - SPELL_BALL_LIGHTNING_N = 52780, - SPELL_BALL_LIGHTNING_H = 59800, - SPELL_STATIC_OVERLOAD_N = 52658, - SPELL_STATIC_OVERLOAD_H = 59795, - - SPELL_DISPERSE = 52770, - SPELL_SUMMON_SPARK = 52746, - SPELL_SPARK_DESPAWN = 52776, - - //Spark of Ionar - SPELL_SPARK_VISUAL_TRIGGER_N = 52667, - SPELL_SPARK_VISUAL_TRIGGER_H = 59833, - - NPC_SPARK_OF_IONAR = 28926, - - MAX_SPARKS = 5, - POINT_CALLBACK = 0 -}; - -/*###### -## Boss Ionar -######*/ - -struct TRINITY_DLL_DECL boss_ionarAI : public ScriptedAI -{ - boss_ionarAI(Creature *pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - Reset(); - } - - ScriptedInstance* m_pInstance; - - std::list m_lSparkGUIDList; - - bool m_bIsHeroic; - - bool m_bIsSplitPhase; - uint32 m_uiSplit_Timer; - uint32 m_uiSparkAtHomeCount; - - uint32 m_uiStaticOverload_Timer; - uint32 m_uiBallLightning_Timer; - - uint32 m_uiHealthAmountModifier; - - void Reset() - { - m_lSparkGUIDList.clear(); - - m_bIsSplitPhase = true; - m_uiSplit_Timer = 25000; - m_uiSparkAtHomeCount = 0; - - m_uiStaticOverload_Timer = 5000 + rand()%1000; - m_uiBallLightning_Timer = 10000 + rand()%1000; - - m_uiHealthAmountModifier = 1; - - if (m_creature->GetVisibility() == VISIBILITY_OFF) - m_creature->SetVisibility(VISIBILITY_ON); - } - - void AttackedBy(Unit* pAttacker) - { - if (m_creature->getVictim()) - return; - - if (m_creature->GetVisibility() == VISIBILITY_OFF) - return; - - AttackStart(pAttacker); - } - - void Aggro(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_IONAR, IN_PROGRESS); - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_IONAR, NOT_STARTED); - } - - void AttackStart(Unit* pWho) - { - if (m_creature->Attack(pWho, true)) - { - m_creature->AddThreat(pWho, 0.0f); - m_creature->SetInCombatWith(pWho); - pWho->SetInCombatWith(m_creature); - - if (m_creature->GetVisibility() != VISIBILITY_OFF) - m_creature->GetMotionMaster()->MoveChase(pWho); - } - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - DespawnSpark(); - - if (m_pInstance) - m_pInstance->SetData(TYPE_IONAR, DONE); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - case 2: DoScriptText(SAY_SLAY_3, m_creature); break; - } - } - - void DespawnSpark() - { - if (m_lSparkGUIDList.empty()) - return; - - for(std::list::iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr) - { - if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr)) - { - if (pTemp->isAlive()) - pTemp->ForcedDespawn(); - } - } - - m_lSparkGUIDList.clear(); - } - - //make sparks come back - void CallBackSparks() - { - //should never be empty here, but check - if (m_lSparkGUIDList.empty()) - return; - - for(std::list::iterator itr = m_lSparkGUIDList.begin(); itr != m_lSparkGUIDList.end(); ++itr) - { - if (Creature* pSpark = Unit::GetCreature(*m_creature, *itr)) - { - if (pSpark->isAlive()) - { - if (pSpark->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - pSpark->GetMotionMaster()->MovementExpired(); - - pSpark->SetSpeed(MOVE_RUN, pSpark->GetCreatureInfo()->speed * 2); - pSpark->GetMotionMaster()->MovePoint(POINT_CALLBACK, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); - } - } - } - } - - void RegisterSparkAtHome() - { - ++m_uiSparkAtHomeCount; - } - - void JustSummoned(Creature* pSummoned) - { - if (pSummoned->GetEntry() == NPC_SPARK_OF_IONAR) - { - pSummoned->CastSpell(pSummoned, m_bIsHeroic ? SPELL_SPARK_VISUAL_TRIGGER_H : SPELL_SPARK_VISUAL_TRIGGER_N, true); - - Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0); - - if (m_creature->getVictim()) - pSummoned->AI()->AttackStart(pTarget ? pTarget : m_creature->getVictim()); - - m_lSparkGUIDList.push_back(pSummoned->GetGUID()); - } - } - - void UpdateAI(const uint32 uiDiff) - { - // Splitted - if (m_creature->GetVisibility() == VISIBILITY_OFF) - { - if (!m_creature->getVictim()) - { - Reset(); - return; - } - - if (m_uiSplit_Timer < uiDiff) - { - m_uiSplit_Timer = 2500; - - // Return sparks to where Ionar splitted - if (m_bIsSplitPhase) - { - CallBackSparks(); - m_bIsSplitPhase = false; - } - // Lightning effect and restore Ionar - else if (m_uiSparkAtHomeCount == MAX_SPARKS) - { - m_creature->SetVisibility(VISIBILITY_ON); - m_creature->CastSpell(m_creature, SPELL_SPARK_DESPAWN, false); - - DespawnSpark(); - - m_uiSparkAtHomeCount = 0; - m_uiSplit_Timer = 25000; - m_bIsSplitPhase = true; - - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) - { - if (m_creature->getVictim()) - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - } - } - else - m_uiSplit_Timer -= uiDiff; - - return; - } - - //Return since we have no target - if (!UpdateVictim()) - return; - - if (m_uiStaticOverload_Timer < uiDiff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, m_bIsHeroic ? SPELL_STATIC_OVERLOAD_H : SPELL_STATIC_OVERLOAD_N); - - m_uiStaticOverload_Timer = 5000 + rand()%1000; - } - else - m_uiStaticOverload_Timer -= uiDiff; - - if (m_uiBallLightning_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_BALL_LIGHTNING_H : SPELL_BALL_LIGHTNING_N); - m_uiBallLightning_Timer = 10000 + rand()%1000; - } - else - m_uiBallLightning_Timer -= uiDiff; - - // Health check - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(20*m_uiHealthAmountModifier))) - { - ++m_uiHealthAmountModifier; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SPLIT_1, m_creature); break; - case 1: DoScriptText(SAY_SPLIT_2, m_creature); break; - } - - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - DoCast(m_creature, SPELL_DISPERSE); - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_ionar(Creature* pCreature) -{ - return new boss_ionarAI(pCreature); -} - -bool EffectDummyCreature_boss_ionar(Unit* pCaster, uint32 uiSpellId, uint32 uiEffIndex, Creature* pCreatureTarget) -{ - //always check spellid and effectindex - if (uiSpellId == SPELL_DISPERSE && uiEffIndex == 0) - { - if (pCreatureTarget->GetEntry() != NPC_IONAR) - return true; - - for(uint8 i = 0; i < MAX_SPARKS; ++i) - { - pCreatureTarget->CastSpell(pCreatureTarget, SPELL_SUMMON_SPARK, true); - - //TODO: remove this line of hack when summon implemented - pCreatureTarget->SummonCreature(NPC_SPARK_OF_IONAR, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 5000); - } - - pCreatureTarget->AttackStop(); - pCreatureTarget->SetVisibility(VISIBILITY_OFF); - - if (pCreatureTarget->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - pCreatureTarget->GetMotionMaster()->MovementExpired(); - - //always return true when we are handling this spell and effect - return true; - } - return false; -} - -/*###### -## mob_spark_of_ionar -######*/ - -struct TRINITY_DLL_DECL mob_spark_of_ionarAI : public ScriptedAI -{ - mob_spark_of_ionarAI(Creature *pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - Reset(); - } - - ScriptedInstance* m_pInstance; - - void Reset() { } - - void MovementInform(uint32 uiType, uint32 uiPointId) - { - if (uiType != POINT_MOTION_TYPE || !m_pInstance) - return; - - if (uiPointId == POINT_CALLBACK) - { - if (Creature* pIonar = m_pInstance->instance->GetCreature(m_pInstance->GetData64(DATA_IONAR))) - { - if (!pIonar->isAlive()) - { - m_creature->ForcedDespawn(); - return; - } - - if (boss_ionarAI* pIonarAI = dynamic_cast(pIonar->AI())) - pIonarAI->RegisterSparkAtHome(); - } - else - m_creature->ForcedDespawn(); - } - } -}; - -CreatureAI* GetAI_mob_spark_of_ionar(Creature* pCreature) -{ - return new mob_spark_of_ionarAI(pCreature); -} - -void AddSC_boss_ionar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_ionar"; - newscript->GetAI = &GetAI_boss_ionar; - newscript->pEffectDummyCreature = &EffectDummyCreature_boss_ionar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_spark_of_ionar"; - newscript->GetAI = &GetAI_mob_spark_of_ionar; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp deleted file mode 100644 index 164b393b6d9..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_loken.cpp +++ /dev/null @@ -1,253 +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 Loken -SD%Complete: 60% -SDComment: Missing intro. Remove hack of Pulsing Shockwave when core supports. Aura is not working (59414) -SDCategory: Halls of Lightning -EndScriptData */ - -#include "precompiled.h" -#include "def_halls_of_lightning.h" - -enum -{ - ACHIEVEMENT_TIMELY_DEATH = 1867, - - SAY_AGGRO = -1602018, - SAY_INTRO_1 = -1602019, - SAY_INTRO_2 = -1602020, - SAY_SLAY_1 = -1602021, - SAY_SLAY_2 = -1602022, - SAY_SLAY_3 = -1602023, - SAY_DEATH = -1602024, - SAY_NOVA_1 = -1602025, - SAY_NOVA_2 = -1602026, - SAY_NOVA_3 = -1602027, - SAY_75HEALTH = -1602028, - SAY_50HEALTH = -1602029, - SAY_25HEALTH = -1602030, - EMOTE_NOVA = -1602031, - - SPELL_ARC_LIGHTNING = 52921, - SPELL_LIGHTNING_NOVA_N = 52960, - SPELL_LIGHTNING_NOVA_H = 59835, - - SPELL_PULSING_SHOCKWAVE_N = 52961, - SPELL_PULSING_SHOCKWAVE_H = 59836, - SPELL_PULSING_SHOCKWAVE_AURA = 59414 -}; - -/*###### -## Boss Loken -######*/ - -struct TRINITY_DLL_DECL boss_lokenAI : public ScriptedAI -{ - boss_lokenAI(Creature* pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - } - - ScriptedInstance* m_pInstance; - - bool m_bIsHeroic; - bool m_bIsAura; - - uint32 m_uiArcLightning_Timer; - uint32 m_uiLightningNova_Timer; - uint32 m_uiPulsingShockwave_Timer; - uint32 m_uiResumePulsingShockwave_Timer; - - uint32 m_uiHealthAmountModifier; - - uint32 EncounterTimer; - - void Reset() - { - m_bIsAura = false; - - m_uiArcLightning_Timer = 15000; - m_uiLightningNova_Timer = 20000; - m_uiPulsingShockwave_Timer = 2000; - m_uiResumePulsingShockwave_Timer = 15000; - - m_uiHealthAmountModifier = 1; - - EncounterTimer = 0; - - if (m_pInstance) - m_pInstance->SetData(TYPE_LOKEN, NOT_STARTED); - } - - void EnterCombat(Unit* pWho) - { - DoScriptText(SAY_AGGRO, m_creature); - - EncounterTimer = 1; - - if (m_pInstance) - m_pInstance->SetData(TYPE_LOKEN, IN_PROGRESS); - } - - void JustDied(Unit* pKiller) - { - DoScriptText(SAY_DEATH, m_creature); - - if (m_bIsHeroic && EncounterTimer <= 120000) - { - AchievementEntry const *AchievTimelyDeath = GetAchievementStore()->LookupEntry(ACHIEVEMENT_TIMELY_DEATH); - if (AchievTimelyDeath) - { - Map* pMap = m_creature->GetMap(); - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &players = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - itr->getSource()->CompletedAchievement(AchievTimelyDeath); - } - } - } - - if (m_pInstance) - m_pInstance->SetData(TYPE_LOKEN, DONE); - } - - void KilledUnit(Unit* pVictim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (EncounterTimer) - EncounterTimer += uiDiff; - - if (m_bIsAura) - { - // workaround for PULSING_SHOCKWAVE - if (m_uiPulsingShockwave_Timer < uiDiff) - { - Map* pMap = m_creature->GetMap(); - if (pMap->IsDungeon()) - { - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - - if (PlayerList.isEmpty()) - return; - - for (Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (i->getSource()->isAlive() && i->getSource()->isTargetableForAttack()) - { - int32 dmg; - float m_fDist = m_creature->GetDistance(i->getSource()); - - if (m_fDist <= 1.0f) // Less than 1 yard - dmg = (m_bIsHeroic ? 850 : 800); // need to correct damage - else // Further from 1 yard - dmg = ((m_bIsHeroic ? 250 : 200) * m_fDist) + (m_bIsHeroic ? 850 : 800); // need to correct damage - - m_creature->CastCustomSpell(i->getSource(), (m_bIsHeroic ? 59837 : 52942), &dmg, 0, 0, false); - } - } - m_uiPulsingShockwave_Timer = 2000; - }else m_uiPulsingShockwave_Timer -= uiDiff; - } - else - { - if (m_uiResumePulsingShockwave_Timer < uiDiff) - { - //breaks at movement, can we assume when it's time, this spell is casted and also must stop movement? - m_creature->CastSpell(m_creature, SPELL_PULSING_SHOCKWAVE_AURA, true); - - DoCast(m_creature, m_bIsHeroic ? SPELL_PULSING_SHOCKWAVE_H : SPELL_PULSING_SHOCKWAVE_N); // need core support - m_bIsAura = true; - m_uiResumePulsingShockwave_Timer = 0; - } - else - m_uiResumePulsingShockwave_Timer -= uiDiff; - } - - if (m_uiArcLightning_Timer < uiDiff) - { - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(pTarget, SPELL_ARC_LIGHTNING); - - m_uiArcLightning_Timer = 15000 + rand()%1000; - } - else - m_uiArcLightning_Timer -= uiDiff; - - if (m_uiLightningNova_Timer < uiDiff) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_NOVA_1, m_creature);break; - case 1: DoScriptText(SAY_NOVA_2, m_creature);break; - case 2: DoScriptText(SAY_NOVA_3, m_creature);break; - } - - DoCast(m_creature, m_bIsHeroic ? SPELL_LIGHTNING_NOVA_H : SPELL_LIGHTNING_NOVA_N); - - m_bIsAura = false; - m_uiResumePulsingShockwave_Timer = (m_bIsHeroic ? 4000 : 5000); // Pause Pulsing Shockwave aura - m_uiLightningNova_Timer = 20000 + rand()%1000; - } - else - m_uiLightningNova_Timer -= uiDiff; - - // Health check - if ((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(25*m_uiHealthAmountModifier))) - { - switch(m_uiHealthAmountModifier) - { - case 1: DoScriptText(SAY_75HEALTH, m_creature); break; - case 2: DoScriptText(SAY_50HEALTH, m_creature); break; - case 3: DoScriptText(SAY_25HEALTH, m_creature); break; - } - - ++m_uiHealthAmountModifier; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_loken(Creature* pCreature) -{ - return new boss_lokenAI(pCreature); -} - -void AddSC_boss_loken() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_loken"; - newscript->GetAI = &GetAI_boss_loken; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp deleted file mode 100644 index 35eadb9783e..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/boss_volkhan.cpp +++ /dev/null @@ -1,494 +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 Volkhan -SD%Complete: 60% -SDComment: Not considered complete. Some events may fail and need further development -SDCategory: Halls of Lightning -EndScriptData */ - -#include "precompiled.h" -#include "def_halls_of_lightning.h" - -enum -{ - SAY_AGGRO = -1602032, - SAY_SLAY_1 = -1602033, - SAY_SLAY_2 = -1602034, - SAY_SLAY_3 = -1602035, - SAY_DEATH = -1602036, - SAY_STOMP_1 = -1602037, - SAY_STOMP_2 = -1602038, - SAY_FORGE_1 = -1602039, - SAY_FORGE_2 = -1602040, - EMOTE_TO_ANVIL = -1602041, - EMOTE_SHATTER = -1602042, - - SPELL_HEAT_N = 52387, - SPELL_HEAT_H = 59528, - SPELL_SHATTERING_STOMP_N = 52237, - SPELL_SHATTERING_STOMP_H = 59529, - - //unclear how "directions" of spells must be. Last, summoning GO, what is it for? Script depend on: - SPELL_TEMPER = 52238, //TARGET_SCRIPT boss->anvil - SPELL_TEMPER_DUMMY = 52654, //TARGET_SCRIPT anvil->boss - - //SPELL_TEMPER_VISUAL = 52661, //summons GO - - SPELL_SUMMON_MOLTEN_GOLEM = 52405, - - //Molten Golem - SPELL_BLAST_WAVE = 23113, - SPELL_IMMOLATION_STRIKE_N = 52433, - SPELL_IMMOLATION_STRIKE_H = 59530, - SPELL_SHATTER_N = 52429, - SPELL_SHATTER_H = 59527, - - NPC_VOLKHAN_ANVIL = 28823, - NPC_MOLTEN_GOLEM = 28695, - NPC_BRITTLE_GOLEM = 28681, - - POINT_ID_ANVIL = 0, - MAX_GOLEM = 2 -}; - -/*###### -## Boss Volkhan -######*/ - -struct TRINITY_DLL_DECL boss_volkhanAI : public ScriptedAI -{ - boss_volkhanAI(Creature *pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - Reset(); - } - - ScriptedInstance* m_pInstance; - - std::list m_lGolemGUIDList; - - bool m_bIsHeroic; - bool m_bHasTemper; - bool m_bIsStriking; - bool m_bCanShatterGolem; - - uint32 m_uiPause_Timer; - uint32 m_uiShatteringStomp_Timer; - uint32 m_uiShatter_Timer; - - uint32 m_uiHealthAmountModifier; - - void Reset() - { - m_bIsStriking = false; - m_bHasTemper = false; - m_bCanShatterGolem = false; - - m_uiPause_Timer = 3500; - m_uiShatteringStomp_Timer = 0; - m_uiShatter_Timer = 5000; - - m_uiHealthAmountModifier = 1; - - DespawnGolem(); - m_lGolemGUIDList.clear(); - - if (m_pInstance) - m_pInstance->SetData(TYPE_VOLKHAN, NOT_STARTED); - } - - void Aggro(Unit* pWho) - { - DoScriptText(SAY_AGGRO, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_VOLKHAN, IN_PROGRESS); - } - - void AttackStart(Unit* pWho) - { - if (m_creature->Attack(pWho, true)) - { - m_creature->AddThreat(pWho, 0.0f); - m_creature->SetInCombatWith(pWho); - pWho->SetInCombatWith(m_creature); - - if (!m_bHasTemper) - m_creature->GetMotionMaster()->MoveChase(pWho); - } - } - - void JustDied(Unit* pKiller) - { - DoScriptText(SAY_DEATH, m_creature); - DespawnGolem(); - - if (m_pInstance) - m_pInstance->SetData(TYPE_VOLKHAN, DONE); - } - - void KilledUnit(Unit* pVictim) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - case 2: DoScriptText(SAY_SLAY_3, m_creature); break; - } - } - - void DespawnGolem() - { - if (m_lGolemGUIDList.empty()) - return; - - for(std::list::iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr) - { - if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr)) - { - if (pTemp->isAlive()) - pTemp->ForcedDespawn(); - } - } - - m_lGolemGUIDList.clear(); - } - - void ShatterGolem() - { - if (m_lGolemGUIDList.empty()) - return; - - for(std::list::iterator itr = m_lGolemGUIDList.begin(); itr != m_lGolemGUIDList.end(); ++itr) - { - if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr)) - { - // only shatter brittle golems - if (pTemp->isAlive() && pTemp->GetEntry() == NPC_BRITTLE_GOLEM) - pTemp->CastSpell(pTemp, m_bIsHeroic ? SPELL_SHATTER_H : SPELL_SHATTER_N, false); - } - } - } - - void SpellHit(Unit* pCaster, const SpellEntry* pSpell) - { - if (pSpell->Id == SPELL_TEMPER_DUMMY) - m_bIsStriking = true; - } - - void JustSummoned(Creature* pSummoned) - { - if (pSummoned->GetEntry() == NPC_MOLTEN_GOLEM) - { - m_lGolemGUIDList.push_back(pSummoned->GetGUID()); - - if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM, 0)) - pSummoned->AI()->AttackStart(pTarget); - - //why healing when just summoned? - pSummoned->CastSpell(pSummoned, m_bIsHeroic ? SPELL_HEAT_H : SPELL_HEAT_N, false, NULL, NULL, m_creature->GetGUID()); - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (m_bIsStriking) - { - if (m_uiPause_Timer < uiDiff) - { - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() != TARGETED_MOTION_TYPE) - { - if (m_creature->getVictim()) - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - - m_bHasTemper = false; - m_bIsStriking = false; - m_uiPause_Timer = 3500; - } - else - m_uiPause_Timer -= uiDiff; - - return; - } - - // When to start shatter? After 60, 40 or 20% hp? - if (!m_bHasTemper && m_uiHealthAmountModifier >= 3) - { - if (m_uiShatteringStomp_Timer < uiDiff) - { - //should he stomp even if he has no brittle golem to shatter? - - switch(rand()%2) - { - case 0: DoScriptText(SAY_STOMP_1, m_creature); break; - case 1: DoScriptText(SAY_STOMP_2, m_creature); break; - } - - DoCast(m_creature, m_bIsHeroic ? SPELL_SHATTERING_STOMP_H : SPELL_SHATTERING_STOMP_N); - - DoScriptText(EMOTE_SHATTER, m_creature); - - m_uiShatteringStomp_Timer = 30000; - m_bCanShatterGolem = true; - } - else - m_uiShatteringStomp_Timer -= uiDiff; - } - - // Shatter Golems 3 seconds after Shattering Stomp - if (m_bCanShatterGolem) - { - if (m_uiShatter_Timer < uiDiff) - { - ShatterGolem(); - m_uiShatter_Timer = 3000; - m_bCanShatterGolem = false; - } - else - m_uiShatter_Timer -= uiDiff; - } - - // Health check - if (!m_bCanShatterGolem && (m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < (100-(20*m_uiHealthAmountModifier))) - { - ++m_uiHealthAmountModifier; - - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - switch(rand()%2) - { - case 0: DoScriptText(SAY_FORGE_1, m_creature); break; - case 1: DoScriptText(SAY_FORGE_2, m_creature); break; - } - - m_bHasTemper = true; - - m_creature->CastSpell(m_creature, SPELL_TEMPER, false); - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_volkhan(Creature* pCreature) -{ - return new boss_volkhanAI(pCreature); -} - -bool EffectDummyCreature_boss_volkhan(Unit* pCaster, uint32 uiSpellId, uint32 uiEffIndex, Creature* pCreatureTarget) -{ - //always check spellid and effectindex - if (uiSpellId == SPELL_TEMPER_DUMMY && uiEffIndex == 0) - { - if (pCaster->GetEntry() != NPC_VOLKHAN_ANVIL || pCreatureTarget->GetEntry() != NPC_VOLKHAN) - return true; - - for(uint8 i = 0; i < MAX_GOLEM; ++i) - { - pCreatureTarget->CastSpell(pCaster, SPELL_SUMMON_MOLTEN_GOLEM, true); - - //TODO: remove this line of hack when summon effect implemented - pCreatureTarget->SummonCreature(NPC_MOLTEN_GOLEM, - pCaster->GetPositionX(), pCaster->GetPositionY(), pCaster->GetPositionZ(), 0.0f, - TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - } - - //always return true when we are handling this spell and effect - return true; - } - - return false; -} - -/*###### -## npc_volkhan_anvil -######*/ - -bool EffectDummyCreature_npc_volkhan_anvil(Unit* pCaster, uint32 uiSpellId, uint32 uiEffIndex, Creature* pCreatureTarget) -{ - //always check spellid and effectindex - if (uiSpellId == SPELL_TEMPER && uiEffIndex == 0) - { - if (pCaster->GetEntry() != NPC_VOLKHAN || pCreatureTarget->GetEntry() != NPC_VOLKHAN_ANVIL) - return true; - - Creature *cre = CAST_CRE(pCaster); - - DoScriptText(EMOTE_TO_ANVIL, pCaster); - - float fX, fY, fZ; - pCreatureTarget->GetContactPoint(pCaster, fX, fY, fZ, INTERACTION_DISTANCE); - - pCaster->AttackStop(); - - if (pCaster->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - pCaster->GetMotionMaster()->MovementExpired(); - - cre->GetMap()->CreatureRelocation(cre, fX, fY, fZ, pCreatureTarget->GetOrientation()); - cre->SendMonsterMove(fX, fY, fZ, 0, cre->GetUnitMovementFlags(), 1); - - pCreatureTarget->CastSpell(pCaster, SPELL_TEMPER_DUMMY, false); - - //always return true when we are handling this spell and effect - return true; - } - - return false; -} - -/*###### -## mob_molten_golem -######*/ - -struct TRINITY_DLL_DECL mob_molten_golemAI : public ScriptedAI -{ - mob_molten_golemAI(Creature *pCreature) : ScriptedAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - m_bIsHeroic = pCreature->GetMap()->IsHeroic(); - Reset(); - } - - ScriptedInstance* m_pInstance; - - bool m_bIsHeroic; - bool m_bIsFrozen; - - uint32 m_uiBlast_Timer; - uint32 m_uiDeathDelay_Timer; - uint32 m_uiImmolation_Timer; - - void Reset() - { - m_bIsFrozen = false; - - m_uiBlast_Timer = 20000; - m_uiDeathDelay_Timer = 0; - m_uiImmolation_Timer = 5000; - } - - void AttackStart(Unit* pWho) - { - if (m_creature->Attack(pWho, true)) - { - m_creature->AddThreat(pWho, 0.0f); - m_creature->SetInCombatWith(pWho); - pWho->SetInCombatWith(m_creature); - - if (!m_bIsFrozen) - m_creature->GetMotionMaster()->MoveChase(pWho); - } - } - - void DamageTaken(Unit* pDoneBy, uint32 &uiDamage) - { - if (m_bIsFrozen) - { - //workaround for now, brittled should be immune to any kind of attacks - uiDamage = 0; - return; - } - - if (uiDamage > m_creature->GetHealth()) - { - m_bIsFrozen = true; - - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - m_creature->RemoveAllAuras(); - m_creature->AttackStop(); - - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - m_creature->GetMotionMaster()->MovementExpired(); - - uiDamage = m_creature->GetHealth()-1; - - m_creature->UpdateEntry(NPC_BRITTLE_GOLEM); - m_creature->SetHealth(1); - } - } - - void SpellHit(Unit* pCaster, const SpellEntry* pSpell) - { - //this is the dummy effect of the spells - if (pSpell->Id == SPELL_SHATTER_N || pSpell->Id == SPELL_SHATTER_H) - { - if (m_creature->GetEntry() == NPC_BRITTLE_GOLEM) - m_creature->ForcedDespawn(); - } - } - - void UpdateAI(const uint32 uiDiff) - { - //Return since we have no target or if we are frozen - if (!UpdateVictim() || m_bIsFrozen) - return; - - if (m_uiBlast_Timer < uiDiff) - { - DoCast(m_creature, SPELL_BLAST_WAVE); - m_uiBlast_Timer = 20000; - } - else - m_uiBlast_Timer -= uiDiff; - - if (m_uiImmolation_Timer < uiDiff) - { - DoCast(m_creature->getVictim(), m_bIsHeroic ? SPELL_IMMOLATION_STRIKE_H : SPELL_IMMOLATION_STRIKE_N); - m_uiImmolation_Timer = 5000; - } - else - m_uiImmolation_Timer -= uiDiff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_molten_golem(Creature* pCreature) -{ - return new mob_molten_golemAI(pCreature); -} - -void AddSC_boss_volkhan() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_volkhan"; - newscript->GetAI = &GetAI_boss_volkhan; - newscript->pEffectDummyCreature = &EffectDummyCreature_boss_volkhan; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "npc_volkhan_anvil"; - newscript->pEffectDummyCreature = &EffectDummyCreature_npc_volkhan_anvil; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_molten_golem"; - newscript->GetAI = &GetAI_mob_molten_golem; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h deleted file mode 100644 index 8790274e599..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/def_halls_of_lightning.h +++ /dev/null @@ -1,34 +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_HALLS_OF_LIGHTNING_H -#define DEF_HALLS_OF_LIGHTNING_H - -enum -{ - MAX_ENCOUNTER = 4, - - DATA_BJARNGRIM = 1, - DATA_IONAR = 2, - DATA_LOKEN = 3, - DATA_VOLKHAN = 4, - - TYPE_BJARNGRIM = 10, - TYPE_IONAR = 11, - TYPE_LOKEN = 12, - TYPE_VOLKHAN = 13, - - NPC_BJARNGRIM = 28586, - NPC_VOLKHAN = 28587, - NPC_IONAR = 28546, - NPC_LOKEN = 28923, - - GO_BJARNGRIM_DOOR = 191416, //_doors10 - GO_VOLKHAN_DOOR = 191325, //_doors07 - GO_IONAR_DOOR = 191326, //_doors05 - GO_LOKEN_DOOR = 191324, //_doors02 - GO_LOKEN_THRONE = 192654 -}; - -#endif diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp deleted file mode 100644 index e9d75fb8b6f..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_lightning/instance_halls_of_lightning.cpp +++ /dev/null @@ -1,194 +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_Halls_of_Lightning -SD%Complete: 90% -SDComment: All ready. -SDCategory: Halls of Lightning -EndScriptData */ - -#include "precompiled.h" -#include "def_halls_of_lightning.h" - -/* Halls of Lightning encounters: -0 - General Bjarngrim -1 - Volkhan -2 - Ionar -3 - Loken -*/ - -struct TRINITY_DLL_DECL instance_halls_of_lightning : public ScriptedInstance -{ - instance_halls_of_lightning(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - - uint64 m_uiGeneralBjarngrimGUID; - uint64 m_uiIonarGUID; - uint64 m_uiLokenGUID; - uint64 m_uiVolkhanGUID; - - uint64 m_uiBjarngrimDoorGUID; - uint64 m_uiVolkhanDoorGUID; - uint64 m_uiIonarDoorGUID; - uint64 m_uiLokenDoorGUID; - uint64 m_uiLokenGlobeGUID; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiGeneralBjarngrimGUID = 0; - m_uiVolkhanGUID = 0; - m_uiIonarGUID = 0; - m_uiLokenGUID = 0; - - m_uiBjarngrimDoorGUID = 0; - m_uiVolkhanDoorGUID = 0; - m_uiIonarDoorGUID = 0; - m_uiLokenDoorGUID = 0; - m_uiLokenGlobeGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case NPC_BJARNGRIM: - m_uiGeneralBjarngrimGUID = pCreature->GetGUID(); - break; - case NPC_VOLKHAN: - m_uiVolkhanGUID = pCreature->GetGUID(); - break; - case NPC_IONAR: - m_uiIonarGUID = pCreature->GetGUID(); - break; - case NPC_LOKEN: - m_uiLokenGUID = pCreature->GetGUID(); - break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case GO_BJARNGRIM_DOOR: - m_uiBjarngrimDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[0] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case GO_VOLKHAN_DOOR: - m_uiVolkhanDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[1] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case GO_IONAR_DOOR: - m_uiIonarDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[2] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case GO_LOKEN_DOOR: - m_uiLokenDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case GO_LOKEN_THRONE: - m_uiLokenGlobeGUID = pGo->GetGUID(); - break; - } - } - - void SetData(uint32 uiType, uint32 uiData) - { - switch(uiType) - { - case TYPE_BJARNGRIM: - if (uiData == DONE) - DoUseDoorOrButton(m_uiBjarngrimDoorGUID); - m_auiEncounter[0] = uiData; - break; - case TYPE_VOLKHAN: - if (uiData == DONE) - DoUseDoorOrButton(m_uiVolkhanDoorGUID); - m_auiEncounter[1] = uiData; - break; - case TYPE_IONAR: - if (uiData == DONE) - DoUseDoorOrButton(m_uiIonarDoorGUID); - m_auiEncounter[2] = uiData; - break; - case TYPE_LOKEN: - if (uiData == DONE) - { - DoUseDoorOrButton(m_uiLokenDoorGUID); - - //Appears to be type 5 GO with animation. Need to figure out how this work, code below only placeholder - if (GameObject* pGlobe = instance->GetGameObject(m_uiLokenGlobeGUID)) - pGlobe->SetGoState(GO_STATE_ACTIVE); - } - m_auiEncounter[3] = uiData; - break; - } - } - - uint32 GetData(uint32 uiType) - { - switch(uiType) - { - case TYPE_BJARNGRIM: - return m_auiEncounter[0]; - case TYPE_VOLKHAN: - return m_auiEncounter[1]; - case TYPE_IONAR: - return m_auiEncounter[2]; - case TYPE_LOKEN: - return m_auiEncounter[3]; - } - return 0; - } - - uint64 GetData64(uint32 uiData) - { - switch(uiData) - { - case DATA_BJARNGRIM: - return m_uiGeneralBjarngrimGUID; - case DATA_VOLKHAN: - return m_uiVolkhanGUID; - case DATA_IONAR: - return m_uiIonarGUID; - case DATA_LOKEN: - return m_uiLokenGUID; - } - return 0; - } -}; - -InstanceData* GetInstanceData_instance_halls_of_lightning(Map* pMap) -{ - return new instance_halls_of_lightning(pMap); -} - -void AddSC_instance_halls_of_lightning() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_halls_of_lightning"; - newscript->GetInstanceData = &GetInstanceData_instance_halls_of_lightning; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp deleted file mode 100644 index e7ec03124de..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_krystallus.cpp +++ /dev/null @@ -1,73 +0,0 @@ -/* Script Data Start -SDName: Boss krystallus -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_krystallus' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_BOULDER_TOSS 50843 -#define SPELL_BOULDER_TOSS_2 59742 -#define SPELL_GROUND_SPIKE 59750 -#define SPELL_SHATTER 50810 -#define SPELL_SHATTER_2 61546 -#define SPELL_STOMP 48131 -#define SPELL_STOMP_2 59744 - -//Yell -#define SAY_AGGRO -1599000 -#define SAY_KILL -1599001 -#define SAY_DEATH -1599002 -#define SAY_SHATTER -1599003 - -struct TRINITY_DLL_DECL boss_krystallusAI : public ScriptedAI -{ - boss_krystallusAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - DoScriptText(SAY_KILL, m_creature); - } -}; - -CreatureAI* GetAI_boss_krystallus(Creature* pCreature) -{ - return new boss_krystallusAI (pCreature); -} - -void AddSC_boss_krystallus() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_krystallus"; - newscript->GetAI = &GetAI_boss_krystallus; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp deleted file mode 100644 index 51e8f26f6a9..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_maiden_of_grief.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* Script Data Start -SDName: Boss maiden_of_grief -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_maiden_of_grief' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spell -#define SPELL_PARTING_SORROW 59723 -#define SPELL_STORM_OF_GRIEF 50752 -#define SPELL_STORM_OF_GRIEF_2 59772 -#define SPELL_SHOCK_OF_SORROW 50760 -#define SPELL_SHOCK_OF_SORROW_2 59726 -#define SPELL_PILLAR_OF_WOE 50761 -#define SPELL_PILLAR_OF_WOE_2 59727 - -//Yell -#define SAY_AGGRO -1599004 -#define SAY_SLAY_1 -1599005 -#define SAY_SLAY_2 -1599006 -#define SAY_SLAY_3 -1599007 -#define SAY_SLAY_4 -1599008 -#define SAY_DEATH -1599009 -#define SAY_STUN -1599010 - -struct TRINITY_DLL_DECL boss_maiden_of_griefAI : public ScriptedAI -{ - boss_maiden_of_griefAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_maiden_of_grief(Creature* pCreature) -{ - return new boss_maiden_of_griefAI (pCreature); -} - -void AddSC_boss_maiden_of_grief() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_maiden_of_grief"; - newscript->GetAI = &GetAI_boss_maiden_of_grief; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp deleted file mode 100644 index d0b0889ea63..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/boss_sjonnir.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* Script Data Start -SDName: Boss sjonnir -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_sjonnir' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_LIGHTING_RING_1 50840 //Periodic Trigger (interval 2s) spell = 50841 -#define SPELL_LIGHTING_RING_2 51849 //Periodic Trigger (interval 2s) spell = 50841 -#define SPELL_LIGHTING_RING_2 59848 //Periodic Trigger (interval 2s) spell = 59849 -#define SPELL_LIGHTING_RING_3 59861 //Periodic Trigger (interval 2s) spell = 59849 -#define SPELL_STATIC_CHARGE_1 50834 //Periodic Trigger 2s interval, spell =50835 -#define SPELL_STATIC_CHARGE_2 59846 //Periodic Trigger 2s interval, spell =50847 -#define SPELL_CHAIN_LIGHTING_1 50830 -#define SPELL_CHAIN_LIGHTING_2 59844 -#define SPELL_LIGHTING_SHIELD_1 50831 -#define SPELL_LIGHTING_SHIELD_2 59845 -#define SPELL_FRENZY 28747 - -//Yell -#define SAY_AGGRO -1599011 -#define SAY_SLAY_1 -1599012 -#define SAY_SLAY_2 -1599013 -#define SAY_SLAY_3 -1599014 -#define SAY_DEATH -1599015 - -struct TRINITY_DLL_DECL boss_sjonnirAI : public ScriptedAI -{ - boss_sjonnirAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_sjonnir(Creature* pCreature) -{ - return new boss_sjonnirAI (pCreature); -} - -void AddSC_boss_sjonnir() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_sjonnir"; - newscript->GetAI = &GetAI_boss_sjonnir; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h deleted file mode 100644 index ade934ad921..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/def_halls_of_stone.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_HALLS_OF_STONE_H -#define DEF_HALLS_OF_STONE_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp b/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp deleted file mode 100644 index fa2dd83637f..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/halls_of_stone/instance_halls_of_stone.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_halls_of_stone.h" - -struct TRINITY_DLL_DECL instance_halls_of_stone : public ScriptedInstance -{ - instance_halls_of_stone(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_halls_of_stone(Map* pMap) -{ - return new instance_halls_of_stone(pMap); -} - -void AddSC_instance_halls_of_stone() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_halls_of_stone"; - newscript->GetInstanceData = &GetInstanceData_instance_halls_of_stone; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_algalon.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_algalon.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_algalon.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_assembly_of_iron.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_assembly_of_iron.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_assembly_of_iron.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_auriaya.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_auriaya.cpp deleted file mode 100644 index 685e2b506c0..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_auriaya.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_ulduar.h" - -//boss_auriaya -#define SPELL_TERRIFYING_SCREECH 64386 -#define SPELL_SONIC_BOOM 38897 -#define SAY_AGGRO -2615016 -#define SAY_SLAY_1 -2615017 - -struct TRINITY_DLL_DECL boss_auriaya_AI : public ScriptedAI -{ - boss_auriaya_AI(Creature *c) : ScriptedAI(c) {} - - uint32 TERRIFYING_SCREECH_Timer; - uint32 SONIC_BOOM_Timer; - - void Reset() - { - TERRIFYING_SCREECH_Timer = 0; - SONIC_BOOM_Timer = 2000; - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO,m_creature); - } - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_SLAY_1, m_creature); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_SLAY_1, m_creature); - } - - void MoveInLineOfSight(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (TERRIFYING_SCREECH_Timer < diff) - { - DoCast(m_creature,SPELL_TERRIFYING_SCREECH); - DoScriptText(SAY_SLAY_1, m_creature); - TERRIFYING_SCREECH_Timer = 360000; - } else TERRIFYING_SCREECH_Timer -= diff; - - if (SONIC_BOOM_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SONIC_BOOM); - SONIC_BOOM_Timer = 20000; - } else SONIC_BOOM_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_auriaya(Creature* pCreature) -{ - return new boss_auriaya_AI (pCreature); -} -void AddSC_boss_auriaya() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_auriaya"; - newscript->GetAI = &GetAI_boss_auriaya; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp deleted file mode 100644 index 20ad85351a9..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_flame_leviathan.cpp +++ /dev/null @@ -1,306 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_ulduar.h" -#include "Vehicle.h" - -#define SPELL_PURSUED 62374 -#define SPELL_GATHERING_SPEED 62375 -#define SPELL_BATTERING_RAM 62376 -#define SPELL_FLAME_VENTS 62396 -#define SPELL_MISSILE_BARRAGE 62400 -#define SPELL_SYSTEMS_SHUTDOWN 62475 - -#define SPELL_CANNON 62397 - -#define SPELL_OVERLOAD_CIRCUIT 62399 - -#define SPELL_SEARING_FLAME 62402 - -enum Events -{ - EVENT_PURSUE = 1, - EVENT_MISSILE, - EVENT_VENT, -}; - -struct TRINITY_DLL_DECL boss_flame_leviathanAI : public BossAI -{ - boss_flame_leviathanAI(Creature *c) : BossAI(c, BOSS_LEVIATHAN) - { - assert(c->isVehicle()); - } - - void MoveInLineOfSight(Unit* who) {} - - void EnterCombat(Unit *who) - { - _EnterCombat(); - events.ScheduleEvent(EVENT_PURSUE, 0); - events.ScheduleEvent(EVENT_MISSILE, 1500); - events.ScheduleEvent(EVENT_VENT, 20000); - if (Creature *turret = CAST_CRE(CAST_VEH(me)->GetPassenger(7))) - turret->AI()->DoZoneInCombat(); - } - - // TODO: effect 0 and effect 1 may be on different target - void SpellHitTarget(Unit *target, const SpellEntry *spell) - { - if (spell->Id == SPELL_PURSUED) - AttackStart(target); - } - - void UpdateAI(const uint32 diff) - { - if (!me->isInCombat()) - return; - - if (me->getThreatManager().isThreatListEmpty()) - { - EnterEvadeMode(); - return; - } - - events.Update(diff); - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - uint32 eventId = events.GetEvent(); - if (!me->getVictim()) - eventId = EVENT_PURSUE; - - switch(eventId) - { - case 0: - return; - case EVENT_PURSUE: - DoCastAOE(SPELL_PURSUED); - events.RepeatEvent(35000); - return; - case EVENT_MISSILE: - //TODO: without unittarget no visual effect - //DoCastAOE(SPELL_MISSILE_BARRAGE); - DoCast(me->getVictim(), SPELL_MISSILE_BARRAGE); - events.RepeatEvent(1500); - return; - case EVENT_VENT: - DoCastAOE(SPELL_FLAME_VENTS); - events.RepeatEvent(20000); - return; - default: - events.PopEvent(); - break; - } - - DoSpellAttackIfReady(SPELL_BATTERING_RAM); - } -}; - - -struct TRINITY_DLL_DECL boss_flame_leviathan_turretAI : public ScriptedAI -{ - boss_flame_leviathan_turretAI(Creature *c) : ScriptedAI(c) - { - me->SetReactState(REACT_PASSIVE); - } - - void Reset() - { - events.Reset(); - } - - EventMap events; - - void EnterCombat(Unit *who) - { - events.ScheduleEvent(1, 5000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateCombatState()) - return; - - events.Update(diff); - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - if (uint32 eventId = events.GetEvent()) - { - switch(eventId) - { - case 1: - DoCast(SelectTarget(SELECT_TARGET_RANDOM), SPELL_CANNON); - events.RepeatEvent(10000); - return; - default: - events.PopEvent(); - break; - } - } - } -}; - - -struct TRINITY_DLL_DECL boss_flame_leviathan_seatAI : public ScriptedAI -{ - boss_flame_leviathan_seatAI(Creature *c) : ScriptedAI(c) - { - assert(c->isVehicle()); - if (const CreatureInfo *cInfo = me->GetCreatureInfo()) - me->SetDisplayId(cInfo->DisplayID_A[0]); // 0 invisible, 1 visible - } - - void Reset() - { - me->SetReactState(REACT_AGGRESSIVE); - } - - void MoveInLineOfSight(Unit *who) // for test - { - if (who->GetTypeId() == TYPEID_PLAYER && !who->m_Vehicle - && !CAST_VEH(me)->GetPassenger(0) && CAST_VEH(me)->GetPassenger(2)) - who->EnterVehicle(CAST_VEH(me), 0); - } - - void UpdateAI(const uint32 diff) - { - if (!CAST_VEH(me)->GetPassenger(2)) - if (Unit *who = CAST_VEH(me)->GetPassenger(0)) - who->ExitVehicle(); - } -}; - -struct TRINITY_DLL_DECL boss_flame_leviathan_defense_turretAI : public ScriptedAI -{ - boss_flame_leviathan_defense_turretAI(Creature *c) : ScriptedAI(c) - { - } - - void Reset() - { - } - - void DamageTaken(Unit *who, uint32 &damage) - { - if (!who->m_Vehicle || who->m_Vehicle->GetEntry() != 33114) - damage = 0; - } - - void MoveInLineOfSight(Unit *who) - { - if (me->getVictim()) - return; - - if (who->GetTypeId() != TYPEID_PLAYER || !who->m_Vehicle || who->m_Vehicle->GetEntry() != 33114) - return; - - AttackStart(who); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - DoCast(me->getVictim(), SPELL_SEARING_FLAME); - } -}; - -struct TRINITY_DLL_DECL boss_flame_leviathan_overload_deviceAI : public ScriptedAI -{ - boss_flame_leviathan_overload_deviceAI(Creature *c) : ScriptedAI(c) - { - if (const CreatureInfo *cInfo = me->GetCreatureInfo()) - me->SetDisplayId(cInfo->DisplayID_H[0]); // A0 gm, H0 device - } - - void Reset() - { - } - - void DamageTaken(Unit *who, uint32 &damage) - { - if (damage >= me->GetHealth()) - { - damage = 0; - if (!me->hasUnitState(UNIT_STAT_CASTING)) - DoCastAOE(SPELL_OVERLOAD_CIRCUIT); - } - } -}; - -CreatureAI* GetAI_boss_flame_leviathan(Creature* pCreature) -{ - return new boss_flame_leviathanAI (pCreature); -} - -CreatureAI* GetAI_boss_flame_leviathan_turret(Creature* pCreature) -{ - return new boss_flame_leviathan_turretAI (pCreature); -} - -CreatureAI* GetAI_boss_flame_leviathan_seat(Creature* pCreature) -{ - return new boss_flame_leviathan_seatAI (pCreature); -} - -CreatureAI* GetAI_boss_flame_leviathan_defense_turret(Creature* pCreature) -{ - return new boss_flame_leviathan_defense_turretAI (pCreature); -} - -CreatureAI* GetAI_boss_flame_leviathan_overload_device(Creature* pCreature) -{ - return new boss_flame_leviathan_overload_deviceAI (pCreature); -} - -void AddSC_boss_flame_leviathan() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_flame_leviathan"; - newscript->GetAI = &GetAI_boss_flame_leviathan; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_flame_leviathan_turret"; - newscript->GetAI = &GetAI_boss_flame_leviathan_turret; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_flame_leviathan_seat"; - newscript->GetAI = &GetAI_boss_flame_leviathan_seat; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_flame_leviathan_defense_turret"; - newscript->GetAI = &GetAI_boss_flame_leviathan_defense_turret; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_flame_leviathan_overload_device"; - newscript->GetAI = &GetAI_boss_flame_leviathan_overload_device; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_freya.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_freya.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_freya.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_general_vezax.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_general_vezax.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_general_vezax.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_hodir.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_hodir.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_hodir.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_ignis.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_ignis.cpp deleted file mode 100644 index 56405eb13e1..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_ignis.cpp +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_ulduar.h" - -#define SPELL_FLAME_JETS 62680 -#define SPELL_SCORCH 62546 -#define SPELL_SLAG_POT 62717 - -#define SAY_AGGRO -10000002 -#define SAY_SLAY -1000003 - -struct TRINITY_DLL_DECL boss_ignis_AI : public ScriptedAI -{ - boss_ignis_AI(Creature *c) : ScriptedAI(c) {} - - uint32 FLAME_JETS_Timer; - uint32 SCORCH_Timer; - uint32 SLAG_POT_Timer; - - void Reset() - { - FLAME_JETS_Timer = 32000; - SCORCH_Timer = 100; - SLAG_POT_Timer = 100; - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO,m_creature); - } - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_SLAY, m_creature); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_SLAY, m_creature); - } - - void MoveInLineOfSight(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (FLAME_JETS_Timer < diff) - { - DoCast(m_creature,SPELL_FLAME_JETS); - DoScriptText(SAY_SLAY, m_creature); - FLAME_JETS_Timer = 25000; - } else FLAME_JETS_Timer -= diff; - - if (SCORCH_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SCORCH); - SCORCH_Timer = 20000; - } else SCORCH_Timer -= diff; - - if (SLAG_POT_Timer < diff) - { - DoCast(m_creature,SPELL_SLAG_POT); - DoScriptText(SAY_SLAY, m_creature); - SLAG_POT_Timer = 30000; - } else SLAG_POT_Timer -= diff; - - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_ignis(Creature* pCreature) -{ - return new boss_ignis_AI (pCreature); -} -void AddSC_boss_ignis() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_ignis"; - newscript->GetAI = &GetAI_boss_ignis; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_kologarn.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_kologarn.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_kologarn.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_mimiron.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_mimiron.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_mimiron.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_razorscale.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_razorscale.cpp deleted file mode 100644 index 59a7b8e6a9a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_razorscale.cpp +++ /dev/null @@ -1,300 +0,0 @@ -/* - * Copyright (C) 2008 - 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 -Name: razorscale -%Complete: 90 -Comment: Made by Epsik from WoW Arthas wow.dsl.net.pk -Category: -EndScriptData */ - -#include "precompiled.h" -#include "def_ulduar.h" - -#define SAY_AGGRO -2000000 -#define SAY_KILL -2000001 -#define SAY_PHASE_2_TRANS -2000002 -#define SAY_PHASE_3_TRANS -2000003 -#define EMOTE_BREATH -2000004 - -#define SPELL_FLAMEBUFFET 64016 -#define SPELL_FIREBALL 62796 - -#define SPELL_WINGBUFFET 62666 -#define SPELL_FLAMEBREATH 63317 -#define SPELL_FUSEARMOR 64771 -#define SPELL_DEVOURINGFLAME 63014 -#define SPELL_KNOCK_AWAY 19633 - -#define SPELL_BELLOWINGROAR 18431 -#define SPELL_HEATED_GROUND 22191 - -#define SPELL_SUMMONADDS 17646 - -#define CREATURE_ADDS 33846 - -static float MovementLocations[4][3]= -{ - {607.7, -281.9, 408.6}, - {602.0, -245.5, 424.7}, - {612.3, -230.8, 409.1}, - {624.1, -251.8, 426.1} -}; - -static float SpawnLocations[4][3]= -{ - {602.0, -248.1, 391.2}, - {624.4, -232-4, 391.1}, - {643.3, -256.4, 391.4}, - {626.6, -271.5, 391.4}, -}; - -struct TRINITY_DLL_DECL boss_razorscaleAI : public ScriptedAI -{ - boss_razorscaleAI(Creature* c) : ScriptedAI(c) {} - - uint32 Phase; - - uint32 FlameBreathTimer; - uint32 FUSEARMORTimer; - uint32 DEVOURINGFLAMETimer; - uint32 MovementTimer; - uint32 SummonAddsTimer; - uint32 BellowingRoarTimer; - uint32 WingBuffetTimer; - uint32 KnockAwayTimer; - uint32 FireballTimer; - - bool InitialSpawn; - - void Reset() - { - Phase = 1; - - FlameBreathTimer = 20000; - DEVOURINGFLAMETimer = 2000; - FUSEARMORTimer = 15000; - MovementTimer = 3000; - SummonAddsTimer = 45000; - BellowingRoarTimer = 30000; - WingBuffetTimer = 17000; - KnockAwayTimer = 15000; - FireballTimer = 18000; - - InitialSpawn = true; - - m_creature->ApplySpellImmune(0, IMMUNITY_STATE, SPELL_AURA_MOD_TAUNT, true); - m_creature->ApplySpellImmune(1, IMMUNITY_EFFECT,SPELL_EFFECT_ATTACK_ME, true); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - } - - void JustDied(Unit* Killer) - { - } - - void KilledUnit(Unit *victim) - { - DoScriptText(SAY_KILL, m_creature); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 99) && (Phase == 1)) - { - Phase = 2; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->SetHover(true); - m_creature->GetMotionMaster()->Clear(false); - m_creature->GetMotionMaster()->MoveIdle(); - DoScriptText(SAY_PHASE_2_TRANS, m_creature); - } - - if (((m_creature->GetHealth()*100 / m_creature->GetMaxHealth()) < 50) && (Phase == 2)) - { - Phase = 3; - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_LEVITATING); - m_creature->SetHover(false); - m_creature->GetMotionMaster()->MovePoint(0, 619.6, -261.1, 391.471832); - DoStartMovement(m_creature->getVictim()); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - DoScriptText(SAY_PHASE_3_TRANS, m_creature); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - } - - if (Phase == 1 || Phase == 3) - { - if (FlameBreathTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FLAMEBREATH); - FlameBreathTimer = 15000; - } else FlameBreathTimer -= diff; - - if (DEVOURINGFLAMETimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (target && !m_creature->HasInArc(M_PI, target)) - DoCast(target, SPELL_DEVOURINGFLAME); - - DEVOURINGFLAMETimer = 10000; - } else DEVOURINGFLAMETimer -= diff; - - if (FUSEARMORTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_FUSEARMOR); - FUSEARMORTimer = 10000; - } else FUSEARMORTimer -= diff; - - if (WingBuffetTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_WINGBUFFET); - WingBuffetTimer = 7000 + ((rand()%8)*1000); - } else WingBuffetTimer -= diff; - - if (KnockAwayTimer < diff) - { - if (rand()%100 <= 30) - { - DoCast(m_creature->getVictim(), SPELL_KNOCK_AWAY); - } - KnockAwayTimer = 15000; - } else KnockAwayTimer -= diff; - - if (Phase == 3) - { - if (BellowingRoarTimer < diff) - { - DoCast(m_creature->getVictim(), SPELL_BELLOWINGROAR); - - BellowingRoarTimer = 30000; - } else BellowingRoarTimer -= diff; - - if (SummonAddsTimer < diff) - { - SummonAdds(Phase); - - SummonAddsTimer = 45000; - } else SummonAddsTimer -= diff; - } - - DoMeleeAttackIfReady(); - } - - if (Phase == 2) - { - if (InitialSpawn) - { - InitialSpawn = false; - - for(uint32 i = 0; i < 4; ++i) - { - uint32 random = rand()%4; - Creature* Add = m_creature->SummonCreature(CREATURE_ADDS, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Add) - Add->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - - - if (FireballTimer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0), SPELL_FIREBALL); - - FireballTimer = 18000; - } else FireballTimer -= diff; - - if (MovementTimer < diff) - { - if (rand()%100 <= 30) - { - DoScriptText(EMOTE_BREATH, m_creature); - DoCast(m_creature->getVictim(), SPELL_FLAMEBUFFET); - } - else ChangePosition(); - - MovementTimer = 25000; - } else MovementTimer -= diff; - - if (SummonAddsTimer < diff) - { - SummonAdds(Phase); - - SummonAddsTimer = 45000; - } else SummonAddsTimer -= diff; - } - } - - void ChangePosition() - { - /* Malfunctioning, Razorscale is flying around randomly, attacking players from hundreds of yards away. - uint32 random = rand() % 4; - if (random<4){ - m_creature->GetMotionMaster()->MovePoint(0, MovementLocations[random][0], MovementLocations[random][1], MovementLocations[random][2]);} */ - } - - void SummonAdds(uint32 Phase) - { - if (Phase == 2) - { - uint32 max = rand()%10; - for(uint32 i = 0; i < 4; ++i) - { - uint32 random = rand()%3; - Creature* Add = m_creature->SummonCreature(CREATURE_ADDS, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Add) - Add->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - - if (Phase == 3) - { - uint32 max = rand() % 10 +1; - if (max < 1) - { - for(uint32 i = 0; i < max; ++i) - { - uint32 random = rand()%4; - Creature* Add = m_creature->SummonCreature(CREATURE_ADDS, SpawnLocations[random][0], SpawnLocations[random][1], SpawnLocations[random][2], 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 30000); - if (Add) - Add->AI()->AttackStart(SelectUnit(SELECT_TARGET_RANDOM, 0)); - } - } - } - } -}; - -CreatureAI* GetAI_boss_razorscale(Creature* pCreature) -{ - return new boss_razorscaleAI (pCreature); -} - -void AddSC_boss_razorscale() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_razorscale"; - newscript->GetAI = &GetAI_boss_razorscale; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_thorim.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_thorim.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_thorim.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_xt002.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_xt002.cpp deleted file mode 100644 index a0d265f6224..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_xt002.cpp +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_ulduar.h" - -#define SPELL_SEARING_LIGHT 63018 -#define SPELL_SONIC_BOOM 38897 - -#define SAY_AGGRO -1000000 -#define SAY_SLAY -1000001 -struct TRINITY_DLL_DECL boss_xt002_AI : public ScriptedAI -{ - boss_xt002_AI(Creature *c) : ScriptedAI(c) {} - - uint32 SEARING_LIGHT_Timer; - uint32 SONIC_BOOM_Timer; - - void Reset() - { - SEARING_LIGHT_Timer = 100; - SONIC_BOOM_Timer = 20; - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO,m_creature); - } - void KilledUnit(Unit* victim) - { - DoScriptText(SAY_SLAY, m_creature); - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_SLAY, m_creature); - } - - void MoveInLineOfSight(Unit* who) {} - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (SEARING_LIGHT_Timer < diff) - { - DoCast(m_creature,SPELL_SEARING_LIGHT); - DoScriptText(SAY_SLAY, m_creature); - SEARING_LIGHT_Timer = 50000; - } else SEARING_LIGHT_Timer -= diff; - - if (SONIC_BOOM_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_SONIC_BOOM); - SONIC_BOOM_Timer = 20000; - } else SONIC_BOOM_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_xt002(Creature* pCreature) -{ - return new boss_xt002_AI (pCreature); -} -void AddSC_boss_xt002() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "boss_xt002"; - newscript->GetAI = &GetAI_boss_xt002; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_yoggsaron.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_yoggsaron.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/boss_yoggsaron.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/def_ulduar.h b/src/bindings/scripts/scripts/zone/ulduar/ulduar/def_ulduar.h deleted file mode 100644 index d73e6324fc8..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/def_ulduar.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2008 - 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 - */ - -#ifndef DEF_ULDUAR_H -#define DEF_ULDUAR_H - -enum Encounter -{ - BOSS_LEVIATHAN, - BOSS_IGNIS, - BOSS_RAZORSCALE, - BOSS_XT002, - BOSS_ASSEMBLY, - BOSS_KOLOGARN, - BOSS_AURIAYA, - BOSS_MIMIRON, - BOSS_HODIR, - BOSS_THORIM, - BOSS_FREYA, - BOSS_VEZAX, - BOSS_YOGGSARON, - BOSS_ALGALON, - MAX_BOSS_NUMBER -}; - -#endif diff --git a/src/bindings/scripts/scripts/zone/ulduar/ulduar/instance_ulduar.cpp b/src/bindings/scripts/scripts/zone/ulduar/ulduar/instance_ulduar.cpp deleted file mode 100644 index a736b2db12a..00000000000 --- a/src/bindings/scripts/scripts/zone/ulduar/ulduar/instance_ulduar.cpp +++ /dev/null @@ -1,20 +0,0 @@ -/* - * Copyright (C) 2008 - 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 "precompiled.h" -#include "def_ulduar.h" diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp deleted file mode 100644 index a2445a97229..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_ingvar_the_plunderer.cpp +++ /dev/null @@ -1,459 +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_Ingvar_The_Plunderer -SD%Complete: 95 -SDComment: Some Problems with Annhylde Movement, Blizzlike Timers -SDCategory: Udgarde Keep -EndScriptData */ - -#include "precompiled.h" -#include "def_utgarde_keep.h" - -enum -{ - //Yells Ingvar - YELL_AGGRO_1 = -1574005, - YELL_AGGRO_2 = -1574006, - - YELL_DEAD_1 = -1574007, - YELL_DEAD_2 = -1574008, - - YELL_KILL_1 = -1574009, - YELL_KILL_2 = -1574010, - -//Ingvar Spells human form - MOB_INGVAR_HUMAN = 23954, - SPELL_CLEAVE = 42724, - SPELL_SMASH = 42669, - H_SPELL_SMASH = 59706, - SPELL_STAGGERING_ROAR = 42708, - H_SPELL_STAGGERING_ROAR = 59708, - SPELL_ENRAGE = 42705, - H_SPELL_ENRAGE = 59707, - - MOB_ANNHYLDE_THE_CALLER = 24068, - SPELL_INGVAR_FEIGN_DEATH = 42795, - SPELL_SUMMON_BANSHEE = 42912, - SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN = 42863, //Spawn resurrecteffekt around Ingvar - - MODEL_INGVAR_UNDEAD = 26351, - MODEL_INGVAR_HUMAN = 21953, - -//Ingvar Spells undead form - MOB_INGVAR_UNDEAD = 23980, - SPELL_DARK_SMASH = 42723, - SPELL_DREADFUL_ROAR = 42729, - H_SPELL_DREADFUL_ROAR = 59734, - SPELL_WOE_STRIKE = 42730, - H_SPELL_WOE_STRIKE = 59735, - - ENTRY_THROW_TARGET = 23996, - SPELL_SHADOW_AXE_SUMMON = 42749 -}; - -struct TRINITY_DLL_DECL boss_ingvar_the_plundererAI : public ScriptedAI -{ - boss_ingvar_the_plundererAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - - bool HeroicMode; - bool undead; - bool event_inProgress; - - uint32 Cleave_Timer; - uint32 Smash_Timer; - uint32 Enrage_Timer; - uint32 Roar_Timer; - uint32 SpawnResTimer; - uint32 wait_Timer; - - void Reset() - { - if (undead) // Visual Hack - m_creature->SetDisplayId(MODEL_INGVAR_HUMAN); - - undead = false; - event_inProgress = false; - - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - - Cleave_Timer = 2000; - Smash_Timer = 5000; - Enrage_Timer = 10000; - Roar_Timer = 15000; - - SpawnResTimer = 3000; - - wait_Timer = 0; - - if (pInstance) - pInstance->SetData(DATA_INGVAR_EVENT, NOT_STARTED); - } - - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (damage >= m_creature->GetHealth() && !undead) - { - //DoCast(m_creature,SPELL_INGVAR_FEIGN_DEATH,true); // Dont work ??? - // visuel hack - m_creature->SetHealth(0); - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->GetMotionMaster()->MovementExpired(false); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); - // visuel hack end - - event_inProgress = true; - undead = true; - - DoScriptText(YELL_DEAD_1,m_creature); - } - - if (event_inProgress) - { - damage = 0; - } - } - - void StartZombiePhase() - { - undead = true; - event_inProgress = false; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - m_creature->AI()->AttackStart(m_creature->getVictim()); - - DoScriptText(YELL_AGGRO_2,m_creature); - } - - void EnterCombat(Unit *who) - { - DoScriptText(YELL_AGGRO_1,m_creature); - - if (pInstance) - pInstance->SetData(DATA_INGVAR_EVENT, IN_PROGRESS); - } - - void JustDied(Unit* killer) - { - DoScriptText(YELL_DEAD_2,m_creature); - - if (pInstance) - pInstance->SetData(DATA_INGVAR_EVENT, DONE); - } - - void KilledUnit(Unit *victim) - { - if (undead) { DoScriptText(YELL_KILL_1,m_creature); } - else { DoScriptText(YELL_KILL_2,m_creature); } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (event_inProgress) - { - if (SpawnResTimer) - if (SpawnResTimer< diff) - { - DoCast(m_creature,SPELL_SUMMON_BANSHEE); // Summons direktly on caster position - //DoCast(m_creature,SPELL_SCOURG_RESURRECTION_EFFEKTSPAWN); // Dont needet ? - SpawnResTimer = 0; - }else SpawnResTimer -= diff; - - return; - } - - // This is used for a spell queue ... the spells should not castet if one spell is already casting - if (wait_Timer) - if (wait_Timer < diff) - { - wait_Timer = 0; - }else wait_Timer -= diff; - - if (Cleave_Timer < diff) - { - if (!wait_Timer) - { - if (undead) - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_WOE_STRIKE : SPELL_WOE_STRIKE); - else - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = rand()%5000 + 2000; - - wait_Timer = 1000; - } - }else Cleave_Timer -= diff; - - if (Smash_Timer < diff) - { - if (!wait_Timer) - { - if (undead) - DoCast(m_creature->getVictim(), SPELL_DARK_SMASH); - else - DoCast(m_creature->getVictim(),HeroicMode ? H_SPELL_SMASH : SPELL_SMASH); - Smash_Timer = 10000; - - wait_Timer = 5000; - } - }else Smash_Timer -= diff; - - if (!undead) - { - if (Enrage_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_ENRAGE : SPELL_ENRAGE); - Enrage_Timer = 10000; - }else Enrage_Timer -= diff; - }else // In Undead form used to summon weapon - { - if (Enrage_Timer < diff) - { - if (!wait_Timer) - { - // Spawn target for Axe - Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 1); - if (target) - { - Creature* temp = m_creature->SummonCreature(ENTRY_THROW_TARGET,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,2000); - - DoCast(m_creature,SPELL_SHADOW_AXE_SUMMON); - } - Enrage_Timer = 30000; - } - }else Enrage_Timer -= diff; - } - - - if (Roar_Timer < diff) - { - if (!wait_Timer) - { - if (undead) - DoCast(m_creature,HeroicMode ? H_SPELL_DREADFUL_ROAR : SPELL_DREADFUL_ROAR); - else - DoCast(m_creature,HeroicMode ? H_SPELL_STAGGERING_ROAR : SPELL_STAGGERING_ROAR); - Roar_Timer = 10000; - - wait_Timer = 5000; - } - }else Roar_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_ingvar_the_plunderer(Creature* pCreature) -{ - return new boss_ingvar_the_plundererAI (pCreature); -} - -enum -{ -//we don't have that text in db so comment it until we get this text -// YELL_RESSURECT = -1574025, - -//Spells for Annhylde - SPELL_SCOURG_RESURRECTION_HEAL = 42704, //Heal Max + DummyAura - SPELL_SCOURG_RESURRECTION_BEAM = 42857, //Channeling Beam of Annhylde - SPELL_SCOURG_RESURRECTION_DUMMY = 42862, //Some Emote Dummy? - SPELL_INGVAR_TRANSFORM = 42796 -}; - -struct TRINITY_DLL_DECL mob_annhylde_the_callerAI : public ScriptedAI -{ - mob_annhylde_the_callerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - float x,y,z; - ScriptedInstance* pInstance; - uint32 Resurect_Timer; - uint32 Resurect_Phase; - - void Reset() - { - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_FLYING + MOVEMENTFLAG_HOVER); - m_creature->SetSpeed(MOVE_SWIM , 1.0f); - m_creature->SetSpeed(MOVE_RUN , 1.0f); - m_creature->SetSpeed(MOVE_WALK , 1.0f); - //m_creature->SetSpeed(MOVE_FLIGHT , 1.0f); - - m_creature->GetPosition(x,y,z); - DoTeleportTo(x+1,y,z+30); - - Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); - if (ingvar) - { - m_creature->GetMotionMaster()->MovePoint(1,x,y,z+15); - -// DoScriptText(YELL_RESSURECT,m_creature); - } - } - - void MovementInform(uint32 type, uint32 id) - { - if (type != POINT_MOTION_TYPE) - return; - Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); - if (ingvar) - { - switch (id) - { - case 1: - ingvar->RemoveAura(SPELL_SUMMON_BANSHEE); - ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_DUMMY,true); - DoCast(ingvar,SPELL_SCOURG_RESURRECTION_BEAM); - Resurect_Timer = 8000; - Resurect_Phase = 1; - break; - case 2: - m_creature->DealDamage(m_creature,m_creature->GetHealth()); - m_creature->RemoveCorpse(); - break; - } - } - } - - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void EnterCombat(Unit *who) {} - void UpdateAI(const uint32 diff) - { - if (Resurect_Timer) - if (Resurect_Timer < diff) - { - if (Resurect_Phase == 1) - { - Unit* ingvar = Unit::GetUnit((*m_creature), pInstance->GetData64(DATA_INGVAR)); - if (ingvar) - { - ingvar->SetStandState(UNIT_STAND_STATE_STAND); - ingvar->CastSpell(ingvar,SPELL_SCOURG_RESURRECTION_HEAL,false); - } - Resurect_Timer = 3000; - Resurect_Phase = 2; - }else if (Resurect_Phase == 2) - { - Creature* ingvar = Unit::GetCreature((*m_creature), pInstance->GetData64(DATA_INGVAR)); - if (ingvar) - { - ingvar->RemoveAurasDueToSpell(SPELL_SCOURG_RESURRECTION_DUMMY); - //ingvar->CastSpell(ingvar,SPELL_INGVAR_TRANSFORM,false); - ingvar->SetDisplayId(MODEL_INGVAR_UNDEAD); // Visual Hack - when he dies he becomes human model -> wrong - Creature* c_ingvar = ingvar; - - CAST_AI(boss_ingvar_the_plundererAI, (c_ingvar->AI()))->StartZombiePhase(); - - m_creature->GetMotionMaster()->MovePoint(2,x+1,y,z+30); - Resurect_Phase++; - } - } - - }else Resurect_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_annhylde_the_caller(Creature* pCreature) -{ - return new mob_annhylde_the_callerAI (pCreature); -} - -enum -{ - SPELL_SHADOW_AXE_DAMAGE = 42750, - H_SPELL_SHADOW_AXE_DAMAGE = 59719 -}; - -struct TRINITY_DLL_DECL mob_ingvar_throw_dummyAI : public ScriptedAI -{ - mob_ingvar_throw_dummyAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = c->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 Despawn_Timer; - - ScriptedInstance* pInstance; - - void Reset() - { - Unit* target = m_creature->FindNearestCreature(ENTRY_THROW_TARGET,50); - if (target) - { - DoCast(m_creature, HeroicMode ? H_SPELL_SHADOW_AXE_DAMAGE : SPELL_SHADOW_AXE_DAMAGE); - float x,y,z; - target->GetPosition(x,y,z); - m_creature->GetMotionMaster()->MovePoint(0,x,y,z); - } - Despawn_Timer = 7000; - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void EnterCombat(Unit *who) {} - void UpdateAI(const uint32 diff) - { - if (Despawn_Timer < diff) - { - m_creature->DealDamage(m_creature,m_creature->GetHealth()); - m_creature->RemoveCorpse(); - Despawn_Timer = 0; - }else Despawn_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ingvar_throw_dummy(Creature* pCreature) -{ - return new mob_ingvar_throw_dummyAI (pCreature); -} - -void AddSC_boss_ingvar_the_plunderer() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_ingvar_the_plunderer"; - newscript->GetAI = &GetAI_boss_ingvar_the_plunderer; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_annhylde_the_caller"; - newscript->GetAI = &GetAI_mob_annhylde_the_caller; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ingvar_throw_dummy"; - newscript->GetAI = &GetAI_mob_ingvar_throw_dummy; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp deleted file mode 100644 index b7701a52472..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_keleseth.cpp +++ /dev/null @@ -1,365 +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_Prince_Keleseth -SD%Complete: 90 -SDComment: Needs Prince Movements, Needs adjustments to blizzlike timers, Needs Shadowbolt castbar, Needs right Ressurect Visual, Needs Some Heroic Spells -SDCategory: Utgarde Keep -EndScriptData */ - -#include "precompiled.h" -#include "def_utgarde_keep.h" - -enum -{ - ACHIEVEMENT_ON_THE_ROCKS = 1919, - - SPELL_SHADOWBOLT = 43667, - SPELL_SHADOWBOLT_HEROIC = 59389, - SPELL_FROST_TOMB = 48400, - SPELL_FROST_TOMB_SUMMON = 42714, - SPELL_DECREPIFY = 42702, - SPELL_SCOURGE_RESSURRECTION = 42704, - CREATURE_FROSTTOMB = 23965, - CREATURE_SKELETON = 23970, - - SAY_AGGRO = -1574000, - SAY_FROST_TOMB = -1574001, - SAY_SKELETONS = -1574002, - SAY_KILL = -1574003, - SAY_DEATH = -1574004 -}; - -#define SKELETONSPAWN_Z 42.8668 - -float SkeletonSpawnPoint[5][5]= -{ - {156.2559, 259.2093}, - {156.2559, 259.2093}, - {156.2559, 259.2093}, - {156.2559, 259.2093}, - {156.2559, 259.2093}, -}; - -float AttackLoc[3]={197.636, 194.046, 40.8164}; - -bool ShatterFrostTomb; // needed for achievement: On The Rocks(1919) - -struct TRINITY_DLL_DECL mob_frost_tombAI : public ScriptedAI -{ - mob_frost_tombAI(Creature *c) : ScriptedAI(c) - { - FrostTombGUID = 0; - } - - uint64 FrostTombGUID; - - void SetPrisoner(Unit* uPrisoner) - { - FrostTombGUID = uPrisoner->GetGUID(); - } - - void Reset(){ FrostTombGUID = 0; } - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - - void JustDied(Unit *killer) - { - if (killer->GetGUID() != m_creature->GetGUID()) - ShatterFrostTomb = true; - - if (FrostTombGUID) - { - Unit* FrostTomb = Unit::GetUnit((*m_creature),FrostTombGUID); - if (FrostTomb) - FrostTomb->RemoveAurasDueToSpell(SPELL_FROST_TOMB); - } - } - - void UpdateAI(const uint32 diff) - { - Unit* temp = Unit::GetUnit((*m_creature),FrostTombGUID); - if ((temp && temp->isAlive() && !temp->HasAura(SPELL_FROST_TOMB)) || !temp) - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } -}; - -struct TRINITY_DLL_DECL boss_kelesethAI : public ScriptedAI -{ - boss_kelesethAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - Heroic = c->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - - uint32 FrostTombTimer; - uint32 SummonSkeletonsTimer; - uint32 RespawnSkeletonsTimer; - uint32 ShadowboltTimer; - uint64 SkeletonGUID[5]; - bool Skeletons; - bool Heroic; - bool RespawnSkeletons; - - void Reset() - { - ShadowboltTimer = 0; - Skeletons = false; - - ShatterFrostTomb = false; - - ResetTimer(); - - if (pInstance) - pInstance->SetData(DATA_PRINCEKELESETH_EVENT, NOT_STARTED); - } - - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - DoScriptText(SAY_KILL, m_creature); - } - - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (Heroic && !ShatterFrostTomb) - { - AchievementEntry const *AchievOnTheRocks = GetAchievementStore()->LookupEntry(ACHIEVEMENT_ON_THE_ROCKS); - if (AchievOnTheRocks) - { - Map* pMap = m_creature->GetMap(); - if (pMap && pMap->IsDungeon()) - { - Map::PlayerList const &players = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - itr->getSource()->CompletedAchievement(AchievOnTheRocks); - } - } - } - - if (pInstance) - pInstance->SetData(DATA_PRINCEKELESETH_EVENT, DONE); - } - - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - DoZoneInCombat(); - - if (pInstance) - pInstance->SetData(DATA_PRINCEKELESETH_EVENT, IN_PROGRESS); - } - - void ResetTimer(uint32 inc = 0) - { - SummonSkeletonsTimer = 5000 + inc; - FrostTombTimer = 28000 + inc; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ShadowboltTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_TOPAGGRO, 0); - if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) - m_creature->CastSpell(target, Heroic ? SPELL_SHADOWBOLT_HEROIC : SPELL_SHADOWBOLT, true); - ShadowboltTimer = 10000; - }else ShadowboltTimer -= diff; - - if (!Skeletons) - if ((SummonSkeletonsTimer < diff)) - { - Creature* Skeleton; - DoScriptText(SAY_SKELETONS, m_creature); - for(uint8 i = 0; i < 5; ++i) - { - Skeleton = m_creature->SummonCreature(CREATURE_SKELETON, SkeletonSpawnPoint[i][0], SkeletonSpawnPoint[i][1] , SKELETONSPAWN_Z, 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN,20000); - if (Skeleton) - { - Skeleton->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - Skeleton->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY() , m_creature->GetPositionZ()); - Skeleton->AddThreat(m_creature->getVictim(), 0.0f); - DoZoneInCombat(Skeleton); - } - } - Skeletons = true; - }else SummonSkeletonsTimer -= diff; - - if (FrostTombTimer < diff) - { - Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 1); - if (target && target->isAlive() && target->GetTypeId() == TYPEID_PLAYER) - { - //DoCast(target, SPELL_FROST_TOMB_SUMMON, true); - Creature* Chains = m_creature->SummonCreature(CREATURE_FROSTTOMB, target->GetPositionX(), target->GetPositionY(), target->GetPositionZ(), 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 20000); - if (Chains) - { - CAST_AI(mob_frost_tombAI, Chains->AI())->SetPrisoner(target); - Chains->CastSpell(target, SPELL_FROST_TOMB, true); - - DoScriptText(SAY_FROST_TOMB, m_creature); - } - } - FrostTombTimer = 15000; - }else FrostTombTimer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -struct TRINITY_DLL_DECL mob_vrykul_skeletonAI : public ScriptedAI -{ - mob_vrykul_skeletonAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - uint32 Respawn_Time; - uint64 Target_Guid; - uint32 Decrepify_Timer; - - bool isDead; - - void Reset() - { - Respawn_Time = 12000; - Decrepify_Timer = 10000 + rand()%20000; - isDead = false; - } - - void EnterCombat(Unit *who){} - void DamageTaken(Unit *done_by, uint32 &damage) - { - if (done_by->GetGUID() == m_creature->GetGUID()) - return; - - if (damage >= m_creature->GetHealth()) - { - PretendToDie(); - damage = 0; - } - } - - - void PretendToDie() - { - isDead = true; - m_creature->InterruptNonMeleeSpells(true); - m_creature->RemoveAllAuras(); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->GetMotionMaster()->MovementExpired(false); - m_creature->GetMotionMaster()->MoveIdle(); - m_creature->SetStandState(UNIT_STAND_STATE_DEAD); - }; - - void Resurrect() - { - isDead = false; - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - m_creature->CastSpell(m_creature,SPELL_SCOURGE_RESSURRECTION,true); - - if (m_creature->getVictim()) - { - m_creature->GetMotionMaster()->MoveChase(m_creature->getVictim()); - m_creature->AI()->AttackStart(m_creature->getVictim()); - } - else - m_creature->GetMotionMaster()->Initialize(); - }; - - void UpdateAI(const uint32 diff) - { - if (pInstance->GetData(DATA_PRINCEKELESETH_EVENT) == IN_PROGRESS) - { - if (isDead) - { - if (Respawn_Time < diff) - { - Resurrect(); - Respawn_Time = 12000; - }else Respawn_Time -= diff; - } - else - { - if (!UpdateVictim()) - return; - - if (Decrepify_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_DECREPIFY); - Decrepify_Timer = 30000; - }else Decrepify_Timer -= diff; - - DoMeleeAttackIfReady(); - } - }else - { - if (m_creature->isAlive()) - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - - } -}; - -CreatureAI* GetAI_mob_frost_tomb(Creature* pCreature) -{ - return new mob_frost_tombAI(pCreature); -} - -CreatureAI* GetAI_boss_keleseth(Creature* pCreature) -{ - return new boss_kelesethAI (pCreature); -} - -CreatureAI* GetAI_mob_vrykul_skeleton(Creature* pCreature) -{ - return new mob_vrykul_skeletonAI (pCreature); -} - -void AddSC_boss_keleseth() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_keleseth"; - newscript->GetAI = &GetAI_boss_keleseth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name = "mob_frost_tomb"; - newscript->GetAI = &GetAI_mob_frost_tomb; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_vrykul_skeleton"; - newscript->GetAI = &GetAI_mob_vrykul_skeleton; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp deleted file mode 100644 index 49811125594..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/boss_skarvald_dalronn.cpp +++ /dev/null @@ -1,397 +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_Skarvald_Dalronn -SD%Complete: 95 -SDComment: Needs adjustments to blizzlike timers, Yell Text + Sound to DB -SDCategory: Utgarde Keep -EndScriptData */ - -#include "precompiled.h" -#include "def_utgarde_keep.h" - -enum -{ - YELL_SKARVALD_AGGRO = -1574011, - YELL_SKARVALD_DAL_DIED = -1574012, - YELL_SKARVALD_SKA_DIEDFIRST = -1574013, - YELL_SKARVALD_KILL = -1574014, - YELL_SKARVALD_DAL_DIEDFIRST = -1574015, - - YELL_DALRONN_AGGRO = -1574016, - YELL_DALRONN_SKA_DIED = -1574017, - YELL_DALRONN_DAL_DIEDFIRST = -1574018, - YELL_DALRONN_KILL = -1574019, - YELL_DALRONN_SKA_DIEDFIRST = -1574020, - -//Spells of Skarvald and his Ghost - MOB_SKARVALD_THE_CONSTRUCTOR = 24200, - SPELL_CHARGE = 43651, - SPELL_STONE_STRIKE = 48583, - SPELL_SUMMON_SKARVALD_GHOST = 48613, - MOB_SKARVALD_GHOST = 27390, -//Spells of Dalronn and his Ghost - MOB_DALRONN_THE_CONTROLLER = 24201, - SPELL_SHADOW_BOLT = 43649, - H_SPELL_SHADOW_BOLT = 59575, - H_SPELL_SUMMON_SKELETONS = 52611, - SPELL_DEBILITATE = 43650, - SPELL_SUMMON_DALRONN_GHOST = 48612, - MOB_DALRONN_GHOST = 27389 -}; - -struct TRINITY_DLL_DECL boss_skarvald_the_constructorAI : public ScriptedAI -{ - boss_skarvald_the_constructorAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - - bool ghost; - bool HeroicMode; - uint32 Charge_Timer; - uint32 StoneStrike_Timer; - uint32 Response_Timer; - uint32 Check_Timer; - bool Dalronn_isDead; - - void Reset() - { - Charge_Timer = 5000; - StoneStrike_Timer = 10000; - Dalronn_isDead = false; - Check_Timer = 5000; - - ghost = (m_creature->GetEntry() == MOB_SKARVALD_GHOST); - if (!ghost) - { - Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); - if (dalronn && dalronn->isDead()) - CAST_CRE(dalronn)->Respawn(); - - if (pInstance) - pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED); - } - } - - void EnterCombat(Unit *who) - { - if (!ghost) - { - DoScriptText(YELL_SKARVALD_AGGRO,m_creature); - - Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); - if (dalronn && dalronn->isAlive() && !dalronn->getVictim()) - dalronn->getThreatManager().addThreat(who,0.0f); - - if (pInstance) - pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* Killer) - { - if (!ghost) - { - Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); - if (dalronn) - { - if (dalronn->isDead()) - { - DoScriptText(YELL_SKARVALD_DAL_DIED,m_creature); - - if (pInstance) - pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE); - } - else - { - DoScriptText(YELL_SKARVALD_SKA_DIEDFIRST,m_creature); - - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - //DoCast(m_creature,SPELL_SUMMON_SKARVALD_GHOST,true); - Creature* temp = m_creature->SummonCreature(MOB_SKARVALD_GHOST,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000); - if (temp) - { - temp->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); - temp->AI()->AttackStart(Killer); - } - } - } - } - } - - void KilledUnit(Unit *victim) - { - if (!ghost) - { - DoScriptText(YELL_SKARVALD_KILL,m_creature); - } - } - - void UpdateAI(const uint32 diff) - { - if (ghost) - { - if (pInstance->GetData(DATA_SKARVALD_DALRONN_EVENT) != IN_PROGRESS) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - if (!UpdateVictim()) - return; - - if (!ghost) - { - if (Check_Timer) - if (Check_Timer < diff) - { - Check_Timer = 5000; - Unit* dalronn = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_DALRONN)); - if (dalronn && dalronn->isDead()) - { - Dalronn_isDead = true; - Response_Timer = 2000; - Check_Timer = 0; - } - }else Check_Timer -= diff; - - if (Response_Timer) - if (Dalronn_isDead) - if (Response_Timer < diff) - { - DoScriptText(YELL_SKARVALD_DAL_DIEDFIRST,m_creature); - - Response_Timer = 0; - }else Response_Timer -= diff; - } - - if (Charge_Timer < diff) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 1), SPELL_CHARGE); - Charge_Timer = 5000+rand()%5000; - }else Charge_Timer -= diff; - - if (StoneStrike_Timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_STONE_STRIKE); - StoneStrike_Timer = 5000+rand()%5000; - }else StoneStrike_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_skarvald_the_constructor(Creature* pCreature) -{ - return new boss_skarvald_the_constructorAI (pCreature); -} - -struct TRINITY_DLL_DECL boss_dalronn_the_controllerAI : public ScriptedAI -{ - boss_dalronn_the_controllerAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - ScriptedInstance* pInstance; - - bool ghost; - bool HeroicMode; - uint32 ShadowBolt_Timer; - uint32 Debilitate_Timer; - uint32 Summon_Timer; - - uint32 Response_Timer; - uint32 Check_Timer; - uint32 AggroYell_Timer; - bool Skarvald_isDead; - - - void Reset() - { - ShadowBolt_Timer = 1000; - Debilitate_Timer = 5000; - Summon_Timer = 10000; - Check_Timer = 5000; - Skarvald_isDead = false; - AggroYell_Timer = 0; - - ghost = m_creature->GetEntry() == MOB_DALRONN_GHOST; - if (!ghost) - { - Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); - if (skarvald && skarvald->isDead()) - CAST_CRE(skarvald)->Respawn(); - - if (pInstance) - pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, NOT_STARTED); - } - } - - void EnterCombat(Unit *who) - { - if (!ghost) - { - Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); - if (skarvald && skarvald->isAlive() && !skarvald->getVictim()) - skarvald->getThreatManager().addThreat(who,0.0f); - - AggroYell_Timer = 5000; - - if (pInstance) - pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, IN_PROGRESS); - } - } - - void JustDied(Unit* Killer) - { - if (!ghost) - { - Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); - if (skarvald) - if (skarvald->isDead()) - { - DoScriptText(YELL_DALRONN_SKA_DIED,m_creature); - - if (pInstance) - pInstance->SetData(DATA_SKARVALD_DALRONN_EVENT, DONE); - } - else - { - DoScriptText(YELL_DALRONN_DAL_DIEDFIRST,m_creature); - - m_creature->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); - //DoCast(m_creature,SPELL_SUMMON_DALRONN_GHOST,true); - Creature* temp = m_creature->SummonCreature(MOB_DALRONN_GHOST,m_creature->GetPositionX(),m_creature->GetPositionY(),m_creature->GetPositionZ(),0,TEMPSUMMON_CORPSE_DESPAWN,5000); - if (temp) - { - temp->SetFlag(UNIT_FIELD_FLAGS,UNIT_FLAG_NON_ATTACKABLE); - temp->AI()->AttackStart(Killer); - } - } - } - } - - void KilledUnit(Unit *victim) - { - if (!ghost) - { - DoScriptText(YELL_DALRONN_KILL,m_creature); - } - } - - void UpdateAI(const uint32 diff) - { - if (ghost) - { - if (pInstance->GetData(DATA_SKARVALD_DALRONN_EVENT) != IN_PROGRESS) - { - m_creature->DealDamage(m_creature, m_creature->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - } - } - - if (!UpdateVictim()) - return; - - if (AggroYell_Timer) - if (AggroYell_Timer < diff) - { - DoScriptText(YELL_DALRONN_AGGRO,m_creature); - - AggroYell_Timer = 0; - }else AggroYell_Timer -= diff; - - if (!ghost) - { - if (Check_Timer) - if (Check_Timer < diff) - { - Check_Timer = 5000; - Unit* skarvald = Unit::GetUnit((*m_creature),pInstance->GetData64(DATA_SKARVALD)); - if (skarvald && skarvald->isDead()) - { - Skarvald_isDead = true; - Response_Timer = 2000; - Check_Timer = 0; - } - }else Check_Timer -= diff; - - if (Response_Timer) - if (Skarvald_isDead) - if (Response_Timer < diff) - { - DoScriptText(YELL_DALRONN_SKA_DIEDFIRST,m_creature); - - Response_Timer = 0; - }else Response_Timer -= diff; - } - - if (ShadowBolt_Timer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),HeroicMode ? H_SPELL_SHADOW_BOLT : SPELL_SHADOW_BOLT); - ShadowBolt_Timer = 1000; - } - }else ShadowBolt_Timer -= diff; - - if (Debilitate_Timer < diff) - { - if (!m_creature->IsNonMeleeSpellCasted(false)) - { - DoCast(SelectUnit(SELECT_TARGET_RANDOM, 0),SPELL_DEBILITATE); - Debilitate_Timer = 5000+rand()%5000; - } - }else Debilitate_Timer -= diff; - - if (HeroicMode) - if (Summon_Timer < diff) - { - DoCast(m_creature,H_SPELL_SUMMON_SKELETONS); - Summon_Timer = (rand()%10000) + 20000; - }else Summon_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_dalronn_the_controller(Creature* pCreature) -{ - return new boss_dalronn_the_controllerAI (pCreature); -} - -void AddSC_boss_skarvald_dalronn() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_skarvald_the_constructor"; - newscript->GetAI = &GetAI_boss_skarvald_the_constructor; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="boss_dalronn_the_controller"; - newscript->GetAI = &GetAI_boss_dalronn_the_controller; - newscript->RegisterSelf(); -} \ No newline at end of file diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h deleted file mode 100644 index b630e156564..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/def_utgarde_keep.h +++ /dev/null @@ -1,35 +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 - */ - -#ifndef DEF_UTGARDE_KEEP_H -#define DEF_UTGARDE_KEEP_H - -#define DATA_PRINCEKELESETH 1 -#define DATA_SKARVALD 3 -#define DATA_DALRONN 4 -#define DATA_INGVAR 6 - -#define DATA_PRINCEKELESETH_EVENT 2 -#define DATA_SKARVALD_DALRONN_EVENT 5 -#define DATA_INGVAR_EVENT 7 - -#define EVENT_FORGE_1 8 -#define EVENT_FORGE_2 9 -#define EVENT_FORGE_3 10 - -#endif diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp deleted file mode 100644 index 4c7668970da..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/instance_utgarde_keep.cpp +++ /dev/null @@ -1,291 +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: Instance_Utgarde_Keep -SD%Complete: 90 -SDComment: Instance Data Scripts and functions to acquire mobs and set encounter status for use in various Utgarde Keep Scripts -SDCategory: Utgarde Keep -EndScriptData */ - -#include "precompiled.h" -#include "def_utgarde_keep.h" - -#define MAX_ENCOUNTER 3 - -#define ENTRY_BELLOW_1 186688 -#define ENTRY_BELLOW_2 186689 -#define ENTRY_BELLOW_3 186690 - -#define ENTRY_FORGEFIRE_1 186692 -#define ENTRY_FORGEFIRE_2 186693 -#define ENTRY_FORGEFIRE_3 186691 - -#define ENTRY_GLOWING_ANVIL_1 186609 -#define ENTRY_GLOWING_ANVIL_2 186610 -#define ENTRY_GLOWING_ANVIL_3 186611 - -/* Utgarde Keep encounters: -0 - Prince Keleseth -1 - Skarvald Dalronn -2 - Ingvar the Plunderer -*/ - -struct TRINITY_DLL_DECL instance_utgarde_keep : public ScriptedInstance -{ - instance_utgarde_keep(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint64 Keleseth; - uint64 Skarvald; - uint64 Dalronn; - uint64 Ingvar; - - uint64 forge_bellow[3]; - uint64 forge_fire[3]; - uint64 forge_anvil[3]; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - Keleseth = 0; - Skarvald = 0; - Dalronn =0; - Ingvar =0; - - for(uint8 i= 0; i < 3; ++i) - { - forge_bellow[i] = 0; - forge_fire[i] = 0; - forge_anvil[i] = 0; - } - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - Player* GetPlayerInMap() - { - Map::PlayerList const& players = instance->GetPlayers(); - - if (!players.isEmpty()) - { - for(Map::PlayerList::const_iterator itr = players.begin(); itr != players.end(); ++itr) - { - if (Player* plr = itr->getSource()) - return plr; - } - } - - debug_log("TSCR: Instance Utgarde Keep: GetPlayerInMap, but PlayerList is empty!"); - return NULL; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 23953: Keleseth = pCreature->GetGUID(); break; - case 24201: Dalronn = pCreature->GetGUID(); break; - case 24200: Skarvald = pCreature->GetGUID(); break; - case 23954: Ingvar = pCreature->GetGUID(); break; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - //door and object id - case ENTRY_BELLOW_1: forge_bellow[0] = pGo->GetGUID(); break; - case ENTRY_BELLOW_2: forge_bellow[1] = pGo->GetGUID(); break; - case ENTRY_BELLOW_3: forge_bellow[2] = pGo->GetGUID(); break; - case ENTRY_FORGEFIRE_1: forge_fire[0] = pGo->GetGUID(); break; - case ENTRY_FORGEFIRE_2: forge_fire[1] = pGo->GetGUID(); break; - case ENTRY_FORGEFIRE_3: forge_fire[2] = pGo->GetGUID(); break; - case ENTRY_GLOWING_ANVIL_1: forge_anvil[0] = pGo->GetGUID(); break; - case ENTRY_GLOWING_ANVIL_2: forge_anvil[1] = pGo->GetGUID(); break; - case ENTRY_GLOWING_ANVIL_3: forge_anvil[2] = pGo->GetGUID(); break; - } - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_PRINCEKELESETH: return Keleseth; - case DATA_DALRONN: return Dalronn; - case DATA_SKARVALD: return Skarvald; - case DATA_INGVAR: return Ingvar; - } - - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_PRINCEKELESETH_EVENT: - if (data == DONE) - { - //HandleGameObject(doorname, 0); - } - m_auiEncounter[0] = data; - break; - case DATA_SKARVALD_DALRONN_EVENT: - if (data == DONE) - { - //HandleGameObject(doorname, 0); - } - m_auiEncounter[1] = data; - break; - case DATA_INGVAR_EVENT: - if (data == DONE) - { - //HandleGameObject(doorname, 0); - } - m_auiEncounter[2] = data; - break; - case EVENT_FORGE_1: - if (data == NOT_STARTED) - { - HandleGameObject(forge_bellow[0],false); - HandleGameObject(forge_fire[0],false); - HandleGameObject(forge_anvil[0],false); - }else - { - HandleGameObject(forge_bellow[0],true); - HandleGameObject(forge_fire[0],true); - HandleGameObject(forge_anvil[0],true); - } - break; - case EVENT_FORGE_2: - if (data == NOT_STARTED) - { - HandleGameObject(forge_bellow[1],false); - HandleGameObject(forge_fire[1],false); - HandleGameObject(forge_anvil[1],false); - }else - { - HandleGameObject(forge_bellow[1],true); - HandleGameObject(forge_fire[1],true); - HandleGameObject(forge_anvil[1],true); - } - break; - case EVENT_FORGE_3: - if (data == NOT_STARTED) - { - HandleGameObject(forge_bellow[2],false); - HandleGameObject(forge_fire[2],false); - HandleGameObject(forge_anvil[2],false); - }else - { - HandleGameObject(forge_bellow[2],true); - HandleGameObject(forge_fire[2],true); - HandleGameObject(forge_anvil[2],true); - } - break; - } - - - if (data == DONE) - { - SaveToDB(); - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_PRINCEKELESETH_EVENT: return m_auiEncounter[0]; - case DATA_SKARVALD_DALRONN_EVENT: return m_auiEncounter[1]; - case DATA_INGVAR_EVENT: return m_auiEncounter[2]; - } - - return 0; - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << "U K " << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2]; - - str_data = saveStream.str(); - - OUT_SAVE_INST_DATA_COMPLETE; - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - char dataHead1, dataHead2; - uint16 data0,data1,data2; - - std::istringstream loadStream(in); - loadStream >> dataHead1 >> dataHead2 >> data0 >> data1 >> data2; - - if (dataHead1 == 'U' && dataHead2 == 'K') - { - m_auiEncounter[0] = data0; - m_auiEncounter[1] = data1; - m_auiEncounter[2] = data2; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - }else OUT_LOAD_INST_DATA_FAIL; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_utgarde_keep(Map* pMap) -{ - return new instance_utgarde_keep(pMap); -} - -void AddSC_instance_utgarde_keep() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_utgarde_keep"; - newscript->GetInstanceData = &GetInstanceData_instance_utgarde_keep; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp deleted file mode 100644 index d82e45f28d4..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_keep/utgarde_keep.cpp +++ /dev/null @@ -1,160 +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 "precompiled.h" -#include "def_utgarde_keep.h" - -uint32 entry_search[3] = -{ - 186609, - 186610, - 186611 -}; - -struct TRINITY_DLL_DECL npc_dragonflayer_forge_masterAI : public ScriptedAI -{ - npc_dragonflayer_forge_masterAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - fm_Type = 0; - } - - ScriptedInstance* pInstance; - uint8 fm_Type; - - void Reset() - { - if (fm_Type == 0) fm_Type = GetForgeMasterType(); - CheckForge(); - } - - void CheckForge() - { - if (pInstance) - { - switch(fm_Type) - { - case 1: - pInstance->SetData(EVENT_FORGE_1,m_creature->isAlive() ? NOT_STARTED : DONE); - break; - case 2: - pInstance->SetData(EVENT_FORGE_2,m_creature->isAlive() ? NOT_STARTED : DONE); - break; - case 3: - pInstance->SetData(EVENT_FORGE_3,m_creature->isAlive() ? NOT_STARTED : DONE); - break; - } - } - } - - void JustDied(Unit *killer) - { - if (fm_Type == 0) fm_Type = GetForgeMasterType(); - if (pInstance) - { - switch(fm_Type) - { - case 1: - pInstance->SetData(EVENT_FORGE_1,DONE); - break; - case 2: - pInstance->SetData(EVENT_FORGE_2,DONE); - break; - case 3: - pInstance->SetData(EVENT_FORGE_3,DONE); - break; - } - } - } - - void EnterCombat(Unit *who) - { - if (fm_Type == 0) fm_Type = GetForgeMasterType(); - if (pInstance) - { - switch(fm_Type) - { - case 1: - pInstance->SetData(EVENT_FORGE_1,IN_PROGRESS); - break; - case 2: - pInstance->SetData(EVENT_FORGE_2,IN_PROGRESS); - break; - case 3: - pInstance->SetData(EVENT_FORGE_3,IN_PROGRESS); - break; - } - } - m_creature->SetUInt32Value(UNIT_NPC_EMOTESTATE ,EMOTE_ONESHOT_NONE); - } - - uint8 GetForgeMasterType() - { - float diff = 30.0f; - int near_f = 0; - - for(uint8 i = 0; i < 3 ; ++i) - { - GameObject* temp; - temp = m_creature->FindNearestGameObject(entry_search[i],30); - if (temp) - { - if (m_creature->IsWithinDist(temp,diff,false)) - { - near_f = i + 1; - diff = m_creature->GetDistance2d(temp); - - } - } - } - - switch (near_f) - { - case 1: return 1; - case 2: return 2; - case 3: return 3; - default: return 0; - } - } - - void UpdateAI(const uint32 diff) - { - if (fm_Type == 0) - fm_Type = GetForgeMasterType(); - - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_npc_dragonflayer_forge_master(Creature* pCreature) -{ - return new npc_dragonflayer_forge_masterAI(pCreature); -} - -void AddSC_utgarde_keep() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="npc_dragonflayer_forge_master"; - newscript->GetAI = &GetAI_npc_dragonflayer_forge_master; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp deleted file mode 100644 index 503cae94f4d..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_palehoof.cpp +++ /dev/null @@ -1,78 +0,0 @@ -/* Script Data Start -SDName: Boss palehoof -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_palehoof' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ARCING_SMASH 48260 -#define SPELL_IMPALE 48261 -#define SPELL_WITHERING_ROAR 48256 - -//Yell -#define SAY_AGGRO -1575000 -#define SAY_SLAY_1 -1575001 -#define SAY_SLAY_2 -1575002 -#define SAY_DEATH -1575003 - -struct TRINITY_DLL_DECL boss_palehoofAI : public ScriptedAI -{ - boss_palehoofAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - - switch(rand()%2) - { - case 0: - DoScriptText(SAY_SLAY_1, m_creature); - break; - case 1: - DoScriptText(SAY_SLAY_2, m_creature); - break; - } - } -}; - -CreatureAI* GetAI_boss_palehoof(Creature* pCreature) -{ - return new boss_palehoofAI (pCreature); -} - -void AddSC_boss_palehoof() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_palehoof"; - newscript->GetAI = &GetAI_boss_palehoof; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp deleted file mode 100644 index f21ae75318a..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_skadi.cpp +++ /dev/null @@ -1,89 +0,0 @@ -/* Script Data Start -SDName: Boss skadi -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_skadi' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Phase 0 "gauntlet even" Skadi on a flying mount, waves of adds charging to the group periodicaly carrying harpoons -//Phase 1 Kill the Skadi drake mount with harppons launcher -//Phase 2 Kill the Skadi - -//Skadi Spells -#define SPELL_CRUSH 50234 -#define SPELL_POISONED_SPEAR 50225 -#define SPELL_WHIRLWIND 50228 //random target, but not the tank approx. every 20s - -//Yell -#define SAY_AGGRO -1575004 -#define SAY_KILL_1 -1575005 -#define SAY_KILL_2 -1575006 -#define SAY_KILL_3 -1575007 -#define SAY_DEATH -1575008 -#define SAY_DRAKE_DEATH -1575009 -#define SAY_DRAKE_HIT_1 -1575010 -#define SAY_DRAKE_HIT_2 -1575011 -#define SAY_DRAKE_BREATH_1 -1575012 -#define SAY_DRAKE_BREATH_2 -1575013 -#define SAY_DRAKE_BREATH_3 -1575014 - -struct TRINITY_DLL_DECL boss_skadiAI : public ScriptedAI -{ - boss_skadiAI(Creature *c) : ScriptedAI(c) {} - - uint32 phase; - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - phase = 0; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_KILL_1, m_creature);break; - case 1: DoScriptText(SAY_KILL_2, m_creature);break; - case 2: DoScriptText(SAY_KILL_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_skadi(Creature* pCreature) -{ - return new boss_skadiAI (pCreature); -} - -void AddSC_boss_skadi() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_skadi"; - newscript->GetAI = &GetAI_boss_skadi; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp deleted file mode 100644 index e43d0cd9d4d..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_svala.cpp +++ /dev/null @@ -1,83 +0,0 @@ -/* Script Data Start -SDName: Boss svala -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_svala' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_CALL_FLAMES 48258 -#define SPELL_RITUAL_OF_THE_SWORD 48276 //Effect #1 Teleport, Effect #2 Dummy -#define SPELL_SINSTER_STRIKE 15667 - -//Yells -#define SAY_DIALOG_WITH_ARTHAS_1 -1575015 -#define SAY_DIALOG_WITH_ARTHAS_2 -1575016 -#define SAY_DIALOG_WITH_ARTHAS_3 -1575017 -#define SAY_AGGRO -1575018 -#define SAY_SLAY_1 -1575019 -#define SAY_SLAY_2 -1575020 -#define SAY_SLAY_3 -1575021 -#define SAY_DEATH -1575022 -#define SAY_SACRIFICE_PLAYER_1 -1575023 -#define SAY_SACRIFICE_PLAYER_2 -1575024 -#define SAY_SACRIFICE_PLAYER_3 -1575025 -#define SAY_SACRIFICE_PLAYER_4 -1575026 -#define SAY_SACRIFICE_PLAYER_5 -1575027 - -struct TRINITY_DLL_DECL boss_svalaAI : public ScriptedAI -{ - boss_svalaAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_svala(Creature* pCreature) -{ - return new boss_svalaAI (pCreature); -} - -void AddSC_boss_svala() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_svala"; - newscript->GetAI = &GetAI_boss_svala; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp deleted file mode 100644 index 43a16a78db4..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/boss_ymiron.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* Script Data Start -SDName: Boss ymiron -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = 'boss_ymiron' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_BANE 48294 -#define SPELL_DARK_SLASH 48292 -#define SPELL_FETID_ROT 48291 -#define SPELL_SCREAMS_OF_THE_DEAD 51750 -#define SPELL_SPIRIT_BURST 48529 -#define SPELL_SPIRIT_STRIKE 48423 -//every 20% stuns the party and runs to a boat - -//Yell -#define SAY_AGGRO -1575028 -#define SAY_SLAY_1 -1575029 -#define SAY_SLAY_2 -1575030 -#define SAY_SLAY_3 -1575031 -#define SAY_SLAY_4 -1575032 -#define SAY_DEATH -1575033 -#define SAY_SUMMON_BJORN -1575034 -#define SAY_SUMMON_HALDOR -1575035 -#define SAY_SUMMON_RANULF -1575036 -#define SAY_SUMMON_TORGYN -1575037 - -struct TRINITY_DLL_DECL boss_ymironAI : public ScriptedAI -{ - boss_ymironAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%4) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - case 3: DoScriptText(SAY_SLAY_4, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_ymiron(Creature* pCreature) -{ - return new boss_ymironAI (pCreature); -} - -void AddSC_boss_ymiron() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_ymiron"; - newscript->GetAI = &GetAI_boss_ymiron; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h deleted file mode 100644 index 82e2173fab5..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/def_pinnacle.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_PINNACLE_H -#define DEF_PINNACLE_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp b/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp deleted file mode 100644 index e1361c8960e..00000000000 --- a/src/bindings/scripts/scripts/zone/utgarde_keep/utgarde_pinnacle/instance_pinnacle.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_pinnacle.h" - -struct TRINITY_DLL_DECL instance_pinnacle : public ScriptedInstance -{ - instance_pinnacle(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_pinnacle(Map* pMap) -{ - return new instance_pinnacle(pMap); -} - -void AddSC_instance_pinnacle() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_pinnacle"; - newscript->GetInstanceData = &GetInstanceData_instance_pinnacle; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp b/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp deleted file mode 100644 index 2a0e7fcd007..00000000000 --- a/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_archavon.cpp +++ /dev/null @@ -1,199 +0,0 @@ -/*** SQL START *** -UPDATE `creature_template` SET `ScriptName`='boss_archavon' WHERE `entry`='31125'; -UPDATE `creature_template` SET `ScriptName`='mob_archavon_warder' WHERE `entry`='32353'; -*** SQL END ***/ -#include "precompiled.h" -#include "def_vault_of_archavon.h" - -#define EMOTE_BERSERK -1590002 - -//Spells Archavon -#define SPELL_ROCK_SHARDS 58678 -#define SPELL_CRUSHING_LEAP HEROIC(58960,60894)//Instant (10-80yr range) -- Leaps at an enemy, inflicting 8000 Physical damage, knocking all nearby enemies away, and creating a cloud of choking debris. -#define SPELL_STOMP HEROIC(58663,60880) -#define SPELL_IMPALE HEROIC(58666,60882) //Lifts an enemy off the ground with a spiked fist, inflicting 47125 to 52875 Physical damage and 9425 to 10575 additional damage each second for 8 sec. -#define SPELL_BERSERK 47008 -//Spells Archavon Warders -#define SPELL_ROCK_SHOWER HEROIC(60919,60923) -#define SPELL_SHIELD_CRUSH HEROIC(60897,60899) -#define SPELL_WHIRL HEROIC(60902,60916) - -//4 Warders spawned -#define ARCHAVON_WARDER 32353 //npc 32353 - -//Yell -#define SAY_LEAP "Archavon the Stone Watcher lunges for $N!" //$N should be the target - -#define EVENT_ROCK_SHARDS 1 //15s cd -#define EVENT_CHOKING_CLOUD 2 //30s cd -#define EVENT_STOMP 3 //45s cd -#define EVENT_IMPALE 4 -#define EVENT_BERSERK 5 //300s cd - -//mob -#define EVENT_ROCK_SHOWER 5 //set = 20s cd,unkown cd -#define EVENT_SHIELD_CRUSH 6 //set = 30s cd -#define EVENT_WHIRL 8 //set= 10s cd - -struct TRINITY_DLL_DECL boss_archavonAI : public ScriptedAI -{ - boss_archavonAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - EventMap events; - - void Reset() - { - events.Reset(); - - if (pInstance) - pInstance->SetData(DATA_ARCHAVON_EVENT, NOT_STARTED); - } - - void KilledUnit(Unit* Victim){} - - void JustDied(Unit* Killer) - { - if (pInstance) - pInstance->SetData(DATA_ARCHAVON_EVENT, DONE); - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000); - events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000); - events.ScheduleEvent(EVENT_STOMP, 45000); - events.ScheduleEvent(EVENT_BERSERK, 300000); - - if (pInstance) - pInstance->SetData(DATA_ARCHAVON_EVENT, IN_PROGRESS); - } - - // Below UpdateAI may need review/debug. - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - if (me->hasUnitState(UNIT_STAT_CASTING)) - return; - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_ROCK_SHARDS: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_ROCK_SHARDS); - events.ScheduleEvent(EVENT_ROCK_SHARDS, 15000); - return; - case EVENT_CHOKING_CLOUD: - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CRUSHING_LEAP, true); //10y~80y, ignore range - events.ScheduleEvent(EVENT_CHOKING_CLOUD, 30000); - return; - case EVENT_STOMP: - DoCast(me->getVictim(), SPELL_STOMP); - events.ScheduleEvent(EVENT_IMPALE, 3000); - events.ScheduleEvent(EVENT_STOMP, 45000); - return; - case EVENT_IMPALE: - DoCast(me->getVictim(), SPELL_IMPALE); - return; - case EVENT_BERSERK: - DoCast(m_creature, SPELL_BERSERK); - DoScriptText(EMOTE_BERSERK, m_creature); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -/*###### -## Mob Archavon Warder -######*/ -struct TRINITY_DLL_DECL mob_warderAI : public ScriptedAI //npc 32353 -{ - mob_warderAI(Creature *c) : ScriptedAI(c) {} - - EventMap events; - - void Reset() - { - events.Reset(); - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - events.ScheduleEvent(EVENT_ROCK_SHOWER, 2000); - events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000); - events.ScheduleEvent(EVENT_WHIRL, 7500); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_ROCK_SHOWER: - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_ROCK_SHOWER); - events.ScheduleEvent(EVENT_ROCK_SHARDS, 6000); - return; - } - case EVENT_SHIELD_CRUSH: - DoCast(m_creature->getVictim(), SPELL_SHIELD_CRUSH); - events.ScheduleEvent(EVENT_SHIELD_CRUSH, 20000); - return; - case EVENT_WHIRL: - DoCast(m_creature->getVictim(), SPELL_WHIRL); - events.ScheduleEvent(EVENT_WHIRL, 8000); - return; - } - } - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_warder(Creature* pCreature) -{ - return new mob_warderAI (pCreature); -} - -CreatureAI* GetAI_boss_archavon(Creature* pCreature) -{ - return new boss_archavonAI (pCreature); -} - -void AddSC_boss_archavon() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_archavon"; - newscript->GetAI = &GetAI_boss_archavon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_archavon_warder"; - newscript->GetAI = &GetAI_mob_warder; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_emalon.cpp b/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_emalon.cpp deleted file mode 100644 index 94290a05007..00000000000 --- a/src/bindings/scripts/scripts/zone/vault_of_archavon/boss_emalon.cpp +++ /dev/null @@ -1,275 +0,0 @@ -#include "precompiled.h" -#include "def_vault_of_archavon.h" - -//Emalon spells -#define SPELL_CHAIN_LIGHTNING HEROIC(64213, 64215) -#define SPELL_LIGHTNING_NOVA HEROIC(64216, 65279) -#define SPELL_OVERCHARGE 64218 //Casted every 45 sec on a random Tempest Minion -#define SPELL_BERSERK 26662 - -//Tempest Minion spells -#define SPELL_SHOCK 64363 -#define SPELL_OVERCHARGED 64217 -#define SPELL_OVERCHARGED_BLAST 64219 //Casted when Overcharged reaches 10 stacks. Mob dies after that - -//Emotes -#define EMOTE_OVERCHARGE -1590000 -#define EMOTE_MINION_RESPAWN -1590001 -#define EMOTE_BERSERK -1590002 - -//Events -#define EVENT_CHAIN_LIGHTNING 1 -#define EVENT_LIGHTNING_NOVA 2 -#define EVENT_OVERCHARGE 3 -#define EVENT_BERSERK 4 -#define EVENT_SHOCK 5 - -//Creatures -#define MOB_TEMPEST_MINION 33998 - -float TempestMinions[4][5] = -{ - {33998, -203.980103, -281.287720, 91.650223, 1.598807}, - {33998, -233.489410, -281.139282, 91.652412, 1.598807}, - {33998, -233.267578, -297.104645, 91.681915, 1.598807}, - {33998, -203.842529, -297.097015, 91.745163, 1.598807} -}; - -/*###### -## Emalon the Storm Watcher -######*/ -struct TRINITY_DLL_DECL boss_emalonAI : public ScriptedAI -{ - boss_emalonAI(Creature *c) : ScriptedAI(c), summons(m_creature) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - EventMap events; - std::list MinionList; - SummonList summons; - - void Reset() - { - events.Reset(); - summons.DespawnAll(); - MinionList.clear(); - - Creature* Minion; - for (uint32 i = 0; i < 4; ++i) - { - Minion = m_creature->SummonCreature(((uint32)TempestMinions[i][0]),TempestMinions[i][1],TempestMinions[i][2],TempestMinions[i][3],TempestMinions[i][4],TEMPSUMMON_DEAD_DESPAWN, 0); - MinionList.push_back(Minion->GetGUID()); - if(Unit* target = m_creature->getVictim()) - Minion->AI()->AttackStart(target); - } - - if (pInstance) - pInstance->SetData(DATA_EMALON_EVENT, NOT_STARTED); - } - - void JustSummoned(Creature* summoned) - { - summons.Summon(summoned); - } - - void SummonedCreatureDespawn(Creature *summon) {summons.Despawn(summon);} - - void JustDied(Unit* Killer) - { - summons.DespawnAll(); - - if (pInstance) - pInstance->SetData(DATA_EMALON_EVENT, DONE); - } - - void EnterCombat(Unit *who) - { - if(!MinionList.empty()) - { - for(std::list::const_iterator itr = MinionList.begin(); itr != MinionList.end(); ++itr) - { - Creature* Minion = (Unit::GetCreature(*m_creature, *itr)); - Minion->AI()->AttackStart(who); - } - } - - DoZoneInCombat(); - events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 5000); - events.ScheduleEvent(EVENT_LIGHTNING_NOVA, 40000); - events.ScheduleEvent(EVENT_BERSERK, 360000); - events.ScheduleEvent(EVENT_OVERCHARGE, 45000); - - if (pInstance) - pInstance->SetData(DATA_EMALON_EVENT, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if(!UpdateVictim()) - return; - - events.Update(diff); - - if(me->hasUnitState(UNIT_STAT_CASTING)) - return; - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_CHAIN_LIGHTNING: - if(Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CHAIN_LIGHTNING); - events.ScheduleEvent(EVENT_CHAIN_LIGHTNING, 25000); - return; - case EVENT_LIGHTNING_NOVA: - DoCastAOE(SPELL_LIGHTNING_NOVA, false); - events.ScheduleEvent(EVENT_LIGHTNING_NOVA, 40000); - return; - case EVENT_OVERCHARGE: - if(Creature* Minion = GetClosestCreatureWithEntry(me, MOB_TEMPEST_MINION, 1000.0f)) - { - Minion->CastSpell(me, SPELL_OVERCHARGED, true); - Minion->SetHealth(Minion->GetMaxHealth()); - DoScriptText(EMOTE_OVERCHARGE, m_creature); - } - events.ScheduleEvent(EVENT_OVERCHARGE, 45000); - return; - case EVENT_BERSERK: - DoCast(m_creature, SPELL_BERSERK); - DoScriptText(EMOTE_BERSERK, m_creature); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -/*###### -## Tempest Minion -######*/ -struct TRINITY_DLL_DECL mob_tempest_minionAI : public ScriptedAI -{ - mob_tempest_minionAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - EmalonGUID = pInstance ? pInstance->GetData64(DATA_EMALON) : 0; - Emalon = Unit::GetCreature(*m_creature, EmalonGUID); - } - - ScriptedInstance* pInstance; - - EventMap events; - - uint64 EmalonGUID; - Creature* Emalon; - - uint32 OverchargedTimer; - - void Reset() - { - events.Reset(); - - OverchargedTimer = 0; - } - - void JustDied(Unit* Killer) - { - Creature* Emalon; - Emalon = Unit::GetCreature(*m_creature, EmalonGUID); - float x,y,z; - Emalon->GetPosition(x,y,z); - Emalon->SummonCreature(MOB_TEMPEST_MINION,x,y,z,m_creature->GetOrientation(),TEMPSUMMON_DEAD_DESPAWN,0); - DoScriptText(EMOTE_MINION_RESPAWN, m_creature); - } - - void EnterCombat(Unit *who) - { - DoZoneInCombat(); - events.ScheduleEvent(EVENT_SHOCK, 20000); - - if(Emalon) - Emalon->AI()->AttackStart(who); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if(!UpdateVictim()) - return; - - events.Update(diff); - - if(me->hasUnitState(UNIT_STAT_CASTING)) - return; - - if(Aura *OverchargedAura = m_creature->GetAura(SPELL_OVERCHARGED)) - { - if(OverchargedAura->GetStackAmount() < 10) - { - if(OverchargedTimer < diff) - { - DoCast(me, SPELL_OVERCHARGED); - OverchargedTimer = 2000; - }else OverchargedTimer -=diff; - } - else - { - if(OverchargedAura->GetStackAmount() == 10) - { - DoCast(me,SPELL_OVERCHARGED_BLAST); - m_creature->setDeathState(JUST_DIED); - Creature* Emalon; - Emalon = Unit::GetCreature(*m_creature, EmalonGUID); - float x,y,z; - Emalon->GetPosition(x,y,z); - Emalon->SummonCreature(MOB_TEMPEST_MINION,x,y,z,m_creature->GetOrientation(),TEMPSUMMON_DEAD_DESPAWN,0); - DoScriptText(EMOTE_MINION_RESPAWN, m_creature); - } - } - } - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_SHOCK: - DoCast(me->getVictim(), SPELL_SHOCK); - events.ScheduleEvent(EVENT_SHOCK, 20000); - return; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_tempest_minion(Creature *_Creature) -{ - return new mob_tempest_minionAI (_Creature); -} - -CreatureAI* GetAI_boss_emalon(Creature *_Creature) -{ - return new boss_emalonAI (_Creature); -} - -void AddSC_boss_emalon() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_emalon"; - newscript->GetAI = &GetAI_boss_emalon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_tempest_minion"; - newscript->GetAI = &GetAI_mob_tempest_minion; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h b/src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h deleted file mode 100644 index 95c44035184..00000000000 --- a/src/bindings/scripts/scripts/zone/vault_of_archavon/def_vault_of_archavon.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef DEF_ARCHAVON_H -#define DEF_ARCHAVON_H - -#define DATA_ARCHAVON_EVENT 1 -#define DATA_EMALON_EVENT 2 -#define DATA_EMALON 3 -#define DATA_ARCHAVON 4 -#endif diff --git a/src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp b/src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp deleted file mode 100644 index 45d0a4be7ae..00000000000 --- a/src/bindings/scripts/scripts/zone/vault_of_archavon/instance_vault_of_archavon.cpp +++ /dev/null @@ -1,124 +0,0 @@ -#include "precompiled.h" -#include "def_vault_of_archavon.h" - -#define ENCOUNTERS 2 - -/* Vault of Archavon encounters: -1 - Archavon the Stone Watcher event -2 - Emalon the Storm Watcher event -*/ - -struct TRINITY_DLL_DECL instance_archavon : public ScriptedInstance -{ - instance_archavon(Map *Map) : ScriptedInstance(Map) {Initialize();}; - - uint32 Encounters[ENCOUNTERS]; - - uint64 Archavon; - uint64 Emalon; - - void Initialize() - { - Archavon = 0; - Emalon = 0; - - for(uint8 i = 0; i < ENCOUNTERS; i++) - Encounters[i] = NOT_STARTED; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < ENCOUNTERS; i++) - if(Encounters[i] == IN_PROGRESS) return true; - - return false; - } - - void OnCreatureCreate(Creature *creature, bool add) - { - switch(creature->GetEntry()) - { - case 31125: Archavon = creature->GetGUID(); break; - case 33993: Emalon = creature->GetGUID(); break; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case DATA_ARCHAVON_EVENT: return Encounters[0]; - case DATA_EMALON_EVENT: return Encounters[1]; - } - return 0; - } - - uint64 GetData64(uint32 identifier) - { - switch(identifier) - { - case DATA_ARCHAVON: return Archavon; - case DATA_EMALON: return Emalon; - } - return 0; - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_ARCHAVON_EVENT: Encounters[0] = data; break; - case DATA_EMALON_EVENT: Encounters[1] = data; break; - } - - if(data == DONE) - SaveToDB(); - } - - std::string GetSaveData() - { - OUT_SAVE_INST_DATA; - std::ostringstream stream; - stream << Encounters[0] << " " << Encounters[1]; - char* out = new char[stream.str().length() + 1]; - strcpy(out, stream.str().c_str()); - if(out) - { - OUT_SAVE_INST_DATA_COMPLETE; - return out; - } - - return NULL; - } - - void Load(const char* in) - { - if(!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - std::istringstream stream(in); - stream >> Encounters[0] >> Encounters[1]; - for(uint8 i = 0; i < ENCOUNTERS; ++i) - if(Encounters[i] == IN_PROGRESS) - Encounters[i] = NOT_STARTED; - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_archavon(Map* map) -{ - return new instance_archavon(map); -} - -void AddSC_instance_archavon() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_archavon"; - newscript->GetInstanceData = &GetInstanceData_instance_archavon; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp deleted file mode 100644 index 13ad8c27a75..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/boss_cyanigosa.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* Script Data Start -SDName: Boss cyanigosa -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ARCANE_VACUM 58694 -#define SPELL_BLIZZARD 58693 -#define SPELL_MANA_DESTRUCTION 59374 -#define SPELL_TAIL_SWEEP 58690 -#define SPELL_UNCONTROLLABLE_ENERGY 58688 - -//Yells -#define SAY_AGGRO -1608000 -#define SAY_SLAY_1 -1608001 -#define SAY_SLAY_2 -1608002 -#define SAY_SLAY_3 -1608003 -#define SAY_DEATH -1608004 -#define SAY_SPAWN -1608005 -#define SAY_DISRUPTION -1608006 -#define SAY_BREATH_ATTACK -1608007 -#define SAY_SPECIAL_ATTACK_1 -1608008 -#define SAY_SPECIAL_ATTACK_2 -1608009 - -struct TRINITY_DLL_DECL boss_cyanigosaAI : public ScriptedAI -{ - boss_cyanigosaAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_cyanigosa(Creature* pCreature) -{ - return new boss_cyanigosaAI (pCreature); -} - -void AddSC_boss_cyanigosa() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_cyanigosa"; - newscript->GetAI = &GetAI_boss_cyanigosa; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp deleted file mode 100644 index d5f18ac806f..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/boss_erekem.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* Script Data Start -SDName: Boss erekem -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_BLOODLUST 54516 -#define SPELL_BREAK_BONDS 59463 -#define SPELL_CHAIN_HEAL 54481 -#define SPELL_EARTH_SHIELD 54479 -#define SPELL_EARTH_SHOCK 54511 -#define SPELL_LIGHTNING_BOLT 53044 -#define SPELL_STORMSTRIKE 51876 - -//Yells -#define SAY_AGGRO -1608010 -#define SAY_SLAY_1 -1608011 -#define SAY_SLAY_2 -1608012 -#define SAY_SLAY_3 -1608013 -#define SAY_DEATH -1608014 -#define SAY_SPAWN -1608015 -#define SAY_ADD_KILED -1608016 -#define SAY_BOTH_ADDS_KILED -1608017 - -struct TRINITY_DLL_DECL boss_erekemAI : public ScriptedAI -{ - boss_erekemAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_erekem(Creature* pCreature) -{ - return new boss_erekemAI (pCreature); -} - -void AddSC_boss_erekem() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_erekem"; - newscript->GetAI = &GetAI_boss_erekem; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp deleted file mode 100644 index 60b1c656808..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/boss_ichoron.cpp +++ /dev/null @@ -1,81 +0,0 @@ -/* Script Data Start -SDName: Boss ichoron -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_DRAINED 59820 -#define SPELL_FRENZY 54312 -#define SPELL_PROTECTIVE_BUBBLE 54306 -#define SPELL_WATER_BLAST 54237 -#define SPELL_WATER_BOLT_VOLLEY 54241 - -//Yells -#define SAY_AGGRO -1608018 -#define SAY_SLAY_1 -1608019 -#define SAY_SLAY_2 -1608020 -#define SAY_SLAY_3 -1608021 -#define SAY_DEATH -1608022 -#define SAY_SPAWN -1608023 -#define SAY_ENRAGE -1608024 -#define SAY_SHATTER -1608025 -#define SAY_BUBBLE -1608026 - -struct TRINITY_DLL_DECL boss_ichoronAI : public ScriptedAI -{ - boss_ichoronAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_ichoron(Creature* pCreature) -{ - return new boss_ichoronAI (pCreature); -} - -void AddSC_boss_ichoron() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_ichoron"; - newscript->GetAI = &GetAI_boss_ichoron; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp deleted file mode 100644 index 430a8acb178..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/boss_lavanthor.cpp +++ /dev/null @@ -1,52 +0,0 @@ -/* Script Data Start -SDName: Boss lavanthor -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_CAUTERIZING_FLAMES 59466 -#define SPELL_FIREBOLT 54235 -#define SPELL_FLAME_BREATH 54282 -#define SPELL_LAVA_BURN 54249 - -struct TRINITY_DLL_DECL boss_lavanthorAI : public ScriptedAI -{ - boss_lavanthorAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; - -CreatureAI* GetAI_boss_lavanthor(Creature* pCreature) -{ - return new boss_lavanthorAI (pCreature); -} - -void AddSC_boss_lavanthor() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_lavanthor"; - newscript->GetAI = &GetAI_boss_lavanthor; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp deleted file mode 100644 index fdc18a3c549..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/boss_moragg.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/* Script Data Start -SDName: Boss moragg -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_CORROSICE_SALIVA 54527 -#define SPELL_OPTIC_LINK 54396 - -struct TRINITY_DLL_DECL boss_moraggAI : public ScriptedAI -{ - boss_moraggAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) {} - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) {} -}; - -CreatureAI* GetAI_boss_moragg(Creature* pCreature) -{ - return new boss_moraggAI (pCreature); -} - -void AddSC_boss_moragg() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_moragg"; - newscript->GetAI = &GetAI_boss_moragg; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp deleted file mode 100644 index b59c4aec4e1..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/boss_xevozz.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* Script Data Start -SDName: Boss xevozz -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_ARCANE_BARRAGE_VOLLEY 54202 -#define SPELL_ARCANE_BUFFET 54226 -#define SPELL_SUMMON_ETHEREAL_SPHERE_1 54102 -#define SPELL_SUMMON_ETHEREAL_SPHERE_2 54137 -#define SPELL_SUMMON_ETHEREAL_SPHERE_3 54138 - -//Yells -#define SAY_AGGRO -1608027 -#define SAY_SLAY_1 -1608028 -#define SAY_SLAY_2 -1608029 -#define SAY_SLAY_3 -1608030 -#define SAY_DEATH -1608031 -#define SAY_SPAWN -1608032 -#define SAY_CHARGED -1608033 -#define SAY_REPEAT_SUMMON_1 -1608034 -#define SAY_REPEAT_SUMMON_2 -1608035 -#define SAY_SUMMON_ENERGY -1608036 - -struct TRINITY_DLL_DECL boss_xevozzAI : public ScriptedAI -{ - boss_xevozzAI(Creature *c) : ScriptedAI(c) {} - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_xevozz(Creature* pCreature) -{ - return new boss_xevozzAI (pCreature); -} - -void AddSC_boss_xevozz() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_xevozz"; - newscript->GetAI = &GetAI_boss_xevozz; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp b/src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp deleted file mode 100644 index 218b5915bec..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/boss_zuramat.cpp +++ /dev/null @@ -1,82 +0,0 @@ -/* Script Data Start -SDName: Boss zuramat -SDAuthor: LordVanMartin -SD%Complete: -SDComment: -SDCategory: -Script Data End */ - -/*** SQL START *** -update creature_template set scriptname = '' where entry = ''; -*** SQL END ***/ -#include "precompiled.h" - -//Spells -#define SPELL_SHROUD_OF_DARKNESS 54524 -#define SPELL_SUMMON_VOID_SENTRY 54524 -#define SPELL_VOID_SHIFT 54524 - -#define NPC_VOID_SENTRY 29364 - -//Yells -#define SAY_AGGRO -1608037 -#define SAY_SLAY_1 -1608038 -#define SAY_SLAY_2 -1608039 -#define SAY_SLAY_3 -1608040 -#define SAY_DEATH -1608041 -#define SAY_SPAWN -1608042 -#define SAY_SHIELD -1608043 -#define SAY_WHISPER -1608044 - -struct TRINITY_DLL_DECL boss_zuramatAI : public ScriptedAI -{ - boss_zuramatAI(Creature *c) : ScriptedAI(c) {} - - uint32 void_shift; - - void Reset() {} - void EnterCombat(Unit* who) - { - DoScriptText(SAY_AGGRO, m_creature); - } - void AttackStart(Unit* who) {} - void MoveInLineOfSight(Unit* who) {} - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - DoMeleeAttackIfReady(); - } - void JustDied(Unit* killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - void KilledUnit(Unit *victim) - { - if (victim == m_creature) - return; - switch(rand()%3) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature);break; - case 1: DoScriptText(SAY_SLAY_2, m_creature);break; - case 2: DoScriptText(SAY_SLAY_3, m_creature);break; - } - } -}; - -CreatureAI* GetAI_boss_zuramat(Creature* pCreature) -{ - return new boss_zuramatAI (pCreature); -} - -void AddSC_boss_zuramat() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_zuramat"; - newscript->GetAI = &GetAI_boss_zuramat; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h b/src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h deleted file mode 100644 index 71bc0d18d2f..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/def_violet_hold.h +++ /dev/null @@ -1,4 +0,0 @@ -#ifndef DEF_VIOLET_HOLD_H -#define DEF_VIOLET_HOLD_H - -#endif diff --git a/src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp b/src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp deleted file mode 100644 index 98962b919e0..00000000000 --- a/src/bindings/scripts/scripts/zone/violet_hold/instance_violet_hold.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "precompiled.h" -#include "def_violet_hold.h" - -struct TRINITY_DLL_DECL instance_violet_hold : public ScriptedInstance -{ - instance_violet_hold(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; -}; - -InstanceData* GetInstanceData_instance_violet_hold(Map* pMap) -{ - return new instance_violet_hold(pMap); -} - -void AddSC_instance_violet_hold() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_violet_hold"; - newscript->GetInstanceData = &GetInstanceData_instance_violet_hold; - newscript->RegisterSelf(); -} diff --git a/src/bindings/scripts/scripts/zone/wintergrasp/wintergrasp.cpp b/src/bindings/scripts/scripts/zone/wintergrasp/wintergrasp.cpp deleted file mode 100644 index 275043d91e5..00000000000 --- a/src/bindings/scripts/scripts/zone/wintergrasp/wintergrasp.cpp +++ /dev/null @@ -1,60 +0,0 @@ -/* Copyright (C) 2008 - 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 "precompiled.h" -#include "Wintergrasp.h" - -bool GossipHello_npc_demolisher_engineerer(Player* pPlayer, Creature* pCreature) -{ - if (pCreature->isQuestGiver()) - pPlayer->PrepareQuestMenu(pCreature->GetGUID()); - - if (pPlayer->HasAura(SPELL_CORPORAL)) - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build catapult.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - else if (pPlayer->HasAura(SPELL_LIEUTENANT)) - { - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build catapult.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build demolisher.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1); - pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Build siege engine.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2); - } - - pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); - return true; -} - -bool GossipSelect_npc_demolisher_engineerer(Player* pPlayer, Creature* me, uint32 uiSender, uint32 uiAction) -{ - pPlayer->CLOSE_GOSSIP_MENU(); - switch(uiAction - GOSSIP_ACTION_INFO_DEF) - { - case 0: pPlayer->CastSpell(pPlayer, 56663, false, NULL, NULL, me->GetGUID()); break; - case 1: pPlayer->CastSpell(pPlayer, 56575, false, NULL, NULL, me->GetGUID()); break; - case 2: pPlayer->CastSpell(pPlayer, pPlayer->GetTeamId() ? 61408 : 56661, false, NULL, NULL, me->GetGUID()); break; - } - - return true; -} - -void AddSC_wintergrasp() -{ - Script *newscript; - - newscript = new Script; - newscript->Name = "npc_demolisher_engineerer"; - newscript->pGossipHello = &GossipHello_npc_demolisher_engineerer; - newscript->pGossipSelect = &GossipSelect_npc_demolisher_engineerer; - newscript->RegisterSelf(); -} \ No newline at end of file diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 6f49b54a515..85221f5cb7e 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -250,58 +250,75 @@ extern void AddSC_teldrassil(); extern void AddSC_the_barrens(); extern void AddSC_thousand_needles(); extern void AddSC_thunder_bluff(); +extern void AddSC_ungoro_crater(); extern void AddSC_winterspring(); //northrend +extern void AddSC_instance_ahnkahet(); //Azjol-Nerub Ahn'kahet +extern void AddSC_boss_elder_nadox(); +extern void AddSC_boss_anubrekhan(); //Naxxramas +extern void AddSC_boss_maexxna(); +extern void AddSC_boss_patchwerk(); +extern void AddSC_boss_grobbulus(); +extern void AddSC_boss_razuvious(); +extern void AddSC_boss_kelthuzad(); +extern void AddSC_boss_loatheb(); +extern void AddSC_boss_noth(); +extern void AddSC_boss_gluth(); +extern void AddSC_boss_sapphiron(); +extern void AddSC_boss_four_horsemen(); +extern void AddSC_boss_faerlina(); +extern void AddSC_boss_heigan(); +extern void AddSC_boss_gothik(); +extern void AddSC_boss_thaddius(); +extern void AddSC_instance_naxxramas(); +extern void AddSC_boss_magus_telestra(); //The Nexus Nexus +extern void AddSC_boss_anomalus(); +extern void AddSC_boss_ormorok(); +extern void AddSC_boss_keristrasza(); +extern void AddSC_instance_nexus(); +extern void AddSC_boss_sartharion(); //Obsidian Sanctum +extern void AddSC_instance_obsidian_sanctum(); +extern void AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning +extern void AddSC_boss_loken(); +extern void AddSC_instance_halls_of_lightning(); +extern void AddSC_boss_auriaya(); //Ulduar Ulduar +extern void AddSC_boss_flame_leviathan(); +extern void AddSC_boss_ignis(); +extern void AddSC_boss_razorscale(); +extern void AddSC_boss_xt002(); +//extern void AddSC_instance_ulduar(); +extern void AddSC_boss_keleseth(); //Utgarde Keep +extern void AddSC_boss_skarvald_dalronn(); +extern void AddSC_boss_ingvar_the_plunderer(); +extern void AddSC_instance_utgarde_keep(); +extern void AddSC_utgarde_keep(); +extern void AddSC_boss_archavon(); //Vault of Archavon +extern void AddSC_boss_emalon(); +extern void AddSC_instance_archavon(); + extern void AddSC_borean_tundra(); extern void AddSC_dragonblight(); extern void AddSC_grizzly_hills(); extern void AddSC_icecrown(); extern void AddSC_sholazar_basin(); +extern void AddSC_wintergrasp(); extern void AddSC_zuldrak(); //outland -extern void AddSC_blades_edge_mountains(); -extern void AddSC_boss_doomlordkazzak(); -extern void AddSC_boss_doomwalker(); -extern void AddSC_hellfire_peninsula(); -extern void AddSC_nagrand(); -extern void AddSC_netherstorm(); -extern void AddSC_shadowmoon_valley(); -extern void AddSC_shattrath_city(); -extern void AddSC_terokkar_forest(); -extern void AddSC_zangarmarsh(); - -//-------------------- -//------ ZONE -------- - -//Aunchindoun -//--Auchenai Crypts -extern void AddSC_boss_exarch_maladaar(); +extern void AddSC_boss_exarch_maladaar(); //Aunchindoun Auchenai Crypts extern void AddSC_boss_shirrak_the_dead_watcher(); -//--Mana Tombs -extern void AddSC_boss_nexusprince_shaffar(); +extern void AddSC_boss_nexusprince_shaffar(); //Aunchindoun Mana Tombs extern void AddSC_boss_pandemonius(); - -//--Sekketh Halls -extern void AddSC_boss_darkweaver_syth(); +extern void AddSC_boss_darkweaver_syth(); //Aunchindoun Sekketh Halls extern void AddSC_boss_talon_king_ikiss(); extern void AddSC_instance_sethekk_halls(); - -//--Shadow Labyrinth -extern void AddSC_instance_shadow_labyrinth(); +extern void AddSC_instance_shadow_labyrinth(); //Aunchindoun Shadow Labyrinth extern void AddSC_boss_ambassador_hellmaw(); extern void AddSC_boss_blackheart_the_inciter(); extern void AddSC_boss_grandmaster_vorpil(); extern void AddSC_boss_murmur(); - -//Azjol-Nerub -//--Ahn'kahet -extern void AddSC_instance_ahnkahet(); -extern void AddSC_boss_elder_nadox(); - -//Black Temple -extern void AddSC_black_temple(); +extern void AddSC_black_temple(); //Black Temple extern void AddSC_boss_illidan(); extern void AddSC_boss_shade_of_akama(); extern void AddSC_boss_supremus(); @@ -312,149 +329,63 @@ extern void AddSC_boss_teron_gorefiend(); extern void AddSC_boss_najentus(); extern void AddSC_boss_illidari_council(); extern void AddSC_instance_black_temple(); - -//Coilfang Resevoir -//--Serpent Shrine Cavern -extern void AddSC_boss_fathomlord_karathress(); +extern void AddSC_boss_fathomlord_karathress(); //CR Serpent Shrine Cavern extern void AddSC_boss_hydross_the_unstable(); extern void AddSC_boss_lady_vashj(); extern void AddSC_boss_leotheras_the_blind(); extern void AddSC_boss_morogrim_tidewalker(); extern void AddSC_instance_serpentshrine_cavern(); extern void AddSC_boss_the_lurker_below(); - -//--Slave Pens - -//--Steam Vault -extern void AddSC_boss_hydromancer_thespia(); +extern void AddSC_boss_hydromancer_thespia(); //CR Steam Vault extern void AddSC_boss_mekgineer_steamrigger(); extern void AddSC_boss_warlord_kalithresh(); extern void AddSC_instance_steam_vault(); - -//--Underbog -extern void AddSC_boss_hungarfen(); +extern void AddSC_boss_hungarfen(); //CR Underbog extern void AddSC_boss_the_black_stalker(); - -//Gruul's Lair -extern void AddSC_boss_gruul(); +extern void AddSC_boss_gruul(); //Gruul's Lair extern void AddSC_boss_high_king_maulgar(); extern void AddSC_instance_gruuls_lair(); - -//Hellfire Citadel -//--Blood Furnace -extern void AddSC_boss_broggok(); +extern void AddSC_boss_broggok(); //HC Blood Furnace extern void AddSC_boss_kelidan_the_breaker(); extern void AddSC_boss_the_maker(); extern void AddSC_instance_blood_furnace(); - -//--Magtheridon's Lair -extern void AddSC_boss_magtheridon(); +extern void AddSC_boss_magtheridon(); //HC Magtheridon's Lair extern void AddSC_instance_magtheridons_lair(); - -//--Shattered Halls -extern void AddSC_boss_grand_warlock_nethekurse(); +extern void AddSC_boss_grand_warlock_nethekurse(); //HC Shattered Halls extern void AddSC_boss_warbringer_omrogg(); extern void AddSC_boss_warchief_kargath_bladefist(); extern void AddSC_instance_shattered_halls(); - -//--Ramparts -extern void AddSC_boss_watchkeeper_gargolmar(); +extern void AddSC_boss_watchkeeper_gargolmar(); //HC Ramparts extern void AddSC_boss_omor_the_unscarred(); extern void AddSC_boss_vazruden_the_herald(); extern void AddSC_instance_ramparts(); - -//Naxxramas -extern void AddSC_boss_anubrekhan(); -extern void AddSC_boss_maexxna(); -extern void AddSC_boss_patchwerk(); -extern void AddSC_boss_grobbulus(); -extern void AddSC_boss_razuvious(); -extern void AddSC_boss_kelthuzad(); -extern void AddSC_boss_loatheb(); -extern void AddSC_boss_noth(); -extern void AddSC_boss_gluth(); -extern void AddSC_boss_sapphiron(); -extern void AddSC_boss_four_horsemen(); -extern void AddSC_boss_faerlina(); -extern void AddSC_boss_heigan(); -extern void AddSC_boss_gothik(); -extern void AddSC_boss_thaddius(); -extern void AddSC_instance_naxxramas(); - -//The Nexus -//Eye of Eternety - -//Nexus -extern void AddSC_boss_magus_telestra(); -extern void AddSC_boss_anomalus(); -extern void AddSC_boss_ormorok(); -extern void AddSC_boss_keristrasza(); -extern void AddSC_instance_nexus(); - -//Oculus - -//Obsidian Sanctum -extern void AddSC_boss_sartharion(); -extern void AddSC_instance_obsidian_sanctum(); - -//Tempest Keep -//--Arcatraz -extern void AddSC_arcatraz(); +extern void AddSC_arcatraz(); //TK Arcatraz extern void AddSC_boss_harbinger_skyriss(); extern void AddSC_instance_arcatraz(); - -//--Botanica -extern void AddSC_boss_high_botanist_freywinn(); +extern void AddSC_boss_high_botanist_freywinn(); //TK Botanica extern void AddSC_boss_laj(); extern void AddSC_boss_warp_splinter(); - -//--The Eye -extern void AddSC_boss_alar(); +extern void AddSC_boss_alar(); //TK The Eye extern void AddSC_boss_kaelthas(); extern void AddSC_boss_void_reaver(); extern void AddSC_boss_high_astromancer_solarian(); extern void AddSC_instance_the_eye(); extern void AddSC_the_eye(); - -//--The Mechanar -extern void AddSC_boss_gatewatcher_iron_hand(); +extern void AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar extern void AddSC_boss_nethermancer_sepethrea(); extern void AddSC_boss_pathaleon_the_calculator(); extern void AddSC_instance_mechanar(); - -//Ulduar -extern void AddSC_boss_auriaya(); -extern void AddSC_boss_flame_leviathan(); -extern void AddSC_boss_ignis(); -extern void AddSC_boss_razorscale(); -extern void AddSC_boss_xt002(); -//extern void AddSC_instance_ulduar(); - -//Un'Goro Crater -extern void AddSC_ungoro_crater(); - -//Upper blackrock spire - -//Utgarde Keep -extern void AddSC_boss_keleseth(); -extern void AddSC_boss_skarvald_dalronn(); -extern void AddSC_boss_ingvar_the_plunderer(); -extern void AddSC_instance_utgarde_keep(); -extern void AddSC_utgarde_keep(); - -//Vault of Archavon -extern void AddSC_boss_archavon(); -extern void AddSC_boss_emalon(); -extern void AddSC_instance_archavon(); - -//Halls of Lightning -extern void AddSC_boss_bjarngrim(); -extern void AddSC_boss_loken(); -extern void AddSC_instance_halls_of_lightning(); - -//Region -extern void AddSC_wintergrasp(); +extern void AddSC_blades_edge_mountains(); +extern void AddSC_boss_doomlordkazzak(); +extern void AddSC_boss_doomwalker(); +extern void AddSC_hellfire_peninsula(); +extern void AddSC_nagrand(); +extern void AddSC_netherstorm(); +extern void AddSC_shadowmoon_valley(); +extern void AddSC_shattrath_city(); +extern void AddSC_terokkar_forest(); +extern void AddSC_zangarmarsh(); void AddScripts() { @@ -704,58 +635,75 @@ void AddScripts() AddSC_the_barrens(); AddSC_thousand_needles(); AddSC_thunder_bluff(); + AddSC_ungoro_crater(); AddSC_winterspring(); //northrend + AddSC_instance_ahnkahet(); //Azjol-Nerub Ahn'kahet + AddSC_boss_elder_nadox(); + AddSC_boss_anubrekhan(); //Naxxramas + AddSC_boss_maexxna(); + AddSC_boss_patchwerk(); + AddSC_boss_grobbulus(); + AddSC_boss_razuvious(); + AddSC_boss_kelthuzad(); + AddSC_boss_loatheb(); + AddSC_boss_noth(); + AddSC_boss_gluth(); + AddSC_boss_sapphiron(); + AddSC_boss_four_horsemen(); + AddSC_boss_faerlina(); + AddSC_boss_heigan(); + AddSC_boss_gothik(); + AddSC_boss_thaddius(); + AddSC_instance_naxxramas(); + AddSC_boss_magus_telestra(); //The Nexus Nexus + AddSC_boss_anomalus(); + AddSC_boss_ormorok(); + AddSC_boss_keristrasza(); + AddSC_instance_nexus(); + AddSC_boss_sartharion(); //Obsidian Sanctum + AddSC_instance_obsidian_sanctum(); + AddSC_boss_bjarngrim(); //Ulduar Halls of Lightning + AddSC_boss_loken(); + AddSC_instance_halls_of_lightning(); + AddSC_boss_auriaya(); //Ulduar Ulduar + AddSC_boss_flame_leviathan(); + AddSC_boss_ignis(); + AddSC_boss_razorscale(); + AddSC_boss_xt002(); + //AddSC_instance_ulduar(); + AddSC_boss_keleseth(); //Utgarde Keep + AddSC_boss_skarvald_dalronn(); + AddSC_boss_ingvar_the_plunderer(); + AddSC_instance_utgarde_keep(); + AddSC_utgarde_keep(); + AddSC_boss_archavon(); //Vault of Archavon + AddSC_boss_emalon(); + AddSC_instance_archavon(); + AddSC_borean_tundra(); AddSC_dragonblight(); AddSC_grizzly_hills(); AddSC_icecrown(); AddSC_sholazar_basin(); + AddSC_wintergrasp(); AddSC_zuldrak(); //outland - AddSC_blades_edge_mountains(); - AddSC_boss_doomlordkazzak(); - AddSC_boss_doomwalker(); - AddSC_hellfire_peninsula(); - AddSC_nagrand(); - AddSC_netherstorm(); - AddSC_shadowmoon_valley(); - AddSC_shattrath_city(); - AddSC_terokkar_forest(); - AddSC_zangarmarsh(); - - //-------------------- - //------ ZONE -------- - - //Aunchindoun - //--Auchenai Crypts - AddSC_boss_exarch_maladaar(); + AddSC_boss_exarch_maladaar(); //Aunchindoun Auchenai Crypts AddSC_boss_shirrak_the_dead_watcher(); - //--Mana Tombs - AddSC_boss_nexusprince_shaffar(); + AddSC_boss_nexusprince_shaffar(); //Aunchindoun Mana Tombs AddSC_boss_pandemonius(); - - //--Sekketh Halls - AddSC_boss_darkweaver_syth(); + AddSC_boss_darkweaver_syth(); //Aunchindoun Sekketh Halls AddSC_boss_talon_king_ikiss(); AddSC_instance_sethekk_halls(); - - //--Shadow Labyrinth - AddSC_instance_shadow_labyrinth(); + AddSC_instance_shadow_labyrinth(); //Aunchindoun Shadow Labyrinth AddSC_boss_ambassador_hellmaw(); AddSC_boss_blackheart_the_inciter(); AddSC_boss_grandmaster_vorpil(); AddSC_boss_murmur(); - - //Azjol-Nerub - //--Ahn'kahet - AddSC_instance_ahnkahet(); - AddSC_boss_elder_nadox(); - - //Black Temple - AddSC_black_temple(); + AddSC_black_temple(); //Black Temple AddSC_boss_illidan(); AddSC_boss_shade_of_akama(); AddSC_boss_supremus(); @@ -766,147 +714,61 @@ void AddScripts() AddSC_boss_najentus(); AddSC_boss_illidari_council(); AddSC_instance_black_temple(); - - //Coilfang Resevoir - //--Serpent Shrine Cavern - AddSC_boss_fathomlord_karathress(); + AddSC_boss_fathomlord_karathress(); //CR Serpent Shrine Cavern AddSC_boss_hydross_the_unstable(); AddSC_boss_lady_vashj(); AddSC_boss_leotheras_the_blind(); AddSC_boss_morogrim_tidewalker(); AddSC_instance_serpentshrine_cavern(); AddSC_boss_the_lurker_below(); - - //--Slave Pens - - //--Steam Vault - AddSC_boss_hydromancer_thespia(); + AddSC_boss_hydromancer_thespia(); //CR Steam Vault AddSC_boss_mekgineer_steamrigger(); AddSC_boss_warlord_kalithresh(); AddSC_instance_steam_vault(); - - //--Underbog - AddSC_boss_hungarfen(); + AddSC_boss_hungarfen(); //CR Underbog AddSC_boss_the_black_stalker(); - - //Gruul's Lair - AddSC_boss_gruul(); + AddSC_boss_gruul(); //Gruul's Lair AddSC_boss_high_king_maulgar(); AddSC_instance_gruuls_lair(); - - //Hellfire Citadel - //--Blood Furnace - AddSC_boss_broggok(); + AddSC_boss_broggok(); //HC Blood Furnace AddSC_boss_kelidan_the_breaker(); AddSC_boss_the_maker(); AddSC_instance_blood_furnace(); - - //--Magtheridon's Lair - AddSC_boss_magtheridon(); + AddSC_boss_magtheridon(); //HC Magtheridon's Lair AddSC_instance_magtheridons_lair(); - - //--Shattered Halls - AddSC_boss_grand_warlock_nethekurse(); + AddSC_boss_grand_warlock_nethekurse(); //HC Shattered Halls AddSC_boss_warbringer_omrogg(); AddSC_boss_warchief_kargath_bladefist(); AddSC_instance_shattered_halls(); - - //--Ramparts - AddSC_boss_watchkeeper_gargolmar(); + AddSC_boss_watchkeeper_gargolmar(); //HC Ramparts AddSC_boss_omor_the_unscarred(); AddSC_boss_vazruden_the_herald(); AddSC_instance_ramparts(); - - //Naxxramas - AddSC_boss_anubrekhan(); - AddSC_boss_maexxna(); - AddSC_boss_patchwerk(); - AddSC_boss_grobbulus(); - AddSC_boss_razuvious(); - AddSC_boss_kelthuzad(); - AddSC_boss_loatheb(); - AddSC_boss_noth(); - AddSC_boss_gluth(); - AddSC_boss_sapphiron(); - AddSC_boss_four_horsemen(); - AddSC_boss_faerlina(); - AddSC_boss_heigan(); - AddSC_boss_gothik(); - AddSC_boss_thaddius(); - AddSC_instance_naxxramas(); - - //The Nexus - //Eye of Eternety - - //Nexus - AddSC_boss_magus_telestra(); - AddSC_boss_anomalus(); - AddSC_boss_ormorok(); - AddSC_boss_keristrasza(); - AddSC_instance_nexus(); - - //Oculus - - //Obsidian Sanctum - AddSC_boss_sartharion(); - AddSC_instance_obsidian_sanctum(); - - //Tempest Keep - //--Arcatraz - AddSC_arcatraz(); + AddSC_arcatraz(); //TK Arcatraz AddSC_boss_harbinger_skyriss(); AddSC_instance_arcatraz(); - - //--Botanica - AddSC_boss_high_botanist_freywinn(); + AddSC_boss_high_botanist_freywinn(); //TK Botanica AddSC_boss_laj(); AddSC_boss_warp_splinter(); - - //--The Eye - AddSC_boss_alar(); + AddSC_boss_alar(); //TK The Eye AddSC_boss_kaelthas(); AddSC_boss_void_reaver(); AddSC_boss_high_astromancer_solarian(); AddSC_instance_the_eye(); AddSC_the_eye(); - - //--The Mechanar - AddSC_boss_gatewatcher_iron_hand(); + AddSC_boss_gatewatcher_iron_hand(); //TK The Mechanar AddSC_boss_nethermancer_sepethrea(); AddSC_boss_pathaleon_the_calculator(); AddSC_instance_mechanar(); - - //Ulduar - AddSC_boss_auriaya(); - AddSC_boss_flame_leviathan(); - AddSC_boss_ignis(); - AddSC_boss_razorscale(); - AddSC_boss_xt002(); - //AddSC_instance_ulduar(); - - //Un'Goro Crater - AddSC_ungoro_crater(); - - //Upper blackrock spire - - //Utgarde Keep - AddSC_boss_keleseth(); - AddSC_boss_skarvald_dalronn(); - AddSC_boss_ingvar_the_plunderer(); - AddSC_instance_utgarde_keep(); - AddSC_utgarde_keep(); - - //Vault of Archavon - AddSC_boss_archavon(); - AddSC_boss_emalon(); - AddSC_instance_archavon(); - - //Halls of Lightning - AddSC_boss_bjarngrim(); - AddSC_boss_loken(); - AddSC_instance_halls_of_lightning(); - - //Region - AddSC_wintergrasp(); + AddSC_blades_edge_mountains(); + AddSC_boss_doomlordkazzak(); + AddSC_boss_doomwalker(); + AddSC_hellfire_peninsula(); + AddSC_nagrand(); + AddSC_netherstorm(); + AddSC_shadowmoon_valley(); + AddSC_shattrath_city(); + AddSC_terokkar_forest(); + AddSC_zangarmarsh(); } -- cgit v1.2.3 From 683848679649994f048a526be55f776644165827 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 17:30:05 +0200 Subject: Merge [SD2] r1306 Remove now empty zone folder and complete re-organize file/folder structure. Thanks to DasBlub, Zor and others for inspiration, help and suggestions. --HG-- branch : trunk --- src/bindings/scripts/CMakeLists.txt | 3 ++- src/bindings/scripts/VC80/80ScriptDev2.vcproj | 12 ++++++++---- src/bindings/scripts/VC90/90ScriptDev2.vcproj | 12 ++++++++---- src/bindings/scripts/system.cpp | 22 ---------------------- src/bindings/scripts/system/system.cpp | 22 ++++++++++++++++++++++ src/bindings/scripts/system/system.h | 8 ++++++++ 6 files changed, 48 insertions(+), 31 deletions(-) delete mode 100644 src/bindings/scripts/system.cpp create mode 100644 src/bindings/scripts/system/system.cpp create mode 100644 src/bindings/scripts/system/system.h (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 0ea35a6b201..3ee74c0e592 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -510,7 +510,8 @@ SET(trinityscript_LIB_SRCS scripts/world/npc_taxi.cpp system/ScriptLoader.cpp system/ScriptLoader.h - system.cpp + system/system.cpp + system/system.h ) add_library(trinityscript SHARED ${trinityscript_LIB_SRCS}) diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 3136b5d6adc..7368025639f 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -2754,6 +2754,14 @@ RelativePath="..\system\ScriptLoader.h" > + + + + - - diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index 33a3e2aeca1..ea5fbf72f26 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -2751,6 +2751,14 @@ RelativePath="..\system\ScriptLoader.h" > + + + + - - diff --git a/src/bindings/scripts/system.cpp b/src/bindings/scripts/system.cpp deleted file mode 100644 index ab62e530681..00000000000 --- a/src/bindings/scripts/system.cpp +++ /dev/null @@ -1,22 +0,0 @@ -/* - * Copyright (C) 2008-2009 Trinity - * - * Thanks to the original authors: MaNGOS - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public 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 "precompiled.h" - diff --git a/src/bindings/scripts/system/system.cpp b/src/bindings/scripts/system/system.cpp new file mode 100644 index 00000000000..ab62e530681 --- /dev/null +++ b/src/bindings/scripts/system/system.cpp @@ -0,0 +1,22 @@ +/* + * Copyright (C) 2008-2009 Trinity + * + * Thanks to the original authors: MaNGOS + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public 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 "precompiled.h" + diff --git a/src/bindings/scripts/system/system.h b/src/bindings/scripts/system/system.h new file mode 100644 index 00000000000..886f31355a9 --- /dev/null +++ b/src/bindings/scripts/system/system.h @@ -0,0 +1,8 @@ +/* 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 SC_SYSTEM_H +#define SC_SYSTEM_H + +#endif -- cgit v1.2.3 From 9ddfd5bf22269f8622f72ee3797a56b0dcc37422 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 17:54:31 +0200 Subject: Merge [SD2] r1307 Add gossip for npc_tracy_proudwell. Patch by hoshie r1308 Fixed one not initialized array. r1309 Correct typo in folder name. - skip r1310 Enable faction change and remove unitState at attackStart for script related to quest 1560 --HG-- branch : trunk --- sql/FULL/world_scripts_full.sql | 1 + sql/updates/5092_world_scripts.sql | 1 + src/bindings/scripts/scripts/kalimdor/tanaris.cpp | 24 +++++++++- .../ulduar/halls_of_lightning/boss_bjarngrim.cpp | 5 +- .../scripts/scripts/outland/hellfire_peninsula.cpp | 55 ++++++++++++++++++++++ 5 files changed, 83 insertions(+), 3 deletions(-) create mode 100644 sql/updates/5092_world_scripts.sql (limited to 'src/bindings/scripts') diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index 81350d1cd44..af5e9af4800 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -550,6 +550,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_wounded_blood_elf' WHERE `entry UPDATE `creature_template` SET `ScriptName`='npc_aeranas' WHERE `entry`=17085; UPDATE `gameobject_template` SET `ScriptName`='go_haaleshi_altar' WHERE `entry`=181606; UPDATE `creature_template` SET `ScriptName`='npc_naladu' WHERE `entry`=19361; +UPDATE `creature_template` SET `ScriptName`='npc_tracy_proudwell' WHERE `entry`=18266; /* HILLSBRAD FOOTHILLS */ diff --git a/sql/updates/5092_world_scripts.sql b/sql/updates/5092_world_scripts.sql new file mode 100644 index 00000000000..bd9535181af --- /dev/null +++ b/sql/updates/5092_world_scripts.sql @@ -0,0 +1 @@ +UPDATE creature_template SET ScriptName='npc_tracy_proudwell' WHERE entry=18266; diff --git a/src/bindings/scripts/scripts/kalimdor/tanaris.cpp b/src/bindings/scripts/scripts/kalimdor/tanaris.cpp index be97636270e..44d9c67d9e6 100644 --- a/src/bindings/scripts/scripts/kalimdor/tanaris.cpp +++ b/src/bindings/scripts/scripts/kalimdor/tanaris.cpp @@ -582,6 +582,25 @@ struct MANGOS_DLL_DECL npc_toogaAI : public ScriptedAI } } + void AttackStart(Unit* pWho) + { + if (!pWho) + return; + + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho, 0.0f); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (m_creature->hasUnitState(UNIT_STAT_FOLLOW)) + m_creature->clearUnitState(UNIT_STAT_FOLLOW); + + if (IsCombatMovement()) + m_creature->GetMotionMaster()->MoveChase(pWho); + } + } + void EnterEvadeMode() { m_creature->RemoveAllAuras(); @@ -598,6 +617,9 @@ struct MANGOS_DLL_DECL npc_toogaAI : public ScriptedAI } else { + if (m_creature->hasUnitState(UNIT_STAT_FOLLOW)) + m_creature->clearUnitState(UNIT_STAT_FOLLOW); + m_creature->GetMotionMaster()->MoveTargetedHome(); } } @@ -622,7 +644,7 @@ struct MANGOS_DLL_DECL npc_toogaAI : public ScriptedAI m_uiPlayerGUID = pPlayer->GetGUID(); m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - //m_creature->setFaction(FACTION_TOOG_ESCORTEE); + m_creature->setFaction(FACTION_TOOG_ESCORTEE); m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); } diff --git a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp index 5b6301019a5..1dc5f77fd96 100644 --- a/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp +++ b/src/bindings/scripts/scripts/northrend/ulduar/halls_of_lightning/boss_bjarngrim.cpp @@ -86,6 +86,7 @@ struct TRINITY_DLL_DECL boss_bjarngrimAI : public ScriptedAI m_pInstance = pCreature->GetInstanceData(); m_bIsHeroic = pCreature->GetMap()->IsHeroic(); m_uiStance = STANCE_DEFENSIVE; + memset(&m_auiStormforgedLieutenantGUID, 0, sizeof(m_auiStormforgedLieutenantGUID)); } ScriptedInstance* m_pInstance; @@ -111,7 +112,7 @@ struct TRINITY_DLL_DECL boss_bjarngrimAI : public ScriptedAI uint32 m_uiMortalStrike_Timer; uint32 m_uiSlam_Timer; - uint64 m_uiStormforgedLieutenantGUID[2]; + uint64 m_auiStormforgedLieutenantGUID[2]; void Reset() { @@ -136,7 +137,7 @@ struct TRINITY_DLL_DECL boss_bjarngrimAI : public ScriptedAI for(uint8 i = 0; i < 2; ++i) { - if (Creature* pStormforgedLieutenant = (Unit::GetCreature((*m_creature), m_uiStormforgedLieutenantGUID[i]))) + if (Creature* pStormforgedLieutenant = (Unit::GetCreature((*m_creature), m_auiStormforgedLieutenantGUID[i]))) { if (!pStormforgedLieutenant->isAlive()) pStormforgedLieutenant->Respawn(); diff --git a/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp b/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp index da5d0e15699..171258922d6 100644 --- a/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp +++ b/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp @@ -25,6 +25,7 @@ EndScriptData */ npc_aeranas go_haaleshi_altar npc_naladu +npc_tracy_proudwell npc_wounded_blood_elf EndContentData */ @@ -156,6 +157,54 @@ bool GossipSelect_npc_naladu(Player* pPlayer, Creature* pCreature, uint32 uiSend return true; } +/*###### +## npc_tracy_proudwell +######*/ + +#define GOSSIP_TEXT_REDEEM_MARKS "I have marks to redeem!" +#define GOSSIP_TRACY_PROUDWELL_ITEM1 "I heard that your dog Fei Fei took Klatu's prayer beads..." +#define GOSSIP_TRACY_PROUDWELL_ITEM2 "" + +enum +{ + GOSSIP_TEXTID_TRACY_PROUDWELL1 = 10689, + QUEST_DIGGING_FOR_PRAYER_BEADS = 10916 +}; + +bool GossipHello_npc_tracy_proudwell(Player* pPlayer, Creature* pCreature) +{ + if (pCreature->isQuestGiver()) + pPlayer->PrepareQuestMenu(pCreature->GetGUID()); + + if (pCreature->isVendor()) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_REDEEM_MARKS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE); + + if (pPlayer->GetQuestStatus(QUEST_DIGGING_FOR_PRAYER_BEADS) == QUEST_STATUS_INCOMPLETE) + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TRACY_PROUDWELL_ITEM1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1); + + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + return true; +} + +bool GossipSelect_npc_tracy_proudwell(Player* pPlayer, Creature* pCreature, uint32 uiSender, uint32 uiAction) +{ + switch(uiAction) + { + case GOSSIP_ACTION_INFO_DEF+1: + pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_TRACY_PROUDWELL_ITEM2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2); + pPlayer->SEND_GOSSIP_MENU(GOSSIP_TEXTID_TRACY_PROUDWELL1, pCreature->GetGUID()); + break; + case GOSSIP_ACTION_INFO_DEF+2: + pPlayer->SEND_GOSSIP_MENU(pCreature->GetNpcTextId(), pCreature->GetGUID()); + break; + case GOSSIP_ACTION_TRADE: + pPlayer->SEND_VENDORLIST(pCreature->GetGUID()); + break; + } + + return true; +} + /*###### ## npc_wounded_blood_elf ######*/ @@ -268,6 +317,12 @@ void AddSC_hellfire_peninsula() newscript->pGossipSelect = &GossipSelect_npc_naladu; newscript->RegisterSelf(); + newscript = new Script; + newscript->Name = "npc_tracy_proudwell"; + newscript->pGossipHello = &GossipHello_npc_tracy_proudwell; + newscript->pGossipSelect = &GossipSelect_npc_tracy_proudwell; + newscript->RegisterSelf(); + newscript = new Script; newscript->Name="npc_wounded_blood_elf"; newscript->GetAI = &GetAI_npc_wounded_blood_elf; -- cgit v1.2.3 From a4b91e2cc4a4d0a09bce01c686df1fc7c812a12a Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 18:34:45 +0200 Subject: Merge [SD2] r1311 Move SetData from Reset to JustReachedHome for channelers and boss. r1312 Added class for FollowerAI. Note this is under development and may have issues in some situations. FollowerAI is generally to be used for escort quests where NPC follow leader instead of using a predefined path. --HG-- branch : trunk --- src/bindings/scripts/CMakeLists.txt | 6 +- src/bindings/scripts/VC80/80ScriptDev2.vcproj | 12 +- src/bindings/scripts/VC90/90ScriptDev2.vcproj | 12 +- src/bindings/scripts/base/escortAI.cpp | 409 --------------------- src/bindings/scripts/base/escortAI.h | 107 ------ src/bindings/scripts/base/escort_ai.cpp | 409 +++++++++++++++++++++ src/bindings/scripts/base/escort_ai.h | 107 ++++++ src/bindings/scripts/base/follower_ai.cpp | 309 ++++++++++++++++ src/bindings/scripts/base/follower_ai.h | 50 +++ src/bindings/scripts/scripts/custom/test.cpp | 2 +- .../scripts/eastern_kingdoms/arathi_highlands.cpp | 2 +- .../blackrock_depths/blackrock_depths.cpp | 2 +- .../scripts/eastern_kingdoms/eversong_woods.cpp | 2 +- .../scripts/eastern_kingdoms/ghostlands.cpp | 2 +- .../scripts/eastern_kingdoms/hinterlands.cpp | 2 +- .../scripts/eastern_kingdoms/karazhan/karazhan.cpp | 2 +- .../scarlet_enclave/the_scarlet_enclave.cpp | 2 +- .../scarlet_monastery/boss_herod.cpp | 2 +- .../shadowfang_keep/shadowfang_keep.cpp | 2 +- .../scripts/eastern_kingdoms/silverpine_forest.cpp | 2 +- .../scripts/scripts/eastern_kingdoms/westfall.cpp | 2 +- .../scripts/scripts/examples/example_escort.cpp | 2 +- .../scripts/scripts/kalimdor/ashenvale.cpp | 2 +- .../scripts/scripts/kalimdor/azuremyst_isle.cpp | 2 +- .../kalimdor/caverns_of_time/hyjal/hyjalAI.h | 2 +- .../kalimdor/caverns_of_time/hyjal/hyjal_trash.h | 2 +- .../old_hillsbrad/boss_leutenant_drake.cpp | 2 +- .../old_hillsbrad/old_hillsbrad.cpp | 2 +- .../scripts/scripts/kalimdor/darkshore.cpp | 2 +- src/bindings/scripts/scripts/kalimdor/feralas.cpp | 2 +- .../scripts/scripts/kalimdor/moonglade.cpp | 2 +- src/bindings/scripts/scripts/kalimdor/mulgore.cpp | 2 +- .../kalimdor/razorfen_kraul/razorfen_kraul.cpp | 2 +- .../scripts/kalimdor/stonetalon_mountains.cpp | 2 +- src/bindings/scripts/scripts/kalimdor/tanaris.cpp | 2 +- .../scripts/scripts/kalimdor/the_barrens.cpp | 2 +- .../scripts/scripts/kalimdor/thousand_needles.cpp | 2 +- .../scripts/scripts/kalimdor/ungoro_crater.cpp | 2 +- .../kalimdor/wailing_caverns/wailing_caverns.cpp | 2 +- .../scripts/scripts/northrend/sholazar_basin.cpp | 2 +- .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 2 +- .../serpent_shrine/boss_fathomlord_karathress.cpp | 2 +- .../magtheridons_lair/boss_magtheridon.cpp | 33 +- .../scripts/scripts/outland/hellfire_peninsula.cpp | 2 +- .../scripts/scripts/outland/netherstorm.cpp | 2 +- .../scripts/scripts/outland/shadowmoon_valley.cpp | 2 +- .../scripts/scripts/outland/shattrath_city.cpp | 2 +- .../scripts/scripts/outland/terokkar_forest.cpp | 2 +- .../scripts/scripts/outland/zangarmarsh.cpp | 2 +- .../scripts/scripts/world/npcs_special.cpp | 2 +- 50 files changed, 959 insertions(+), 575 deletions(-) delete mode 100644 src/bindings/scripts/base/escortAI.cpp delete mode 100644 src/bindings/scripts/base/escortAI.h create mode 100644 src/bindings/scripts/base/escort_ai.cpp create mode 100644 src/bindings/scripts/base/escort_ai.h create mode 100644 src/bindings/scripts/base/follower_ai.cpp create mode 100644 src/bindings/scripts/base/follower_ai.h (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 3ee74c0e592..571dbc1b2a9 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -4,8 +4,10 @@ SET(trinityscript_LIB_SRCS ScriptMgr.cpp ScriptMgr.h - base/escortAI.cpp - base/escortAI.h + base/escort_ai.cpp + base/escort_ai.h + base/follower_ai.cpp + base/follower_ai.h base/guard_ai.cpp base/guard_ai.h base/simple_ai.cpp diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 7368025639f..ee1a8c87592 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -364,11 +364,19 @@ Name="base" > + + + + + + + + - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -/* ScriptData -SDName: Npc_EscortAI -SD%Complete: 100 -SDComment: -SDCategory: Npc -EndScriptData */ - -#include "precompiled.h" -#include "escortAI.h" - -enum -{ - POINT_LAST_POINT = 0xFFFFFF, - POINT_HOME = 0xFFFFFE -}; - -extern std::list PointMovementList; - -void npc_escortAI::AttackStart(Unit* pWho) -{ - if (!pWho) - return; - - if (m_creature->Attack(pWho, true)) - { - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) - m_creature->GetMotionMaster()->MovementExpired(); - - if (IsCombatMovement()) - m_creature->GetMotionMaster()->MoveChase(pWho); - } -} - -void npc_escortAI::MoveInLineOfSight(Unit* pWho) -{ - if (IsBeingEscorted && !m_bIsActiveAttacker) - return; - - ScriptedAI::MoveInLineOfSight(pWho); -} - -void npc_escortAI::JustDied(Unit* pKiller) -{ - if (!IsBeingEscorted || !PlayerGUID || !m_pQuestForEscort) - return; - - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - { - if (Group* pGroup = pPlayer->GetGroup()) - { - for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) - { - if (Player* pMember = pRef->getSource()) - { - if (pPlayer->GetQuestStatus(m_pQuestForEscort->GetQuestId()) == QUEST_STATUS_INCOMPLETE) - pPlayer->FailQuest(m_pQuestForEscort->GetQuestId()); - } - } - } - else - { - if (pPlayer->GetQuestStatus(m_pQuestForEscort->GetQuestId()) == QUEST_STATUS_INCOMPLETE) - pPlayer->FailQuest(m_pQuestForEscort->GetQuestId()); - } - } -} - -void npc_escortAI::JustRespawned() -{ - IsBeingEscorted = false; - IsOnHold = false; - - if (!IsCombatMovement()) - SetCombatMovement(true); - - //add a small delay before going to first waypoint, normal in near all cases - m_uiWPWaitTimer = 2500; - - if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A) - me->RestoreFaction(); - - Reset(); -} - -void npc_escortAI::ReturnToLastPoint() -{ - float x, y, z, o; - m_creature->GetHomePosition(x, y, z, o); - m_creature->GetMotionMaster()->MovePoint(POINT_LAST_POINT, x, y, z); -} - -void npc_escortAI::EnterEvadeMode() -{ - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - m_creature->SetLootRecipient(NULL); - - if (IsBeingEscorted) - { - m_bIsReturning = true; - ReturnToLastPoint(); - debug_log("TSCR: EscortAI has left combat and is now returning to last point"); - } - else - m_creature->GetMotionMaster()->MoveTargetedHome(); - - Reset(); -} - -void npc_escortAI::UpdateAI(const uint32 uiDiff) -{ - //Waypoint Updating - if (IsBeingEscorted && !m_creature->getVictim() && m_uiWPWaitTimer && !m_bIsReturning) - { - if (m_uiWPWaitTimer <= uiDiff) - { - //End of the line - if (CurrentWP == WaypointList.end()) - { - if (DespawnAtEnd) - { - debug_log("TSCR: EscortAI reached end of waypoints"); - - if (m_bCanReturnToStart) - { - float fRetX, fRetY, fRetZ; - m_creature->GetRespawnCoord(fRetX, fRetY, fRetZ); - - m_creature->GetMotionMaster()->MovePoint(POINT_HOME, fRetX, fRetY, fRetZ); - - m_uiWPWaitTimer = 0; - - debug_log("TSCR: EscortAI are returning home to spawn location: %u, %f, %f, %f", POINT_HOME, fRetX, fRetY, fRetZ); - return; - } - - if (m_bCanInstantRespawn) - { - m_creature->setDeathState(JUST_DIED); - m_creature->Respawn(); - } - else - m_creature->ForcedDespawn(); - - return; - } - else - { - debug_log("TSCR: EscortAI reached end of waypoints with Despawn off"); - - return; - } - } - - if (!IsOnHold) - { - m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); - debug_log("TSCR: EscortAI Next WP is: %u, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); - m_uiWPWaitTimer = 0; - } - } - else - m_uiWPWaitTimer -= uiDiff; - } - - //Check if player or any member of his group is within range - if (IsBeingEscorted && PlayerGUID && !m_creature->getVictim() && !m_bIsReturning) - { - if (m_uiPlayerCheckTimer < uiDiff) - { - bool bIsMaxRangeExceeded = true; - - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - { - if (Group* pGroup = pPlayer->GetGroup()) - { - for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) - { - Player* pMember = pRef->getSource(); - - if (pMember && m_creature->IsWithinDistInMap(pMember, GetMaxPlayerDistance())) - { - bIsMaxRangeExceeded = false; - break; - } - } - } - else - { - if (m_creature->IsWithinDistInMap(pPlayer, GetMaxPlayerDistance())) - bIsMaxRangeExceeded = false; - } - } - - if (DespawnAtFar && bIsMaxRangeExceeded) - { - debug_log("TSCR: EscortAI failed because player/group was to far away or not found"); - - if (m_bCanInstantRespawn) - { - m_creature->setDeathState(JUST_DIED); - m_creature->Respawn(); - } - else - m_creature->ForcedDespawn(); - - return; - } - - m_uiPlayerCheckTimer = 1000; - } - else - m_uiPlayerCheckTimer -= uiDiff; - } - - if (CanMelee && UpdateVictim()) - DoMeleeAttackIfReady(); -} - -void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) -{ - if (uiMoveType != POINT_MOTION_TYPE || !IsBeingEscorted) - return; - - //Combat start position reached, continue waypoint movement - if (uiPointId == POINT_LAST_POINT) - { - debug_log("TSCR: EscortAI has returned to original position before combat"); - - if (m_bIsRunning && m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - else if (!m_bIsRunning && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - - m_bIsReturning = false; - - if (!m_uiWPWaitTimer) - m_uiWPWaitTimer = 1; - } - else if (uiPointId == POINT_HOME) - { - debug_log("TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list."); - - CurrentWP = WaypointList.begin(); - m_uiWPWaitTimer = 1; - } - else - { - //Make sure that we are still on the right waypoint - if (CurrentWP->id != uiPointId) - { - debug_log("TSCR ERROR: EscortAI reached waypoint out of order %d, expected %d", uiPointId, CurrentWP->id); - return; - } - - debug_log("TSCR: EscortAI Waypoint %d reached", CurrentWP->id); - - //Call WP function - WaypointReached(CurrentWP->id); - - m_uiWPWaitTimer = CurrentWP->WaitTimeMs + 1; - - ++CurrentWP; - } -} - -/* -void npc_escortAI::OnPossess(bool apply) -{ - // We got possessed in the middle of being escorted, store the point - // where we left off to come back to when possess is removed - if (IsBeingEscorted) - { - if (apply) - m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z); - else - { - Returning = true; - m_creature->GetMotionMaster()->MovementExpired(); - m_creature->GetMotionMaster()->MovePoint(WP_LAST_POINT, LastPos.x, LastPos.y, LastPos.z); - } - } -} -*/ - -void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs) -{ - Escort_Waypoint t(id, x, y, z, WaitTimeMs); - - WaypointList.push_back(t); - - // i think SD2 no longer uses this function - ScriptWP = true; - /*PointMovement wp; - wp.m_uiCreatureEntry = me->GetEntry(); - wp.m_uiPointId = id; - wp.m_fX = x; - wp.m_fY = y; - wp.m_fZ = z; - wp.m_uiWaitTime = WaitTimeMs; - PointMovementMap[wp.m_uiCreatureEntry].push_back(wp);*/ -} - -void npc_escortAI::FillPointMovementListForCreature() -{ - UNORDERED_MAP >::iterator pPointsEntries = PointMovementMap.find(m_creature->GetEntry()); - - if (pPointsEntries != PointMovementMap.end()) - { - std::vector::iterator itr; - - for (itr = pPointsEntries->second.begin(); itr != pPointsEntries->second.end(); ++itr) - { - Escort_Waypoint pPoint(itr->m_uiPointId,itr->m_fX,itr->m_fY,itr->m_fZ,itr->m_uiWaitTime); - WaypointList.push_back(pPoint); - } - } -} - -void npc_escortAI::SetRun(bool bRun) -{ - if (bRun) - { - if (!m_bIsRunning) - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - else - debug_log("TSCR: EscortAI attempt to set run mode, but is already running."); - } - else - { - if (m_bIsRunning) - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - else - debug_log("TSCR: EscortAI attempt to set walk mode, but is already walking."); - } - m_bIsRunning = bRun; -} - -//TODO: get rid of this many variables passed in function. -void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, const Quest* pQuest, bool bInstantRespawn, bool bCanLoopPath) -{ - if (m_creature->getVictim()) - { - debug_log("TSCR ERROR: EscortAI attempt to Start while in combat"); - return; - } - - if (IsBeingEscorted) - { - error_log("TSCR: EscortAI attempt to Start while already escorting"); - return; - } - - if(!ScriptWP) // sd2 never adds wp in script, but tc does - { - - if (!WaypointList.empty()) - WaypointList.clear(); - - FillPointMovementListForCreature(); - - } - - if (WaypointList.empty()) - { - error_db_log("TSCR: EscortAI Start with 0 waypoints (possible missing entry in script_waypoint)"); - return; - } - - //set variables - m_bIsActiveAttacker = bIsActiveAttacker; - m_bIsRunning = bRun; - - PlayerGUID = uiPlayerGUID; - m_pQuestForEscort = pQuest; - - m_bCanInstantRespawn = bInstantRespawn; - m_bCanReturnToStart = bCanLoopPath; - - if (m_bCanReturnToStart && m_bCanInstantRespawn) - debug_log("TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn."); - - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) - { - m_creature->GetMotionMaster()->MovementExpired(); - m_creature->GetMotionMaster()->MoveIdle(); - debug_log("TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle."); - } - - //disable npcflags - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - - debug_log("TSCR: EscortAI started with %d waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), m_bIsActiveAttacker, m_bIsRunning, PlayerGUID); - - CurrentWP = WaypointList.begin(); - - //Set initial speed - if (m_bIsRunning) - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - else - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - - IsBeingEscorted = true; -} diff --git a/src/bindings/scripts/base/escortAI.h b/src/bindings/scripts/base/escortAI.h deleted file mode 100644 index 8ce82eb370a..00000000000 --- a/src/bindings/scripts/base/escortAI.h +++ /dev/null @@ -1,107 +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 SC_ESCORTAI_H -#define SC_ESCORTAI_H - -#define DEFAULT_MAX_PLAYER_DISTANCE 50 - -extern UNORDERED_MAP > PointMovementMap; - -struct Escort_Waypoint -{ - Escort_Waypoint(uint32 _id, float _x, float _y, float _z, uint32 _w) - { - id = _id; - x = _x; - y = _y; - z = _z; - WaitTimeMs = _w; - } - - uint32 id; - float x; - float y; - float z; - uint32 WaitTimeMs; -}; - -struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI -{ - public: - explicit npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature), - IsBeingEscorted(false), IsOnHold(false), PlayerGUID(0), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), CanMelee(true), m_uiPlayerCheckTimer(1000), m_uiWPWaitTimer(2500), m_bIsReturning(false), m_bIsActiveAttacker(true), m_bIsRunning(false), DespawnAtEnd(true), DespawnAtFar(true), m_pQuestForEscort(NULL), m_bCanInstantRespawn(false), m_bCanReturnToStart(false), ScriptWP(false) {} - ~npc_escortAI() {} - - // Pure Virtual Functions - virtual void WaypointReached(uint32) = 0; - - // CreatureAI functions - void AttackStart(Unit* who); - - void MoveInLineOfSight(Unit* who); - - void JustDied(Unit*); - - void JustRespawned(); - - void ReturnToLastPoint(); - - void EnterEvadeMode(); - - void UpdateAI(const uint32); - - void MovementInform(uint32, uint32); - - // EscortAI functions - void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0); - - void FillPointMovementListForCreature(); - - void Start(bool bIsActiveAttacker = true, bool bRun = false, uint64 uiPlayerGUID = 0, const Quest* pQuest = NULL, bool bInstantRespawn = false, bool bCanLoopPath = false); - - void SetRun(bool bRun = true); - - void SetMaxPlayerDistance(float newMax) { MaxPlayerDistance = newMax; } - float GetMaxPlayerDistance() { return MaxPlayerDistance; } - - bool IsEscorted() {return IsBeingEscorted;} - - void SetCanMelee(bool usemelee) { CanMelee = usemelee; } - void SetDespawnAtEnd(bool despawn) { DespawnAtEnd = despawn; } - void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; } - bool GetAttack() { return m_bIsActiveAttacker; }//used in EnterEvadeMode override - bool GetIsBeingEscorted() { return IsBeingEscorted; }//used in EnterEvadeMode override - void SetReturning(bool returning) { m_bIsReturning = returning; }//used in EnterEvadeMode override - void SetCanAttack(bool attack) { m_bIsActiveAttacker = attack; } - uint64 GetEventStarterGUID() { return PlayerGUID; } - - // EscortAI variables - protected: - uint64 PlayerGUID; - bool IsBeingEscorted; - bool IsOnHold; - - private: - uint32 m_uiWPWaitTimer; - uint32 m_uiPlayerCheckTimer; - float MaxPlayerDistance; - - const Quest* m_pQuestForEscort; //generally passed in Start() when regular escort script. - - std::list WaypointList; - std::list::iterator CurrentWP; - - bool m_bIsActiveAttacker; //possible obsolete, and should be determined with db only (civilian) - bool m_bIsReturning; //in use when creature leave combat, and are returning to combat start position - bool m_bIsRunning; //all creatures are walking by default (has flag MOVEMENTFLAG_WALK) - bool m_bCanInstantRespawn; //if creature should respawn instantly after escort over (if not, database respawntime are used) - bool m_bCanReturnToStart; //if creature can walk same path (loop) without despawn. Not for regular escort quests. - bool CanMelee; - bool DespawnAtEnd; - bool DespawnAtFar; - bool ScriptWP; -}; -#endif - diff --git a/src/bindings/scripts/base/escort_ai.cpp b/src/bindings/scripts/base/escort_ai.cpp new file mode 100644 index 00000000000..3f4c8601f90 --- /dev/null +++ b/src/bindings/scripts/base/escort_ai.cpp @@ -0,0 +1,409 @@ +/* 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: Npc_EscortAI +SD%Complete: 100 +SDComment: +SDCategory: Npc +EndScriptData */ + +#include "precompiled.h" +#include "escort_ai.h" + +enum +{ + POINT_LAST_POINT = 0xFFFFFF, + POINT_HOME = 0xFFFFFE +}; + +extern std::list PointMovementList; + +void npc_escortAI::AttackStart(Unit* pWho) +{ + if (!pWho) + return; + + if (m_creature->Attack(pWho, true)) + { + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == POINT_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + if (IsCombatMovement()) + m_creature->GetMotionMaster()->MoveChase(pWho); + } +} + +void npc_escortAI::MoveInLineOfSight(Unit* pWho) +{ + if (IsBeingEscorted && !m_bIsActiveAttacker) + return; + + ScriptedAI::MoveInLineOfSight(pWho); +} + +void npc_escortAI::JustDied(Unit* pKiller) +{ + if (!IsBeingEscorted || !PlayerGUID || !m_pQuestForEscort) + return; + + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + { + if (Group* pGroup = pPlayer->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + if (Player* pMember = pRef->getSource()) + { + if (pPlayer->GetQuestStatus(m_pQuestForEscort->GetQuestId()) == QUEST_STATUS_INCOMPLETE) + pPlayer->FailQuest(m_pQuestForEscort->GetQuestId()); + } + } + } + else + { + if (pPlayer->GetQuestStatus(m_pQuestForEscort->GetQuestId()) == QUEST_STATUS_INCOMPLETE) + pPlayer->FailQuest(m_pQuestForEscort->GetQuestId()); + } + } +} + +void npc_escortAI::JustRespawned() +{ + IsBeingEscorted = false; + IsOnHold = false; + + if (!IsCombatMovement()) + SetCombatMovement(true); + + //add a small delay before going to first waypoint, normal in near all cases + m_uiWPWaitTimer = 2500; + + if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A) + me->RestoreFaction(); + + Reset(); +} + +void npc_escortAI::ReturnToLastPoint() +{ + float x, y, z, o; + m_creature->GetHomePosition(x, y, z, o); + m_creature->GetMotionMaster()->MovePoint(POINT_LAST_POINT, x, y, z); +} + +void npc_escortAI::EnterEvadeMode() +{ + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->SetLootRecipient(NULL); + + if (IsBeingEscorted) + { + m_bIsReturning = true; + ReturnToLastPoint(); + debug_log("TSCR: EscortAI has left combat and is now returning to last point"); + } + else + m_creature->GetMotionMaster()->MoveTargetedHome(); + + Reset(); +} + +void npc_escortAI::UpdateAI(const uint32 uiDiff) +{ + //Waypoint Updating + if (IsBeingEscorted && !m_creature->getVictim() && m_uiWPWaitTimer && !m_bIsReturning) + { + if (m_uiWPWaitTimer <= uiDiff) + { + //End of the line + if (CurrentWP == WaypointList.end()) + { + if (DespawnAtEnd) + { + debug_log("TSCR: EscortAI reached end of waypoints"); + + if (m_bCanReturnToStart) + { + float fRetX, fRetY, fRetZ; + m_creature->GetRespawnCoord(fRetX, fRetY, fRetZ); + + m_creature->GetMotionMaster()->MovePoint(POINT_HOME, fRetX, fRetY, fRetZ); + + m_uiWPWaitTimer = 0; + + debug_log("TSCR: EscortAI are returning home to spawn location: %u, %f, %f, %f", POINT_HOME, fRetX, fRetY, fRetZ); + return; + } + + if (m_bCanInstantRespawn) + { + m_creature->setDeathState(JUST_DIED); + m_creature->Respawn(); + } + else + m_creature->ForcedDespawn(); + + return; + } + else + { + debug_log("TSCR: EscortAI reached end of waypoints with Despawn off"); + + return; + } + } + + if (!IsOnHold) + { + m_creature->GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); + debug_log("TSCR: EscortAI Next WP is: %u, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); + m_uiWPWaitTimer = 0; + } + } + else + m_uiWPWaitTimer -= uiDiff; + } + + //Check if player or any member of his group is within range + if (IsBeingEscorted && PlayerGUID && !m_creature->getVictim() && !m_bIsReturning) + { + if (m_uiPlayerCheckTimer < uiDiff) + { + bool bIsMaxRangeExceeded = true; + + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + { + if (Group* pGroup = pPlayer->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + Player* pMember = pRef->getSource(); + + if (pMember && m_creature->IsWithinDistInMap(pMember, GetMaxPlayerDistance())) + { + bIsMaxRangeExceeded = false; + break; + } + } + } + else + { + if (m_creature->IsWithinDistInMap(pPlayer, GetMaxPlayerDistance())) + bIsMaxRangeExceeded = false; + } + } + + if (DespawnAtFar && bIsMaxRangeExceeded) + { + debug_log("TSCR: EscortAI failed because player/group was to far away or not found"); + + if (m_bCanInstantRespawn) + { + m_creature->setDeathState(JUST_DIED); + m_creature->Respawn(); + } + else + m_creature->ForcedDespawn(); + + return; + } + + m_uiPlayerCheckTimer = 1000; + } + else + m_uiPlayerCheckTimer -= uiDiff; + } + + if (CanMelee && UpdateVictim()) + DoMeleeAttackIfReady(); +} + +void npc_escortAI::MovementInform(uint32 uiMoveType, uint32 uiPointId) +{ + if (uiMoveType != POINT_MOTION_TYPE || !IsBeingEscorted) + return; + + //Combat start position reached, continue waypoint movement + if (uiPointId == POINT_LAST_POINT) + { + debug_log("TSCR: EscortAI has returned to original position before combat"); + + if (m_bIsRunning && m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + else if (!m_bIsRunning && !m_creature->HasUnitMovementFlag(MOVEMENTFLAG_WALK_MODE)) + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + + m_bIsReturning = false; + + if (!m_uiWPWaitTimer) + m_uiWPWaitTimer = 1; + } + else if (uiPointId == POINT_HOME) + { + debug_log("TSCR: EscortAI has returned to original home location and will continue from beginning of waypoint list."); + + CurrentWP = WaypointList.begin(); + m_uiWPWaitTimer = 1; + } + else + { + //Make sure that we are still on the right waypoint + if (CurrentWP->id != uiPointId) + { + debug_log("TSCR ERROR: EscortAI reached waypoint out of order %d, expected %d", uiPointId, CurrentWP->id); + return; + } + + debug_log("TSCR: EscortAI Waypoint %d reached", CurrentWP->id); + + //Call WP function + WaypointReached(CurrentWP->id); + + m_uiWPWaitTimer = CurrentWP->WaitTimeMs + 1; + + ++CurrentWP; + } +} + +/* +void npc_escortAI::OnPossess(bool apply) +{ + // We got possessed in the middle of being escorted, store the point + // where we left off to come back to when possess is removed + if (IsBeingEscorted) + { + if (apply) + m_creature->GetPosition(LastPos.x, LastPos.y, LastPos.z); + else + { + Returning = true; + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MovePoint(WP_LAST_POINT, LastPos.x, LastPos.y, LastPos.z); + } + } +} +*/ + +void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs) +{ + Escort_Waypoint t(id, x, y, z, WaitTimeMs); + + WaypointList.push_back(t); + + // i think SD2 no longer uses this function + ScriptWP = true; + /*PointMovement wp; + wp.m_uiCreatureEntry = me->GetEntry(); + wp.m_uiPointId = id; + wp.m_fX = x; + wp.m_fY = y; + wp.m_fZ = z; + wp.m_uiWaitTime = WaitTimeMs; + PointMovementMap[wp.m_uiCreatureEntry].push_back(wp);*/ +} + +void npc_escortAI::FillPointMovementListForCreature() +{ + UNORDERED_MAP >::iterator pPointsEntries = PointMovementMap.find(m_creature->GetEntry()); + + if (pPointsEntries != PointMovementMap.end()) + { + std::vector::iterator itr; + + for (itr = pPointsEntries->second.begin(); itr != pPointsEntries->second.end(); ++itr) + { + Escort_Waypoint pPoint(itr->m_uiPointId,itr->m_fX,itr->m_fY,itr->m_fZ,itr->m_uiWaitTime); + WaypointList.push_back(pPoint); + } + } +} + +void npc_escortAI::SetRun(bool bRun) +{ + if (bRun) + { + if (!m_bIsRunning) + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + else + debug_log("TSCR: EscortAI attempt to set run mode, but is already running."); + } + else + { + if (m_bIsRunning) + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + else + debug_log("TSCR: EscortAI attempt to set walk mode, but is already walking."); + } + m_bIsRunning = bRun; +} + +//TODO: get rid of this many variables passed in function. +void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, const Quest* pQuest, bool bInstantRespawn, bool bCanLoopPath) +{ + if (m_creature->getVictim()) + { + debug_log("TSCR ERROR: EscortAI attempt to Start while in combat"); + return; + } + + if (IsBeingEscorted) + { + error_log("TSCR: EscortAI attempt to Start while already escorting"); + return; + } + + if(!ScriptWP) // sd2 never adds wp in script, but tc does + { + + if (!WaypointList.empty()) + WaypointList.clear(); + + FillPointMovementListForCreature(); + + } + + if (WaypointList.empty()) + { + error_db_log("TSCR: EscortAI Start with 0 waypoints (possible missing entry in script_waypoint)"); + return; + } + + //set variables + m_bIsActiveAttacker = bIsActiveAttacker; + m_bIsRunning = bRun; + + PlayerGUID = uiPlayerGUID; + m_pQuestForEscort = pQuest; + + m_bCanInstantRespawn = bInstantRespawn; + m_bCanReturnToStart = bCanLoopPath; + + if (m_bCanReturnToStart && m_bCanInstantRespawn) + debug_log("TSCR: EscortAI is set to return home after waypoint end and instant respawn at waypoint end. Creature will never despawn."); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + { + m_creature->GetMotionMaster()->MovementExpired(); + m_creature->GetMotionMaster()->MoveIdle(); + debug_log("TSCR: EscortAI start with WAYPOINT_MOTION_TYPE, changed to MoveIdle."); + } + + //disable npcflags + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + + debug_log("TSCR: EscortAI started with %d waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), m_bIsActiveAttacker, m_bIsRunning, PlayerGUID); + + CurrentWP = WaypointList.begin(); + + //Set initial speed + if (m_bIsRunning) + m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + else + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + + IsBeingEscorted = true; +} diff --git a/src/bindings/scripts/base/escort_ai.h b/src/bindings/scripts/base/escort_ai.h new file mode 100644 index 00000000000..8ce82eb370a --- /dev/null +++ b/src/bindings/scripts/base/escort_ai.h @@ -0,0 +1,107 @@ +/* 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 SC_ESCORTAI_H +#define SC_ESCORTAI_H + +#define DEFAULT_MAX_PLAYER_DISTANCE 50 + +extern UNORDERED_MAP > PointMovementMap; + +struct Escort_Waypoint +{ + Escort_Waypoint(uint32 _id, float _x, float _y, float _z, uint32 _w) + { + id = _id; + x = _x; + y = _y; + z = _z; + WaitTimeMs = _w; + } + + uint32 id; + float x; + float y; + float z; + uint32 WaitTimeMs; +}; + +struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI +{ + public: + explicit npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature), + IsBeingEscorted(false), IsOnHold(false), PlayerGUID(0), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), CanMelee(true), m_uiPlayerCheckTimer(1000), m_uiWPWaitTimer(2500), m_bIsReturning(false), m_bIsActiveAttacker(true), m_bIsRunning(false), DespawnAtEnd(true), DespawnAtFar(true), m_pQuestForEscort(NULL), m_bCanInstantRespawn(false), m_bCanReturnToStart(false), ScriptWP(false) {} + ~npc_escortAI() {} + + // Pure Virtual Functions + virtual void WaypointReached(uint32) = 0; + + // CreatureAI functions + void AttackStart(Unit* who); + + void MoveInLineOfSight(Unit* who); + + void JustDied(Unit*); + + void JustRespawned(); + + void ReturnToLastPoint(); + + void EnterEvadeMode(); + + void UpdateAI(const uint32); + + void MovementInform(uint32, uint32); + + // EscortAI functions + void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0); + + void FillPointMovementListForCreature(); + + void Start(bool bIsActiveAttacker = true, bool bRun = false, uint64 uiPlayerGUID = 0, const Quest* pQuest = NULL, bool bInstantRespawn = false, bool bCanLoopPath = false); + + void SetRun(bool bRun = true); + + void SetMaxPlayerDistance(float newMax) { MaxPlayerDistance = newMax; } + float GetMaxPlayerDistance() { return MaxPlayerDistance; } + + bool IsEscorted() {return IsBeingEscorted;} + + void SetCanMelee(bool usemelee) { CanMelee = usemelee; } + void SetDespawnAtEnd(bool despawn) { DespawnAtEnd = despawn; } + void SetDespawnAtFar(bool despawn) { DespawnAtFar = despawn; } + bool GetAttack() { return m_bIsActiveAttacker; }//used in EnterEvadeMode override + bool GetIsBeingEscorted() { return IsBeingEscorted; }//used in EnterEvadeMode override + void SetReturning(bool returning) { m_bIsReturning = returning; }//used in EnterEvadeMode override + void SetCanAttack(bool attack) { m_bIsActiveAttacker = attack; } + uint64 GetEventStarterGUID() { return PlayerGUID; } + + // EscortAI variables + protected: + uint64 PlayerGUID; + bool IsBeingEscorted; + bool IsOnHold; + + private: + uint32 m_uiWPWaitTimer; + uint32 m_uiPlayerCheckTimer; + float MaxPlayerDistance; + + const Quest* m_pQuestForEscort; //generally passed in Start() when regular escort script. + + std::list WaypointList; + std::list::iterator CurrentWP; + + bool m_bIsActiveAttacker; //possible obsolete, and should be determined with db only (civilian) + bool m_bIsReturning; //in use when creature leave combat, and are returning to combat start position + bool m_bIsRunning; //all creatures are walking by default (has flag MOVEMENTFLAG_WALK) + bool m_bCanInstantRespawn; //if creature should respawn instantly after escort over (if not, database respawntime are used) + bool m_bCanReturnToStart; //if creature can walk same path (loop) without despawn. Not for regular escort quests. + bool CanMelee; + bool DespawnAtEnd; + bool DespawnAtFar; + bool ScriptWP; +}; +#endif + diff --git a/src/bindings/scripts/base/follower_ai.cpp b/src/bindings/scripts/base/follower_ai.cpp new file mode 100644 index 00000000000..eb847c219db --- /dev/null +++ b/src/bindings/scripts/base/follower_ai.cpp @@ -0,0 +1,309 @@ +/* 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: FollowerAI +SD%Complete: 50 +SDComment: This AI is under development +SDCategory: Npc +EndScriptData */ + +#include "precompiled.h" +#include "follower_ai.h" + +const float MAX_PLAYER_DISTANCE = 100.0f; + +enum +{ + POINT_COMBAT_START = 0xFFFFFF +}; + +FollowerAI::FollowerAI(Creature* pCreature) : ScriptedAI(pCreature), + m_uiLeaderGUID(0), + m_pQuestForFollow(NULL), + m_uiUpdateFollowTimer(2500), + m_bIsFollowing(false), + m_bIsReturnToLeader(false), + m_bIsFollowComplete(false) +{} + +void FollowerAI::AttackStart(Unit* pWho) +{ + if (!pWho) + return; + + if (m_creature->Attack(pWho, true)) + { + m_creature->AddThreat(pWho, 0.0f); + m_creature->SetInCombatWith(pWho); + pWho->SetInCombatWith(m_creature); + + if (m_creature->hasUnitState(UNIT_STAT_FOLLOW)) + m_creature->clearUnitState(UNIT_STAT_FOLLOW); + + if (IsCombatMovement()) + m_creature->GetMotionMaster()->MoveChase(pWho); + } +} + +void FollowerAI::MoveInLineOfSight(Unit* pWho) +{ + if (!m_creature->hasUnitState(UNIT_STAT_STUNNED) && pWho->isTargetableForAttack() && + m_creature->IsHostileTo(pWho) && pWho->isInAccessiblePlaceFor(m_creature)) + { + if (!m_creature->canFly() && m_creature->GetDistanceZ(pWho) > CREATURE_Z_ATTACK_RANGE) + return; + + //This part provides assistance to a player that are attacked by pWho, even if out of normal aggro range + //It will cause m_creature to attack pWho that are attacking _any_ player (which has been confirmed may happen also on offi) + //The flag (type_flag) is unconfirmed, but used here for further research and is a good candidate. + if (m_creature->hasUnitState(UNIT_STAT_FOLLOW) && + m_creature->GetCreatureInfo()->type_flags & 0x01000 && + pWho->getVictim() && + pWho->getVictim()->GetCharmerOrOwnerPlayerOrPlayerItself() && + m_creature->IsWithinDistInMap(pWho, MAX_PLAYER_DISTANCE) && + m_creature->IsWithinLOSInMap(pWho)) + { + pWho->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); + AttackStart(pWho); + } + else + { + float attackRadius = m_creature->GetAttackDistance(pWho); + if (m_creature->IsWithinDistInMap(pWho, attackRadius) && m_creature->IsWithinLOSInMap(pWho)) + { + if (!m_creature->getVictim()) + { + pWho->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); + AttackStart(pWho); + } + else if (m_creature->GetMap()->IsDungeon()) + { + pWho->SetInCombatWith(m_creature); + m_creature->AddThreat(pWho, 0.0f); + } + } + } + } +} + +void FollowerAI::JustDied(Unit* pKiller) +{ + if (!m_bIsFollowing || !m_uiLeaderGUID) + return; + + //TODO: need a better check for quests with time limit. + if (Player* pPlayer = GetLeaderForFollower()) + { + if (Group* pGroup = pPlayer->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + if (Player* pMember = pRef->getSource()) + { + if (pPlayer->GetQuestStatus(m_pQuestForFollow->GetQuestId()) == QUEST_STATUS_INCOMPLETE) + pPlayer->FailQuest(m_pQuestForFollow->GetQuestId()); + } + } + } + else + { + if (pPlayer->GetQuestStatus(m_pQuestForFollow->GetQuestId()) == QUEST_STATUS_INCOMPLETE) + pPlayer->FailQuest(m_pQuestForFollow->GetQuestId()); + } + } +} + +void FollowerAI::JustRespawned() +{ + m_bIsFollowing = false; + m_bIsReturnToLeader = false; + m_bIsFollowComplete = false; + + if (!IsCombatMovement()) + SetCombatMovement(true); + + if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A) + m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A); + + Reset(); +} + +void FollowerAI::EnterEvadeMode() +{ + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + m_creature->SetLootRecipient(NULL); + + if (m_bIsFollowing) + { + debug_log("SD2: FollowerAI left combat, returning to CombatStartPosition."); + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + { + float fPosX, fPosY, fPosZ; + m_creature->GetPosition(fPosX, fPosY, fPosZ); + m_creature->GetMotionMaster()->MovePoint(POINT_COMBAT_START, fPosX, fPosY, fPosZ); + } + } + else + { + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + m_creature->GetMotionMaster()->MoveTargetedHome(); + } + + Reset(); +} + +void FollowerAI::UpdateAI(const uint32 uiDiff) +{ + if (m_bIsFollowing && !m_creature->getVictim()) + { + if (m_uiUpdateFollowTimer < uiDiff) + { + if (m_bIsFollowComplete) + { + debug_log("SD2: FollowerAI is set completed, despawns."); + m_creature->ForcedDespawn(); + return; + } + + bool bIsMaxRangeExceeded = true; + + if (Player* pPlayer = GetLeaderForFollower()) + { + if (m_bIsReturnToLeader) + { + debug_log("SD2: FollowerAI is returning to leader."); + m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); + m_bIsReturnToLeader = false; + return; + } + + if (Group* pGroup = pPlayer->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + Player* pMember = pRef->getSource(); + + if (pMember && m_creature->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE)) + { + bIsMaxRangeExceeded = false; + break; + } + } + } + else + { + if (m_creature->IsWithinDistInMap(pPlayer, MAX_PLAYER_DISTANCE)) + bIsMaxRangeExceeded = false; + } + } + + if (bIsMaxRangeExceeded) + { + debug_log("SD2: FollowerAI failed because player/group was to far away or not found"); + m_creature->ForcedDespawn(); + return; + } + + m_uiUpdateFollowTimer = 1000; + } + else + m_uiUpdateFollowTimer -= uiDiff; + } + + UpdateFollowerAI(uiDiff); +} + +void FollowerAI::UpdateFollowerAI(const uint32 uiDiff) +{ + if (!UpdateVictim()) + return; + + DoMeleeAttackIfReady(); +} + +void FollowerAI::MovementInform(uint32 uiMotionType, uint32 uiPointId) +{ + if (uiMotionType != POINT_MOTION_TYPE || !m_bIsFollowing) + return; + + if (uiPointId == POINT_COMBAT_START) + { + if (GetLeaderForFollower()) + m_bIsReturnToLeader = true; + else + m_creature->ForcedDespawn(); + } +} + +void FollowerAI::StartFollow(Player* pLeader, uint32 uiFactionForFollower, const Quest* pQuest) +{ + if (m_creature->getVictim()) + { + debug_log("SD2: FollowerAI attempt to StartFollow while in combat."); + return; + } + + if (m_bIsFollowing) + { + error_log("SD2: FollowerAI attempt to StartFollow while already following."); + return; + } + + //set variables + m_uiLeaderGUID = pLeader->GetGUID(); + + if (uiFactionForFollower) + m_creature->setFaction(uiFactionForFollower); + + m_pQuestForFollow = pQuest; + + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == WAYPOINT_MOTION_TYPE) + { + m_creature->GetMotionMaster()->Clear(); + m_creature->GetMotionMaster()->MoveIdle(); + debug_log("SD2: FollowerAI start with WAYPOINT_MOTION_TYPE, set to MoveIdle."); + } + + m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); + + m_creature->GetMotionMaster()->MoveFollow(pLeader, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE); + + m_bIsFollowing = true; + + debug_log("SD2: FollowerAI start follow %s (GUID %u)", pLeader->GetName(), m_uiLeaderGUID); +} + +Player* FollowerAI::GetLeaderForFollower() +{ + if (Player* pLeader = (Player*)Unit::GetUnit(*m_creature, m_uiLeaderGUID)) + { + if (pLeader->isAlive()) + return pLeader; + else + { + if (Group* pGroup = pLeader->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + Player* pMember = pRef->getSource(); + + if (pMember && pMember->isAlive() && m_creature->IsWithinDistInMap(pMember, MAX_PLAYER_DISTANCE)) + { + debug_log("SD2: FollowerAI GetLeader changed and returned new leader."); + m_uiLeaderGUID = pMember->GetGUID(); + return pMember; + break; + } + } + } + } + } + + debug_log("SD2: FollowerAI GetLeader can not find suitable leader."); + return NULL; +} diff --git a/src/bindings/scripts/base/follower_ai.h b/src/bindings/scripts/base/follower_ai.h new file mode 100644 index 00000000000..d62980d4951 --- /dev/null +++ b/src/bindings/scripts/base/follower_ai.h @@ -0,0 +1,50 @@ +/* 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 SC_FOLLOWERAI_H +#define SC_FOLLOWERAI_H + +class TRINITY_DLL_DECL FollowerAI : public ScriptedAI +{ + public: + explicit FollowerAI(Creature* pCreature); + ~FollowerAI() {} + + //virtual void WaypointReached(uint32 uiPointId) = 0; + + void MovementInform(uint32 uiMotionType, uint32 uiPointId); + + void AttackStart(Unit*); + + void MoveInLineOfSight(Unit*); + + void EnterEvadeMode(); + + void JustDied(Unit*); + + void JustRespawned(); + + void UpdateAI(const uint32); //the "internal" update, calls UpdateFollowerAI() + virtual void UpdateFollowerAI(const uint32); //used when it's needed to add code in update (abilities, scripted events, etc) + + void StartFollow(Player* pPlayer, uint32 uiFactionForFollower = 0, const Quest* pQuest = NULL); + + protected: + void SetFollowComplete() { m_bIsFollowComplete = true; } + bool IsFollowComplete() { return m_bIsFollowComplete; } + + Player* GetLeaderForFollower(); + + private: + uint64 m_uiLeaderGUID; + uint32 m_uiUpdateFollowTimer; + + bool m_bIsFollowing; + bool m_bIsReturnToLeader; + bool m_bIsFollowComplete; + + const Quest* m_pQuestForFollow; //normally we have a quest +}; + +#endif diff --git a/src/bindings/scripts/scripts/custom/test.cpp b/src/bindings/scripts/scripts/custom/test.cpp index 20a3e2a20e3..121f5a5ec10 100644 --- a/src/bindings/scripts/scripts/custom/test.cpp +++ b/src/bindings/scripts/scripts/custom/test.cpp @@ -22,7 +22,7 @@ SDCategory: Script Examples EndScriptData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" struct TRINITY_DLL_DECL npc_testAI : public npc_escortAI { diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp index bc33d9841eb..c5325da12d3 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp @@ -26,7 +26,7 @@ npc_professor_phizzlethorpe EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npc_professor_phizzlethorpe diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp index a9cf7b7391f..ee193df3430 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/blackrock_depths/blackrock_depths.cpp @@ -37,7 +37,7 @@ npc_rocknot EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" #include "def_blackrock_depths.h" /*###### diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp index 6c76adeaecb..929fea7f41a 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp @@ -30,7 +30,7 @@ go_harbinger_second_trial EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npc_prospector_anvilward diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp index c96923661de..42122c1f002 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp @@ -29,7 +29,7 @@ npc_ranger_lilatha EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npc_blood_knight_dawnstar diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp index 46f12159acf..b02d3fb918b 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp @@ -26,7 +26,7 @@ npc_rinji EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npc_rinji diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/karazhan.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/karazhan.cpp index 91dd4e44ad3..cecdcc6330e 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/karazhan.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/karazhan/karazhan.cpp @@ -29,7 +29,7 @@ EndContentData */ #include "precompiled.h" #include "def_karazhan.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### # npc_barnesAI diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp index ae6c4942c1a..1a081a49050 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp @@ -19,7 +19,7 @@ #include "precompiled.h" #include "Vehicle.h" #include "ObjectMgr.h" -#include "escortAI.h" +#include "escort_ai.h" #define GCD_CAST 1 diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp index 5a1c8e6d364..6235499fe13 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_monastery/boss_herod.cpp @@ -22,7 +22,7 @@ SDCategory: Scarlet Monastery EndScriptData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" #define SAY_AGGRO -1189000 #define SAY_WHIRLWIND -1189001 diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp index 5f9d42ea65e..346e922a1b4 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/shadowfang_keep/shadowfang_keep.cpp @@ -26,7 +26,7 @@ npc_shadowfang_prisoner EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" #include "def_shadowfang_keep.h" /*###### diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp index bd8b2906c92..07b1979f87f 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp @@ -27,7 +27,7 @@ npc_deathstalker_erland EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npc_astor_hadren diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp index 3ddaffe6e25..d6cbea99fb5 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp @@ -27,7 +27,7 @@ npc_defias_traitor EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npc_daphne_stilwell diff --git a/src/bindings/scripts/scripts/examples/example_escort.cpp b/src/bindings/scripts/scripts/examples/example_escort.cpp index 23c97fb9b60..e603d3ce79c 100644 --- a/src/bindings/scripts/scripts/examples/example_escort.cpp +++ b/src/bindings/scripts/scripts/examples/example_escort.cpp @@ -22,7 +22,7 @@ SDCategory: Script Examples EndScriptData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" enum { diff --git a/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp b/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp index 86f3286c92f..88572bf3463 100644 --- a/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp +++ b/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp @@ -27,7 +27,7 @@ npc_ruul_snowhoof EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*#### # npc_torek diff --git a/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp b/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp index 71341f4d0ee..0e21a4b310d 100644 --- a/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp +++ b/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp @@ -31,7 +31,7 @@ mob_nestlewood_owlkin EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" #include /*###### diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h index 3b0ff32a429..c646c47699c 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjalAI.h @@ -6,7 +6,7 @@ #define SC_HYJALAI_H #include "def_hyjal.h" -#include "escortAI.h" +#include "escort_ai.h" // Trash Mobs summoned in waves #define NECROMANCER 17899//done diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.h b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.h index 9eeff8a03f4..17fdbad5fda 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.h +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/hyjal/hyjal_trash.h @@ -3,7 +3,7 @@ #define SC_HYJAL_TRASH_AI_H #include "def_hyjal.h" -#include "escortAI.h" +#include "escort_ai.h" #define MINRAIDDAMAGE 700000//minimal damage before trash can drop loot and reputation, resets if faction leader dies diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp index 266f61354c0..6200d947b63 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/boss_leutenant_drake.cpp @@ -23,7 +23,7 @@ EndScriptData */ #include "precompiled.h" #include "def_old_hillsbrad.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## go_barrel_old_hillsbrad diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp index 5559989ef65..7c0290fe565 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp @@ -28,7 +28,7 @@ npc_taretha EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" #include "def_old_hillsbrad.h" #define QUEST_ENTRY_HILLSBRAD 10282 diff --git a/src/bindings/scripts/scripts/kalimdor/darkshore.cpp b/src/bindings/scripts/scripts/kalimdor/darkshore.cpp index fef5cf36e43..6c2520cd8b5 100644 --- a/src/bindings/scripts/scripts/kalimdor/darkshore.cpp +++ b/src/bindings/scripts/scripts/kalimdor/darkshore.cpp @@ -27,7 +27,7 @@ npc_threshwackonator EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*#### # npc_prospector_remtravel diff --git a/src/bindings/scripts/scripts/kalimdor/feralas.cpp b/src/bindings/scripts/scripts/kalimdor/feralas.cpp index 826d9cf19f8..08c00a9a5a7 100644 --- a/src/bindings/scripts/scripts/kalimdor/feralas.cpp +++ b/src/bindings/scripts/scripts/kalimdor/feralas.cpp @@ -22,7 +22,7 @@ SDCategory: Feralas EndScriptData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npc_gregan_brewspewer diff --git a/src/bindings/scripts/scripts/kalimdor/moonglade.cpp b/src/bindings/scripts/scripts/kalimdor/moonglade.cpp index 4206e370f4c..10d61132c5b 100644 --- a/src/bindings/scripts/scripts/kalimdor/moonglade.cpp +++ b/src/bindings/scripts/scripts/kalimdor/moonglade.cpp @@ -30,7 +30,7 @@ npc_clintar_dreamwalker EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npc_bunthen_plainswind diff --git a/src/bindings/scripts/scripts/kalimdor/mulgore.cpp b/src/bindings/scripts/scripts/kalimdor/mulgore.cpp index 544cce69d28..97e2e1233cc 100644 --- a/src/bindings/scripts/scripts/kalimdor/mulgore.cpp +++ b/src/bindings/scripts/scripts/kalimdor/mulgore.cpp @@ -28,7 +28,7 @@ npc_plains_vision EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### # npc_skorn_whitecloud diff --git a/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp index a6bd845b13e..5c51e64f5a2 100644 --- a/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp +++ b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp @@ -26,7 +26,7 @@ npc_willix EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" #include "def_razorfen_kraul.h" #define SAY_READY -1047000 diff --git a/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp b/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp index 5c9dbe0b199..2b927af4852 100644 --- a/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp +++ b/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp @@ -27,7 +27,7 @@ npc_kaya_flathoof EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npc_braug_dimspirit diff --git a/src/bindings/scripts/scripts/kalimdor/tanaris.cpp b/src/bindings/scripts/scripts/kalimdor/tanaris.cpp index 44d9c67d9e6..9745fce9966 100644 --- a/src/bindings/scripts/scripts/kalimdor/tanaris.cpp +++ b/src/bindings/scripts/scripts/kalimdor/tanaris.cpp @@ -32,7 +32,7 @@ npc_tooga EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## mob_aquementas diff --git a/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp b/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp index aff67963445..d17d0b06cd1 100644 --- a/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp +++ b/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp @@ -31,7 +31,7 @@ npc_wizzlecrank_shredder EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npc_beaten_corpse diff --git a/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp b/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp index 6ec4a1403ab..be0c2db5aa9 100644 --- a/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp +++ b/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp @@ -29,7 +29,7 @@ npc_plucky EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*##### # npc_kanati diff --git a/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp b/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp index 426b7fa2217..323faf67814 100644 --- a/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp +++ b/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp @@ -26,7 +26,7 @@ npc_a-me EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" #define SAY_READY -1000200 #define SAY_AGGRO1 -1000201 diff --git a/src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp index 622800127db..be222c33e3d 100644 --- a/src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp +++ b/src/bindings/scripts/scripts/kalimdor/wailing_caverns/wailing_caverns.cpp @@ -25,7 +25,7 @@ EndScriptData */ EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" #include "def_wailing_caverns.h" /*###### diff --git a/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp b/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp index da370ac4978..bb97fb12d18 100644 --- a/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp +++ b/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp @@ -26,7 +26,7 @@ npc_injured_rainspeaker_oracle EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npc_injured_rainspeaker_oracle diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp index f9961e10174..66e6b3a108d 100644 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp +++ b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp @@ -22,7 +22,7 @@ SDCategory: Auchindoun, Shadow Labyrinth EndScriptData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" #include "def_shadow_labyrinth.h" enum diff --git a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp index 1e62083f1f9..33e6e8f1b3a 100644 --- a/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp +++ b/src/bindings/scripts/scripts/outland/coilfang_resevoir/serpent_shrine/boss_fathomlord_karathress.cpp @@ -23,7 +23,7 @@ EndScriptData */ #include "precompiled.h" #include "def_serpent_shrine.h" -#include "escortAI.h" +#include "escort_ai.h" #define SAY_AGGRO -1548021 #define SAY_GAIN_BLESSING -1548022 diff --git a/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp index 8f7c076a701..24a3afa1d4b 100644 --- a/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp +++ b/src/bindings/scripts/scripts/outland/hellfire_citadel/magtheridons_lair/boss_magtheridon.cpp @@ -205,12 +205,6 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI void Reset() { - if (pInstance) - { - pInstance->SetData(DATA_MAGTHERIDON_EVENT, NOT_STARTED); - pInstance->SetData(DATA_COLLAPSE, false); - } - Berserk_Timer = 1320000; Quake_Timer = 40000; Debris_Timer = 10000; @@ -229,6 +223,15 @@ struct TRINITY_DLL_DECL boss_magtheridonAI : public ScriptedAI m_creature->CastSpell(m_creature, SPELL_SHADOW_CAGE_C, true); } + void JustReachedHome() + { + if (pInstance) + { + pInstance->SetData(DATA_MAGTHERIDON_EVENT, NOT_STARTED); + pInstance->SetData(DATA_COLLAPSE, false); + } + } + void SetClicker(uint64 cubeGUID, uint64 clickerGUID) { // to avoid multiclicks from 1 cube @@ -432,11 +435,6 @@ struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI Infernal_Timer = 10000 + rand()%40000; Check_Timer = 5000; - - if (pInstance) - pInstance->SetData(DATA_CHANNELER_EVENT, NOT_STARTED); - - m_creature->CastSpell(m_creature, SPELL_SHADOW_GRASP_C, false); } void EnterCombat(Unit *who) @@ -448,9 +446,18 @@ struct TRINITY_DLL_DECL mob_hellfire_channelerAI : public ScriptedAI DoZoneInCombat(); } - void JustSummoned(Creature *summon) {summon->AI()->AttackStart(m_creature->getVictim());} + void JustReachedHome() + { + if (pInstance) + pInstance->SetData(DATA_CHANNELER_EVENT, NOT_STARTED); + + m_creature->CastSpell(m_creature, SPELL_SHADOW_GRASP_C, false); + } - void MoveInLineOfSight(Unit* who) {} + void JustSummoned(Creature *summon) + { + summon->AI()->AttackStart(m_creature->getVictim()); + } void DamageTaken(Unit*, uint32 &damage) { diff --git a/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp b/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp index 171258922d6..209d11c3509 100644 --- a/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp +++ b/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp @@ -30,7 +30,7 @@ npc_wounded_blood_elf EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npc_aeranas diff --git a/src/bindings/scripts/scripts/outland/netherstorm.cpp b/src/bindings/scripts/scripts/outland/netherstorm.cpp index e251951f4aa..1e3c4349116 100644 --- a/src/bindings/scripts/scripts/outland/netherstorm.cpp +++ b/src/bindings/scripts/scripts/outland/netherstorm.cpp @@ -29,7 +29,7 @@ npc_bessy EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npc_manaforge_control_console diff --git a/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp index 41b1ec159b8..998cedf9c1e 100644 --- a/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp +++ b/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp @@ -40,7 +40,7 @@ npc_enraged_spirit EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*##### # mob_mature_netherwing_drake diff --git a/src/bindings/scripts/scripts/outland/shattrath_city.cpp b/src/bindings/scripts/scripts/outland/shattrath_city.cpp index e44aea2e0a0..5e0904f7661 100644 --- a/src/bindings/scripts/scripts/outland/shattrath_city.cpp +++ b/src/bindings/scripts/scripts/outland/shattrath_city.cpp @@ -33,7 +33,7 @@ npc_khadgar EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npc_raliq_the_drunk diff --git a/src/bindings/scripts/scripts/outland/terokkar_forest.cpp b/src/bindings/scripts/scripts/outland/terokkar_forest.cpp index ebe8c0b944f..b2c658c0eef 100644 --- a/src/bindings/scripts/scripts/outland/terokkar_forest.cpp +++ b/src/bindings/scripts/scripts/outland/terokkar_forest.cpp @@ -32,7 +32,7 @@ npc_slim EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## mob_unkor_the_ruthless diff --git a/src/bindings/scripts/scripts/outland/zangarmarsh.cpp b/src/bindings/scripts/scripts/outland/zangarmarsh.cpp index 5267767c544..0ce14cc0aee 100644 --- a/src/bindings/scripts/scripts/outland/zangarmarsh.cpp +++ b/src/bindings/scripts/scripts/outland/zangarmarsh.cpp @@ -30,7 +30,7 @@ npc_kayra_longmane EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" /*###### ## npcs_ashyen_and_keleth diff --git a/src/bindings/scripts/scripts/world/npcs_special.cpp b/src/bindings/scripts/scripts/world/npcs_special.cpp index 2a56a825b11..ef826d4af3a 100644 --- a/src/bindings/scripts/scripts/world/npcs_special.cpp +++ b/src/bindings/scripts/scripts/world/npcs_special.cpp @@ -38,7 +38,7 @@ npc_snake_trap_serpents 80% AI for snakes that summoned by Snake Trap EndContentData */ #include "precompiled.h" -#include "escortAI.h" +#include "escort_ai.h" #include "ObjectMgr.h" /*######## -- cgit v1.2.3 From 81ee07fa2a2ac050e56ed5666892e96997dd17bf Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 19:38:18 +0200 Subject: Merge [SD2] r1313 Implement new class SystemMgr for storage and management of script data. Move database load to new class and instead use functions in class to retrieve data from storage. --HG-- branch : trunk --- src/bindings/scripts/ScriptMgr.cpp | 312 ++++------------------------- src/bindings/scripts/base/escort_ai.cpp | 26 ++- src/bindings/scripts/base/escort_ai.h | 5 +- src/bindings/scripts/include/sc_creature.h | 10 - src/bindings/scripts/system/system.cpp | 233 +++++++++++++++++++++ src/bindings/scripts/system/system.h | 70 +++++++ 6 files changed, 362 insertions(+), 294 deletions(-) (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/ScriptMgr.cpp b/src/bindings/scripts/ScriptMgr.cpp index 84215e01a0c..29744ccec9a 100644 --- a/src/bindings/scripts/ScriptMgr.cpp +++ b/src/bindings/scripts/ScriptMgr.cpp @@ -9,6 +9,7 @@ #include "ObjectMgr.h" #include "ProgressBar.h" #include "../system/ScriptLoader.h" +#include "../system/system.h" #define _FULLVERSION "TrinityScript" @@ -19,26 +20,8 @@ int num_sc_scripts; Script *m_scripts[MAX_SCRIPTS]; -DatabaseType TScriptDB; Config TScriptConfig; -// String text additional data, used in TextMap -struct StringTextData -{ - uint32 SoundId; - uint8 Type; - uint32 Language; - uint32 Emote; -}; - -#define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available - -// Text Maps -UNORDERED_MAP TextMap; - -// Waypoint map (escorts) -UNORDERED_MAP > PointMovementMap; - void FillSpellSummary(); void LoadOverridenSQLData(); void LoadOverridenDBCData(); @@ -56,228 +39,21 @@ void LoadDatabase() //Initialize connection to DB if (!dbstring.empty() && TScriptDB.Initialize(dbstring.c_str())) - outstring_log("TSCR: TrinityScript database: %s",dbstring.c_str()); - else - { - error_log("TSCR: Unable to connect to Database. Load database aborted."); - return; - } - - //***Preform all DB queries here*** - QueryResult *result; - - //Get Version information - result = TScriptDB.PQuery("SELECT script_version FROM version LIMIT 1"); - - if (result) - { - Field *fields = result->Fetch(); - outstring_log("TSCR: Database version is: %s", fields[0].GetString()); - outstring_log(""); - delete result; - - }else { - error_log("TSCR: Missing `version.script_version` information."); + outstring_log("TSCR: TrinityScript database at %s initialized", dbstring.c_str()); outstring_log(""); - } - - // Drop Existing Text Map, only done once and we are ready to add data from multiple sources. - TextMap.clear(); - - // Load Script Text - outstring_log("TSCR: Loading Script Texts..."); - LoadTrinityStrings(TScriptDB,"script_texts",TEXT_SOURCE_RANGE,1+(TEXT_SOURCE_RANGE*2)); - - // Gather Additional data from Script Texts - result = TScriptDB.PQuery("SELECT entry, sound, type, language, emote FROM script_texts"); - - outstring_log("TSCR: Loading Script Texts additional data..."); - if (result) - { - barGoLink bar(result->GetRowCount()); - uint32 count = 0; - do - { - bar.step(); - Field* fields = result->Fetch(); - StringTextData temp; - - int32 i = fields[0].GetInt32(); - temp.SoundId = fields[1].GetInt32(); - temp.Type = fields[2].GetInt32(); - temp.Language = fields[3].GetInt32(); - temp.Emote = fields[4].GetInt32(); - - if (i >= 0) - { - error_db_log("TSCR: Entry %i in table `script_texts` is not a negative value.",i); - continue; - } - - if (i > TEXT_SOURCE_RANGE || i <= TEXT_SOURCE_RANGE*2) - { - error_db_log("TSCR: Entry %i in table `script_texts` is out of accepted entry range for table.",i); - continue; - } - - if (temp.SoundId) - { - if (!GetSoundEntriesStore()->LookupEntry(temp.SoundId)) - error_db_log("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.",i, temp.SoundId); - } - - if (!GetLanguageDescByID(temp.Language)) - error_db_log("TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.",i, temp.Language); - - if (temp.Type > CHAT_TYPE_ZONE_YELL) - error_db_log("TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.",i, temp.Type); - - TextMap[i] = temp; - ++count; - } while (result->NextRow()); - - delete result; - - outstring_log(""); - outstring_log(">> TSCR: Loaded %u additional Script Texts data.", count); - }else - { - barGoLink bar(1); - bar.step(); - outstring_log(""); - outstring_log(">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty."); - } - - // Load Custom Text - outstring_log("TSCR: Loading Custom Texts..."); - LoadTrinityStrings(TScriptDB,"custom_texts",TEXT_SOURCE_RANGE*2,1+(TEXT_SOURCE_RANGE*3)); - - // Gather Additional data from Custom Texts - result = TScriptDB.PQuery("SELECT entry, sound, type, language, emote FROM custom_texts"); - - outstring_log("TSCR: Loading Custom Texts additional data..."); - if (result) - { - barGoLink bar(result->GetRowCount()); - uint32 count = 0; - - do - { - bar.step(); - Field* fields = result->Fetch(); - StringTextData temp; - - int32 i = fields[0].GetInt32(); - temp.SoundId = fields[1].GetInt32(); - temp.Type = fields[2].GetInt32(); - temp.Language = fields[3].GetInt32(); - temp.Emote = fields[4].GetInt32(); - - if (i >= 0) - { - error_db_log("TSCR: Entry %i in table `custom_texts` is not a negative value.",i); - continue; - } - - if (i > TEXT_SOURCE_RANGE*2 || i <= TEXT_SOURCE_RANGE*3) - { - error_db_log("TSCR: Entry %i in table `custom_texts` is out of accepted entry range for table.",i); - continue; - } - - if (temp.SoundId) - { - if (!GetSoundEntriesStore()->LookupEntry(temp.SoundId)) - error_db_log("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.",i, temp.SoundId); - } - - if (!GetLanguageDescByID(temp.Language)) - error_db_log("TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.",i, temp.Language); - - if (temp.Type > CHAT_TYPE_ZONE_YELL) - error_db_log("TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.",i, temp.Type); - - TextMap[i] = temp; - ++count; - } while (result->NextRow()); - - delete result; - - outstring_log(""); - outstring_log(">> Loaded %u additional Custom Texts data.", count); - }else - { - barGoLink bar(1); - bar.step(); - outstring_log(""); - outstring_log(">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty."); - } - - // Drop Existing Waypoint list - PointMovementMap.clear(); - uint64 uiCreatureCount = 0; - - // Load Waypoints - result = TScriptDB.PQuery("SELECT COUNT(entry) FROM script_waypoint GROUP BY entry"); - if (result) - { - uiCreatureCount = result->GetRowCount(); - delete result; - } - - outstring_log("TSCR: Loading Script Waypoints for %u creature(s)...", uiCreatureCount); - - result = TScriptDB.PQuery("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid"); - - if (result) - { - barGoLink bar(result->GetRowCount()); - uint32 uiNodeCount = 0; - - do - { - bar.step(); - Field* pFields = result->Fetch(); - PointMovement pTemp; - - pTemp.m_uiCreatureEntry = pFields[0].GetUInt32(); - uint32 uiCreatureEntry = pTemp.m_uiCreatureEntry; - pTemp.m_uiPointId = pFields[1].GetUInt32(); - pTemp.m_fX = pFields[2].GetFloat(); - pTemp.m_fY = pFields[3].GetFloat(); - pTemp.m_fZ = pFields[4].GetFloat(); - pTemp.m_uiWaitTime = pFields[5].GetUInt32(); - - CreatureInfo const* pCInfo = GetCreatureTemplateStore(pTemp.m_uiCreatureEntry); - if (!pCInfo) - { - error_db_log("TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", pTemp.m_uiCreatureEntry); - continue; - } - - if (!pCInfo->ScriptID) - error_db_log("TSCR: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", pTemp.m_uiCreatureEntry); - - PointMovementMap[uiCreatureEntry].push_back(pTemp); - ++uiNodeCount; - } while (result->NextRow()); - - delete result; - - outstring_log(""); - outstring_log(">> Loaded %u Script Waypoint nodes.", uiNodeCount); + pSystemMgr.LoadVersion(); + pSystemMgr.LoadScriptTexts(); + pSystemMgr.LoadScriptTextsCustom(); + pSystemMgr.LoadScriptWaypoints(); } else { - barGoLink bar(1); - bar.step(); - outstring_log(""); - outstring_log(">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty."); + error_log("TSCR: Unable to connect to Database. Load database aborted."); + return; } - //Free database thread and resources TScriptDB.HaltDelayThread(); } @@ -303,8 +79,6 @@ void ScriptsFree() TRINITY_DLL_EXPORT void ScriptsInit(char const* cfg_file = "trinitycore.conf") { - bool CanLoadDB = true; - //Trinity Script startup outstring_log(" _____ _ _ _ ____ _ _"); outstring_log("|_ _| __(_)_ __ (_) |_ _ _/ ___| ___ _ __(_)_ __ | |_ "); @@ -317,17 +91,14 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") //Get configuration file if (!TScriptConfig.SetSource(cfg_file)) - { - CanLoadDB = false; error_log("TSCR: Unable to open configuration file. Database will be unaccessible. Configuration values will use default."); - } - else outstring_log("TSCR: Using configuration file %s",cfg_file); + else + outstring_log("TSCR: Using configuration file %s",cfg_file); outstring_log(""); - //Load database (must be called after TScriptConfig.SetSource). In case it failed, no need to even try load. - if (CanLoadDB) - LoadDatabase(); + //Load database (must be called after SD2Config.SetSource). + LoadDatabase(); outstring_log("TSCR: Loading C++ scripts"); barGoLink bar(1); @@ -352,78 +123,78 @@ void ScriptsInit(char const* cfg_file = "trinitycore.conf") //********************************* //*** Functions used globally *** -void DoScriptText(int32 textEntry, WorldObject* pSource, Unit* target) +void DoScriptText(int32 iTextEntry, WorldObject* pSource, Unit* pTarget) { if (!pSource) { - error_log("TSCR: DoScriptText entry %i, invalid Source pointer.",textEntry); + error_log("TSCR: DoScriptText entry %i, invalid Source pointer.", iTextEntry); return; } - if (textEntry >= 0) + if (iTextEntry >= 0) { - error_log("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry); + error_log("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) attempts to process text entry %i, but text entry must be negative.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry); return; } - UNORDERED_MAP::iterator i = TextMap.find(textEntry); + const StringTextData* pData = pSystemMgr.GetTextData(iTextEntry); - if (i == TextMap.end()) + if (!pData) { - error_log("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.",pSource->GetEntry(),pSource->GetTypeId(),pSource->GetGUIDLow(),textEntry); + error_log("TSCR: DoScriptText with source entry %u (TypeId=%u, guid=%u) could not find text entry %i.", pSource->GetEntry(), pSource->GetTypeId(), pSource->GetGUIDLow(), iTextEntry); return; } - debug_log("TSCR: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u",textEntry,(*i).second.SoundId,(*i).second.Type,(*i).second.Language,(*i).second.Emote); + debug_log("TSCR: DoScriptText: text entry=%i, Sound=%u, Type=%u, Language=%u, Emote=%u", iTextEntry, pData->uiSoundId, pData->uiType, pData->uiLanguage, pData->uiEmote); - if((*i).second.SoundId) + if(pData->uiSoundId) { - if(GetSoundEntriesStore()->LookupEntry((*i).second.SoundId)) + if(GetSoundEntriesStore()->LookupEntry(pData->uiSoundId)) { - pSource->SendPlaySound((*i).second.SoundId, false); + pSource->SendPlaySound(pData->uiSoundId, false); } else - error_log("TSCR: DoScriptText entry %i tried to process invalid sound id %u.",textEntry,(*i).second.SoundId); + error_log("TSCR: DoScriptText entry %i tried to process invalid sound id %u.", iTextEntry, pData->uiSoundId); } - if((*i).second.Emote) + if(pData->uiEmote) { if (pSource->GetTypeId() == TYPEID_UNIT || pSource->GetTypeId() == TYPEID_PLAYER) - { - ((Unit*)pSource)->HandleEmoteCommand((*i).second.Emote); - } + ((Unit*)pSource)->HandleEmoteCommand(pData->uiEmote); else - error_log("TSCR: DoScriptText entry %i tried to process emote for invalid TypeId (%u).",textEntry, pSource->GetTypeId()); + error_log("TSCR: DoScriptText entry %i tried to process emote for invalid TypeId (%u).", iTextEntry, pSource->GetTypeId()); } - switch((*i).second.Type) + switch(pData->uiType) { case CHAT_TYPE_SAY: - pSource->MonsterSay(textEntry, (*i).second.Language, target ? target->GetGUID() : 0); + pSource->MonsterSay(iTextEntry, pData->uiLanguage, pTarget ? pTarget->GetGUID() : 0); break; case CHAT_TYPE_YELL: - pSource->MonsterYell(textEntry, (*i).second.Language, target ? target->GetGUID() : 0); + pSource->MonsterYell(iTextEntry, pData->uiLanguage, pTarget ? pTarget->GetGUID() : 0); break; case CHAT_TYPE_TEXT_EMOTE: - pSource->MonsterTextEmote(textEntry, target ? target->GetGUID() : 0); + pSource->MonsterTextEmote(iTextEntry, pTarget ? pTarget->GetGUID() : 0); break; case CHAT_TYPE_BOSS_EMOTE: - pSource->MonsterTextEmote(textEntry, target ? target->GetGUID() : 0, true); + pSource->MonsterTextEmote(iTextEntry, pTarget ? pTarget->GetGUID() : 0, true); break; case CHAT_TYPE_WHISPER: { - if (target && target->GetTypeId() == TYPEID_PLAYER) - pSource->MonsterWhisper(textEntry, target->GetGUID()); - else error_log("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry); + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) + pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID()); + else + error_log("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); }break; case CHAT_TYPE_BOSS_WHISPER: { - if (target && target->GetTypeId() == TYPEID_PLAYER) - pSource->MonsterWhisper(textEntry, target->GetGUID(), true); - else error_log("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", textEntry); + if (pTarget && pTarget->GetTypeId() == TYPEID_PLAYER) + pSource->MonsterWhisper(iTextEntry, pTarget->GetGUID(), true); + else + error_log("TSCR: DoScriptText entry %i cannot whisper without target unit (TYPEID_PLAYER).", iTextEntry); }break; case CHAT_TYPE_ZONE_YELL: - pSource->MonsterYellToZone(textEntry, (*i).second.Language, target ? target->GetGUID() : 0); + pSource->MonsterYellToZone(iTextEntry, pData->uiLanguage, pTarget ? pTarget->GetGUID() : 0); break; } } @@ -454,6 +225,7 @@ char const* ScriptsVersion() { return "Default Trinity scripting library"; } + TRINITY_DLL_EXPORT bool GossipHello (Player * pPlayer, Creature* pCreature) { diff --git a/src/bindings/scripts/base/escort_ai.cpp b/src/bindings/scripts/base/escort_ai.cpp index 3f4c8601f90..f4979487d31 100644 --- a/src/bindings/scripts/base/escort_ai.cpp +++ b/src/bindings/scripts/base/escort_ai.cpp @@ -11,6 +11,7 @@ EndScriptData */ #include "precompiled.h" #include "escort_ai.h" +#include "../system/system.h" enum { @@ -18,8 +19,6 @@ enum POINT_HOME = 0xFFFFFE }; -extern std::list PointMovementList; - void npc_escortAI::AttackStart(Unit* pWho) { if (!pWho) @@ -218,6 +217,11 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) m_uiPlayerCheckTimer -= uiDiff; } + UpdateEscortAI(uiDiff); +} + +void npc_escortAI::UpdateEscortAI(const uint32 uiDiff) +{ if (CanMelee && UpdateVictim()) DoMeleeAttackIfReady(); } @@ -308,17 +312,17 @@ void npc_escortAI::AddWaypoint(uint32 id, float x, float y, float z, uint32 Wait void npc_escortAI::FillPointMovementListForCreature() { - UNORDERED_MAP >::iterator pPointsEntries = PointMovementMap.find(m_creature->GetEntry()); + std::vector const &pPointsEntries = pSystemMgr.GetPointMoveList(m_creature->GetEntry()); - if (pPointsEntries != PointMovementMap.end()) - { - std::vector::iterator itr; + if (pPointsEntries.empty()) + return; - for (itr = pPointsEntries->second.begin(); itr != pPointsEntries->second.end(); ++itr) - { - Escort_Waypoint pPoint(itr->m_uiPointId,itr->m_fX,itr->m_fY,itr->m_fZ,itr->m_uiWaitTime); - WaypointList.push_back(pPoint); - } + std::vector::const_iterator itr; + + for (itr = pPointsEntries.begin(); itr != pPointsEntries.end(); ++itr) + { + Escort_Waypoint pPoint(itr->uiPointId, itr->fX, itr->fY, itr->fZ, itr->uiWaitTime); + WaypointList.push_back(pPoint); } } diff --git a/src/bindings/scripts/base/escort_ai.h b/src/bindings/scripts/base/escort_ai.h index 8ce82eb370a..5d27aebfec6 100644 --- a/src/bindings/scripts/base/escort_ai.h +++ b/src/bindings/scripts/base/escort_ai.h @@ -7,8 +7,6 @@ #define DEFAULT_MAX_PLAYER_DISTANCE 50 -extern UNORDERED_MAP > PointMovementMap; - struct Escort_Waypoint { Escort_Waypoint(uint32 _id, float _x, float _y, float _z, uint32 _w) @@ -50,7 +48,8 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI void EnterEvadeMode(); - void UpdateAI(const uint32); + void UpdateAI(const uint32); //the "internal" update, calls UpdateEscortAI() + virtual void UpdateEscortAI(const uint32); //used when it's needed to add code in update (abilities, scripted events, etc) void MovementInform(uint32, uint32); diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index b0a885643fc..6baac76a8dd 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -41,16 +41,6 @@ class SummonList : private std::list Creature *m_creature; }; -struct PointMovement -{ - uint32 m_uiCreatureEntry; - uint32 m_uiPointId; - float m_fX; - float m_fY; - float m_fZ; - uint32 m_uiWaitTime; -}; - struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI { explicit ScriptedAI(Creature* creature); diff --git a/src/bindings/scripts/system/system.cpp b/src/bindings/scripts/system/system.cpp index ab62e530681..4ed51825262 100644 --- a/src/bindings/scripts/system/system.cpp +++ b/src/bindings/scripts/system/system.cpp @@ -19,4 +19,237 @@ */ #include "precompiled.h" +#include "system.h" +#include "ProgressBar.h" +#include "ObjectMgr.h" +#include "Database/DatabaseEnv.h" +DatabaseType TScriptDB; + +SystemMgr::SystemMgr() +{ +} + +SystemMgr& SystemMgr::Instance() +{ + static SystemMgr pSysMgr; + return pSysMgr; +} + +void SystemMgr::LoadVersion() +{ + //Get Version information + QueryResult* pResult = TScriptDB.PQuery("SELECT script_version FROM version LIMIT 1"); + + if (pResult) + { + Field* pFields = pResult->Fetch(); + + outstring_log("TSCR: Database version is: %s", pFields[0].GetString()); + outstring_log(""); + } + else + { + error_log("TSCR: Missing `version`.`script_version` information."); + outstring_log(""); + } +} + +void SystemMgr::LoadScriptTexts() +{ + outstring_log("TSCR: Loading Script Texts..."); + LoadTrinityStrings(TScriptDB,"script_texts",TEXT_SOURCE_RANGE,1+(TEXT_SOURCE_RANGE*2)); + + QueryResult* pResult = TScriptDB.PQuery("SELECT entry, sound, type, language, emote FROM script_texts"); + + outstring_log("TSCR: Loading Script Texts additional data..."); + + if (pResult) + { + barGoLink bar(pResult->GetRowCount()); + uint32 uiCount = 0; + + do + { + bar.step(); + Field* pFields = pResult->Fetch(); + StringTextData pTemp; + + int32 iId = pFields[0].GetInt32(); + pTemp.uiSoundId = pFields[1].GetUInt32(); + pTemp.uiType = pFields[2].GetUInt32(); + pTemp.uiLanguage = pFields[3].GetUInt32(); + pTemp.uiEmote = pFields[4].GetUInt32(); + + if (iId >= 0) + { + error_db_log("TSCR: Entry %i in table `script_texts` is not a negative value.", iId); + continue; + } + + if (iId > TEXT_SOURCE_RANGE || iId <= TEXT_SOURCE_RANGE*2) + { + error_db_log("TSCR: Entry %i in table `script_texts` is out of accepted entry range for table.", iId); + continue; + } + + if (pTemp.uiSoundId) + { + if (!GetSoundEntriesStore()->LookupEntry(pTemp.uiSoundId)) + error_db_log("TSCR: Entry %i in table `script_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId); + } + + if (!GetLanguageDescByID(pTemp.uiLanguage)) + error_db_log("TSCR: Entry %i in table `script_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage); + + if (pTemp.uiType > CHAT_TYPE_ZONE_YELL) + error_db_log("TSCR: Entry %i in table `script_texts` has Type %u but this Chat Type does not exist.", iId, pTemp.uiType); + + m_mTextDataMap[iId] = pTemp; + ++uiCount; + } while (pResult->NextRow()); + + outstring_log(""); + outstring_log(">> Loaded %u additional Script Texts data.", uiCount); + } + else + { + barGoLink bar(1); + bar.step(); + outstring_log(""); + outstring_log(">> Loaded 0 additional Script Texts data. DB table `script_texts` is empty."); + } +} + +void SystemMgr::LoadScriptTextsCustom() +{ + outstring_log("TSCR: Loading Custom Texts..."); + LoadTrinityStrings(TScriptDB,"custom_texts",TEXT_SOURCE_RANGE*2,1+(TEXT_SOURCE_RANGE*3)); + + QueryResult* pResult = TScriptDB.PQuery("SELECT entry, sound, type, language, emote FROM custom_texts"); + + outstring_log("TSCR: Loading Custom Texts additional data..."); + + if (pResult) + { + barGoLink bar(pResult->GetRowCount()); + uint32 uiCount = 0; + + do + { + bar.step(); + Field* pFields = pResult->Fetch(); + StringTextData pTemp; + + int32 iId = pFields[0].GetInt32(); + pTemp.uiSoundId = pFields[1].GetUInt32(); + pTemp.uiType = pFields[2].GetUInt32(); + pTemp.uiLanguage = pFields[3].GetUInt32(); + pTemp.uiEmote = pFields[4].GetUInt32(); + + if (iId >= 0) + { + error_db_log("TSCR: Entry %i in table `custom_texts` is not a negative value.", iId); + continue; + } + + if (iId > TEXT_SOURCE_RANGE*2 || iId <= TEXT_SOURCE_RANGE*3) + { + error_db_log("TSCR: Entry %i in table `custom_texts` is out of accepted entry range for table.", iId); + continue; + } + + if (pTemp.uiSoundId) + { + if (!GetSoundEntriesStore()->LookupEntry(pTemp.uiSoundId)) + error_db_log("TSCR: Entry %i in table `custom_texts` has soundId %u but sound does not exist.", iId, pTemp.uiSoundId); + } + + if (!GetLanguageDescByID(pTemp.uiLanguage)) + error_db_log("TSCR: Entry %i in table `custom_texts` using Language %u but Language does not exist.", iId, pTemp.uiLanguage); + + if (pTemp.uiType > CHAT_TYPE_ZONE_YELL) + error_db_log("TSCR: Entry %i in table `custom_texts` has Type %u but this Chat Type does not exist.", iId, pTemp.uiType); + + m_mTextDataMap[iId] = pTemp; + ++uiCount; + } while (pResult->NextRow()); + + outstring_log(""); + outstring_log(">> Loaded %u additional Custom Texts data.", uiCount); + } + else + { + barGoLink bar(1); + bar.step(); + outstring_log(""); + outstring_log(">> Loaded 0 additional Custom Texts data. DB table `custom_texts` is empty."); + } +} + +void SystemMgr::LoadScriptWaypoints() +{ + // Drop Existing Waypoint list + m_mPointMoveMap.clear(); + + uint64 uiCreatureCount = 0; + + // Load Waypoints + QueryResult* pResult = TScriptDB.PQuery("SELECT COUNT(entry) FROM script_waypoint GROUP BY entry"); + if (pResult) + { + uiCreatureCount = pResult->GetRowCount(); + delete pResult; + } + + outstring_log("TSCR: Loading Script Waypoints for %u creature(s)...", uiCreatureCount); + + pResult = TScriptDB.PQuery("SELECT entry, pointid, location_x, location_y, location_z, waittime FROM script_waypoint ORDER BY pointid"); + + if (pResult) + { + barGoLink bar(pResult->GetRowCount()); + uint32 uiNodeCount = 0; + + do + { + bar.step(); + Field* pFields = pResult->Fetch(); + ScriptPointMove pTemp; + + pTemp.uiCreatureEntry = pFields[0].GetUInt32(); + uint32 uiEntry = pTemp.uiCreatureEntry; + pTemp.uiPointId = pFields[1].GetUInt32(); + pTemp.fX = pFields[2].GetFloat(); + pTemp.fY = pFields[3].GetFloat(); + pTemp.fZ = pFields[4].GetFloat(); + pTemp.uiWaitTime = pFields[5].GetUInt32(); + + CreatureInfo const* pCInfo = GetCreatureTemplateStore(pTemp.uiCreatureEntry); + + if (!pCInfo) + { + error_db_log("TSCR: DB table script_waypoint has waypoint for non-existant creature entry %u", pTemp.uiCreatureEntry); + continue; + } + + if (!pCInfo->ScriptID) + error_db_log("TSCR: DB table script_waypoint has waypoint for creature entry %u, but creature does not have ScriptName defined and then useless.", pTemp.uiCreatureEntry); + + m_mPointMoveMap[uiEntry].push_back(pTemp); + ++uiNodeCount; + } while (pResult->NextRow()); + + delete pResult; + + outstring_log(""); + outstring_log(">> Loaded %u Script Waypoint nodes.", uiNodeCount); + } + else + { + barGoLink bar(1); + bar.step(); + outstring_log(""); + outstring_log(">> Loaded 0 Script Waypoints. DB table `script_waypoint` is empty."); + } +} diff --git a/src/bindings/scripts/system/system.h b/src/bindings/scripts/system/system.h index 886f31355a9..a9d35b6f3f0 100644 --- a/src/bindings/scripts/system/system.h +++ b/src/bindings/scripts/system/system.h @@ -5,4 +5,74 @@ #ifndef SC_SYSTEM_H #define SC_SYSTEM_H +extern DatabaseType TScriptDB; + +#define TEXT_SOURCE_RANGE -1000000 //the amount of entries each text source has available + +struct ScriptPointMove +{ + uint32 uiCreatureEntry; + uint32 uiPointId; + float fX; + float fY; + float fZ; + uint32 uiWaitTime; +}; + +struct StringTextData +{ + uint32 uiSoundId; + uint8 uiType; + uint32 uiLanguage; + uint32 uiEmote; +}; + +#define pSystemMgr SystemMgr::Instance() + +class SystemMgr +{ + public: + SystemMgr(); + ~SystemMgr() {} + + static SystemMgr& Instance(); + + //Maps and lists + typedef UNORDERED_MAP TextDataMap; + typedef UNORDERED_MAP > PointMoveMap; + + //Database + void LoadVersion(); + void LoadScriptTexts(); + void LoadScriptTextsCustom(); + void LoadScriptWaypoints(); + + //Retrive from storage + StringTextData const* GetTextData(int32 uiTextId) const + { + TextDataMap::const_iterator itr = m_mTextDataMap.find(uiTextId); + + if (itr == m_mTextDataMap.end()) + return NULL; + + return &itr->second; + } + + std::vector const &GetPointMoveList(uint32 uiCreatureEntry) const + { + static std::vector vEmpty; + + PointMoveMap::const_iterator itr = m_mPointMoveMap.find(uiCreatureEntry); + + if (itr == m_mPointMoveMap.end()) + return vEmpty; + + return itr->second; + } + + protected: + TextDataMap m_mTextDataMap; //additional data for text strings + PointMoveMap m_mPointMoveMap; //coordinates for waypoints +}; + #endif -- cgit v1.2.3 From 91f3d69edf754c4e62d973cf1ae81e9a2e36d7bc Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 21:46:31 +0200 Subject: Merge [SD2] r1314 Correct some spellId's and apply SD2 code style r1315 Correct more spells and apply SD2 code style r1316 Replace magic number with enum type name UNIT_DYNFLAG_DEAD r1317 Add support for quest 1249. Patch by jotapdiez r1318 Move AI's implementation from headers. Original patch/idea by DasBlub r1319 Convert script related to quest 938 to use followerAI r1320 Add new virtual function WaypointStart() to escortAI. --HG-- branch : trunk --- sql/FULL/world_script_waypoints.sql | 10 ++ sql/FULL/world_scripts_full.sql | 2 + sql/updates/5096_world_scripts.sql | 12 ++ src/bindings/scripts/CMakeLists.txt | 1 + src/bindings/scripts/VC80/80ScriptDev2.vcproj | 4 + src/bindings/scripts/VC90/90ScriptDev2.vcproj | 4 + src/bindings/scripts/base/escort_ai.cpp | 24 ++- src/bindings/scripts/base/escort_ai.h | 6 +- src/bindings/scripts/base/guard_ai.cpp | 5 + src/bindings/scripts/base/guard_ai.h | 4 +- src/bindings/scripts/include/sc_creature.cpp | 6 +- src/bindings/scripts/include/sc_creature.h | 2 +- .../scripts/eastern_kingdoms/dun_morogh.cpp | 2 +- .../scripts/eastern_kingdoms/elwynn_forest.cpp | 2 +- .../scholomance/boss_doctor_theolen_krastinov.cpp | 64 ++++---- .../eastern_kingdoms/scholomance/boss_vectus.cpp | 59 ++++---- .../scripts/scripts/eastern_kingdoms/wetlands.cpp | 167 +++++++++++++++++++++ .../scripts/scripts/kalimdor/teldrassil.cpp | 107 +++---------- src/bindings/scripts/scripts/outland/nagrand.cpp | 2 +- src/bindings/scripts/system/ScriptLoader.cpp | 2 + 20 files changed, 332 insertions(+), 153 deletions(-) create mode 100644 sql/updates/5096_world_scripts.sql create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp (limited to 'src/bindings/scripts') diff --git a/sql/FULL/world_script_waypoints.sql b/sql/FULL/world_script_waypoints.sql index e6884155154..9dfa805c30f 100644 --- a/sql/FULL/world_script_waypoints.sql +++ b/sql/FULL/world_script_waypoints.sql @@ -13,6 +13,16 @@ CREATE TABLE script_waypoint ( PRIMARY KEY (entry, pointid) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints'; +DELETE FROM script_waypoint WHERE entry=4962; +INSERT INTO script_waypoint VALUES +(4962, 0, -3804.438965, -828.048035, 10.093068, 0, ''), +(4962, 1, -3803.934326, -835.772400, 10.077722, 0, ''), +(4962, 2, -3792.629150, -835.670898, 9.655657, 0, ''), +(4962, 3, -3772.433838, -835.345947, 10.868981, 0, ''), +(4962, 4, -3765.937256, -840.128601, 10.885593, 0, ''), +(4962, 5, -3738.633789, -830.997498, 11.057384, 0, ''), +(4962, 6, -3690.224121, -862.261597, 9.960449, 0, ''); + DELETE FROM script_waypoint WHERE entry=10638; INSERT INTO script_waypoint VALUES (10638, 0, -4903.521973, -1368.339844, -52.611, 5000, 'SAY_KAN_START'), diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index af5e9af4800..88f51044f53 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -1086,6 +1086,8 @@ UPDATE `creature_template` SET `ScriptName`='npc_defias_traitor' WHERE `entry`=4 UPDATE `creature_template` SET `ScriptName`='npc_daphne_stilwell' WHERE `entry`=6182; /* WETLANDS */ +UPDATE creature_template SET ScriptName='npc_tapoke_slim_jahn' WHERE entry=4962; +UPDATE creature_template SET ScriptName='npc_mikhail' WHERE entry=4963; /* WINTERSPRING */ UPDATE `creature_template` SET `ScriptName`='npc_lorax' WHERE `entry`=10918; diff --git a/sql/updates/5096_world_scripts.sql b/sql/updates/5096_world_scripts.sql new file mode 100644 index 00000000000..37bf49f3d7d --- /dev/null +++ b/sql/updates/5096_world_scripts.sql @@ -0,0 +1,12 @@ +UPDATE creature_template SET ScriptName='npc_tapoke_slim_jahn' WHERE entry=4962; +UPDATE creature_template SET ScriptName='npc_mikhail' WHERE entry=4963; + +DELETE FROM script_waypoint WHERE entry=4962; +INSERT INTO script_waypoint VALUES +(4962, 0, -3804.438965, -828.048035, 10.093068, 0, ''), +(4962, 1, -3803.934326, -835.772400, 10.077722, 0, ''), +(4962, 2, -3792.629150, -835.670898, 9.655657, 0, ''), +(4962, 3, -3772.433838, -835.345947, 10.868981, 0, ''), +(4962, 4, -3765.937256, -840.128601, 10.885593, 0, ''), +(4962, 5, -3738.633789, -830.997498, 11.057384, 0, ''), +(4962, 6, -3690.224121, -862.261597, 9.960449, 0, ''); diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 571dbc1b2a9..285fb004c59 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -192,6 +192,7 @@ SET(trinityscript_LIB_SRCS scripts/eastern_kingdoms/undercity.cpp scripts/eastern_kingdoms/western_plaguelands.cpp scripts/eastern_kingdoms/westfall.cpp + scripts/eastern_kingdoms/wetlands.cpp scripts/examples/example_creature.cpp scripts/examples/example_escort.cpp scripts/examples/example_gossip_codebox.cpp diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index ee1a8c87592..635f9356908 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -1162,6 +1162,10 @@ RelativePath="..\scripts\eastern_kingdoms\westfall.cpp" > + + + + GetMotionMaster()->MovePoint(CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); - debug_log("TSCR: EscortAI Next WP is: %u, %f, %f, %f", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); + debug_log("TSCR: EscortAI start waypoint %u (%f, %f, %f).", CurrentWP->id, CurrentWP->x, CurrentWP->y, CurrentWP->z); + + WaypointStart(CurrentWP->id); + m_uiWPWaitTimer = 0; } } diff --git a/src/bindings/scripts/base/escort_ai.h b/src/bindings/scripts/base/escort_ai.h index 5d27aebfec6..663e11d79f6 100644 --- a/src/bindings/scripts/base/escort_ai.h +++ b/src/bindings/scripts/base/escort_ai.h @@ -28,12 +28,12 @@ struct Escort_Waypoint struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI { public: - explicit npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature), - IsBeingEscorted(false), IsOnHold(false), PlayerGUID(0), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), CanMelee(true), m_uiPlayerCheckTimer(1000), m_uiWPWaitTimer(2500), m_bIsReturning(false), m_bIsActiveAttacker(true), m_bIsRunning(false), DespawnAtEnd(true), DespawnAtFar(true), m_pQuestForEscort(NULL), m_bCanInstantRespawn(false), m_bCanReturnToStart(false), ScriptWP(false) {} + explicit npc_escortAI(Creature* pCreature); ~npc_escortAI() {} // Pure Virtual Functions - virtual void WaypointReached(uint32) = 0; + virtual void WaypointReached(uint32 uiPointId) = 0; + virtual void WaypointStart(uint32 uiPointId) {} // CreatureAI functions void AttackStart(Unit* who); diff --git a/src/bindings/scripts/base/guard_ai.cpp b/src/bindings/scripts/base/guard_ai.cpp index 7f1daa1e2df..b55eae2dbad 100644 --- a/src/bindings/scripts/base/guard_ai.cpp +++ b/src/bindings/scripts/base/guard_ai.cpp @@ -32,6 +32,11 @@ EndScriptData */ #define SAY_GUARD_SIL_AGGRO2 -1070002 #define SAY_GUARD_SIL_AGGRO3 -1070003 +guardAI::guardAI(Creature* pCreature) : ScriptedAI(pCreature), + GlobalCooldown(0), + BuffTimer(0) +{} + void guardAI::Reset() { GlobalCooldown = 0; diff --git a/src/bindings/scripts/base/guard_ai.h b/src/bindings/scripts/base/guard_ai.h index 85baa30fb9d..a7fff32e3ab 100644 --- a/src/bindings/scripts/base/guard_ai.h +++ b/src/bindings/scripts/base/guard_ai.h @@ -9,7 +9,9 @@ struct TRINITY_DLL_DECL guardAI : public ScriptedAI { - guardAI(Creature *c) : ScriptedAI(c) {} + public: + explicit guardAI(Creature* pCreature); + ~guardAI() {} uint32 GlobalCooldown; //This variable acts like the global cooldown that players have (1.5 seconds) uint32 BuffTimer; //This variable keeps track of buffs diff --git a/src/bindings/scripts/include/sc_creature.cpp b/src/bindings/scripts/include/sc_creature.cpp index 1d423574f42..aa64a6fcbf1 100644 --- a/src/bindings/scripts/include/sc_creature.cpp +++ b/src/bindings/scripts/include/sc_creature.cpp @@ -80,7 +80,11 @@ void SummonList::DespawnAll() } } -ScriptedAI::ScriptedAI(Creature* creature) : CreatureAI(creature), m_creature(creature), IsFleeing(false), m_bCombatMovement(true), m_uiEvadeCheckCooldown(2500) +ScriptedAI::ScriptedAI(Creature* pCreature) : CreatureAI(pCreature), + m_creature(pCreature), + IsFleeing(false), + m_bCombatMovement(true), + m_uiEvadeCheckCooldown(2500) { HeroicMode = m_creature->GetMap()->IsHeroic(); } diff --git a/src/bindings/scripts/include/sc_creature.h b/src/bindings/scripts/include/sc_creature.h index 6baac76a8dd..74eea9ad599 100644 --- a/src/bindings/scripts/include/sc_creature.h +++ b/src/bindings/scripts/include/sc_creature.h @@ -43,7 +43,7 @@ class SummonList : private std::list struct TRINITY_DLL_DECL ScriptedAI : public CreatureAI { - explicit ScriptedAI(Creature* creature); + explicit ScriptedAI(Creature* pCreature); ~ScriptedAI() {} //************* diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp index 7e61df13575..29731ca83e3 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/dun_morogh.cpp @@ -43,7 +43,7 @@ struct TRINITY_DLL_DECL npc_narm_faulkAI : public ScriptedAI void Reset() { lifeTimer = 120000; - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); m_creature->SetStandState(UNIT_STAND_STATE_DEAD); spellHit = false; } diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp index 67456755cd2..e44081d72ba 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/elwynn_forest.cpp @@ -43,7 +43,7 @@ struct TRINITY_DLL_DECL npc_henze_faulkAI : public ScriptedAI void Reset() { lifeTimer = 120000; - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); m_creature->SetStandState(UNIT_STAND_STATE_DEAD); // lay down spellHit = false; } diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp index badea0761e4..c4590243571 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_doctor_theolen_krastinov.cpp @@ -24,30 +24,33 @@ EndScriptData */ #include "precompiled.h" #include "def_scholomance.h" -#define EMOTE_GENERIC_FRENZY_KILL -1000001 +enum +{ + EMOTE_GENERIC_FRENZY_KILL = -1000001, -#define SPELL_REND 18106 -#define SPELL_CLEAVE 15584 -#define SPELL_FRENZY 28371 + SPELL_REND = 16509, + SPELL_BACKHAND = 18103, + SPELL_FRENZY = 8269 +}; struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI { boss_theolenkrastinovAI(Creature *c) : ScriptedAI(c) {} - uint32 Rend_Timer; - uint32 Cleave_Timer; - uint32 Frenzy_Timer; + uint32 m_uiRend_Timer; + uint32 m_uiBackhand_Timer; + uint32 m_uiFrenzy_Timer; void Reset() { - Rend_Timer = 8000; - Cleave_Timer = 9000; - Frenzy_Timer =0; + m_uiRend_Timer = 8000; + m_uiBackhand_Timer = 9000; + m_uiFrenzy_Timer = 1000; } - void JustDied(Unit *killer) + void JustDied(Unit* pKiller) { - ScriptedInstance *pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; + ScriptedInstance* pInstance = (m_creature->GetInstanceData()) ? (m_creature->GetInstanceData()) : NULL; if (pInstance) { pInstance->SetData(DATA_DOCTORTHEOLENKRASTINOV_DEATH, 0); @@ -57,44 +60,47 @@ struct TRINITY_DLL_DECL boss_theolenkrastinovAI : public ScriptedAI } } - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; //Rend_Timer - if (Rend_Timer < diff) + if (m_uiRend_Timer < uiDiff) { - DoCast(m_creature->getVictim(),SPELL_REND); - Rend_Timer = 10000; - }else Rend_Timer -= diff; + DoCast(m_creature->getVictim(), SPELL_REND); + m_uiRend_Timer = 10000; + } + else + m_uiRend_Timer -= uiDiff; - //Cleave_Timer - if (Cleave_Timer < diff) + //Backhand_Timer + if (m_uiBackhand_Timer < uiDiff) { - DoCast(m_creature->getVictim(),SPELL_CLEAVE); - Cleave_Timer = 10000; - }else Cleave_Timer -= diff; + DoCast(m_creature->getVictim(), SPELL_BACKHAND); + m_uiBackhand_Timer = 10000; + } + else + m_uiBackhand_Timer -= uiDiff; //Frenzy_Timer if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 26) { - if (Frenzy_Timer < diff) + if (m_uiFrenzy_Timer < uiDiff) { DoCast(m_creature,SPELL_FRENZY); DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); - Frenzy_Timer = 8000; - }else Frenzy_Timer -= diff; + m_uiFrenzy_Timer = 120000; + } + else + m_uiFrenzy_Timer -= uiDiff; } DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_theolenkrastinov(Creature* pCreature) { return new boss_theolenkrastinovAI (pCreature); diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp index 9d343d26a7e..f12b5473abf 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scholomance/boss_vectus.cpp @@ -23,65 +23,72 @@ EndScriptData */ #include "precompiled.h" -#define EMOTE_GENERIC_FRENZY_KILL -1000001 +enum +{ + EMOTE_GENERIC_FRENZY_KILL = -1000001, -#define SPELL_FIRESHIELD 19626 -#define SPELL_BLASTWAVE 13021 -#define SPELL_FRENZY 28371 + SPELL_FLAMESTRIKE = 18399, + SPELL_BLAST_WAVE = 16046, + SPELL_FIRESHIELD = 19626, + SPELL_FRENZY = 8269 //28371, +}; struct TRINITY_DLL_DECL boss_vectusAI : public ScriptedAI { boss_vectusAI(Creature *c) : ScriptedAI(c) {} - uint32 FireShield_Timer; - uint32 BlastWave_Timer; - uint32 Frenzy_Timer; + uint32 m_uiFireShield_Timer; + uint32 m_uiBlastWave_Timer; + uint32 m_uiFrenzy_Timer; void Reset() { - FireShield_Timer = 2000; - BlastWave_Timer = 14000; - Frenzy_Timer = 0; - } - - void EnterCombat(Unit *who) - { + m_uiFireShield_Timer = 2000; + m_uiBlastWave_Timer = 14000; + m_uiFrenzy_Timer = 0; } - void UpdateAI(const uint32 diff) + void UpdateAI(const uint32 uiDiff) { if (!UpdateVictim()) return; //FireShield_Timer - if (FireShield_Timer < diff) + if (m_uiFireShield_Timer < uiDiff) { DoCast(m_creature, SPELL_FIRESHIELD); - FireShield_Timer = 90000; - }else FireShield_Timer -= diff; + m_uiFireShield_Timer = 90000; + } + else + m_uiFireShield_Timer -= uiDiff; //BlastWave_Timer - if (BlastWave_Timer < diff) + if (m_uiBlastWave_Timer < uiDiff) { - DoCast(m_creature->getVictim(),SPELL_BLASTWAVE); - BlastWave_Timer = 12000; - }else BlastWave_Timer -= diff; + DoCast(m_creature->getVictim(), SPELL_BLAST_WAVE); + m_uiBlastWave_Timer = 12000; + } + else + m_uiBlastWave_Timer -= uiDiff; //Frenzy_Timer if (m_creature->GetHealth()*100 / m_creature->GetMaxHealth() < 25) { - if (Frenzy_Timer < diff) + if (m_uiFrenzy_Timer < uiDiff) { - DoCast(m_creature,SPELL_FRENZY); + DoCast(m_creature, SPELL_FRENZY); DoScriptText(EMOTE_GENERIC_FRENZY_KILL, m_creature); - Frenzy_Timer = 24000; - }else Frenzy_Timer -= diff; + m_uiFrenzy_Timer = 24000; + } + else + m_uiFrenzy_Timer -= uiDiff; } DoMeleeAttackIfReady(); } }; + CreatureAI* GetAI_boss_vectus(Creature* pCreature) { return new boss_vectusAI (pCreature); diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp new file mode 100644 index 00000000000..4a9d944cb3e --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp @@ -0,0 +1,167 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Wetlands +SD%Complete: 80 +SDComment: Quest support: 1249 +SDCategory: Wetlands +EndScriptData */ + +/* ContentData +npc_mikhail +npc_tapoke_slim_jahn +EndContentData */ + +#include "precompiled.h" +#include "escort_ai.h" + +/*###### +## npc_tapoke_slim_jahn +######*/ + +enum +{ + QUEST_MISSING_DIPLO_PT11 = 1249, + FACTION_ENEMY = 168, + SPELL_STEALTH = 1785, + NPC_SLIMS_FRIEND = 4971, + NPC_TAPOKE_SLIM_JAHN = 4962 +}; + +struct TRINITY_DLL_DECL npc_tapoke_slim_jahnAI : public npc_escortAI +{ + npc_tapoke_slim_jahnAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + bool m_bFriendSummoned; + + void Reset() + { + if (!IsBeingEscorted) + m_bFriendSummoned = false; + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 2: + if (m_creature->HasStealthAura()) + m_creature->RemoveAurasDueToSpell(SPELL_AURA_MOD_STEALTH); + + SetRun(); + m_creature->setFaction(FACTION_ENEMY); + break; + } + } + + void Aggro(Unit* pWho) + { + Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID); + + if (IsBeingEscorted && !m_bFriendSummoned && pPlayer) + { + m_creature->SummonCreature(NPC_SLIMS_FRIEND, 0.0f, 0.0f, 0.0f, 3.10f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + m_creature->SummonCreature(NPC_SLIMS_FRIEND, 0.0f, 0.0f, 0.0f, 2.35f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + m_creature->SummonCreature(NPC_SLIMS_FRIEND, 0.0f, 0.0f, 0.0f, 2.02f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000); + m_bFriendSummoned = true; + } + } + + void JustSummoned(Creature* pSummoned) + { + if (Unit* pPlayer = Unit::GetPlayer(PlayerGUID)) + pSummoned->AI()->AttackStart(pPlayer); + } + + void AttackedBy(Unit* pAttacker) + { + if (m_creature->getVictim()) + return; + + if (m_creature->IsFriendlyTo(pAttacker)) + return; + + AttackStart(pAttacker); + } + + void DamageTaken(Unit* pDoneBy, uint32& uiDamage) + { + if (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*20) + { + if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + { + if (pPlayer->GetTypeId() == TYPEID_PLAYER) + CAST_PLR(pPlayer)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, m_creature); + + uiDamage = 0; + + me->RestoreFaction(); + m_creature->RemoveAllAuras(); + m_creature->DeleteThreatList(); + m_creature->CombatStop(true); + + SetRun(false); + } + } + } +}; + +CreatureAI* GetAI_npc_tapoke_slim_jahn(Creature* pCreature) +{ + return new npc_tapoke_slim_jahnAI(pCreature); +} + +/*###### +## npc_mikhail +######*/ + +bool QuestAccept_npc_mikhail(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_MISSING_DIPLO_PT11) + { + Creature* pSlim = pCreature->FindNearestCreature(NPC_TAPOKE_SLIM_JAHN, 25.0f); + + if (!pSlim) + return false; + + if (!pSlim->HasStealthAura()) + pSlim->CastSpell(pSlim, SPELL_STEALTH, true); + + if (npc_tapoke_slim_jahnAI* pEscortAI = CAST_AI(npc_tapoke_slim_jahnAI, pSlim->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); + } + return false; +} + +/*###### +## AddSC +######*/ + +void AddSC_wetlands() +{ + Script *newscript; + + newscript = new Script; + newscript->Name = "npc_tapoke_slim_jahn"; + newscript->GetAI = &GetAI_npc_tapoke_slim_jahn; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name = "npc_mikhail"; + newscript->pQuestAccept = &QuestAccept_npc_mikhail; + newscript->RegisterSelf(); +} diff --git a/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp b/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp index 58cb2a55b2f..40e849fbbe6 100644 --- a/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp +++ b/src/bindings/scripts/scripts/kalimdor/teldrassil.cpp @@ -26,6 +26,7 @@ npc_mist EndContentData */ #include "precompiled.h" +#include "follower_ai.h" /*#### # npc_mist @@ -37,31 +38,20 @@ enum EMOTE_AT_HOME = -1000412, QUEST_MIST = 938, NPC_ARYNIA = 3519, + FACTION_DARNASSUS = 79 }; -struct TRINITY_DLL_DECL npc_mistAI : public ScriptedAI +struct TRINITY_DLL_DECL npc_mistAI : public FollowerAI { - npc_mistAI(Creature *c) : ScriptedAI(c) - { - uiNpcFlags = c->GetUInt32Value(UNIT_NPC_FLAGS); - uiPlayerGUID = 0; - } - - uint64 uiPlayerGUID; - uint32 uiNpcFlags; - uint32 uiCheckPlayerTimer; - - void Reset() - { - uiCheckPlayerTimer = 2500; + npc_mistAI(Creature* pCreature) : FollowerAI(pCreature) { } - if (!uiPlayerGUID) - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, uiNpcFlags); - } + void Reset() { } void MoveInLineOfSight(Unit *pWho) { - if (pWho->GetEntry() == NPC_ARYNIA) + FollowerAI::MoveInLineOfSight(pWho); + + if (!m_creature->getVictim() && !IsFollowComplete() && pWho->GetEntry() == NPC_ARYNIA) { if (m_creature->IsWithinDistInMap(pWho, 10.0f)) { @@ -71,43 +61,11 @@ struct TRINITY_DLL_DECL npc_mistAI : public ScriptedAI } } - void EnterEvadeMode() - { - m_creature->RemoveAllAuras(); - m_creature->DeleteThreatList(); - m_creature->CombatStop(true); - m_creature->LoadCreaturesAddon(); - - if (m_creature->isAlive()) - { - if (Player* pPlayer = Unit::GetPlayer(uiPlayerGUID)) - m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, m_creature->GetFollowAngle()); - else - { - m_creature->GetMotionMaster()->MovementExpired(); - m_creature->GetMotionMaster()->MoveTargetedHome(); - } - } - - m_creature->SetLootRecipient(NULL); - - Reset(); - } - - void DoStart(uint64 uiPlayer) - { - uiPlayerGUID = uiPlayer; - m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - - if (Player* pPlayer = Unit::GetPlayer(uiPlayer)) - m_creature->GetMotionMaster()->MoveFollow(pPlayer, PET_FOLLOW_DIST, m_creature->GetFollowAngle()); - } - void DoComplete() { DoScriptText(EMOTE_AT_HOME, m_creature); - if (Player* pPlayer = Unit::GetPlayer(uiPlayerGUID)) + if (Player* pPlayer = GetLeaderForFollower()) { if (pPlayer->GetQuestStatus(QUEST_MIST) == QUEST_STATUS_INCOMPLETE) { @@ -115,55 +73,25 @@ struct TRINITY_DLL_DECL npc_mistAI : public ScriptedAI if (uiQuestLogSlot < MAX_QUEST_LOG_SIZE) { + //This will be wrong, need to check all group members (if any) for state before event if (pPlayer->GetQuestSlotState(uiQuestLogSlot) != QUEST_STATE_FAIL) pPlayer->AreaExploredOrEventHappens(QUEST_MIST); } } } - uiPlayerGUID = 0; - EnterEvadeMode(); - } - - void EnterCombat(Unit* who) { } - - void JustDied(Unit* pKiller) - { - if (Player* pPlayer = Unit::GetPlayer(uiPlayerGUID)) - pPlayer->FailQuest(QUEST_MIST); - - uiPlayerGUID = 0; - m_creature->GetMotionMaster()->MovementExpired(); + //The follow is over (and for later development to indicate a post event can now run) + SetFollowComplete(); } - void UpdateAI(const uint32 diff) + //call not needed here, no known abilities + /*void UpdateFollowerAI(const uint32 uiDiff) { - if (uiPlayerGUID) - { - if (!m_creature->isInCombat()) - { - if (uiCheckPlayerTimer < diff) - { - uiCheckPlayerTimer = 5000; - - Player* pPlayer = Unit::GetPlayer(uiPlayerGUID); - - if (pPlayer && !pPlayer->isAlive()) - { - uiPlayerGUID = 0; - EnterEvadeMode(); - } - } - else - uiCheckPlayerTimer -= diff; - } - } - if (!UpdateVictim()) return; DoMeleeAttackIfReady(); - } + }*/ }; CreatureAI* GetAI_npc_mist(Creature* pCreature) @@ -174,7 +102,10 @@ CreatureAI* GetAI_npc_mist(Creature* pCreature) bool QuestAccept_npc_mist(Player* pPlayer, Creature* pCreature, Quest const* pQuest) { if (pQuest->GetQuestId() == QUEST_MIST) - CAST_AI(npc_mistAI, (pCreature->AI()))->DoStart(pPlayer->GetGUID()); + { + if (npc_mistAI* pMistAI = CAST_AI(npc_mistAI, pCreature->AI())) + pMistAI->StartFollow(pPlayer, FACTION_DARNASSUS, pQuest); + } return true; } diff --git a/src/bindings/scripts/scripts/outland/nagrand.cpp b/src/bindings/scripts/scripts/outland/nagrand.cpp index 09435b91efe..865fc24f922 100644 --- a/src/bindings/scripts/scripts/outland/nagrand.cpp +++ b/src/bindings/scripts/scripts/outland/nagrand.cpp @@ -237,7 +237,7 @@ struct TRINITY_DLL_DECL mob_sunspring_villagerAI : public ScriptedAI void Reset() { - m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, 32); + m_creature->SetUInt32Value(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_DEAD); m_creature->SetStandState(UNIT_STAND_STATE_DEAD); } diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 85221f5cb7e..024fbe7b7a1 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -188,6 +188,7 @@ extern void AddSC_tirisfal_glades(); extern void AddSC_undercity(); extern void AddSC_western_plaguelands(); extern void AddSC_westfall(); +extern void AddSC_wetlands(); //kalimdor extern void AddSC_instance_blackfathom_deeps(); //Blackfathom Depths @@ -573,6 +574,7 @@ void AddScripts() AddSC_undercity(); AddSC_western_plaguelands(); AddSC_westfall(); + AddSC_wetlands(); //kalimdor AddSC_instance_blackfathom_deeps(); //Blackfathom Depths -- cgit v1.2.3 From 5d2d8d8074eb7f845627fcc97645c8d0081be2ba Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Sun, 16 Aug 2009 22:21:57 +0200 Subject: Merge [SD2] r1321 Add support for quest 863. Some cleanup in existing script. r1322 Correct database info for current supported Mangos revision (8273+) (Windows may use from 8190+) - skip r1323 Make escortAI function IsPlayerOrGroupInRange and move existing code to this. r1324 Fixed IsEncounterInProgress for Arcatraz, The Eye and Shadow Labyrinth r1325 Renamed aunchindoun to auchindoun. Fixed comment typos. --HG-- branch : trunk --- sql/FULL/world_script_waypoints.sql | 68 ++++ sql/FULL/world_scripts_full.sql | 1 + sql/updates/5097_world_scripts.sql | 69 ++++ src/bindings/scripts/CMakeLists.txt | 28 +- src/bindings/scripts/VC80/80ScriptDev2.vcproj | 28 +- src/bindings/scripts/VC90/90ScriptDev2.vcproj | 28 +- src/bindings/scripts/base/escort_ai.cpp | 52 +-- src/bindings/scripts/base/escort_ai.h | 2 + .../scripts/eastern_kingdoms/hinterlands.cpp | 168 ++++++-- .../auchenai_crypts/boss_exarch_maladaar.cpp | 358 +++++++++++++++++ .../boss_shirrak_the_dead_watcher.cpp | 212 ++++++++++ .../mana_tombs/boss_nexusprince_shaffar.cpp | 369 +++++++++++++++++ .../auchindoun/mana_tombs/boss_pandemonius.cpp | 138 +++++++ .../sethekk_halls/boss_darkweaver_syth.cpp | 438 +++++++++++++++++++++ .../sethekk_halls/boss_tailonking_ikiss.cpp | 221 +++++++++++ .../auchindoun/sethekk_halls/def_sethekk_halls.h | 14 + .../sethekk_halls/instance_sethekk_halls.cpp | 91 +++++ .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 217 ++++++++++ .../boss_blackheart_the_inciter.cpp | 177 +++++++++ .../shadow_labyrinth/boss_grandmaster_vorpil.cpp | 321 +++++++++++++++ .../auchindoun/shadow_labyrinth/boss_murmur.cpp | 207 ++++++++++ .../shadow_labyrinth/def_shadow_labyrinth.h | 15 + .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 227 +++++++++++ .../auchenai_crypts/boss_exarch_maladaar.cpp | 358 ----------------- .../boss_shirrak_the_dead_watcher.cpp | 212 ---------- .../mana_tombs/boss_nexusprince_shaffar.cpp | 369 ----------------- .../aunchindoun/mana_tombs/boss_pandemonius.cpp | 138 ------- .../sethekk_halls/boss_darkweaver_syth.cpp | 438 --------------------- .../sethekk_halls/boss_tailonking_ikiss.cpp | 221 ----------- .../aunchindoun/sethekk_halls/def_sethekk_halls.h | 14 - .../sethekk_halls/instance_sethekk_halls.cpp | 91 ----- .../shadow_labyrinth/boss_ambassador_hellmaw.cpp | 217 ---------- .../boss_blackheart_the_inciter.cpp | 177 --------- .../shadow_labyrinth/boss_grandmaster_vorpil.cpp | 321 --------------- .../aunchindoun/shadow_labyrinth/boss_murmur.cpp | 207 ---------- .../shadow_labyrinth/def_shadow_labyrinth.h | 15 - .../shadow_labyrinth/instance_shadow_labyrinth.cpp | 227 ----------- .../tempest_keep/arcatraz/instance_arcatraz.cpp | 3 +- src/bindings/scripts/system/ScriptLoader.cpp | 16 +- 39 files changed, 3367 insertions(+), 3106 deletions(-) create mode 100644 sql/updates/5097_world_scripts.sql create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h create mode 100644 src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h delete mode 100644 src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp (limited to 'src/bindings/scripts') diff --git a/sql/FULL/world_script_waypoints.sql b/sql/FULL/world_script_waypoints.sql index 9dfa805c30f..86aee4a71ac 100644 --- a/sql/FULL/world_script_waypoints.sql +++ b/sql/FULL/world_script_waypoints.sql @@ -13,6 +13,74 @@ CREATE TABLE script_waypoint ( PRIMARY KEY (entry, pointid) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints'; +DELETE FROM script_waypoint WHERE entry=7806; +INSERT INTO script_waypoint VALUES +(7806, 0, 495.404358, -3478.350830, 114.837, 0, ''), +(7806, 1, 492.704742, -3486.112549, 108.627, 0, ''), +(7806, 2, 487.249756, -3485.764404, 107.890, 0, ''), +(7806, 3, 476.851959, -3489.875977, 99.985, 0, ''), +(7806, 4, 467.212402, -3493.355469, 99.819, 0, ''), +(7806, 5, 460.017029, -3496.984375, 104.481, 0, ''), +(7806, 6, 439.619446, -3500.730225, 110.534, 0, ''), +(7806, 7, 428.326385, -3495.874756, 118.662, 0, ''), +(7806, 8, 424.664032, -3489.381592, 121.999, 0, ''), +(7806, 9, 424.137299, -3470.952637, 124.333, 0, ''), +(7806, 10, 421.791107, -3449.242676, 119.126, 0, ''), +(7806, 11, 404.247070, -3429.376953, 117.644, 0, ''), +(7806, 12, 335.465271, -3430.717773, 116.456, 0, ''), +(7806, 13, 317.160126, -3426.708984, 116.226, 0, ''), +(7806, 14, 331.180115, -3464.002197, 117.143, 0, ''), +(7806, 15, 336.393616, -3501.877441, 118.201, 0, ''), +(7806, 16, 337.251312, -3544.764648, 117.284, 0, ''), +(7806, 17, 337.748932, -3565.415527, 116.797, 0, ''), +(7806, 18, 336.010925, -3597.363037, 118.225, 0, ''), +(7806, 19, 324.619141, -3622.884033, 119.811, 0, ''), +(7806, 20, 308.027466, -3648.600098, 123.047, 0, ''), +(7806, 21, 276.325409, -3685.738525, 128.356, 0, ''), +(7806, 22, 239.981064, -3717.330811, 131.874, 0, ''), +(7806, 23, 224.950974, -3730.169678, 132.125, 0, ''), +(7806, 24, 198.707870, -3768.292725, 129.420, 0, ''), +(7806, 25, 183.758316, -3791.068848, 128.045, 0, ''), +(7806, 26, 178.110657, -3801.575439, 128.370, 3000, 'SAY_OOX_DANGER'), +(7806, 27, 162.215225, -3827.014160, 129.424, 0, ''), +(7806, 28, 141.664734, -3864.519287, 131.419, 0, ''), +(7806, 29, 135.301697, -3880.089111, 132.120, 0, ''), +(7806, 30, 122.461151, -3910.071533, 135.605, 0, ''), +(7806, 31, 103.376175, -3937.725098, 137.342, 0, ''), +(7806, 32, 81.414474, -3958.614258, 138.469, 0, ''), +(7806, 33, 55.378139, -3982.004639, 136.520, 0, ''), +(7806, 34, 13.983131, -4013.952881, 126.903, 0, ''), +(7806, 35, -21.658007, -4048.713623, 118.068, 0, ''), +(7806, 36, -52.443058, -4081.209717, 117.477, 0, ''), +(7806, 37, -102.710854, -4116.760742, 118.666, 0, ''), +(7806, 38, -92.996193, -4135.847168, 119.310, 0, ''), +(7806, 39, -86.391273, -4153.331055, 122.502, 0, ''), +(7806, 40, -85.746086, -4163.600586, 121.892, 0, ''), +(7806, 41, -90.544006, -4183.577637, 117.587, 0, ''), +(7806, 42, -110.223564, -4205.861328, 121.878, 0, ''), +(7806, 43, -115.257607, -4211.962402, 121.878, 3000, 'SAY_OOX_DANGER'), +(7806, 44, -128.594650, -4233.343750, 117.766, 0, ''), +(7806, 45, -135.358917, -4258.120117, 117.562, 0, ''), +(7806, 46, -156.832428, -4258.961914, 120.059, 0, ''), +(7806, 47, -167.119873, -4274.102539, 117.062, 0, ''), +(7806, 48, -176.291016, -4287.594727, 118.721, 0, ''), +(7806, 49, -196.992981, -4315.815430, 117.588, 0, ''), +(7806, 50, -209.329300, -4331.671387, 115.142, 0, ''), +(7806, 51, -232.292236, -4356.015625, 108.543, 0, ''), +(7806, 52, -232.159683, -4370.904297, 102.815, 0, ''), +(7806, 53, -210.271133, -4389.896973, 84.167, 0, ''), +(7806, 54, -187.940186, -4407.532715, 70.987, 0, ''), +(7806, 55, -181.353577, -4418.771973, 64.778, 0, ''), +(7806, 56, -170.529861, -4440.438965, 58.943, 0, ''), +(7806, 57, -141.428543, -4465.323242, 45.963, 0, ''), +(7806, 58, -120.993629, -4487.088379, 32.075, 0, ''), +(7806, 59, -104.134621, -4501.837402, 25.051, 0, ''), +(7806, 60, -84.154663, -4529.436523, 11.952, 0, ''), +(7806, 61, -88.698898, -4544.626465, 9.055, 0, ''), +(7806, 62, -100.603447, -4575.034180, 11.388, 0, ''), +(7806, 63, -106.908669, -4600.407715, 11.046, 0, ''), +(7806, 64, -106.831703, -4620.503418, 11.057, 3000, 'SAY_OOX_COMPLETE'); + DELETE FROM script_waypoint WHERE entry=4962; INSERT INTO script_waypoint VALUES (4962, 0, -3804.438965, -828.048035, 10.093068, 0, ''), diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index 88f51044f53..ae503cd4e47 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -555,6 +555,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_tracy_proudwell' WHERE `entry`= /* HILLSBRAD FOOTHILLS */ /* HINTERLANDS */ +UPDATE `creature_template` SET `ScriptName`='npc_00x09hl' WHERE `entry`=7806; UPDATE `creature_template` SET `ScriptName`='npc_rinji' WHERE `entry`=7780; /* ICECROWN */ diff --git a/sql/updates/5097_world_scripts.sql b/sql/updates/5097_world_scripts.sql new file mode 100644 index 00000000000..6a4f6f8cd61 --- /dev/null +++ b/sql/updates/5097_world_scripts.sql @@ -0,0 +1,69 @@ +UPDATE creature_template SET ScriptName='npc_00x09hl' WHERE entry=7806; + +DELETE FROM script_waypoint WHERE entry=7806; +INSERT INTO script_waypoint VALUES +(7806, 0, 495.404358, -3478.350830, 114.837, 0, ''), +(7806, 1, 492.704742, -3486.112549, 108.627, 0, ''), +(7806, 2, 487.249756, -3485.764404, 107.890, 0, ''), +(7806, 3, 476.851959, -3489.875977, 99.985, 0, ''), +(7806, 4, 467.212402, -3493.355469, 99.819, 0, ''), +(7806, 5, 460.017029, -3496.984375, 104.481, 0, ''), +(7806, 6, 439.619446, -3500.730225, 110.534, 0, ''), +(7806, 7, 428.326385, -3495.874756, 118.662, 0, ''), +(7806, 8, 424.664032, -3489.381592, 121.999, 0, ''), +(7806, 9, 424.137299, -3470.952637, 124.333, 0, ''), +(7806, 10, 421.791107, -3449.242676, 119.126, 0, ''), +(7806, 11, 404.247070, -3429.376953, 117.644, 0, ''), +(7806, 12, 335.465271, -3430.717773, 116.456, 0, ''), +(7806, 13, 317.160126, -3426.708984, 116.226, 0, ''), +(7806, 14, 331.180115, -3464.002197, 117.143, 0, ''), +(7806, 15, 336.393616, -3501.877441, 118.201, 0, ''), +(7806, 16, 337.251312, -3544.764648, 117.284, 0, ''), +(7806, 17, 337.748932, -3565.415527, 116.797, 0, ''), +(7806, 18, 336.010925, -3597.363037, 118.225, 0, ''), +(7806, 19, 324.619141, -3622.884033, 119.811, 0, ''), +(7806, 20, 308.027466, -3648.600098, 123.047, 0, ''), +(7806, 21, 276.325409, -3685.738525, 128.356, 0, ''), +(7806, 22, 239.981064, -3717.330811, 131.874, 0, ''), +(7806, 23, 224.950974, -3730.169678, 132.125, 0, ''), +(7806, 24, 198.707870, -3768.292725, 129.420, 0, ''), +(7806, 25, 183.758316, -3791.068848, 128.045, 0, ''), +(7806, 26, 178.110657, -3801.575439, 128.370, 3000, 'SAY_OOX_DANGER'), +(7806, 27, 162.215225, -3827.014160, 129.424, 0, ''), +(7806, 28, 141.664734, -3864.519287, 131.419, 0, ''), +(7806, 29, 135.301697, -3880.089111, 132.120, 0, ''), +(7806, 30, 122.461151, -3910.071533, 135.605, 0, ''), +(7806, 31, 103.376175, -3937.725098, 137.342, 0, ''), +(7806, 32, 81.414474, -3958.614258, 138.469, 0, ''), +(7806, 33, 55.378139, -3982.004639, 136.520, 0, ''), +(7806, 34, 13.983131, -4013.952881, 126.903, 0, ''), +(7806, 35, -21.658007, -4048.713623, 118.068, 0, ''), +(7806, 36, -52.443058, -4081.209717, 117.477, 0, ''), +(7806, 37, -102.710854, -4116.760742, 118.666, 0, ''), +(7806, 38, -92.996193, -4135.847168, 119.310, 0, ''), +(7806, 39, -86.391273, -4153.331055, 122.502, 0, ''), +(7806, 40, -85.746086, -4163.600586, 121.892, 0, ''), +(7806, 41, -90.544006, -4183.577637, 117.587, 0, ''), +(7806, 42, -110.223564, -4205.861328, 121.878, 0, ''), +(7806, 43, -115.257607, -4211.962402, 121.878, 3000, 'SAY_OOX_DANGER'), +(7806, 44, -128.594650, -4233.343750, 117.766, 0, ''), +(7806, 45, -135.358917, -4258.120117, 117.562, 0, ''), +(7806, 46, -156.832428, -4258.961914, 120.059, 0, ''), +(7806, 47, -167.119873, -4274.102539, 117.062, 0, ''), +(7806, 48, -176.291016, -4287.594727, 118.721, 0, ''), +(7806, 49, -196.992981, -4315.815430, 117.588, 0, ''), +(7806, 50, -209.329300, -4331.671387, 115.142, 0, ''), +(7806, 51, -232.292236, -4356.015625, 108.543, 0, ''), +(7806, 52, -232.159683, -4370.904297, 102.815, 0, ''), +(7806, 53, -210.271133, -4389.896973, 84.167, 0, ''), +(7806, 54, -187.940186, -4407.532715, 70.987, 0, ''), +(7806, 55, -181.353577, -4418.771973, 64.778, 0, ''), +(7806, 56, -170.529861, -4440.438965, 58.943, 0, ''), +(7806, 57, -141.428543, -4465.323242, 45.963, 0, ''), +(7806, 58, -120.993629, -4487.088379, 32.075, 0, ''), +(7806, 59, -104.134621, -4501.837402, 25.051, 0, ''), +(7806, 60, -84.154663, -4529.436523, 11.952, 0, ''), +(7806, 61, -88.698898, -4544.626465, 9.055, 0, ''), +(7806, 62, -100.603447, -4575.034180, 11.388, 0, ''), +(7806, 63, -106.908669, -4600.407715, 11.046, 0, ''), +(7806, 64, -106.831703, -4620.503418, 11.057, 3000, 'SAY_OOX_COMPLETE'); diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 285fb004c59..58b91096c18 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -405,20 +405,20 @@ SET(trinityscript_LIB_SRCS scripts/northrend/sholazar_basin.cpp scripts/northrend/wintergrasp.cpp scripts/northrend/zuldrak.cpp - scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp - scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp - scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp - scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp - scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp - scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp - scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h - scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp - scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp - scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h - scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp + scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp + scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp + scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp + scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp + scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp + scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp + scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h + scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp + scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp + scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h + scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp scripts/outland/black_temple/black_temple.cpp scripts/outland/black_temple/boss_bloodboil.cpp scripts/outland/black_temple/boss_illidan.cpp diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 635f9356908..4c98db9abb2 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -2172,11 +2172,11 @@ Name="Auchenai Crypts" > @@ -2184,11 +2184,11 @@ Name="Mana Tombs" > @@ -2196,19 +2196,19 @@ Name="Sethekk Halls" > @@ -2216,27 +2216,27 @@ Name="Shadow Labyrinth" > diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index c6f403470cb..ee30f353115 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -2169,11 +2169,11 @@ Name="Auchenai Crypts" > @@ -2181,11 +2181,11 @@ Name="Mana Tombs" > @@ -2193,19 +2193,19 @@ Name="Sethekk Halls" > @@ -2213,27 +2213,27 @@ Name="Shadow Labyrinth" > diff --git a/src/bindings/scripts/base/escort_ai.cpp b/src/bindings/scripts/base/escort_ai.cpp index 2c28aa6b9a6..37c8c31981b 100644 --- a/src/bindings/scripts/base/escort_ai.cpp +++ b/src/bindings/scripts/base/escort_ai.cpp @@ -130,6 +130,32 @@ void npc_escortAI::EnterEvadeMode() Reset(); } +bool npc_escortAI::IsPlayerOrGroupInRange() +{ + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + { + if (Group* pGroup = pPlayer->GetGroup()) + { + for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) + { + Player* pMember = pRef->getSource(); + + if (pMember && m_creature->IsWithinDistInMap(pMember, GetMaxPlayerDistance())) + { + return true; + break; + } + } + } + else + { + if (m_creature->IsWithinDistInMap(pPlayer, GetMaxPlayerDistance())) + return true; + } + } + return false; +} + void npc_escortAI::UpdateAI(const uint32 uiDiff) { //Waypoint Updating @@ -194,31 +220,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) { if (m_uiPlayerCheckTimer < uiDiff) { - bool bIsMaxRangeExceeded = true; - - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - { - if (Group* pGroup = pPlayer->GetGroup()) - { - for(GroupReference* pRef = pGroup->GetFirstMember(); pRef != NULL; pRef = pRef->next()) - { - Player* pMember = pRef->getSource(); - - if (pMember && m_creature->IsWithinDistInMap(pMember, GetMaxPlayerDistance())) - { - bIsMaxRangeExceeded = false; - break; - } - } - } - else - { - if (m_creature->IsWithinDistInMap(pPlayer, GetMaxPlayerDistance())) - bIsMaxRangeExceeded = false; - } - } - - if (DespawnAtFar && bIsMaxRangeExceeded) + if (DespawnAtFar && !IsPlayerOrGroupInRange()) { debug_log("TSCR: EscortAI failed because player/group was to far away or not found"); diff --git a/src/bindings/scripts/base/escort_ai.h b/src/bindings/scripts/base/escort_ai.h index 663e11d79f6..243e64d6d21 100644 --- a/src/bindings/scripts/base/escort_ai.h +++ b/src/bindings/scripts/base/escort_ai.h @@ -56,6 +56,8 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI // EscortAI functions void AddWaypoint(uint32 id, float x, float y, float z, uint32 WaitTimeMs = 0); + bool IsPlayerOrGroupInRange(); + void FillPointMovementListForCreature(); void Start(bool bIsActiveAttacker = true, bool bRun = false, uint64 uiPlayerGUID = 0, const Quest* pQuest = NULL, bool bInstantRespawn = false, bool bCanLoopPath = false); diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp index b02d3fb918b..6b661dad5ef 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp @@ -17,17 +17,125 @@ /* ScriptData SDName: Hinterlands SD%Complete: 100 -SDComment: Quest support: 2742 +SDComment: Quest support: 863, 2742 SDCategory: The Hinterlands EndScriptData */ /* ContentData +npc_00x09hl npc_rinji EndContentData */ #include "precompiled.h" #include "escort_ai.h" +/*###### +## npc_00x09hl +######*/ + +enum +{ + SAY_OOX_START = -1000416, + SAY_OOX_AGGRO = -1000417, + SAY_OOX_DANGER = -1000418, + SAY_OOX_COMPLETE = -1000419, + + QUEST_RESQUE_OOX_09 = 836, + + NPC_MARAUDING_OWL = 7808, + NPC_VILE_AMBUSHER = 7809, + + FACTION_ESCORTEE_A = 774, + FACTION_ESCORTEE_H = 775 +}; + +struct MANGOS_DLL_DECL npc_00x09hlAI : public npc_escortAI +{ + npc_00x09hlAI(Creature* pCreature) : npc_escortAI(pCreature) { } + + void Reset() { } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 26: + DoScriptText(SAY_OOX_DANGER, m_creature); + break; + case 43: + DoScriptText(SAY_OOX_DANGER, m_creature); + break; + case 64: + DoScriptText(SAY_OOX_COMPLETE, m_creature); + if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + pPlayer->GroupEventHappens(QUEST_RESQUE_OOX_09, m_creature); + break; + } + } + + void WaypointStart(uint32 uiPointId) + { + switch(uiPointId) + { + case 27: + for(int i = 0; i < 3; ++i) + { + float fX, fY, fZ; + m_creature->GetRandomPoint(147.927444, -3851.513428, 130.893, 7.0f, fX, fY, fZ); + + m_creature->SummonCreature(NPC_MARAUDING_OWL, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); + } + break; + case 44: + for(int i = 0; i < 3; ++i) + { + float fX, fY, fZ; + m_creature->GetRandomPoint(-141.151581, -4291.213867, 120.130, 7.0f, fX, fY, fZ); + + m_creature->SummonCreature(NPC_VILE_AMBUSHER, fX, fY, fZ, 0.0f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 25000); + } + break; + } + } + + void Aggro(Unit* pWho) + { + if (pWho->GetEntry() == NPC_MARAUDING_OWL || pWho->GetEntry() == NPC_VILE_AMBUSHER) + return; + + DoScriptText(SAY_OOX_AGGRO, m_creature); + } + + void JustSummoned(Creature* pSummoned) + { + pSummoned->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ()); + } +}; + +bool QuestAccept_npc_00x09hl(Player* pPlayer, Creature* pCreature, const Quest* pQuest) +{ + if (pQuest->GetQuestId() == QUEST_RESQUE_OOX_09) + { + pCreature->SetStandState(UNIT_STAND_STATE_STAND); + + if (pPlayer->GetTeam() == ALLIANCE) + pCreature->setFaction(FACTION_ESCORTEE_A); + else if (pPlayer->GetTeam() == HORDE) + pCreature->setFaction(FACTION_ESCORTEE_H); + + DoScriptText(SAY_OOX_START, pCreature, pPlayer); + + if (npc_00x09hlAI* pEscortAI = CAST_AI(npc_00x09hlAI, pCreature->AI())) + pEscortAI->Start(false, false, pPlayer->GetGUID(), pQuest); + } + return true; +} + +CreatureAI* GetAI_npc_00x09hl(Creature* pCreature) +{ + return new npc_00x09hlAI(pCreature); +} + /*###### ## npc_rinji ######*/ @@ -164,39 +272,45 @@ struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI } } - void UpdateAI(const uint32 uiDiff) + void UpdateEscortAI(const uint32 uiDiff) { - npc_escortAI::UpdateAI(uiDiff); - - if (IsBeingEscorted && m_uiPostEventCount && !m_creature->getVictim()) + //Check if we have a current target + if (!UpdateVictim()) { - if (m_uiPostEventTimer < uiDiff) + if (IsBeingEscorted && m_uiPostEventCount) { - m_uiPostEventTimer = 3000; - - if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + if (m_uiPostEventTimer < uiDiff) { - switch(m_uiPostEventCount) + m_uiPostEventTimer = 3000; + + if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + { + switch(m_uiPostEventCount) + { + case 1: + DoScriptText(SAY_RIN_PROGRESS_1, m_creature, pPlayer); + ++m_uiPostEventCount; + break; + case 2: + DoScriptText(SAY_RIN_PROGRESS_2, m_creature, pPlayer); + m_uiPostEventCount = 0; + break; + } + } + else { - case 1: - DoScriptText(SAY_RIN_PROGRESS_1, m_creature, pPlayer); - ++m_uiPostEventCount; - break; - case 2: - DoScriptText(SAY_RIN_PROGRESS_2, m_creature, pPlayer); - m_uiPostEventCount = 0; - break; + m_creature->ForcedDespawn(); + return; } } else - { - m_creature->ForcedDespawn(); - return; - } + m_uiPostEventTimer -= uiDiff; } - else - m_uiPostEventTimer -= uiDiff; + + return; } + + DoMeleeAttackIfReady(); } }; @@ -222,6 +336,12 @@ void AddSC_hinterlands() { Script* newscript; + newscript = new Script; + newscript->Name = "npc_00x09hl"; + newscript->GetAI = &GetAI_npc_00x09hl; + newscript->pQuestAccept = &QuestAccept_npc_00x09hl; + newscript->RegisterSelf(); + newscript = new Script; newscript->Name = "npc_rinji"; newscript->GetAI = &GetAI_npc_rinji; diff --git a/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp new file mode 100644 index 00000000000..414804a6576 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_exarch_maladaar.cpp @@ -0,0 +1,358 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Exarch_Maladaar +SD%Complete: 95 +SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player. +SDCategory: Auchindoun, Auchenai Crypts +EndScriptData */ + +/* ContentData +mob_stolen_soul +boss_exarch_maladaar +mob_avatar_of_martyred +EndContentData */ + +#include "precompiled.h" + +#define SPELL_MOONFIRE 37328 +#define SPELL_FIREBALL 37329 +#define SPELL_MIND_FLAY 37330 +#define SPELL_HEMORRHAGE 37331 +#define SPELL_FROSTSHOCK 37332 +#define SPELL_CURSE_OF_AGONY 37334 +#define SPELL_MORTAL_STRIKE 37335 +#define SPELL_FREEZING_TRAP 37368 +#define SPELL_HAMMER_OF_JUSTICE 37369 + +struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI +{ + mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {} + + uint8 myClass; + uint32 Class_Timer; + + void Reset() + { + Class_Timer = 1000; + } + + void EnterCombat(Unit *who) + { } + + void SetMyClass(uint8 myclass) + { + myClass = myclass; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Class_Timer < diff) + { + switch (myClass) + { + case CLASS_WARRIOR: + DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); + Class_Timer = 6000; + break; + case CLASS_PALADIN: + DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); + Class_Timer = 6000; + break; + case CLASS_HUNTER: + DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP); + Class_Timer = 20000; + break; + case CLASS_ROGUE: + DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE); + Class_Timer = 10000; + break; + case CLASS_PRIEST: + DoCast(m_creature->getVictim(), SPELL_MIND_FLAY); + Class_Timer = 5000; + break; + case CLASS_SHAMAN: + DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK); + Class_Timer = 8000; + break; + case CLASS_MAGE: + DoCast(m_creature->getVictim(), SPELL_FIREBALL); + Class_Timer = 5000; + break; + case CLASS_WARLOCK: + DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY); + Class_Timer = 20000; + break; + case CLASS_DRUID: + DoCast(m_creature->getVictim(), SPELL_MOONFIRE); + Class_Timer = 10000; + break; + } + } else Class_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature) +{ + return new mob_stolen_soulAI (pCreature); +} + +#define SAY_INTRO -1558000 +#define SAY_SUMMON -1558001 + +#define SAY_AGGRO_1 -1558002 +#define SAY_AGGRO_2 -1558003 +#define SAY_AGGRO_3 -1558004 + +#define SAY_ROAR -1558005 +#define SAY_SOUL_CLEAVE -1558006 + +#define SAY_SLAY_1 -1558007 +#define SAY_SLAY_2 -1558008 + +#define SAY_DEATH -1558009 + +#define SPELL_RIBBON_OF_SOULS 32422 +#define SPELL_SOUL_SCREAM 32421 + +#define SPELL_STOLEN_SOUL 32346 +#define SPELL_STOLEN_SOUL_VISUAL 32395 + +#define SPELL_SUMMON_AVATAR 32424 + +#define ENTRY_STOLEN_SOUL 18441 + +struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI +{ + boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) + { + HasTaunted = false; + } + + uint32 soulmodel; + uint64 soulholder; + uint8 soulclass; + + uint32 Fear_timer; + uint32 Ribbon_of_Souls_timer; + uint32 StolenSoul_Timer; + + bool HasTaunted; + bool Avatar_summoned; + + void Reset() + { + soulmodel = 0; + soulholder = 0; + soulclass = 0; + + Fear_timer = 15000 + rand()% 5000; + Ribbon_of_Souls_timer = 5000; + StolenSoul_Timer = 25000 + rand()% 10000; + + Avatar_summoned = false; + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) + { + DoScriptText(SAY_INTRO, m_creature); + HasTaunted = true; + } + + ScriptedAI::MoveInLineOfSight(who); + } + + + void EnterCombat(Unit *who) + { + switch (rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == ENTRY_STOLEN_SOUL) + { + //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell. + summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); + summoned->SetDisplayId(soulmodel); + summoned->setFaction(m_creature->getFaction()); + + if (Unit *target = Unit::GetUnit(*m_creature,soulholder)) + { + + CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); + summoned->AI()->AttackStart(target); + } + } + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch (rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + //When Exarch Maladar is defeated D'ore appear. + m_creature->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (!Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25)) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(SAY_SUMMON, m_creature); + + DoCast(m_creature, SPELL_SUMMON_AVATAR); + Avatar_summoned = true; + StolenSoul_Timer = 15000 + rand()% 15000; + } + + if (StolenSoul_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (target->GetTypeId() == TYPEID_PLAYER) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + uint32 i = urand(1,2); + if (i == 1) + DoScriptText(SAY_ROAR, m_creature); + else + DoScriptText(SAY_SOUL_CLEAVE, m_creature); + + soulmodel = target->GetDisplayId(); + soulholder = target->GetGUID(); + soulclass = target->getClass(); + + DoCast(target,SPELL_STOLEN_SOUL); + m_creature->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); + + StolenSoul_Timer = 20000 + rand()% 10000; + } else StolenSoul_Timer = 1000; + } + }else StolenSoul_Timer -= diff; + + if (Ribbon_of_Souls_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_RIBBON_OF_SOULS); + + Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000); + }else Ribbon_of_Souls_timer -= diff; + + if (Fear_timer < diff) + { + DoCast(m_creature,SPELL_SOUL_SCREAM); + Fear_timer = 15000 + rand()% 15000; + }else Fear_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) +{ + return new boss_exarch_maladaarAI (pCreature); +} + +#define SPELL_AV_MORTAL_STRIKE 16856 +#define SPELL_AV_SUNDER_ARMOR 16145 + +struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI +{ + mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {} + + uint32 Mortal_Strike_timer; + + void Reset() + { + Mortal_Strike_timer = 10000; + } + + void EnterCombat(Unit *who) + { + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Mortal_Strike_timer < diff) + { + DoCast(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE); + Mortal_Strike_timer = 10000 + rand()%20 * 1000; + } else Mortal_Strike_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) +{ + return new mob_avatar_of_martyredAI (pCreature); +} + +void AddSC_boss_exarch_maladaar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_exarch_maladaar"; + newscript->GetAI = &GetAI_boss_exarch_maladaar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_avatar_of_martyred"; + newscript->GetAI = &GetAI_mob_avatar_of_martyred; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_stolen_soul"; + newscript->GetAI = &GetAI_mob_stolen_soul; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp new file mode 100644 index 00000000000..4dfdd407731 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp @@ -0,0 +1,212 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +Name: Boss_Shirrak_the_dead_watcher +%Complete: 80 +Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented +Category: Auchindoun, Auchenai Crypts +EndScriptData */ + +#include "precompiled.h" + +#define SPELL_INHIBITMAGIC 32264 +#define SPELL_ATTRACTMAGIC 32265 +#define N_SPELL_CARNIVOROUSBITE 36383 +#define H_SPELL_CARNIVOROUSBITE 39382 +#define SPELL_CARNIVOROUSBITE (HeroicMode?H_SPELL_CARNIVOROUSBITE:N_SPELL_CARNIVOROUSBITE) + +#define ENTRY_FOCUS_FIRE 18374 + +#define N_SPELL_FIERY_BLAST 32302 +#define H_SPELL_FIERY_BLAST 38382 +#define SPELL_FIERY_BLAST (HeroicMode?H_SPELL_FIERY_BLAST:N_SPELL_FIERY_BLAST) +#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual + +struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI +{ + boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 Inhibitmagic_Timer; + uint32 Attractmagic_Timer; + uint32 Carnivorousbite_Timer; + uint32 FocusFire_Timer; + bool HeroicMode; + Unit *focusedTarget; + + void Reset() + { + Inhibitmagic_Timer = 0; + Attractmagic_Timer = 28000; + Carnivorousbite_Timer = 10000; + FocusFire_Timer = 17000; + focusedTarget = NULL; + } + + void EnterCombat(Unit *who) + { } + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE) + { + summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false); + summoned->setFaction(m_creature->getFaction()); + summoned->SetLevel(m_creature->getLevel()); + summoned->addUnitState(UNIT_STAT_ROOT); + + if (focusedTarget) + summoned->AI()->AttackStart(focusedTarget); + } + } + + void UpdateAI(const uint32 diff) + { + //Inhibitmagic_Timer + if (Inhibitmagic_Timer < diff) + { + float dist; + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(m_creature, 45))) + { + i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC); + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 35) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 25) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + if (dist < 15) + m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); + } + Inhibitmagic_Timer = 3000+(rand()%1000); + }else Inhibitmagic_Timer -= diff; + + //Return since we have no target + if (!UpdateVictim()) + return; + + //Attractmagic_Timer + if (Attractmagic_Timer < diff) + { + DoCast(m_creature,SPELL_ATTRACTMAGIC); + Attractmagic_Timer = 30000; + Carnivorousbite_Timer = 1500; + }else Attractmagic_Timer -= diff; + + //Carnivorousbite_Timer + if (Carnivorousbite_Timer < diff) + { + DoCast(m_creature,SPELL_CARNIVOROUSBITE); + Carnivorousbite_Timer = 10000; + }else Carnivorousbite_Timer -= diff; + + //FocusFire_Timer + if (FocusFire_Timer < diff) + { + // Summon Focus Fire & Emote + Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); + if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + { + focusedTarget = target; + m_creature->SummonCreature(ENTRY_FOCUS_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500); + + // TODO: Find better way to handle emote + // Emote + std::string *emote = new std::string("focuses on "); + emote->append(target->GetName()); + emote->append("!"); + const char* text = emote->c_str(); + m_creature->MonsterTextEmote(text, 0, true); + delete emote; + } + FocusFire_Timer = 15000+(rand()%5000); + }else FocusFire_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature) +{ + return new boss_shirrak_the_dead_watcherAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI +{ + mob_focus_fireAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 FieryBlast_Timer; + bool fiery1, fiery2; + + void Reset() + { + FieryBlast_Timer = 3000+(rand()%1000); + fiery1 = fiery2 = true; + } + + void EnterCombat(Unit *who) + { } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + //FieryBlast_Timer + if (fiery2 && FieryBlast_Timer < diff) + { + DoCast(m_creature,SPELL_FIERY_BLAST); + + if (fiery1) fiery1 = false; + else if (fiery2) fiery2 = false; + + FieryBlast_Timer = 1000; + }else FieryBlast_Timer -= diff; + + //DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_focus_fire(Creature* pCreature) +{ + return new mob_focus_fireAI (pCreature); +} + +void AddSC_boss_shirrak_the_dead_watcher() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_shirrak_the_dead_watcher"; + newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_focus_fire"; + newscript->GetAI = &GetAI_mob_focus_fire; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp new file mode 100644 index 00000000000..dcaaefee8c2 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_nexusprince_shaffar.cpp @@ -0,0 +1,369 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_NexusPrince_Shaffar +SD%Complete: 80 +SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro. +SDCategory: Auchindoun, Mana Tombs +EndScriptData */ + +/* ContentData +boss_nexusprince_shaffar +mob_ethereal_beacon +EndContentData */ + +#include "precompiled.h" + +enum +{ + SAY_INTRO = -1557000, + SAY_AGGRO_1 = -1557001, + SAY_AGGRO_2 = -1557002, + SAY_AGGRO_3 = -1557003, + SAY_SLAY_1 = -1557004, + SAY_SLAY_2 = -1557005, + SAY_SUMMON = -1557006, + SAY_DEAD = -1557007, + + SPELL_BLINK = 34605, + SPELL_FROSTBOLT = 32364, + SPELL_FIREBALL = 32363, + SPELL_FROSTNOVA = 32365, + + SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON + SPELL_ETHEREAL_BEACON_VISUAL = 32368, + + NPC_BEACON = 18431, + NPC_SHAFFAR = 18344, + + NR_INITIAL_BEACONS = 3 +}; + +struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI +{ + boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; } + + uint32 Blink_Timer; + uint32 Beacon_Timer; + uint32 FireBall_Timer; + uint32 Frostbolt_Timer; + uint32 FrostNova_Timer; + + SummonList summons; + + bool HasTaunted; + bool CanBlink; + + void Reset() + { + Blink_Timer = 1500; + Beacon_Timer = 10000; + FireBall_Timer = 8000; + Frostbolt_Timer = 4000; + FrostNova_Timer = 15000; + + CanBlink = false; + + float dist = 8.0f; + float posX, posY, posZ, angle; + m_creature->GetHomePosition(posX, posY, posZ, angle); + + m_creature->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + m_creature->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + m_creature->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); + } + + void EnterEvadeMode() + { + summons.DespawnAll(); + ScriptedAI::EnterEvadeMode(); + } + + void MoveInLineOfSight(Unit *who) + { + if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 100.0f)) + { + DoScriptText(SAY_INTRO, m_creature); + HasTaunted = true; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + DoZoneInCombat(); + summons.DoZoneInCombat(); + } + + void JustSummoned(Creature *summoned) + { + if (summoned->GetEntry() == NPC_BEACON) + { + summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); + + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + summons.Summon(summoned); + } + + void SummonedCreatureDespawn(Creature *summon) + { + summons.Despawn(summon); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEAD, m_creature); + summons.DespawnAll(); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (FrostNova_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoCast(m_creature,SPELL_FROSTNOVA); + FrostNova_Timer = 17500 + rand()%7500; + CanBlink = true; + }else FrostNova_Timer -= diff; + + if (Frostbolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); + Frostbolt_Timer = 4500 + rand()%1500; + }else Frostbolt_Timer -= diff; + + if (FireBall_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_FIREBALL); + FireBall_Timer = 4500 + rand()%1500; + }else FireBall_Timer -= diff; + + if (CanBlink) + { + if (Blink_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + //expire movement, will prevent from running right back to victim after cast + //(but should MoveChase be used again at a certain time or should he not move?) + if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) + m_creature->GetMotionMaster()->MovementExpired(); + + DoCast(m_creature,SPELL_BLINK); + Blink_Timer = 1000 + rand()%1500; + CanBlink = false; + }else Blink_Timer -= diff; + } + + if (Beacon_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + if (!urand(0,3)) + DoScriptText(SAY_SUMMON, m_creature); + + DoCast(m_creature,SPELL_ETHEREAL_BEACON, true); + + Beacon_Timer = 10000; + }else Beacon_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) +{ + return new boss_nexusprince_shaffarAI (pCreature); +} + +enum +{ + SPELL_ARCANE_BOLT = 15254, + SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430 +}; + +struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI +{ + mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 Apprentice_Timer; + uint32 ArcaneBolt_Timer; + uint32 Check_Timer; + + void KillSelf() + { + m_creature->Kill(m_creature); + } + + void Reset() + { + Apprentice_Timer = (HeroicMode ? 10000 : 20000); + ArcaneBolt_Timer = 1000; + Check_Timer = 1000; + } + + void EnterCombat(Unit *who) + { + // Send Shaffar to fight + Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); + if (!Shaffar || Shaffar->isDead()) + { + KillSelf(); + return; + } + if (!Shaffar->isInCombat()) + Shaffar->AI()->AttackStart(who); + } + + void JustSummoned(Creature *summoned) + { + summoned->AI()->AttackStart(m_creature->getVictim()); + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Check_Timer < diff) + { + Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); + if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) + { + KillSelf(); + return; + } + Check_Timer = 1000; + }else Check_Timer -= diff; + + if (ArcaneBolt_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT); + ArcaneBolt_Timer = 2000 + rand()%2500; + }else ArcaneBolt_Timer -= diff; + + if (Apprentice_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true); + m_creature->ForcedDespawn(); + return; + }else Apprentice_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) +{ + return new mob_ethereal_beaconAI (pCreature); +} + +enum +{ + SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, + SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 +}; + +struct TRINITY_DLL_DECL mob_ethereal_apprenticeAI : public ScriptedAI +{ + mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {} + + uint32 Cast_Timer; + + bool isFireboltTurn; + + void Reset() + { + Cast_Timer = 3000; + isFireboltTurn = true; + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Cast_Timer < diff) + { + if (isFireboltTurn) + { + m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true); + isFireboltTurn = false; + }else{ + m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true); + isFireboltTurn = true; + } + Cast_Timer = 3000; + }else Cast_Timer -= diff; + } +}; + +CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature) +{ + return new mob_ethereal_apprenticeAI (pCreature); +} + +void AddSC_boss_nexusprince_shaffar() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="boss_nexusprince_shaffar"; + newscript->GetAI = &GetAI_boss_nexusprince_shaffar; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ethereal_beacon"; + newscript->GetAI = &GetAI_mob_ethereal_beacon; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_ethereal_apprentice"; + newscript->GetAI = &GetAI_mob_ethereal_apprentice; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.cpp new file mode 100644 index 00000000000..77e1c535340 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/mana_tombs/boss_pandemonius.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_Pandemonius +SD%Complete: 75 +SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged. +SDCategory: Auchindoun, Mana Tombs +EndScriptData */ + +#include "precompiled.h" + +#define SAY_AGGRO_1 -1557008 +#define SAY_AGGRO_2 -1557009 +#define SAY_AGGRO_3 -1557010 + +#define SAY_KILL_1 -1557011 +#define SAY_KILL_2 -1557012 + +#define SAY_DEATH -1557013 + +#define EMOTE_DARK_SHELL -1557014 + +#define SPELL_VOID_BLAST 32325 +#define H_SPELL_VOID_BLAST 38760 +#define SPELL_DARK_SHELL 32358 +#define H_SPELL_DARK_SHELL 38759 + +struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI +{ + boss_pandemoniusAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + uint32 VoidBlast_Timer; + uint32 DarkShell_Timer; + uint32 VoidBlast_Counter; + + void Reset() + { + VoidBlast_Timer = 8000+rand()%15000; + DarkShell_Timer = 20000; + VoidBlast_Counter = 0; + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_KILL_1, m_creature); break; + case 1: DoScriptText(SAY_KILL_2, m_creature); break; + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (VoidBlast_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + { + DoCast(target,HeroicMode ? H_SPELL_VOID_BLAST : SPELL_VOID_BLAST); + VoidBlast_Timer = 500; + ++VoidBlast_Counter; + } + + if (VoidBlast_Counter == 5) + { + VoidBlast_Timer = 15000+rand()%10000; + VoidBlast_Counter = 0; + } + }else VoidBlast_Timer -= diff; + + if (!VoidBlast_Counter) + { + if (DarkShell_Timer < diff) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(true); + + DoScriptText(EMOTE_DARK_SHELL, m_creature); + + DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL); + DarkShell_Timer = 20000; + }else DarkShell_Timer -= diff; + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) +{ + return new boss_pandemoniusAI (pCreature); +} + +void AddSC_boss_pandemonius() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_pandemonius"; + newscript->GetAI = &GetAI_boss_pandemonius; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp new file mode 100644 index 00000000000..00e43fa257d --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_darkweaver_syth.cpp @@ -0,0 +1,438 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Darkweaver_Syth +SD%Complete: 85 +SDComment: Shock spells/times need more work. Heroic partly implemented. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" + +#define SAY_SUMMON -1556000 + +#define SAY_AGGRO_1 -1556001 +#define SAY_AGGRO_2 -1556002 +#define SAY_AGGRO_3 -1556003 + +#define SAY_SLAY_1 -1556004 +#define SAY_SLAY_2 -1556005 + +#define SAY_DEATH -1556006 + +#define SPELL_FROST_SHOCK 21401 //37865 +#define SPELL_FLAME_SHOCK 34354 +#define SPELL_SHADOW_SHOCK 30138 +#define SPELL_ARCANE_SHOCK 37132 + +#define SPELL_CHAIN_LIGHTNING 15659 //15305 + +#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203 +#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205 +#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204 +#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206 + +#define SPELL_FLAME_BUFFET (HeroicMode?38141:33526) +#define SPELL_ARCANE_BUFFET (HeroicMode?38138:33527) +#define SPELL_FROST_BUFFET (HeroicMode?38142:33528) +#define SPELL_SHADOW_BUFFET (HeroicMode?38143:33529) + +struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI +{ + boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 flameshock_timer; + uint32 arcaneshock_timer; + uint32 frostshock_timer; + uint32 shadowshock_timer; + uint32 chainlightning_timer; + + bool summon90; + bool summon50; + bool summon10; + bool HeroicMode; + + void Reset() + { + flameshock_timer = 2000; + arcaneshock_timer = 4000; + frostshock_timer = 6000; + shadowshock_timer = 8000; + chainlightning_timer = 15000; + + summon90 = false; + summon50 = false; + summon10 = false; + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + } + + void KilledUnit(Unit* victim) + { + if (rand()%2) + return; + + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void JustSummoned(Creature *summoned) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + summoned->AI()->AttackStart(target); + } + + void SythSummoning() + { + DoScriptText(SAY_SUMMON, m_creature); + + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + DoCast(m_creature,SPELL_SUMMON_SYTH_ARCANE,true); //front + DoCast(m_creature,SPELL_SUMMON_SYTH_FIRE,true); //back + DoCast(m_creature,SPELL_SUMMON_SYTH_FROST,true); //left + DoCast(m_creature,SPELL_SUMMON_SYTH_SHADOW,true); //right + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90) + { + SythSummoning(); + summon90 = true; + } + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50) + { + SythSummoning(); + summon50 = true; + } + + if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10) + { + SythSummoning(); + summon10 = true; + } + + if (flameshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_SHOCK); + + flameshock_timer = 10000 + rand()%5000; + } else flameshock_timer -= diff; + + if (arcaneshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_SHOCK); + + arcaneshock_timer = 10000 + rand()%5000; + } else arcaneshock_timer -= diff; + + if (frostshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_SHOCK); + + frostshock_timer = 10000 + rand()%5000; + } else frostshock_timer -= diff; + + if (shadowshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_SHOCK); + + shadowshock_timer = 10000 + rand()%5000; + } else shadowshock_timer -= diff; + + if (chainlightning_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_CHAIN_LIGHTNING); + + chainlightning_timer = 25000; + } else chainlightning_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature) +{ + return new boss_darkweaver_sythAI (pCreature); +} + +/* ELEMENTALS */ + +struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI +{ + mob_syth_fireAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 flameshock_timer; + uint32 flamebuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); + flameshock_timer = 2500; + flamebuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (flameshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_SHOCK); + + flameshock_timer = 5000; + }else flameshock_timer -= diff; + + if (flamebuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FLAME_BUFFET); + + flamebuffet_timer = 5000; + }else flamebuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_fire(Creature* pCreature) +{ + return new mob_syth_fireAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI +{ + mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 arcaneshock_timer; + uint32 arcanebuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); + arcaneshock_timer = 2500; + arcanebuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (arcaneshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_SHOCK); + + arcaneshock_timer = 5000; + }else arcaneshock_timer -= diff; + + if (arcanebuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_ARCANE_BUFFET); + + arcanebuffet_timer = 5000; + }else arcanebuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature) +{ + return new mob_syth_arcaneAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI +{ + mob_syth_frostAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 frostshock_timer; + uint32 frostbuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); + frostshock_timer = 2500; + frostbuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (frostshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_SHOCK); + + frostshock_timer = 5000; + }else frostshock_timer -= diff; + + if (frostbuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_FROST_BUFFET); + + frostbuffet_timer = 5000; + }else frostbuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_frost(Creature* pCreature) +{ + return new mob_syth_frostAI (pCreature); +} + +struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI +{ + mob_syth_shadowAI(Creature *c) : ScriptedAI(c) + + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 shadowshock_timer; + uint32 shadowbuffet_timer; + bool HeroicMode; + + void Reset() + { + m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); + shadowshock_timer = 2500; + shadowbuffet_timer = 5000; + } + + void EnterCombat(Unit *who) { } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (shadowshock_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_SHOCK); + + shadowshock_timer = 5000; + }else shadowshock_timer -= diff; + + if (shadowbuffet_timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + DoCast(target,SPELL_SHADOW_BUFFET); + + shadowbuffet_timer = 5000; + }else shadowbuffet_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature) +{ + return new mob_syth_shadowAI (pCreature); +} + +void AddSC_boss_darkweaver_syth() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_darkweaver_syth"; + newscript->GetAI = &GetAI_boss_darkweaver_syth; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_fire"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_arcane"; + newscript->GetAI = &GetAI_mob_syth_arcane; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_frost"; + newscript->GetAI = &GetAI_mob_syth_frost; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_syth_shadow"; + newscript->GetAI = &GetAI_mob_syth_shadow; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp new file mode 100644 index 00000000000..7830fc10645 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/boss_tailonking_ikiss.cpp @@ -0,0 +1,221 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Talon_King_Ikiss +SD%Complete: 80 +SDComment: Heroic supported. Some details missing, but most are spell related. +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" +#include "def_sethekk_halls.h" + +#define SAY_INTRO -1556007 + +#define SAY_AGGRO_1 -1556008 +#define SAY_AGGRO_2 -1556009 +#define SAY_AGGRO_3 -1556010 + +#define SAY_SLAY_1 -1556011 +#define SAY_SLAY_2 -1556012 +#define SAY_DEATH -1556013 +#define EMOTE_ARCANE_EXP -1556015 + +#define SPELL_BLINK 38194 +#define SPELL_BLINK_TELEPORT 38203 +#define SPELL_MANA_SHIELD 38151 +#define SPELL_ARCANE_BUBBLE 9438 +#define H_SPELL_SLOW 35032 + +#define SPELL_POLYMORPH 38245 +#define H_SPELL_POLYMORPH 43309 + +#define SPELL_ARCANE_VOLLEY 35059 +#define H_SPELL_ARCANE_VOLLEY 40424 + +#define SPELL_ARCANE_EXPLOSION 38197 +#define H_SPELL_ARCANE_EXPLOSION 40425 + +struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI +{ + boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance* pInstance; + + bool HeroicMode; + + uint32 ArcaneVolley_Timer; + uint32 Sheep_Timer; + uint32 Blink_Timer; + uint32 Slow_Timer; + + bool ManaShield; + bool Blink; + bool Intro; + + void Reset() + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + + ArcaneVolley_Timer = 5000; + Sheep_Timer = 8000; + Blink_Timer = 35000; + Slow_Timer = 15000+rand()%15000; + Blink = false; + Intro = false; + ManaShield = false; + } + + void MoveInLineOfSight(Unit *who) + { + if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) + { + if (!Intro && m_creature->IsWithinDistInMap(who, 100)) + { + Intro = true; + DoScriptText(SAY_INTRO, m_creature); + } + + if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) + return; + + float attackRadius = m_creature->GetAttackDistance(who); + if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) + { + //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + AttackStart(who); + } + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; + } + } + + void JustDied(Unit* Killer) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_IKISSDOOREVENT, DONE); + } + + void KilledUnit(Unit* victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY_1, m_creature); break; + case 1: DoScriptText(SAY_SLAY_2, m_creature); break; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (Blink) + { + DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION); + m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true); + Blink = false; + } + + if (ArcaneVolley_Timer < diff) + { + DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY); + ArcaneVolley_Timer = 7000+rand()%5000; + }else ArcaneVolley_Timer -= diff; + + if (Sheep_Timer < diff) + { + //second top aggro target in normal, random target in heroic correct? + Unit *target = NULL; + target = HeroicMode ? SelectUnit(SELECT_TARGET_RANDOM,0) : SelectUnit(SELECT_TARGET_TOPAGGRO,1); + if (target) + DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH); + Sheep_Timer = 15000+rand()%2500; + }else Sheep_Timer -= diff; + + //may not be correct time to cast + if (!ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20)) + { + DoCast(m_creature,SPELL_MANA_SHIELD); + ManaShield = true; + } + + if (HeroicMode) + { + if (Slow_Timer < diff) + { + DoCast(m_creature,H_SPELL_SLOW); + Slow_Timer = 15000+rand()%25000; + }else Slow_Timer -= diff; + } + + if (Blink_Timer < diff) + { + DoScriptText(EMOTE_ARCANE_EXP, m_creature); + + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) + { + if (m_creature->IsNonMeleeSpellCasted(false)) + m_creature->InterruptNonMeleeSpells(false); + + //Spell doesn't work, but we use for visual effect at least + DoCast(target,SPELL_BLINK); + + float X = target->GetPositionX(); + float Y = target->GetPositionY(); + float Z = target->GetPositionZ(); + + DoTeleportTo(X,Y,Z); + + DoCast(target,SPELL_BLINK_TELEPORT); + Blink = true; + } + Blink_Timer = 35000+rand()%5000; + }else Blink_Timer -= diff; + + if (!Blink) + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature) +{ + return new boss_talon_king_ikissAI (pCreature); +} + +void AddSC_boss_talon_king_ikiss() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_talon_king_ikiss"; + newscript->GetAI = &GetAI_boss_talon_king_ikiss; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h new file mode 100644 index 00000000000..6156f354d84 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/def_sethekk_halls.h @@ -0,0 +1,14 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SETHEKK_HALLS_H +#define DEF_SETHEKK_HALLS_H + +enum +{ + DATA_IKISSDOOREVENT = 1, + TYPE_ANZU_ENCOUNTER = 2, +}; +#endif + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp new file mode 100644 index 00000000000..060e09a1325 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/sethekk_halls/instance_sethekk_halls.cpp @@ -0,0 +1,91 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance - Sethekk Halls +SD%Complete: 50 +SDComment: Instance Data for Sethekk Halls instance +SDCategory: Auchindoun, Sethekk Halls +EndScriptData */ + +#include "precompiled.h" +#include "def_sethekk_halls.h" + +enum +{ + NPC_ANZU = 23035, + IKISS_DOOR = 177203, +}; + +struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance +{ + instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 AnzuEncounter; + uint64 m_uiIkissDoorGUID; + + void Initialize() + { + AnzuEncounter = NOT_STARTED; + m_uiIkissDoorGUID = 0; + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + if (pCreature->GetEntry() == NPC_ANZU && AnzuEncounter >= IN_PROGRESS) + { + pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + pCreature->RemoveCorpse(); + } else { + AnzuEncounter = IN_PROGRESS; + } + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + if (pGo->GetEntry() == IKISS_DOOR) + m_uiIkissDoorGUID = pGo->GetGUID(); + } + + void SetData(uint32 type, uint32 data) + { + switch(type) + { + case DATA_IKISSDOOREVENT: + if (data == DONE) + DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); + break; + case TYPE_ANZU_ENCOUNTER: + AnzuEncounter = data; + break; + } + } +}; + +InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) +{ + return new instance_sethekk_halls(pMap); +} + +void AddSC_instance_sethekk_halls() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_sethekk_halls"; + newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp new file mode 100644 index 00000000000..66e6b3a108d --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_ambassador_hellmaw.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_Ambassador_Hellmaw +SD%Complete: 80 +SDComment: Enrage spell missing/not known +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "escort_ai.h" +#include "def_shadow_labyrinth.h" + +enum +{ + SAY_INTRO = -1555000, + SAY_AGGRO1 = -1555001, + SAY_AGGRO2 = -1555002, + SAY_AGGRO3 = -1555003, + SAY_HELP = -1555004, + SAY_SLAY1 = -1555005, + SAY_SLAY2 = -1555006, + SAY_DEATH = -1555007, + + SPELL_BANISH = 30231, + SPELL_CORROSIVE_ACID = 33551, + SPELL_FEAR = 33547, + SPELL_ENRAGE = 34970 +}; + +struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI +{ + boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_pInstance = pCreature->GetInstanceData(); + HeroicMode = pCreature->GetMap()->IsHeroic(); + } + + ScriptedInstance* m_pInstance; + bool HeroicMode; + + uint32 EventCheck_Timer; + uint32 CorrosiveAcid_Timer; + uint32 Fear_Timer; + uint32 Enrage_Timer; + bool Intro; + bool IsBanished; + bool Enraged; + + void Reset() + { + EventCheck_Timer = 5000; + CorrosiveAcid_Timer = 5000 + rand()%5000; + Fear_Timer = 25000 + rand()%5000; + Enrage_Timer = 180000; + Intro = false; + IsBanished = true; + Enraged = false; + + if (m_pInstance && m_creature->isAlive()) + { + if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) + m_creature->CastSpell(m_creature, SPELL_BANISH, true); + } + } + + void JustReachedHome() + { + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, FAIL); + } + + void MoveInLineOfSight(Unit* pWho) + { + if (m_creature->HasAura(SPELL_BANISH)) + return; + + npc_escortAI::MoveInLineOfSight(pWho); + } + + void WaypointReached(uint32 i) + { + } + + void DoIntro() + { + if (m_creature->HasAura(SPELL_BANISH)) + m_creature->RemoveAurasDueToSpell(SPELL_BANISH); + + IsBanished = false; + Intro = true; + + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) + { + DoScriptText(SAY_INTRO, m_creature); + Start(true, false, 0, NULL, false, true); + } + + m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); + } + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (m_pInstance) + m_pInstance->SetData(TYPE_HELLMAW, DONE); + } + + void UpdateAI(const uint32 diff) + { + if (!Intro && !IsBeingEscorted) + { + if (EventCheck_Timer < diff) + { + if (m_pInstance) + { + if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) + { + DoIntro(); + return; + } + } + EventCheck_Timer = 5000; + return; + } + else + { + EventCheck_Timer -= diff; + return; + } + } + + npc_escortAI::UpdateAI(diff); + + if (!UpdateVictim()) + return; + + if (m_creature->HasAura(SPELL_BANISH, 0)) + { + EnterEvadeMode(); + return; + } + + if (CorrosiveAcid_Timer < diff) + { + DoCast(m_creature->getVictim(),SPELL_CORROSIVE_ACID); + CorrosiveAcid_Timer = 15000 + rand()%10000; + }else CorrosiveAcid_Timer -= diff; + + if (Fear_Timer < diff) + { + DoCast(m_creature,SPELL_FEAR); + Fear_Timer = 20000 + rand()%15000; + }else Fear_Timer -= diff; + + if (HeroicMode) + { + if (!Enraged && Enrage_Timer < diff) + { + DoCast(m_creature,SPELL_ENRAGE); + Enraged = true; + }else Enrage_Timer -= diff; + } + } +}; + +CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) +{ + return new boss_ambassador_hellmawAI(pCreature); +} + +void AddSC_boss_ambassador_hellmaw() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_ambassador_hellmaw"; + newscript->GetAI = &GetAI_boss_ambassador_hellmaw; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp new file mode 100644 index 00000000000..73374c08f8c --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp @@ -0,0 +1,177 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Blackheart_the_Inciter +SD%Complete: 75 +SDComment: Incite Chaos not functional since core lacks Mind Control support +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define SPELL_INCITE_CHAOS 33676 +#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party +#define SPELL_CHARGE 33709 +#define SPELL_WAR_STOMP 33707 + +#define SAY_INTRO1 -1555008 +#define SAY_INTRO2 -1555009 +#define SAY_INTRO3 -1555010 +#define SAY_AGGRO1 -1555011 +#define SAY_AGGRO2 -1555012 +#define SAY_AGGRO3 -1555013 +#define SAY_SLAY1 -1555014 +#define SAY_SLAY2 -1555015 +#define SAY_HELP -1555016 +#define SAY_DEATH -1555017 + +#define SAY2_INTRO1 -1555018 +#define SAY2_INTRO2 -1555019 +#define SAY2_INTRO3 -1555020 +#define SAY2_AGGRO1 -1555021 +#define SAY2_AGGRO2 -1555022 +#define SAY2_AGGRO3 -1555023 +#define SAY2_SLAY1 -1555024 +#define SAY2_SLAY2 -1555025 +#define SAY2_HELP -1555026 +#define SAY2_DEATH -1555027 + +struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI +{ + boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + } + + ScriptedInstance *pInstance; + + bool InciteChaos; + uint32 InciteChaos_Timer; + uint32 InciteChaosWait_Timer; + uint32 Charge_Timer; + uint32 Knockback_Timer; + + void Reset() + { + InciteChaos = false; + InciteChaos_Timer = 20000; + InciteChaosWait_Timer = 15000; + Charge_Timer = 5000; + Knockback_Timer = 15000; + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED); + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + + if (pInstance) + pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target + if (!UpdateVictim()) + return; + + if (InciteChaos) + { + if (InciteChaosWait_Timer < diff) + { + InciteChaos = false; + InciteChaosWait_Timer = 15000; + }else InciteChaosWait_Timer -= diff; + + return; + } + + if (InciteChaos_Timer < diff) + { + DoCast(m_creature, SPELL_INCITE_CHAOS); + + std::list t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (target && target->GetTypeId() == TYPEID_PLAYER) + target->CastSpell(target,SPELL_INCITE_CHAOS_B,true); + } + + DoResetThreat(); + InciteChaos = true; + InciteChaos_Timer = 40000; + return; + }else InciteChaos_Timer -= diff; + + //Charge_Timer + if (Charge_Timer < diff) + { + if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) + DoCast(target, SPELL_CHARGE); + Charge_Timer = 15000 + rand()%10000; + }else Charge_Timer -= diff; + + //Knockback_Timer + if (Knockback_Timer < diff) + { + DoCast(m_creature, SPELL_WAR_STOMP); + Knockback_Timer = 18000 + rand()%6000; + }else Knockback_Timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) +{ + return new boss_blackheart_the_inciterAI (pCreature); +} + +void AddSC_boss_blackheart_the_inciter() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_blackheart_the_inciter"; + newscript->GetAI = &GetAI_boss_blackheart_the_inciter; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp new file mode 100644 index 00000000000..0cc6255f3cf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp @@ -0,0 +1,321 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Grandmaster_Vorpil +SD%Complete: 100 +SDComment: +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define SAY_INTRO -1555028 +#define SAY_AGGRO1 -1555029 +#define SAY_AGGRO2 -1555030 +#define SAY_AGGRO3 -1555031 +#define SAY_HELP -1555032 +#define SAY_SLAY1 -1555033 +#define SAY_SLAY2 -1555034 +#define SAY_DEATH -1555035 + +#define SPELL_RAIN_OF_FIRE 33617 +#define H_SPELL_RAIN_OF_FIRE 39363 + +#define SPELL_DRAW_SHADOWS 33563 +#define SPELL_SHADOWBOLT_VOLLEY 33841 +#define SPELL_BANISH 38791 + +#define MOB_VOID_TRAVELER 19226 +#define SPELL_SACRIFICE 33587 +#define SPELL_SHADOW_NOVA 33846 +#define SPELL_EMPOWERING_SHADOWS 33783 +#define H_SPELL_EMPOWERING_SHADOWS 39364 + +#define MOB_VOID_PORTAL 19224 +#define SPELL_VOID_PORTAL_VISUAL 33569 + +float VorpilPosition[3] = {-252.8820,-264.3030,17.1}; + +float VoidPortalCoords[5][3] = +{ + {-283.5894, -239.5718, 12.7}, + {-306.5853, -258.4539, 12.7}, + {-295.8789, -269.0899, 12.7}, + {-209.3401, -262.7564, 17.1}, + {-261.4533, -297.3298, 17.1} +}; + +struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI +{ + mob_voidtravelerAI(Creature *c) : ScriptedAI(c) + { + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + bool HeroicMode; + Unit *Vorpil; + uint32 move; + bool sacrificed; + + void Reset() + { + Vorpil = NULL; + move = 0; + sacrificed = false; + } + + void EnterCombat(Unit *who){} + + void UpdateAI(const uint32 diff) + { + if (!Vorpil) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + if (move < diff) + { + if (sacrificed) + { + SpellEntry *spell = GET_SPELL(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS); + if (spell) + Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature)); + Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25); + DoCast(m_creature, SPELL_SHADOW_NOVA, true); + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + m_creature->GetMotionMaster()->MoveFollow(Vorpil,0,0); + if (m_creature->IsWithinDist(Vorpil, 3)) + { + DoCast(m_creature, SPELL_SACRIFICE, false); + sacrificed = true; + move = 500; + return; + } + if (!Vorpil->isInCombat() || Vorpil->isDead()) + { + m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + return; + } + move = 1000; + }else move -= diff; + } +}; +CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature) +{ + return new mob_voidtravelerAI (pCreature); +} + +struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI +{ + boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) + { + pInstance = c->GetInstanceData(); + HeroicMode = m_creature->GetMap()->IsHeroic(); + Intro = false; + } + + ScriptedInstance *pInstance; + bool Intro, HelpYell; + bool sumportals; + bool HeroicMode; + + uint32 ShadowBoltVolley_Timer; + uint32 DrawShadows_Timer; + uint32 summonTraveler_Timer; + uint32 banish_Timer; + uint64 PortalsGuid[5]; + + void Reset() + { + ShadowBoltVolley_Timer = 7000 + rand()%7000; + DrawShadows_Timer = 45000; + summonTraveler_Timer = 90000; + banish_Timer = 17000; + HelpYell = false; + destroyPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); + } + + void summonPortals() + { + if (!sumportals) + { + for (int i = 0;i<5; ++i) + { + Creature *Portal = NULL; + Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000); + if (Portal) + { + PortalsGuid[i] = Portal->GetGUID(); + Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); + } + } + sumportals = true; + summonTraveler_Timer = 5000; + } + } + + void destroyPortals() + { + if (sumportals) + { + for (int i = 0;i < 5; i ++) + { + Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]); + if (Portal && Portal->isAlive()) + Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + PortalsGuid[i] = 0; + } + sumportals = false; + } + } + + void spawnVoidTraveler() + { + int pos = rand()%5; + m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000); + if (!HelpYell) + { + DoScriptText(SAY_HELP, m_creature); + HelpYell = true; + } + } + + void JustSummoned(Creature *summoned) + { + if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) + CAST_AI(mob_voidtravelerAI, summoned->AI())->Vorpil = m_creature; + } + + void KilledUnit(Unit *victim) + { + switch(rand()%2) + { + case 0: DoScriptText(SAY_SLAY1, m_creature); break; + case 1: DoScriptText(SAY_SLAY2, m_creature); break; + } + } + + void JustDied(Unit *victim) + { + DoScriptText(SAY_DEATH, m_creature); + destroyPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); + } + + void EnterCombat(Unit *who) + { + switch(rand()%3) + { + case 0: DoScriptText(SAY_AGGRO1, m_creature); break; + case 1: DoScriptText(SAY_AGGRO2, m_creature); break; + case 2: DoScriptText(SAY_AGGRO3, m_creature); break; + } + summonPortals(); + + if (pInstance) + pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); + } + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who)) + { + DoScriptText(SAY_INTRO, m_creature); + Intro = true; + } + } + + void UpdateAI(const uint32 diff) + { + if (!UpdateVictim()) + return; + + if (ShadowBoltVolley_Timer < diff) + { + DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY); + ShadowBoltVolley_Timer = 15000 + rand()%15000;; + }else ShadowBoltVolley_Timer -= diff; + + if (HeroicMode && banish_Timer < diff) + { + Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); + if (target) + { + DoCast(target,SPELL_BANISH); + banish_Timer = 16000; + } + }else banish_Timer -= diff; + + if (DrawShadows_Timer < diff) + { + Map* pMap = m_creature->GetMap(); + Map::PlayerList const &PlayerList = pMap->GetPlayers(); + for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) + if (Player* i_pl = i->getSource()) + if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) + i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); + + m_creature->GetMap()->CreatureRelocation(m_creature, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f); + DoCast(m_creature,SPELL_DRAW_SHADOWS,true); + + DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE); + + ShadowBoltVolley_Timer = 6000; + DrawShadows_Timer = 30000; + }else DrawShadows_Timer -= diff; + + if (summonTraveler_Timer < diff) + { + spawnVoidTraveler(); + summonTraveler_Timer = 10000; + //enrage at 20% + if ((m_creature->GetHealth()*5) < m_creature->GetMaxHealth()) + summonTraveler_Timer = 5000; + }else summonTraveler_Timer -=diff; + + DoMeleeAttackIfReady(); + } +}; +CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) +{ + return new boss_grandmaster_vorpilAI (pCreature); +} + +void AddSC_boss_grandmaster_vorpil() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_grandmaster_vorpil"; + newscript->GetAI = &GetAI_boss_grandmaster_vorpil; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_voidtraveler"; + newscript->GetAI = &GetAI_mob_voidtraveler; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp new file mode 100644 index 00000000000..259f6091af6 --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/boss_murmur.cpp @@ -0,0 +1,207 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Boss_Murmur +SD%Complete: 90 +SDComment: Timers may be incorrect +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define EMOTE_SONIC_BOOM -1555036 + +#define SPELL_SONIC_BOOM_CAST (HeroicMode?38796:33923) +#define SPELL_SONIC_BOOM_EFFECT (HeroicMode?38795:33666) +#define SPELL_RESONANCE 33657 +#define SPELL_MURMURS_TOUCH (HeroicMode?38794:33711) +#define SPELL_MAGNETIC_PULL 33689 +#define SPELL_SONIC_SHOCK 38797 +#define SPELL_THUNDERING_STORM 39365 + +struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI +{ + boss_murmurAI(Creature *c) : ScriptedAI(c) + { + SetCombatMovement(false); + HeroicMode = m_creature->GetMap()->IsHeroic(); + } + + uint32 SonicBoom_Timer; + uint32 MurmursTouch_Timer; + uint32 Resonance_Timer; + uint32 MagneticPull_Timer; + uint32 SonicShock_Timer; + uint32 ThunderingStorm_Timer; + bool HeroicMode; + bool SonicBoom; + + void Reset() + { + SonicBoom_Timer = 30000; + MurmursTouch_Timer = 8000 + rand()%12000; + Resonance_Timer = 5000; + MagneticPull_Timer = 15000 + rand()%15000; + ThunderingStorm_Timer = 15000; + SonicShock_Timer = 10000; + SonicBoom = false; + + //database should have `RegenHealth`=0 to prevent regen + uint32 hp = (m_creature->GetMaxHealth()*40)/100; + if (hp) m_creature->SetHealth(hp); + m_creature->ResetPlayerDamageReq(); + } + + void SonicBoomEffect() + { + std::list t_list = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) + { + Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); + if (target && target->GetTypeId() == TYPEID_PLAYER) + { + //Not do anything without aura, spell can be resisted! + if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f)) + { + //This will be wrong calculation. Also, comments suggest it must deal damage + target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8)); + } + } + } + } + + void EnterCombat(Unit *who) { } + + // Sonic Boom instant damage (needs core fix instead of this) + void SpellHitTarget(Unit *target, const SpellEntry *spell) + { + if (target && target->isAlive() && spell && spell->Id == SPELL_SONIC_BOOM_EFFECT) + m_creature->DealDamage(target,(target->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell); + } + + void UpdateAI(const uint32 diff) + { + //Return since we have no target or casting + if (!UpdateVictim() || m_creature->IsNonMeleeSpellCasted(false)) + return; + + // Sonic Boom + if (SonicBoom) + { + DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true); + SonicBoomEffect(); + + SonicBoom = false; + Resonance_Timer = 1500; + } + if (SonicBoom_Timer < diff) + { + DoScriptText(EMOTE_SONIC_BOOM, m_creature); + DoCast(m_creature, SPELL_SONIC_BOOM_CAST); + SonicBoom_Timer = 30000; + SonicBoom = true; + return; + }else SonicBoom_Timer -= diff; + + // Murmur's Touch + if (MurmursTouch_Timer < diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) + DoCast(target, SPELL_MURMURS_TOUCH); + MurmursTouch_Timer = 25000 + rand()%10000; + }else MurmursTouch_Timer -= diff; + + // Resonance + if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim()))) + { + if (Resonance_Timer < diff) + { + DoCast(m_creature, SPELL_RESONANCE); + Resonance_Timer = 5000; + }else Resonance_Timer -= diff; + } + + // Magnetic Pull + if (MagneticPull_Timer < diff) + { + if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) + { + DoCast(target, SPELL_MAGNETIC_PULL); + MagneticPull_Timer = 15000+rand()%15000; + return; + } + MagneticPull_Timer = 500; + }else MagneticPull_Timer -= diff; + + if (HeroicMode) + { + // Thundering Storm + if (ThunderingStorm_Timer < diff) + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) + if (target->isAlive() && !m_creature->IsWithinDist(target, 35, false)) + DoCast(target, SPELL_THUNDERING_STORM, true); + ThunderingStorm_Timer = 15000; + }else ThunderingStorm_Timer -= diff; + + // Sonic Shock + if (SonicShock_Timer < diff) + { + if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) + if (target->isAlive()) + DoCast(target, SPELL_SONIC_SHOCK); + SonicShock_Timer = 10000+rand()%10000; + }else SonicShock_Timer -= diff; + } + + // Select nearest most aggro target if top aggro too far + if (!m_creature->isAttackReady()) + return; + if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) + { + std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); + for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) + if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) + if (target->isAlive() && m_creature->IsWithinMeleeRange(target)) + { + m_creature->TauntApply(target); + break; + } + } + + DoMeleeAttackIfReady(); + } +}; + +CreatureAI* GetAI_boss_murmur(Creature* pCreature) +{ + return new boss_murmurAI (pCreature); +} + +void AddSC_boss_murmur() +{ + Script *newscript; + newscript = new Script; + newscript->Name="boss_murmur"; + newscript->GetAI = &GetAI_boss_murmur; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h new file mode 100644 index 00000000000..a78955368bf --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/def_shadow_labyrinth.h @@ -0,0 +1,15 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software licensed under GPL version 2 + * Please see the included DOCS/LICENSE.TXT for more information */ + +#ifndef DEF_SHADOW_LABYRINTH_H +#define DEF_SHADOW_LABYRINTH_H + +#define TYPE_HELLMAW 1 +#define TYPE_OVERSEER 2 +#define DATA_BLACKHEARTTHEINCITEREVENT 3 +#define DATA_GRANDMASTERVORPILEVENT 4 +#define DATA_MURMUREVENT 5 +#define DATA_GRANDMASTERVORPIL 6 +#endif + diff --git a/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp new file mode 100644 index 00000000000..f8f3b73bffa --- /dev/null +++ b/src/bindings/scripts/scripts/outland/auchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp @@ -0,0 +1,227 @@ +/* Copyright (C) 2006 - 2009 ScriptDev2 + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +/* ScriptData +SDName: Instance_Shadow_Labyrinth +SD%Complete: 85 +SDComment: Some cleanup left along with save +SDCategory: Auchindoun, Shadow Labyrinth +EndScriptData */ + +#include "precompiled.h" +#include "def_shadow_labyrinth.h" + +#define MAX_ENCOUNTER 5 + +#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies +#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies + +/* Shadow Labyrinth encounters: +1 - Ambassador Hellmaw event +2 - Blackheart the Inciter event +3 - Grandmaster Vorpil event +4 - Murmur event +*/ + +struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance +{ + instance_shadow_labyrinth(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; + + uint32 m_auiEncounter[MAX_ENCOUNTER]; + std::string str_data; + + uint64 m_uiRefectoryDoorGUID; + uint64 m_uiScreamingHallDoorGUID; + + uint64 m_uiGrandmasterVorpil; + uint32 m_uiFelOverseerCount; + + void Initialize() + { + memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); + + m_uiRefectoryDoorGUID = 0; + m_uiScreamingHallDoorGUID = 0; + + m_uiGrandmasterVorpil = 0; + m_uiFelOverseerCount = 0; + } + + bool IsEncounterInProgress() const + { + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) return true; + + return false; + } + + void OnGameObjectCreate(GameObject* pGo, bool add) + { + switch(pGo->GetEntry()) + { + case REFECTORY_DOOR: + m_uiRefectoryDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[2] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + case SCREAMING_HALL_DOOR: + m_uiScreamingHallDoorGUID = pGo->GetGUID(); + if (m_auiEncounter[3] == DONE) + pGo->SetGoState(GO_STATE_ACTIVE); + break; + } + } + + void OnCreatureCreate(Creature* pCreature, bool add) + { + switch(pCreature->GetEntry()) + { + case 18732: + m_uiGrandmasterVorpil = pCreature->GetGUID(); + break; + case 18796: + if (pCreature->isAlive()) + { + ++m_uiFelOverseerCount; + debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); + } + break; + } + } + + void SetData(uint32 type, uint32 uiData) + { + switch(type) + { + case TYPE_HELLMAW: + m_auiEncounter[0] = uiData; + break; + + case TYPE_OVERSEER: + if (uiData != DONE) + { + error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); + return; + } + if (m_uiFelOverseerCount) + { + --m_uiFelOverseerCount; + + if (m_uiFelOverseerCount) + debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); + else + { + m_auiEncounter[1] = DONE; + debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); + } + } + break; + + case DATA_BLACKHEARTTHEINCITEREVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiRefectoryDoorGUID); + m_auiEncounter[2] = uiData; + break; + + case DATA_GRANDMASTERVORPILEVENT: + if (uiData == DONE) + DoUseDoorOrButton(m_uiScreamingHallDoorGUID); + m_auiEncounter[3] = uiData; + break; + + case DATA_MURMUREVENT: + m_auiEncounter[4] = uiData; + break; + } + + if (uiData == DONE) + { + if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0) + return; + + OUT_SAVE_INST_DATA; + + std::ostringstream saveStream; + saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " + << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; + + str_data = saveStream.str(); + + SaveToDB(); + OUT_SAVE_INST_DATA_COMPLETE; + } + } + + uint32 GetData(uint32 type) + { + switch(type) + { + case TYPE_HELLMAW: return m_auiEncounter[0]; + case TYPE_OVERSEER: return m_auiEncounter[1]; + case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3]; + case DATA_MURMUREVENT: return m_auiEncounter[4]; + } + return false; + } + + uint64 GetData64(uint32 identifier) + { + if (identifier == DATA_GRANDMASTERVORPIL) + return m_uiGrandmasterVorpil; + + return 0; + } + + std::string GetSaveData() + { + return str_data; + } + + void Load(const char* in) + { + if (!in) + { + OUT_LOAD_INST_DATA_FAIL; + return; + } + + OUT_LOAD_INST_DATA(in); + + std::istringstream loadStream(in); + loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; + + for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) + if (m_auiEncounter[i] == IN_PROGRESS) + m_auiEncounter[i] = NOT_STARTED; + + OUT_LOAD_INST_DATA_COMPLETE; + } +}; + +InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) +{ + return new instance_shadow_labyrinth(pMap); +} + +void AddSC_instance_shadow_labyrinth() +{ + Script *newscript; + newscript = new Script; + newscript->Name = "instance_shadow_labyrinth"; + newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; + newscript->RegisterSelf(); +} + diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp deleted file mode 100644 index 414804a6576..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_exarch_maladaar.cpp +++ /dev/null @@ -1,358 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Exarch_Maladaar -SD%Complete: 95 -SDComment: Most of event implemented, some adjustments to timers remain and possibly make some better code for switching his dark side in to better "images" of player. -SDCategory: Auchindoun, Auchenai Crypts -EndScriptData */ - -/* ContentData -mob_stolen_soul -boss_exarch_maladaar -mob_avatar_of_martyred -EndContentData */ - -#include "precompiled.h" - -#define SPELL_MOONFIRE 37328 -#define SPELL_FIREBALL 37329 -#define SPELL_MIND_FLAY 37330 -#define SPELL_HEMORRHAGE 37331 -#define SPELL_FROSTSHOCK 37332 -#define SPELL_CURSE_OF_AGONY 37334 -#define SPELL_MORTAL_STRIKE 37335 -#define SPELL_FREEZING_TRAP 37368 -#define SPELL_HAMMER_OF_JUSTICE 37369 - -struct TRINITY_DLL_DECL mob_stolen_soulAI : public ScriptedAI -{ - mob_stolen_soulAI(Creature *c) : ScriptedAI(c) {} - - uint8 myClass; - uint32 Class_Timer; - - void Reset() - { - Class_Timer = 1000; - } - - void EnterCombat(Unit *who) - { } - - void SetMyClass(uint8 myclass) - { - myClass = myclass; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Class_Timer < diff) - { - switch (myClass) - { - case CLASS_WARRIOR: - DoCast(m_creature->getVictim(), SPELL_MORTAL_STRIKE); - Class_Timer = 6000; - break; - case CLASS_PALADIN: - DoCast(m_creature->getVictim(), SPELL_HAMMER_OF_JUSTICE); - Class_Timer = 6000; - break; - case CLASS_HUNTER: - DoCast(m_creature->getVictim(), SPELL_FREEZING_TRAP); - Class_Timer = 20000; - break; - case CLASS_ROGUE: - DoCast(m_creature->getVictim(), SPELL_HEMORRHAGE); - Class_Timer = 10000; - break; - case CLASS_PRIEST: - DoCast(m_creature->getVictim(), SPELL_MIND_FLAY); - Class_Timer = 5000; - break; - case CLASS_SHAMAN: - DoCast(m_creature->getVictim(), SPELL_FROSTSHOCK); - Class_Timer = 8000; - break; - case CLASS_MAGE: - DoCast(m_creature->getVictim(), SPELL_FIREBALL); - Class_Timer = 5000; - break; - case CLASS_WARLOCK: - DoCast(m_creature->getVictim(), SPELL_CURSE_OF_AGONY); - Class_Timer = 20000; - break; - case CLASS_DRUID: - DoCast(m_creature->getVictim(), SPELL_MOONFIRE); - Class_Timer = 10000; - break; - } - } else Class_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_stolen_soul(Creature* pCreature) -{ - return new mob_stolen_soulAI (pCreature); -} - -#define SAY_INTRO -1558000 -#define SAY_SUMMON -1558001 - -#define SAY_AGGRO_1 -1558002 -#define SAY_AGGRO_2 -1558003 -#define SAY_AGGRO_3 -1558004 - -#define SAY_ROAR -1558005 -#define SAY_SOUL_CLEAVE -1558006 - -#define SAY_SLAY_1 -1558007 -#define SAY_SLAY_2 -1558008 - -#define SAY_DEATH -1558009 - -#define SPELL_RIBBON_OF_SOULS 32422 -#define SPELL_SOUL_SCREAM 32421 - -#define SPELL_STOLEN_SOUL 32346 -#define SPELL_STOLEN_SOUL_VISUAL 32395 - -#define SPELL_SUMMON_AVATAR 32424 - -#define ENTRY_STOLEN_SOUL 18441 - -struct TRINITY_DLL_DECL boss_exarch_maladaarAI : public ScriptedAI -{ - boss_exarch_maladaarAI(Creature *c) : ScriptedAI(c) - { - HasTaunted = false; - } - - uint32 soulmodel; - uint64 soulholder; - uint8 soulclass; - - uint32 Fear_timer; - uint32 Ribbon_of_Souls_timer; - uint32 StolenSoul_Timer; - - bool HasTaunted; - bool Avatar_summoned; - - void Reset() - { - soulmodel = 0; - soulholder = 0; - soulclass = 0; - - Fear_timer = 15000 + rand()% 5000; - Ribbon_of_Souls_timer = 5000; - StolenSoul_Timer = 25000 + rand()% 10000; - - Avatar_summoned = false; - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && m_creature->IsWithinDistInMap(who, 150.0)) - { - DoScriptText(SAY_INTRO, m_creature); - HasTaunted = true; - } - - ScriptedAI::MoveInLineOfSight(who); - } - - - void EnterCombat(Unit *who) - { - switch (rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == ENTRY_STOLEN_SOUL) - { - //SPELL_STOLEN_SOUL_VISUAL has shapeshift effect, but not implemented feature in Trinity for this spell. - summoned->CastSpell(summoned,SPELL_STOLEN_SOUL_VISUAL,false); - summoned->SetDisplayId(soulmodel); - summoned->setFaction(m_creature->getFaction()); - - if (Unit *target = Unit::GetUnit(*m_creature,soulholder)) - { - - CAST_AI(mob_stolen_soulAI, summoned->AI())->SetMyClass(soulclass); - summoned->AI()->AttackStart(target); - } - } - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch (rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - //When Exarch Maladar is defeated D'ore appear. - m_creature->SummonCreature(19412, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 600000); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (!Avatar_summoned && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 25)) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoScriptText(SAY_SUMMON, m_creature); - - DoCast(m_creature, SPELL_SUMMON_AVATAR); - Avatar_summoned = true; - StolenSoul_Timer = 15000 + rand()% 15000; - } - - if (StolenSoul_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (target->GetTypeId() == TYPEID_PLAYER) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - uint32 i = urand(1,2); - if (i == 1) - DoScriptText(SAY_ROAR, m_creature); - else - DoScriptText(SAY_SOUL_CLEAVE, m_creature); - - soulmodel = target->GetDisplayId(); - soulholder = target->GetGUID(); - soulclass = target->getClass(); - - DoCast(target,SPELL_STOLEN_SOUL); - m_creature->SummonCreature(ENTRY_STOLEN_SOUL, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 10000); - - StolenSoul_Timer = 20000 + rand()% 10000; - } else StolenSoul_Timer = 1000; - } - }else StolenSoul_Timer -= diff; - - if (Ribbon_of_Souls_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_RIBBON_OF_SOULS); - - Ribbon_of_Souls_timer = 5000 + (rand()%20 * 1000); - }else Ribbon_of_Souls_timer -= diff; - - if (Fear_timer < diff) - { - DoCast(m_creature,SPELL_SOUL_SCREAM); - Fear_timer = 15000 + rand()% 15000; - }else Fear_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_exarch_maladaar(Creature* pCreature) -{ - return new boss_exarch_maladaarAI (pCreature); -} - -#define SPELL_AV_MORTAL_STRIKE 16856 -#define SPELL_AV_SUNDER_ARMOR 16145 - -struct TRINITY_DLL_DECL mob_avatar_of_martyredAI : public ScriptedAI -{ - mob_avatar_of_martyredAI(Creature *c) : ScriptedAI(c) {} - - uint32 Mortal_Strike_timer; - - void Reset() - { - Mortal_Strike_timer = 10000; - } - - void EnterCombat(Unit *who) - { - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Mortal_Strike_timer < diff) - { - DoCast(m_creature->getVictim(), SPELL_AV_MORTAL_STRIKE); - Mortal_Strike_timer = 10000 + rand()%20 * 1000; - } else Mortal_Strike_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_avatar_of_martyred(Creature* pCreature) -{ - return new mob_avatar_of_martyredAI (pCreature); -} - -void AddSC_boss_exarch_maladaar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_exarch_maladaar"; - newscript->GetAI = &GetAI_boss_exarch_maladaar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_avatar_of_martyred"; - newscript->GetAI = &GetAI_mob_avatar_of_martyred; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_stolen_soul"; - newscript->GetAI = &GetAI_mob_stolen_soul; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp deleted file mode 100644 index 4dfdd407731..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/auchenai_crypts/boss_shirrak_the_dead_watcher.cpp +++ /dev/null @@ -1,212 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -Name: Boss_Shirrak_the_dead_watcher -%Complete: 80 -Comment: InhibitMagic should stack slower far from the boss, proper Visual for Focus Fire, heroic implemented -Category: Auchindoun, Auchenai Crypts -EndScriptData */ - -#include "precompiled.h" - -#define SPELL_INHIBITMAGIC 32264 -#define SPELL_ATTRACTMAGIC 32265 -#define N_SPELL_CARNIVOROUSBITE 36383 -#define H_SPELL_CARNIVOROUSBITE 39382 -#define SPELL_CARNIVOROUSBITE (HeroicMode?H_SPELL_CARNIVOROUSBITE:N_SPELL_CARNIVOROUSBITE) - -#define ENTRY_FOCUS_FIRE 18374 - -#define N_SPELL_FIERY_BLAST 32302 -#define H_SPELL_FIERY_BLAST 38382 -#define SPELL_FIERY_BLAST (HeroicMode?H_SPELL_FIERY_BLAST:N_SPELL_FIERY_BLAST) -#define SPELL_FOCUS_FIRE_VISUAL 42075 //need to find better visual - -struct TRINITY_DLL_DECL boss_shirrak_the_dead_watcherAI : public ScriptedAI -{ - boss_shirrak_the_dead_watcherAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 Inhibitmagic_Timer; - uint32 Attractmagic_Timer; - uint32 Carnivorousbite_Timer; - uint32 FocusFire_Timer; - bool HeroicMode; - Unit *focusedTarget; - - void Reset() - { - Inhibitmagic_Timer = 0; - Attractmagic_Timer = 28000; - Carnivorousbite_Timer = 10000; - FocusFire_Timer = 17000; - focusedTarget = NULL; - } - - void EnterCombat(Unit *who) - { } - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == ENTRY_FOCUS_FIRE) - { - summoned->CastSpell(summoned,SPELL_FOCUS_FIRE_VISUAL,false); - summoned->setFaction(m_creature->getFaction()); - summoned->SetLevel(m_creature->getLevel()); - summoned->addUnitState(UNIT_STAT_ROOT); - - if (focusedTarget) - summoned->AI()->AttackStart(focusedTarget); - } - } - - void UpdateAI(const uint32 diff) - { - //Inhibitmagic_Timer - if (Inhibitmagic_Timer < diff) - { - float dist; - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && (dist = i_pl->IsWithinDist(m_creature, 45))) - { - i_pl->RemoveAurasDueToSpell(SPELL_INHIBITMAGIC); - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 35) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 25) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - if (dist < 15) - m_creature->AddAura(SPELL_INHIBITMAGIC, i_pl); - } - Inhibitmagic_Timer = 3000+(rand()%1000); - }else Inhibitmagic_Timer -= diff; - - //Return since we have no target - if (!UpdateVictim()) - return; - - //Attractmagic_Timer - if (Attractmagic_Timer < diff) - { - DoCast(m_creature,SPELL_ATTRACTMAGIC); - Attractmagic_Timer = 30000; - Carnivorousbite_Timer = 1500; - }else Attractmagic_Timer -= diff; - - //Carnivorousbite_Timer - if (Carnivorousbite_Timer < diff) - { - DoCast(m_creature,SPELL_CARNIVOROUSBITE); - Carnivorousbite_Timer = 10000; - }else Carnivorousbite_Timer -= diff; - - //FocusFire_Timer - if (FocusFire_Timer < diff) - { - // Summon Focus Fire & Emote - Unit *target = SelectUnit(SELECT_TARGET_RANDOM,1); - if (target && target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) - { - focusedTarget = target; - m_creature->SummonCreature(ENTRY_FOCUS_FIRE,target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(),0,TEMPSUMMON_TIMED_DESPAWN,5500); - - // TODO: Find better way to handle emote - // Emote - std::string *emote = new std::string("focuses on "); - emote->append(target->GetName()); - emote->append("!"); - const char* text = emote->c_str(); - m_creature->MonsterTextEmote(text, 0, true); - delete emote; - } - FocusFire_Timer = 15000+(rand()%5000); - }else FocusFire_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_shirrak_the_dead_watcher(Creature* pCreature) -{ - return new boss_shirrak_the_dead_watcherAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_focus_fireAI : public ScriptedAI -{ - mob_focus_fireAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 FieryBlast_Timer; - bool fiery1, fiery2; - - void Reset() - { - FieryBlast_Timer = 3000+(rand()%1000); - fiery1 = fiery2 = true; - } - - void EnterCombat(Unit *who) - { } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - //FieryBlast_Timer - if (fiery2 && FieryBlast_Timer < diff) - { - DoCast(m_creature,SPELL_FIERY_BLAST); - - if (fiery1) fiery1 = false; - else if (fiery2) fiery2 = false; - - FieryBlast_Timer = 1000; - }else FieryBlast_Timer -= diff; - - //DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_focus_fire(Creature* pCreature) -{ - return new mob_focus_fireAI (pCreature); -} - -void AddSC_boss_shirrak_the_dead_watcher() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_shirrak_the_dead_watcher"; - newscript->GetAI = &GetAI_boss_shirrak_the_dead_watcher; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_focus_fire"; - newscript->GetAI = &GetAI_mob_focus_fire; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp deleted file mode 100644 index dcaaefee8c2..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_nexusprince_shaffar.cpp +++ /dev/null @@ -1,369 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_NexusPrince_Shaffar -SD%Complete: 80 -SDComment: Need more tuning of spell timers, it should not be as linear fight as current. Also should possibly find a better way to deal with his three initial beacons to make sure all aggro. -SDCategory: Auchindoun, Mana Tombs -EndScriptData */ - -/* ContentData -boss_nexusprince_shaffar -mob_ethereal_beacon -EndContentData */ - -#include "precompiled.h" - -enum -{ - SAY_INTRO = -1557000, - SAY_AGGRO_1 = -1557001, - SAY_AGGRO_2 = -1557002, - SAY_AGGRO_3 = -1557003, - SAY_SLAY_1 = -1557004, - SAY_SLAY_2 = -1557005, - SAY_SUMMON = -1557006, - SAY_DEAD = -1557007, - - SPELL_BLINK = 34605, - SPELL_FROSTBOLT = 32364, - SPELL_FIREBALL = 32363, - SPELL_FROSTNOVA = 32365, - - SPELL_ETHEREAL_BEACON = 32371, // Summons NPC_BEACON - SPELL_ETHEREAL_BEACON_VISUAL = 32368, - - NPC_BEACON = 18431, - NPC_SHAFFAR = 18344, - - NR_INITIAL_BEACONS = 3 -}; - -struct TRINITY_DLL_DECL boss_nexusprince_shaffarAI : public ScriptedAI -{ - boss_nexusprince_shaffarAI(Creature *c) : ScriptedAI(c), summons(me) { HasTaunted = false; } - - uint32 Blink_Timer; - uint32 Beacon_Timer; - uint32 FireBall_Timer; - uint32 Frostbolt_Timer; - uint32 FrostNova_Timer; - - SummonList summons; - - bool HasTaunted; - bool CanBlink; - - void Reset() - { - Blink_Timer = 1500; - Beacon_Timer = 10000; - FireBall_Timer = 8000; - Frostbolt_Timer = 4000; - FrostNova_Timer = 15000; - - CanBlink = false; - - float dist = 8.0f; - float posX, posY, posZ, angle; - m_creature->GetHomePosition(posX, posY, posZ, angle); - - m_creature->SummonCreature(NPC_BEACON, posX - dist, posY - dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - m_creature->SummonCreature(NPC_BEACON, posX - dist, posY + dist, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - m_creature->SummonCreature(NPC_BEACON, posX + dist, posY, posZ, angle, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 7200000); - } - - void EnterEvadeMode() - { - summons.DespawnAll(); - ScriptedAI::EnterEvadeMode(); - } - - void MoveInLineOfSight(Unit *who) - { - if (!HasTaunted && who->GetTypeId() == TYPEID_PLAYER && m_creature->IsWithinDistInMap(who, 100.0f)) - { - DoScriptText(SAY_INTRO, m_creature); - HasTaunted = true; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - DoZoneInCombat(); - summons.DoZoneInCombat(); - } - - void JustSummoned(Creature *summoned) - { - if (summoned->GetEntry() == NPC_BEACON) - { - summoned->CastSpell(summoned,SPELL_ETHEREAL_BEACON_VISUAL,false); - - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(target); - } - - summons.Summon(summoned); - } - - void SummonedCreatureDespawn(Creature *summon) - { - summons.Despawn(summon); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEAD, m_creature); - summons.DespawnAll(); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (FrostNova_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoCast(m_creature,SPELL_FROSTNOVA); - FrostNova_Timer = 17500 + rand()%7500; - CanBlink = true; - }else FrostNova_Timer -= diff; - - if (Frostbolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FROSTBOLT); - Frostbolt_Timer = 4500 + rand()%1500; - }else Frostbolt_Timer -= diff; - - if (FireBall_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_FIREBALL); - FireBall_Timer = 4500 + rand()%1500; - }else FireBall_Timer -= diff; - - if (CanBlink) - { - if (Blink_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - //expire movement, will prevent from running right back to victim after cast - //(but should MoveChase be used again at a certain time or should he not move?) - if (m_creature->GetMotionMaster()->GetCurrentMovementGeneratorType() == TARGETED_MOTION_TYPE) - m_creature->GetMotionMaster()->MovementExpired(); - - DoCast(m_creature,SPELL_BLINK); - Blink_Timer = 1000 + rand()%1500; - CanBlink = false; - }else Blink_Timer -= diff; - } - - if (Beacon_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - if (!urand(0,3)) - DoScriptText(SAY_SUMMON, m_creature); - - DoCast(m_creature,SPELL_ETHEREAL_BEACON, true); - - Beacon_Timer = 10000; - }else Beacon_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_nexusprince_shaffar(Creature* pCreature) -{ - return new boss_nexusprince_shaffarAI (pCreature); -} - -enum -{ - SPELL_ARCANE_BOLT = 15254, - SPELL_ETHEREAL_APPRENTICE = 32372 // Summon 18430 -}; - -struct TRINITY_DLL_DECL mob_ethereal_beaconAI : public ScriptedAI -{ - mob_ethereal_beaconAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 Apprentice_Timer; - uint32 ArcaneBolt_Timer; - uint32 Check_Timer; - - void KillSelf() - { - m_creature->Kill(m_creature); - } - - void Reset() - { - Apprentice_Timer = (HeroicMode ? 10000 : 20000); - ArcaneBolt_Timer = 1000; - Check_Timer = 1000; - } - - void EnterCombat(Unit *who) - { - // Send Shaffar to fight - Creature* Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); - if (!Shaffar || Shaffar->isDead()) - { - KillSelf(); - return; - } - if (!Shaffar->isInCombat()) - Shaffar->AI()->AttackStart(who); - } - - void JustSummoned(Creature *summoned) - { - summoned->AI()->AttackStart(m_creature->getVictim()); - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Check_Timer < diff) - { - Creature *Shaffar = me->FindNearestCreature(NPC_SHAFFAR, 100); - if (!Shaffar || Shaffar->isDead() || !Shaffar->isInCombat()) - { - KillSelf(); - return; - } - Check_Timer = 1000; - }else Check_Timer -= diff; - - if (ArcaneBolt_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_ARCANE_BOLT); - ArcaneBolt_Timer = 2000 + rand()%2500; - }else ArcaneBolt_Timer -= diff; - - if (Apprentice_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - m_creature->CastSpell(m_creature,SPELL_ETHEREAL_APPRENTICE,true); - m_creature->ForcedDespawn(); - return; - }else Apprentice_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ethereal_beacon(Creature* pCreature) -{ - return new mob_ethereal_beaconAI (pCreature); -} - -enum -{ - SPELL_ETHEREAL_APPRENTICE_FIREBOLT = 32369, - SPELL_ETHEREAL_APPRENTICE_FROSTBOLT = 32370 -}; - -struct TRINITY_DLL_DECL mob_ethereal_apprenticeAI : public ScriptedAI -{ - mob_ethereal_apprenticeAI(Creature *c) : ScriptedAI(c) {} - - uint32 Cast_Timer; - - bool isFireboltTurn; - - void Reset() - { - Cast_Timer = 3000; - isFireboltTurn = true; - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Cast_Timer < diff) - { - if (isFireboltTurn) - { - m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FIREBOLT, true); - isFireboltTurn = false; - }else{ - m_creature->CastSpell(m_creature->getVictim(), SPELL_ETHEREAL_APPRENTICE_FROSTBOLT, true); - isFireboltTurn = true; - } - Cast_Timer = 3000; - }else Cast_Timer -= diff; - } -}; - -CreatureAI* GetAI_mob_ethereal_apprentice(Creature* pCreature) -{ - return new mob_ethereal_apprenticeAI (pCreature); -} - -void AddSC_boss_nexusprince_shaffar() -{ - Script *newscript; - - newscript = new Script; - newscript->Name="boss_nexusprince_shaffar"; - newscript->GetAI = &GetAI_boss_nexusprince_shaffar; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ethereal_beacon"; - newscript->GetAI = &GetAI_mob_ethereal_beacon; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_ethereal_apprentice"; - newscript->GetAI = &GetAI_mob_ethereal_apprentice; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.cpp deleted file mode 100644 index 77e1c535340..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/mana_tombs/boss_pandemonius.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_Pandemonius -SD%Complete: 75 -SDComment: Not known how void blast is done (amount of rapid cast seems to be related to players in party). All mobs remaining in surrounding area should aggro when engaged. -SDCategory: Auchindoun, Mana Tombs -EndScriptData */ - -#include "precompiled.h" - -#define SAY_AGGRO_1 -1557008 -#define SAY_AGGRO_2 -1557009 -#define SAY_AGGRO_3 -1557010 - -#define SAY_KILL_1 -1557011 -#define SAY_KILL_2 -1557012 - -#define SAY_DEATH -1557013 - -#define EMOTE_DARK_SHELL -1557014 - -#define SPELL_VOID_BLAST 32325 -#define H_SPELL_VOID_BLAST 38760 -#define SPELL_DARK_SHELL 32358 -#define H_SPELL_DARK_SHELL 38759 - -struct TRINITY_DLL_DECL boss_pandemoniusAI : public ScriptedAI -{ - boss_pandemoniusAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - uint32 VoidBlast_Timer; - uint32 DarkShell_Timer; - uint32 VoidBlast_Counter; - - void Reset() - { - VoidBlast_Timer = 8000+rand()%15000; - DarkShell_Timer = 20000; - VoidBlast_Counter = 0; - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_KILL_1, m_creature); break; - case 1: DoScriptText(SAY_KILL_2, m_creature); break; - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (VoidBlast_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - { - DoCast(target,HeroicMode ? H_SPELL_VOID_BLAST : SPELL_VOID_BLAST); - VoidBlast_Timer = 500; - ++VoidBlast_Counter; - } - - if (VoidBlast_Counter == 5) - { - VoidBlast_Timer = 15000+rand()%10000; - VoidBlast_Counter = 0; - } - }else VoidBlast_Timer -= diff; - - if (!VoidBlast_Counter) - { - if (DarkShell_Timer < diff) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(true); - - DoScriptText(EMOTE_DARK_SHELL, m_creature); - - DoCast(m_creature,HeroicMode ? H_SPELL_DARK_SHELL : SPELL_DARK_SHELL); - DarkShell_Timer = 20000; - }else DarkShell_Timer -= diff; - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_pandemonius(Creature* pCreature) -{ - return new boss_pandemoniusAI (pCreature); -} - -void AddSC_boss_pandemonius() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_pandemonius"; - newscript->GetAI = &GetAI_boss_pandemonius; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp deleted file mode 100644 index 00e43fa257d..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_darkweaver_syth.cpp +++ /dev/null @@ -1,438 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Darkweaver_Syth -SD%Complete: 85 -SDComment: Shock spells/times need more work. Heroic partly implemented. -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" - -#define SAY_SUMMON -1556000 - -#define SAY_AGGRO_1 -1556001 -#define SAY_AGGRO_2 -1556002 -#define SAY_AGGRO_3 -1556003 - -#define SAY_SLAY_1 -1556004 -#define SAY_SLAY_2 -1556005 - -#define SAY_DEATH -1556006 - -#define SPELL_FROST_SHOCK 21401 //37865 -#define SPELL_FLAME_SHOCK 34354 -#define SPELL_SHADOW_SHOCK 30138 -#define SPELL_ARCANE_SHOCK 37132 - -#define SPELL_CHAIN_LIGHTNING 15659 //15305 - -#define SPELL_SUMMON_SYTH_FIRE 33537 // Spawns 19203 -#define SPELL_SUMMON_SYTH_ARCANE 33538 // Spawns 19205 -#define SPELL_SUMMON_SYTH_FROST 33539 // Spawns 19204 -#define SPELL_SUMMON_SYTH_SHADOW 33540 // Spawns 19206 - -#define SPELL_FLAME_BUFFET (HeroicMode?38141:33526) -#define SPELL_ARCANE_BUFFET (HeroicMode?38138:33527) -#define SPELL_FROST_BUFFET (HeroicMode?38142:33528) -#define SPELL_SHADOW_BUFFET (HeroicMode?38143:33529) - -struct TRINITY_DLL_DECL boss_darkweaver_sythAI : public ScriptedAI -{ - boss_darkweaver_sythAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 flameshock_timer; - uint32 arcaneshock_timer; - uint32 frostshock_timer; - uint32 shadowshock_timer; - uint32 chainlightning_timer; - - bool summon90; - bool summon50; - bool summon10; - bool HeroicMode; - - void Reset() - { - flameshock_timer = 2000; - arcaneshock_timer = 4000; - frostshock_timer = 6000; - shadowshock_timer = 8000; - chainlightning_timer = 15000; - - summon90 = false; - summon50 = false; - summon10 = false; - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - } - - void KilledUnit(Unit* victim) - { - if (rand()%2) - return; - - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void JustSummoned(Creature *summoned) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - summoned->AI()->AttackStart(target); - } - - void SythSummoning() - { - DoScriptText(SAY_SUMMON, m_creature); - - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - DoCast(m_creature,SPELL_SUMMON_SYTH_ARCANE,true); //front - DoCast(m_creature,SPELL_SUMMON_SYTH_FIRE,true); //back - DoCast(m_creature,SPELL_SUMMON_SYTH_FROST,true); //left - DoCast(m_creature,SPELL_SUMMON_SYTH_SHADOW,true); //right - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 90) && !summon90) - { - SythSummoning(); - summon90 = true; - } - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 50) && !summon50) - { - SythSummoning(); - summon50 = true; - } - - if (((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 10) && !summon10) - { - SythSummoning(); - summon10 = true; - } - - if (flameshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_SHOCK); - - flameshock_timer = 10000 + rand()%5000; - } else flameshock_timer -= diff; - - if (arcaneshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_SHOCK); - - arcaneshock_timer = 10000 + rand()%5000; - } else arcaneshock_timer -= diff; - - if (frostshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_SHOCK); - - frostshock_timer = 10000 + rand()%5000; - } else frostshock_timer -= diff; - - if (shadowshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_SHOCK); - - shadowshock_timer = 10000 + rand()%5000; - } else shadowshock_timer -= diff; - - if (chainlightning_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_CHAIN_LIGHTNING); - - chainlightning_timer = 25000; - } else chainlightning_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_darkweaver_syth(Creature* pCreature) -{ - return new boss_darkweaver_sythAI (pCreature); -} - -/* ELEMENTALS */ - -struct TRINITY_DLL_DECL mob_syth_fireAI : public ScriptedAI -{ - mob_syth_fireAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 flameshock_timer; - uint32 flamebuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FIRE, true); - flameshock_timer = 2500; - flamebuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (flameshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_SHOCK); - - flameshock_timer = 5000; - }else flameshock_timer -= diff; - - if (flamebuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FLAME_BUFFET); - - flamebuffet_timer = 5000; - }else flamebuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_fire(Creature* pCreature) -{ - return new mob_syth_fireAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_arcaneAI : public ScriptedAI -{ - mob_syth_arcaneAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 arcaneshock_timer; - uint32 arcanebuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_ARCANE, true); - arcaneshock_timer = 2500; - arcanebuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (arcaneshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_SHOCK); - - arcaneshock_timer = 5000; - }else arcaneshock_timer -= diff; - - if (arcanebuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_ARCANE_BUFFET); - - arcanebuffet_timer = 5000; - }else arcanebuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_arcane(Creature* pCreature) -{ - return new mob_syth_arcaneAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_frostAI : public ScriptedAI -{ - mob_syth_frostAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 frostshock_timer; - uint32 frostbuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_FROST, true); - frostshock_timer = 2500; - frostbuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (frostshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_SHOCK); - - frostshock_timer = 5000; - }else frostshock_timer -= diff; - - if (frostbuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_FROST_BUFFET); - - frostbuffet_timer = 5000; - }else frostbuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_frost(Creature* pCreature) -{ - return new mob_syth_frostAI (pCreature); -} - -struct TRINITY_DLL_DECL mob_syth_shadowAI : public ScriptedAI -{ - mob_syth_shadowAI(Creature *c) : ScriptedAI(c) - - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 shadowshock_timer; - uint32 shadowbuffet_timer; - bool HeroicMode; - - void Reset() - { - m_creature->ApplySpellImmune(0, IMMUNITY_SCHOOL, SPELL_SCHOOL_MASK_SHADOW, true); - shadowshock_timer = 2500; - shadowbuffet_timer = 5000; - } - - void EnterCombat(Unit *who) { } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (shadowshock_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_SHOCK); - - shadowshock_timer = 5000; - }else shadowshock_timer -= diff; - - if (shadowbuffet_timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - DoCast(target,SPELL_SHADOW_BUFFET); - - shadowbuffet_timer = 5000; - }else shadowbuffet_timer -= diff; - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_mob_syth_shadow(Creature* pCreature) -{ - return new mob_syth_shadowAI (pCreature); -} - -void AddSC_boss_darkweaver_syth() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_darkweaver_syth"; - newscript->GetAI = &GetAI_boss_darkweaver_syth; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_fire"; - newscript->GetAI = &GetAI_mob_syth_arcane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_arcane"; - newscript->GetAI = &GetAI_mob_syth_arcane; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_frost"; - newscript->GetAI = &GetAI_mob_syth_frost; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_syth_shadow"; - newscript->GetAI = &GetAI_mob_syth_shadow; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp deleted file mode 100644 index 7830fc10645..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/boss_tailonking_ikiss.cpp +++ /dev/null @@ -1,221 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Talon_King_Ikiss -SD%Complete: 80 -SDComment: Heroic supported. Some details missing, but most are spell related. -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" -#include "def_sethekk_halls.h" - -#define SAY_INTRO -1556007 - -#define SAY_AGGRO_1 -1556008 -#define SAY_AGGRO_2 -1556009 -#define SAY_AGGRO_3 -1556010 - -#define SAY_SLAY_1 -1556011 -#define SAY_SLAY_2 -1556012 -#define SAY_DEATH -1556013 -#define EMOTE_ARCANE_EXP -1556015 - -#define SPELL_BLINK 38194 -#define SPELL_BLINK_TELEPORT 38203 -#define SPELL_MANA_SHIELD 38151 -#define SPELL_ARCANE_BUBBLE 9438 -#define H_SPELL_SLOW 35032 - -#define SPELL_POLYMORPH 38245 -#define H_SPELL_POLYMORPH 43309 - -#define SPELL_ARCANE_VOLLEY 35059 -#define H_SPELL_ARCANE_VOLLEY 40424 - -#define SPELL_ARCANE_EXPLOSION 38197 -#define H_SPELL_ARCANE_EXPLOSION 40425 - -struct TRINITY_DLL_DECL boss_talon_king_ikissAI : public ScriptedAI -{ - boss_talon_king_ikissAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance* pInstance; - - bool HeroicMode; - - uint32 ArcaneVolley_Timer; - uint32 Sheep_Timer; - uint32 Blink_Timer; - uint32 Slow_Timer; - - bool ManaShield; - bool Blink; - bool Intro; - - void Reset() - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - - ArcaneVolley_Timer = 5000; - Sheep_Timer = 8000; - Blink_Timer = 35000; - Slow_Timer = 15000+rand()%15000; - Blink = false; - Intro = false; - ManaShield = false; - } - - void MoveInLineOfSight(Unit *who) - { - if (!m_creature->getVictim() && who->isTargetableForAttack() && (m_creature->IsHostileTo(who)) && who->isInAccessiblePlaceFor(m_creature)) - { - if (!Intro && m_creature->IsWithinDistInMap(who, 100)) - { - Intro = true; - DoScriptText(SAY_INTRO, m_creature); - } - - if (!m_creature->canFly() && m_creature->GetDistanceZ(who) > CREATURE_Z_ATTACK_RANGE) - return; - - float attackRadius = m_creature->GetAttackDistance(who); - if (m_creature->IsWithinDistInMap(who, attackRadius) && m_creature->IsWithinLOSInMap(who)) - { - //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); - AttackStart(who); - } - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO_1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO_2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO_3, m_creature); break; - } - } - - void JustDied(Unit* Killer) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_IKISSDOOREVENT, DONE); - } - - void KilledUnit(Unit* victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY_1, m_creature); break; - case 1: DoScriptText(SAY_SLAY_2, m_creature); break; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (Blink) - { - DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_EXPLOSION : SPELL_ARCANE_EXPLOSION); - m_creature->CastSpell(m_creature,SPELL_ARCANE_BUBBLE,true); - Blink = false; - } - - if (ArcaneVolley_Timer < diff) - { - DoCast(m_creature,HeroicMode ? H_SPELL_ARCANE_VOLLEY : SPELL_ARCANE_VOLLEY); - ArcaneVolley_Timer = 7000+rand()%5000; - }else ArcaneVolley_Timer -= diff; - - if (Sheep_Timer < diff) - { - //second top aggro target in normal, random target in heroic correct? - Unit *target = NULL; - target = HeroicMode ? SelectUnit(SELECT_TARGET_RANDOM,0) : SelectUnit(SELECT_TARGET_TOPAGGRO,1); - if (target) - DoCast(target,HeroicMode ? H_SPELL_POLYMORPH : SPELL_POLYMORPH); - Sheep_Timer = 15000+rand()%2500; - }else Sheep_Timer -= diff; - - //may not be correct time to cast - if (!ManaShield && ((m_creature->GetHealth()*100) / m_creature->GetMaxHealth() < 20)) - { - DoCast(m_creature,SPELL_MANA_SHIELD); - ManaShield = true; - } - - if (HeroicMode) - { - if (Slow_Timer < diff) - { - DoCast(m_creature,H_SPELL_SLOW); - Slow_Timer = 15000+rand()%25000; - }else Slow_Timer -= diff; - } - - if (Blink_Timer < diff) - { - DoScriptText(EMOTE_ARCANE_EXP, m_creature); - - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM,0)) - { - if (m_creature->IsNonMeleeSpellCasted(false)) - m_creature->InterruptNonMeleeSpells(false); - - //Spell doesn't work, but we use for visual effect at least - DoCast(target,SPELL_BLINK); - - float X = target->GetPositionX(); - float Y = target->GetPositionY(); - float Z = target->GetPositionZ(); - - DoTeleportTo(X,Y,Z); - - DoCast(target,SPELL_BLINK_TELEPORT); - Blink = true; - } - Blink_Timer = 35000+rand()%5000; - }else Blink_Timer -= diff; - - if (!Blink) - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_talon_king_ikiss(Creature* pCreature) -{ - return new boss_talon_king_ikissAI (pCreature); -} - -void AddSC_boss_talon_king_ikiss() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_talon_king_ikiss"; - newscript->GetAI = &GetAI_boss_talon_king_ikiss; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h deleted file mode 100644 index 6156f354d84..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/def_sethekk_halls.h +++ /dev/null @@ -1,14 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SETHEKK_HALLS_H -#define DEF_SETHEKK_HALLS_H - -enum -{ - DATA_IKISSDOOREVENT = 1, - TYPE_ANZU_ENCOUNTER = 2, -}; -#endif - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp deleted file mode 100644 index 060e09a1325..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/sethekk_halls/instance_sethekk_halls.cpp +++ /dev/null @@ -1,91 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance - Sethekk Halls -SD%Complete: 50 -SDComment: Instance Data for Sethekk Halls instance -SDCategory: Auchindoun, Sethekk Halls -EndScriptData */ - -#include "precompiled.h" -#include "def_sethekk_halls.h" - -enum -{ - NPC_ANZU = 23035, - IKISS_DOOR = 177203, -}; - -struct TRINITY_DLL_DECL instance_sethekk_halls : public ScriptedInstance -{ - instance_sethekk_halls(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 AnzuEncounter; - uint64 m_uiIkissDoorGUID; - - void Initialize() - { - AnzuEncounter = NOT_STARTED; - m_uiIkissDoorGUID = 0; - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - if (pCreature->GetEntry() == NPC_ANZU && AnzuEncounter >= IN_PROGRESS) - { - pCreature->DealDamage(pCreature, pCreature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - pCreature->RemoveCorpse(); - } else { - AnzuEncounter = IN_PROGRESS; - } - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - if (pGo->GetEntry() == IKISS_DOOR) - m_uiIkissDoorGUID = pGo->GetGUID(); - } - - void SetData(uint32 type, uint32 data) - { - switch(type) - { - case DATA_IKISSDOOREVENT: - if (data == DONE) - DoUseDoorOrButton(m_uiIkissDoorGUID,DAY*IN_MILISECONDS); - break; - case TYPE_ANZU_ENCOUNTER: - AnzuEncounter = data; - break; - } - } -}; - -InstanceData* GetInstanceData_instance_sethekk_halls(Map* pMap) -{ - return new instance_sethekk_halls(pMap); -} - -void AddSC_instance_sethekk_halls() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_sethekk_halls"; - newscript->GetInstanceData = &GetInstanceData_instance_sethekk_halls; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.cpp deleted file mode 100644 index 66e6b3a108d..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_ambassador_hellmaw.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_Ambassador_Hellmaw -SD%Complete: 80 -SDComment: Enrage spell missing/not known -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "escort_ai.h" -#include "def_shadow_labyrinth.h" - -enum -{ - SAY_INTRO = -1555000, - SAY_AGGRO1 = -1555001, - SAY_AGGRO2 = -1555002, - SAY_AGGRO3 = -1555003, - SAY_HELP = -1555004, - SAY_SLAY1 = -1555005, - SAY_SLAY2 = -1555006, - SAY_DEATH = -1555007, - - SPELL_BANISH = 30231, - SPELL_CORROSIVE_ACID = 33551, - SPELL_FEAR = 33547, - SPELL_ENRAGE = 34970 -}; - -struct TRINITY_DLL_DECL boss_ambassador_hellmawAI : public npc_escortAI -{ - boss_ambassador_hellmawAI(Creature* pCreature) : npc_escortAI(pCreature) - { - m_pInstance = pCreature->GetInstanceData(); - HeroicMode = pCreature->GetMap()->IsHeroic(); - } - - ScriptedInstance* m_pInstance; - bool HeroicMode; - - uint32 EventCheck_Timer; - uint32 CorrosiveAcid_Timer; - uint32 Fear_Timer; - uint32 Enrage_Timer; - bool Intro; - bool IsBanished; - bool Enraged; - - void Reset() - { - EventCheck_Timer = 5000; - CorrosiveAcid_Timer = 5000 + rand()%5000; - Fear_Timer = 25000 + rand()%5000; - Enrage_Timer = 180000; - Intro = false; - IsBanished = true; - Enraged = false; - - if (m_pInstance && m_creature->isAlive()) - { - if (m_pInstance->GetData(TYPE_OVERSEER) != DONE) - m_creature->CastSpell(m_creature, SPELL_BANISH, true); - } - } - - void JustReachedHome() - { - if (m_pInstance) - m_pInstance->SetData(TYPE_HELLMAW, FAIL); - } - - void MoveInLineOfSight(Unit* pWho) - { - if (m_creature->HasAura(SPELL_BANISH)) - return; - - npc_escortAI::MoveInLineOfSight(pWho); - } - - void WaypointReached(uint32 i) - { - } - - void DoIntro() - { - if (m_creature->HasAura(SPELL_BANISH)) - m_creature->RemoveAurasDueToSpell(SPELL_BANISH); - - IsBanished = false; - Intro = true; - - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_HELLMAW) != FAIL) - { - DoScriptText(SAY_INTRO, m_creature); - Start(true, false, 0, NULL, false, true); - } - - m_pInstance->SetData(TYPE_HELLMAW, IN_PROGRESS); - } - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (m_pInstance) - m_pInstance->SetData(TYPE_HELLMAW, DONE); - } - - void UpdateAI(const uint32 diff) - { - if (!Intro && !IsBeingEscorted) - { - if (EventCheck_Timer < diff) - { - if (m_pInstance) - { - if (m_pInstance->GetData(TYPE_OVERSEER) == DONE) - { - DoIntro(); - return; - } - } - EventCheck_Timer = 5000; - return; - } - else - { - EventCheck_Timer -= diff; - return; - } - } - - npc_escortAI::UpdateAI(diff); - - if (!UpdateVictim()) - return; - - if (m_creature->HasAura(SPELL_BANISH, 0)) - { - EnterEvadeMode(); - return; - } - - if (CorrosiveAcid_Timer < diff) - { - DoCast(m_creature->getVictim(),SPELL_CORROSIVE_ACID); - CorrosiveAcid_Timer = 15000 + rand()%10000; - }else CorrosiveAcid_Timer -= diff; - - if (Fear_Timer < diff) - { - DoCast(m_creature,SPELL_FEAR); - Fear_Timer = 20000 + rand()%15000; - }else Fear_Timer -= diff; - - if (HeroicMode) - { - if (!Enraged && Enrage_Timer < diff) - { - DoCast(m_creature,SPELL_ENRAGE); - Enraged = true; - }else Enrage_Timer -= diff; - } - } -}; - -CreatureAI* GetAI_boss_ambassador_hellmaw(Creature* pCreature) -{ - return new boss_ambassador_hellmawAI(pCreature); -} - -void AddSC_boss_ambassador_hellmaw() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_ambassador_hellmaw"; - newscript->GetAI = &GetAI_boss_ambassador_hellmaw; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp deleted file mode 100644 index 73374c08f8c..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_blackheart_the_inciter.cpp +++ /dev/null @@ -1,177 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Blackheart_the_Inciter -SD%Complete: 75 -SDComment: Incite Chaos not functional since core lacks Mind Control support -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define SPELL_INCITE_CHAOS 33676 -#define SPELL_INCITE_CHAOS_B 33684 //debuff applied to each member of party -#define SPELL_CHARGE 33709 -#define SPELL_WAR_STOMP 33707 - -#define SAY_INTRO1 -1555008 -#define SAY_INTRO2 -1555009 -#define SAY_INTRO3 -1555010 -#define SAY_AGGRO1 -1555011 -#define SAY_AGGRO2 -1555012 -#define SAY_AGGRO3 -1555013 -#define SAY_SLAY1 -1555014 -#define SAY_SLAY2 -1555015 -#define SAY_HELP -1555016 -#define SAY_DEATH -1555017 - -#define SAY2_INTRO1 -1555018 -#define SAY2_INTRO2 -1555019 -#define SAY2_INTRO3 -1555020 -#define SAY2_AGGRO1 -1555021 -#define SAY2_AGGRO2 -1555022 -#define SAY2_AGGRO3 -1555023 -#define SAY2_SLAY1 -1555024 -#define SAY2_SLAY2 -1555025 -#define SAY2_HELP -1555026 -#define SAY2_DEATH -1555027 - -struct TRINITY_DLL_DECL boss_blackheart_the_inciterAI : public ScriptedAI -{ - boss_blackheart_the_inciterAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - } - - ScriptedInstance *pInstance; - - bool InciteChaos; - uint32 InciteChaos_Timer; - uint32 InciteChaosWait_Timer; - uint32 Charge_Timer; - uint32 Knockback_Timer; - - void Reset() - { - InciteChaos = false; - InciteChaos_Timer = 20000; - InciteChaosWait_Timer = 15000; - Charge_Timer = 5000; - Knockback_Timer = 15000; - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, NOT_STARTED); - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, DONE); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - - if (pInstance) - pInstance->SetData(DATA_BLACKHEARTTHEINCITEREVENT, IN_PROGRESS); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target - if (!UpdateVictim()) - return; - - if (InciteChaos) - { - if (InciteChaosWait_Timer < diff) - { - InciteChaos = false; - InciteChaosWait_Timer = 15000; - }else InciteChaosWait_Timer -= diff; - - return; - } - - if (InciteChaos_Timer < diff) - { - DoCast(m_creature, SPELL_INCITE_CHAOS); - - std::list t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (target && target->GetTypeId() == TYPEID_PLAYER) - target->CastSpell(target,SPELL_INCITE_CHAOS_B,true); - } - - DoResetThreat(); - InciteChaos = true; - InciteChaos_Timer = 40000; - return; - }else InciteChaos_Timer -= diff; - - //Charge_Timer - if (Charge_Timer < diff) - { - if (Unit *target = SelectUnit(SELECT_TARGET_RANDOM, 0)) - DoCast(target, SPELL_CHARGE); - Charge_Timer = 15000 + rand()%10000; - }else Charge_Timer -= diff; - - //Knockback_Timer - if (Knockback_Timer < diff) - { - DoCast(m_creature, SPELL_WAR_STOMP); - Knockback_Timer = 18000 + rand()%6000; - }else Knockback_Timer -= diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_blackheart_the_inciter(Creature* pCreature) -{ - return new boss_blackheart_the_inciterAI (pCreature); -} - -void AddSC_boss_blackheart_the_inciter() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_blackheart_the_inciter"; - newscript->GetAI = &GetAI_boss_blackheart_the_inciter; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp deleted file mode 100644 index 0cc6255f3cf..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_grandmaster_vorpil.cpp +++ /dev/null @@ -1,321 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Grandmaster_Vorpil -SD%Complete: 100 -SDComment: -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define SAY_INTRO -1555028 -#define SAY_AGGRO1 -1555029 -#define SAY_AGGRO2 -1555030 -#define SAY_AGGRO3 -1555031 -#define SAY_HELP -1555032 -#define SAY_SLAY1 -1555033 -#define SAY_SLAY2 -1555034 -#define SAY_DEATH -1555035 - -#define SPELL_RAIN_OF_FIRE 33617 -#define H_SPELL_RAIN_OF_FIRE 39363 - -#define SPELL_DRAW_SHADOWS 33563 -#define SPELL_SHADOWBOLT_VOLLEY 33841 -#define SPELL_BANISH 38791 - -#define MOB_VOID_TRAVELER 19226 -#define SPELL_SACRIFICE 33587 -#define SPELL_SHADOW_NOVA 33846 -#define SPELL_EMPOWERING_SHADOWS 33783 -#define H_SPELL_EMPOWERING_SHADOWS 39364 - -#define MOB_VOID_PORTAL 19224 -#define SPELL_VOID_PORTAL_VISUAL 33569 - -float VorpilPosition[3] = {-252.8820,-264.3030,17.1}; - -float VoidPortalCoords[5][3] = -{ - {-283.5894, -239.5718, 12.7}, - {-306.5853, -258.4539, 12.7}, - {-295.8789, -269.0899, 12.7}, - {-209.3401, -262.7564, 17.1}, - {-261.4533, -297.3298, 17.1} -}; - -struct TRINITY_DLL_DECL mob_voidtravelerAI : public ScriptedAI -{ - mob_voidtravelerAI(Creature *c) : ScriptedAI(c) - { - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - bool HeroicMode; - Unit *Vorpil; - uint32 move; - bool sacrificed; - - void Reset() - { - Vorpil = NULL; - move = 0; - sacrificed = false; - } - - void EnterCombat(Unit *who){} - - void UpdateAI(const uint32 diff) - { - if (!Vorpil) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - if (move < diff) - { - if (sacrificed) - { - SpellEntry *spell = GET_SPELL(HeroicMode?H_SPELL_EMPOWERING_SHADOWS:SPELL_EMPOWERING_SHADOWS); - if (spell) - Vorpil->AddAura(new Aura(spell, 1, NULL, Vorpil, m_creature)); - Vorpil->SetHealth(Vorpil->GetHealth()+Vorpil->GetMaxHealth()/25); - DoCast(m_creature, SPELL_SHADOW_NOVA, true); - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - m_creature->GetMotionMaster()->MoveFollow(Vorpil,0,0); - if (m_creature->IsWithinDist(Vorpil, 3)) - { - DoCast(m_creature, SPELL_SACRIFICE, false); - sacrificed = true; - move = 500; - return; - } - if (!Vorpil->isInCombat() || Vorpil->isDead()) - { - m_creature->DealDamage(m_creature, m_creature->GetMaxHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - return; - } - move = 1000; - }else move -= diff; - } -}; -CreatureAI* GetAI_mob_voidtraveler(Creature* pCreature) -{ - return new mob_voidtravelerAI (pCreature); -} - -struct TRINITY_DLL_DECL boss_grandmaster_vorpilAI : public ScriptedAI -{ - boss_grandmaster_vorpilAI(Creature *c) : ScriptedAI(c) - { - pInstance = c->GetInstanceData(); - HeroicMode = m_creature->GetMap()->IsHeroic(); - Intro = false; - } - - ScriptedInstance *pInstance; - bool Intro, HelpYell; - bool sumportals; - bool HeroicMode; - - uint32 ShadowBoltVolley_Timer; - uint32 DrawShadows_Timer; - uint32 summonTraveler_Timer; - uint32 banish_Timer; - uint64 PortalsGuid[5]; - - void Reset() - { - ShadowBoltVolley_Timer = 7000 + rand()%7000; - DrawShadows_Timer = 45000; - summonTraveler_Timer = 90000; - banish_Timer = 17000; - HelpYell = false; - destroyPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, NOT_STARTED); - } - - void summonPortals() - { - if (!sumportals) - { - for (int i = 0;i<5; ++i) - { - Creature *Portal = NULL; - Portal = m_creature->SummonCreature(MOB_VOID_PORTAL,VoidPortalCoords[i][0],VoidPortalCoords[i][1],VoidPortalCoords[i][2],0,TEMPSUMMON_CORPSE_DESPAWN,3000000); - if (Portal) - { - PortalsGuid[i] = Portal->GetGUID(); - Portal->CastSpell(Portal,SPELL_VOID_PORTAL_VISUAL,false); - } - } - sumportals = true; - summonTraveler_Timer = 5000; - } - } - - void destroyPortals() - { - if (sumportals) - { - for (int i = 0;i < 5; i ++) - { - Unit *Portal = Unit::GetUnit((*m_creature), PortalsGuid[i]); - if (Portal && Portal->isAlive()) - Portal->DealDamage(Portal, Portal->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); - PortalsGuid[i] = 0; - } - sumportals = false; - } - } - - void spawnVoidTraveler() - { - int pos = rand()%5; - m_creature->SummonCreature(MOB_VOID_TRAVELER,VoidPortalCoords[pos][0],VoidPortalCoords[pos][1],VoidPortalCoords[pos][2],0,TEMPSUMMON_CORPSE_TIMED_DESPAWN,5000); - if (!HelpYell) - { - DoScriptText(SAY_HELP, m_creature); - HelpYell = true; - } - } - - void JustSummoned(Creature *summoned) - { - if (summoned && summoned->GetEntry() == MOB_VOID_TRAVELER) - CAST_AI(mob_voidtravelerAI, summoned->AI())->Vorpil = m_creature; - } - - void KilledUnit(Unit *victim) - { - switch(rand()%2) - { - case 0: DoScriptText(SAY_SLAY1, m_creature); break; - case 1: DoScriptText(SAY_SLAY2, m_creature); break; - } - } - - void JustDied(Unit *victim) - { - DoScriptText(SAY_DEATH, m_creature); - destroyPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, DONE); - } - - void EnterCombat(Unit *who) - { - switch(rand()%3) - { - case 0: DoScriptText(SAY_AGGRO1, m_creature); break; - case 1: DoScriptText(SAY_AGGRO2, m_creature); break; - case 2: DoScriptText(SAY_AGGRO3, m_creature); break; - } - summonPortals(); - - if (pInstance) - pInstance->SetData(DATA_GRANDMASTERVORPILEVENT, IN_PROGRESS); - } - - void MoveInLineOfSight(Unit *who) - { - ScriptedAI::MoveInLineOfSight(who); - - if (!Intro && m_creature->IsWithinLOSInMap(who)&& m_creature->IsWithinDistInMap(who, 100) && m_creature->IsHostileTo(who)) - { - DoScriptText(SAY_INTRO, m_creature); - Intro = true; - } - } - - void UpdateAI(const uint32 diff) - { - if (!UpdateVictim()) - return; - - if (ShadowBoltVolley_Timer < diff) - { - DoCast(m_creature,SPELL_SHADOWBOLT_VOLLEY); - ShadowBoltVolley_Timer = 15000 + rand()%15000;; - }else ShadowBoltVolley_Timer -= diff; - - if (HeroicMode && banish_Timer < diff) - { - Unit *target = SelectTarget(SELECT_TARGET_RANDOM,0,30,false); - if (target) - { - DoCast(target,SPELL_BANISH); - banish_Timer = 16000; - } - }else banish_Timer -= diff; - - if (DrawShadows_Timer < diff) - { - Map* pMap = m_creature->GetMap(); - Map::PlayerList const &PlayerList = pMap->GetPlayers(); - for(Map::PlayerList::const_iterator i = PlayerList.begin(); i != PlayerList.end(); ++i) - if (Player* i_pl = i->getSource()) - if (i_pl->isAlive() && !i_pl->HasAura(SPELL_BANISH)) - i_pl->TeleportTo(m_creature->GetMapId(), VorpilPosition[0],VorpilPosition[1],VorpilPosition[2], 0, TELE_TO_NOT_LEAVE_COMBAT); - - m_creature->GetMap()->CreatureRelocation(m_creature, VorpilPosition[0],VorpilPosition[1],VorpilPosition[2],0.0f); - DoCast(m_creature,SPELL_DRAW_SHADOWS,true); - - DoCast(m_creature,HeroicMode?H_SPELL_RAIN_OF_FIRE:SPELL_RAIN_OF_FIRE); - - ShadowBoltVolley_Timer = 6000; - DrawShadows_Timer = 30000; - }else DrawShadows_Timer -= diff; - - if (summonTraveler_Timer < diff) - { - spawnVoidTraveler(); - summonTraveler_Timer = 10000; - //enrage at 20% - if ((m_creature->GetHealth()*5) < m_creature->GetMaxHealth()) - summonTraveler_Timer = 5000; - }else summonTraveler_Timer -=diff; - - DoMeleeAttackIfReady(); - } -}; -CreatureAI* GetAI_boss_grandmaster_vorpil(Creature* pCreature) -{ - return new boss_grandmaster_vorpilAI (pCreature); -} - -void AddSC_boss_grandmaster_vorpil() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_grandmaster_vorpil"; - newscript->GetAI = &GetAI_boss_grandmaster_vorpil; - newscript->RegisterSelf(); - - newscript = new Script; - newscript->Name="mob_voidtraveler"; - newscript->GetAI = &GetAI_mob_voidtraveler; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp deleted file mode 100644 index 259f6091af6..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/boss_murmur.cpp +++ /dev/null @@ -1,207 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Boss_Murmur -SD%Complete: 90 -SDComment: Timers may be incorrect -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define EMOTE_SONIC_BOOM -1555036 - -#define SPELL_SONIC_BOOM_CAST (HeroicMode?38796:33923) -#define SPELL_SONIC_BOOM_EFFECT (HeroicMode?38795:33666) -#define SPELL_RESONANCE 33657 -#define SPELL_MURMURS_TOUCH (HeroicMode?38794:33711) -#define SPELL_MAGNETIC_PULL 33689 -#define SPELL_SONIC_SHOCK 38797 -#define SPELL_THUNDERING_STORM 39365 - -struct TRINITY_DLL_DECL boss_murmurAI : public ScriptedAI -{ - boss_murmurAI(Creature *c) : ScriptedAI(c) - { - SetCombatMovement(false); - HeroicMode = m_creature->GetMap()->IsHeroic(); - } - - uint32 SonicBoom_Timer; - uint32 MurmursTouch_Timer; - uint32 Resonance_Timer; - uint32 MagneticPull_Timer; - uint32 SonicShock_Timer; - uint32 ThunderingStorm_Timer; - bool HeroicMode; - bool SonicBoom; - - void Reset() - { - SonicBoom_Timer = 30000; - MurmursTouch_Timer = 8000 + rand()%12000; - Resonance_Timer = 5000; - MagneticPull_Timer = 15000 + rand()%15000; - ThunderingStorm_Timer = 15000; - SonicShock_Timer = 10000; - SonicBoom = false; - - //database should have `RegenHealth`=0 to prevent regen - uint32 hp = (m_creature->GetMaxHealth()*40)/100; - if (hp) m_creature->SetHealth(hp); - m_creature->ResetPlayerDamageReq(); - } - - void SonicBoomEffect() - { - std::list t_list = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator itr = t_list.begin(); itr!= t_list.end(); ++itr) - { - Unit* target = Unit::GetUnit(*m_creature, (*itr)->getUnitGuid()); - if (target && target->GetTypeId() == TYPEID_PLAYER) - { - //Not do anything without aura, spell can be resisted! - if (target->HasAura(SPELL_SONIC_BOOM_CAST) && m_creature->IsWithinDistInMap(target, 34.0f)) - { - //This will be wrong calculation. Also, comments suggest it must deal damage - target->SetHealth(uint32(target->GetMaxHealth() - target->GetMaxHealth() * 0.8)); - } - } - } - } - - void EnterCombat(Unit *who) { } - - // Sonic Boom instant damage (needs core fix instead of this) - void SpellHitTarget(Unit *target, const SpellEntry *spell) - { - if (target && target->isAlive() && spell && spell->Id == SPELL_SONIC_BOOM_EFFECT) - m_creature->DealDamage(target,(target->GetHealth()*90)/100,NULL,SPELL_DIRECT_DAMAGE,SPELL_SCHOOL_MASK_NATURE,spell); - } - - void UpdateAI(const uint32 diff) - { - //Return since we have no target or casting - if (!UpdateVictim() || m_creature->IsNonMeleeSpellCasted(false)) - return; - - // Sonic Boom - if (SonicBoom) - { - DoCast(m_creature, SPELL_SONIC_BOOM_EFFECT, true); - SonicBoomEffect(); - - SonicBoom = false; - Resonance_Timer = 1500; - } - if (SonicBoom_Timer < diff) - { - DoScriptText(EMOTE_SONIC_BOOM, m_creature); - DoCast(m_creature, SPELL_SONIC_BOOM_CAST); - SonicBoom_Timer = 30000; - SonicBoom = true; - return; - }else SonicBoom_Timer -= diff; - - // Murmur's Touch - if (MurmursTouch_Timer < diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,80,true)) - DoCast(target, SPELL_MURMURS_TOUCH); - MurmursTouch_Timer = 25000 + rand()%10000; - }else MurmursTouch_Timer -= diff; - - // Resonance - if (!SonicBoom && !(m_creature->IsWithinMeleeRange(m_creature->getVictim()))) - { - if (Resonance_Timer < diff) - { - DoCast(m_creature, SPELL_RESONANCE); - Resonance_Timer = 5000; - }else Resonance_Timer -= diff; - } - - // Magnetic Pull - if (MagneticPull_Timer < diff) - { - if (Unit* target = SelectUnit(SELECT_TARGET_RANDOM,0)) - if (target->GetTypeId() == TYPEID_PLAYER && target->isAlive()) - { - DoCast(target, SPELL_MAGNETIC_PULL); - MagneticPull_Timer = 15000+rand()%15000; - return; - } - MagneticPull_Timer = 500; - }else MagneticPull_Timer -= diff; - - if (HeroicMode) - { - // Thundering Storm - if (ThunderingStorm_Timer < diff) - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) - if (target->isAlive() && !m_creature->IsWithinDist(target, 35, false)) - DoCast(target, SPELL_THUNDERING_STORM, true); - ThunderingStorm_Timer = 15000; - }else ThunderingStorm_Timer -= diff; - - // Sonic Shock - if (SonicShock_Timer < diff) - { - if (Unit* target = SelectTarget(SELECT_TARGET_RANDOM,0,20,false)) - if (target->isAlive()) - DoCast(target, SPELL_SONIC_SHOCK); - SonicShock_Timer = 10000+rand()%10000; - }else SonicShock_Timer -= diff; - } - - // Select nearest most aggro target if top aggro too far - if (!m_creature->isAttackReady()) - return; - if (!m_creature->IsWithinMeleeRange(m_creature->getVictim())) - { - std::list& m_threatlist = m_creature->getThreatManager().getThreatList(); - for(std::list::iterator i = m_threatlist.begin(); i != m_threatlist.end(); ++i) - if (Unit* target = Unit::GetUnit((*m_creature),(*i)->getUnitGuid())) - if (target->isAlive() && m_creature->IsWithinMeleeRange(target)) - { - m_creature->TauntApply(target); - break; - } - } - - DoMeleeAttackIfReady(); - } -}; - -CreatureAI* GetAI_boss_murmur(Creature* pCreature) -{ - return new boss_murmurAI (pCreature); -} - -void AddSC_boss_murmur() -{ - Script *newscript; - newscript = new Script; - newscript->Name="boss_murmur"; - newscript->GetAI = &GetAI_boss_murmur; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h deleted file mode 100644 index a78955368bf..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/def_shadow_labyrinth.h +++ /dev/null @@ -1,15 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software licensed under GPL version 2 - * Please see the included DOCS/LICENSE.TXT for more information */ - -#ifndef DEF_SHADOW_LABYRINTH_H -#define DEF_SHADOW_LABYRINTH_H - -#define TYPE_HELLMAW 1 -#define TYPE_OVERSEER 2 -#define DATA_BLACKHEARTTHEINCITEREVENT 3 -#define DATA_GRANDMASTERVORPILEVENT 4 -#define DATA_MURMUREVENT 5 -#define DATA_GRANDMASTERVORPIL 6 -#endif - diff --git a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp b/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp deleted file mode 100644 index f8f3b73bffa..00000000000 --- a/src/bindings/scripts/scripts/outland/aunchindoun/shadow_labyrinth/instance_shadow_labyrinth.cpp +++ /dev/null @@ -1,227 +0,0 @@ -/* Copyright (C) 2006 - 2009 ScriptDev2 - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -/* ScriptData -SDName: Instance_Shadow_Labyrinth -SD%Complete: 85 -SDComment: Some cleanup left along with save -SDCategory: Auchindoun, Shadow Labyrinth -EndScriptData */ - -#include "precompiled.h" -#include "def_shadow_labyrinth.h" - -#define MAX_ENCOUNTER 5 - -#define REFECTORY_DOOR 183296 //door opened when blackheart the inciter dies -#define SCREAMING_HALL_DOOR 183295 //door opened when grandmaster vorpil dies - -/* Shadow Labyrinth encounters: -1 - Ambassador Hellmaw event -2 - Blackheart the Inciter event -3 - Grandmaster Vorpil event -4 - Murmur event -*/ - -struct TRINITY_DLL_DECL instance_shadow_labyrinth : public ScriptedInstance -{ - instance_shadow_labyrinth(Map* pMap) : ScriptedInstance(pMap) {Initialize();}; - - uint32 m_auiEncounter[MAX_ENCOUNTER]; - std::string str_data; - - uint64 m_uiRefectoryDoorGUID; - uint64 m_uiScreamingHallDoorGUID; - - uint64 m_uiGrandmasterVorpil; - uint32 m_uiFelOverseerCount; - - void Initialize() - { - memset(&m_auiEncounter, 0, sizeof(m_auiEncounter)); - - m_uiRefectoryDoorGUID = 0; - m_uiScreamingHallDoorGUID = 0; - - m_uiGrandmasterVorpil = 0; - m_uiFelOverseerCount = 0; - } - - bool IsEncounterInProgress() const - { - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) return true; - - return false; - } - - void OnGameObjectCreate(GameObject* pGo, bool add) - { - switch(pGo->GetEntry()) - { - case REFECTORY_DOOR: - m_uiRefectoryDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[2] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - case SCREAMING_HALL_DOOR: - m_uiScreamingHallDoorGUID = pGo->GetGUID(); - if (m_auiEncounter[3] == DONE) - pGo->SetGoState(GO_STATE_ACTIVE); - break; - } - } - - void OnCreatureCreate(Creature* pCreature, bool add) - { - switch(pCreature->GetEntry()) - { - case 18732: - m_uiGrandmasterVorpil = pCreature->GetGUID(); - break; - case 18796: - if (pCreature->isAlive()) - { - ++m_uiFelOverseerCount; - debug_log("TSCR: Shadow Labyrinth: counting %u Fel Overseers.",m_uiFelOverseerCount); - } - break; - } - } - - void SetData(uint32 type, uint32 uiData) - { - switch(type) - { - case TYPE_HELLMAW: - m_auiEncounter[0] = uiData; - break; - - case TYPE_OVERSEER: - if (uiData != DONE) - { - error_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER did not expect other data than DONE"); - return; - } - if (m_uiFelOverseerCount) - { - --m_uiFelOverseerCount; - - if (m_uiFelOverseerCount) - debug_log("TSCR: Shadow Labyrinth: %u Fel Overseers left to kill.",m_uiFelOverseerCount); - else - { - m_auiEncounter[1] = DONE; - debug_log("TSCR: Shadow Labyrinth: TYPE_OVERSEER == DONE"); - } - } - break; - - case DATA_BLACKHEARTTHEINCITEREVENT: - if (uiData == DONE) - DoUseDoorOrButton(m_uiRefectoryDoorGUID); - m_auiEncounter[2] = uiData; - break; - - case DATA_GRANDMASTERVORPILEVENT: - if (uiData == DONE) - DoUseDoorOrButton(m_uiScreamingHallDoorGUID); - m_auiEncounter[3] = uiData; - break; - - case DATA_MURMUREVENT: - m_auiEncounter[4] = uiData; - break; - } - - if (uiData == DONE) - { - if (type == TYPE_OVERSEER && m_uiFelOverseerCount != 0) - return; - - OUT_SAVE_INST_DATA; - - std::ostringstream saveStream; - saveStream << m_auiEncounter[0] << " " << m_auiEncounter[1] << " " - << m_auiEncounter[2] << " " << m_auiEncounter[3] << " " << m_auiEncounter[4]; - - str_data = saveStream.str(); - - SaveToDB(); - OUT_SAVE_INST_DATA_COMPLETE; - } - } - - uint32 GetData(uint32 type) - { - switch(type) - { - case TYPE_HELLMAW: return m_auiEncounter[0]; - case TYPE_OVERSEER: return m_auiEncounter[1]; - case DATA_GRANDMASTERVORPILEVENT: return m_auiEncounter[3]; - case DATA_MURMUREVENT: return m_auiEncounter[4]; - } - return false; - } - - uint64 GetData64(uint32 identifier) - { - if (identifier == DATA_GRANDMASTERVORPIL) - return m_uiGrandmasterVorpil; - - return 0; - } - - std::string GetSaveData() - { - return str_data; - } - - void Load(const char* in) - { - if (!in) - { - OUT_LOAD_INST_DATA_FAIL; - return; - } - - OUT_LOAD_INST_DATA(in); - - std::istringstream loadStream(in); - loadStream >> m_auiEncounter[0] >> m_auiEncounter[1] >> m_auiEncounter[2] >> m_auiEncounter[3] >> m_auiEncounter[4]; - - for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - m_auiEncounter[i] = NOT_STARTED; - - OUT_LOAD_INST_DATA_COMPLETE; - } -}; - -InstanceData* GetInstanceData_instance_shadow_labyrinth(Map* pMap) -{ - return new instance_shadow_labyrinth(pMap); -} - -void AddSC_instance_shadow_labyrinth() -{ - Script *newscript; - newscript = new Script; - newscript->Name = "instance_shadow_labyrinth"; - newscript->GetInstanceData = &GetInstanceData_instance_shadow_labyrinth; - newscript->RegisterSelf(); -} - diff --git a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp index 081c80c56e5..ebf5484671c 100644 --- a/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp +++ b/src/bindings/scripts/scripts/outland/tempest_keep/arcatraz/instance_arcatraz.cpp @@ -84,8 +84,7 @@ struct TRINITY_DLL_DECL instance_arcatraz : public ScriptedInstance bool IsEncounterInProgress() const { for(uint8 i = 0; i < MAX_ENCOUNTER; ++i) - if (m_auiEncounter[i] == IN_PROGRESS) - return true; + if (m_auiEncounter[i] == IN_PROGRESS) return true; return false; } diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 024fbe7b7a1..236dab3bfcc 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -307,14 +307,14 @@ extern void AddSC_wintergrasp(); extern void AddSC_zuldrak(); //outland -extern void AddSC_boss_exarch_maladaar(); //Aunchindoun Auchenai Crypts +extern void AddSC_boss_exarch_maladaar(); //Auchindoun Auchenai Crypts extern void AddSC_boss_shirrak_the_dead_watcher(); -extern void AddSC_boss_nexusprince_shaffar(); //Aunchindoun Mana Tombs +extern void AddSC_boss_nexusprince_shaffar(); //Auchindoun Mana Tombs extern void AddSC_boss_pandemonius(); -extern void AddSC_boss_darkweaver_syth(); //Aunchindoun Sekketh Halls +extern void AddSC_boss_darkweaver_syth(); //Auchindoun Sekketh Halls extern void AddSC_boss_talon_king_ikiss(); extern void AddSC_instance_sethekk_halls(); -extern void AddSC_instance_shadow_labyrinth(); //Aunchindoun Shadow Labyrinth +extern void AddSC_instance_shadow_labyrinth(); //Auchindoun Shadow Labyrinth extern void AddSC_boss_ambassador_hellmaw(); extern void AddSC_boss_blackheart_the_inciter(); extern void AddSC_boss_grandmaster_vorpil(); @@ -693,14 +693,14 @@ void AddScripts() AddSC_zuldrak(); //outland - AddSC_boss_exarch_maladaar(); //Aunchindoun Auchenai Crypts + AddSC_boss_exarch_maladaar(); //Auchindoun Auchenai Crypts AddSC_boss_shirrak_the_dead_watcher(); - AddSC_boss_nexusprince_shaffar(); //Aunchindoun Mana Tombs + AddSC_boss_nexusprince_shaffar(); //Auchindoun Mana Tombs AddSC_boss_pandemonius(); - AddSC_boss_darkweaver_syth(); //Aunchindoun Sekketh Halls + AddSC_boss_darkweaver_syth(); //Auchindoun Sekketh Halls AddSC_boss_talon_king_ikiss(); AddSC_instance_sethekk_halls(); - AddSC_instance_shadow_labyrinth(); //Aunchindoun Shadow Labyrinth + AddSC_instance_shadow_labyrinth(); //Auchindoun Shadow Labyrinth AddSC_boss_ambassador_hellmaw(); AddSC_boss_blackheart_the_inciter(); AddSC_boss_grandmaster_vorpil(); -- cgit v1.2.3 From 0bf3aa109f061409e96930a4becd2f86ba608da1 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 16 Aug 2009 16:20:31 -0500 Subject: *Some quest fixes for some dk quests. Not enabled for now. By Azrael and ckegg. sql will be added later so you may get some console error during start up. --HG-- branch : trunk --- src/bindings/scripts/CMakeLists.txt | 2 + src/bindings/scripts/VC80/80ScriptDev2.vcproj | 8 + src/bindings/scripts/VC90/90ScriptDev2.vcproj | 8 + .../scarlet_enclave/the_scarlet_enclave.cpp | 1135 +------------------- src/bindings/scripts/system/ScriptLoader.cpp | 4 + src/game/SpellEffects.cpp | 3 +- 6 files changed, 25 insertions(+), 1135 deletions(-) (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/CMakeLists.txt b/src/bindings/scripts/CMakeLists.txt index 58b91096c18..1cd3212f00b 100644 --- a/src/bindings/scripts/CMakeLists.txt +++ b/src/bindings/scripts/CMakeLists.txt @@ -89,6 +89,8 @@ SET(trinityscript_LIB_SRCS scripts/eastern_kingdoms/molten_core/instance_molten_core.cpp scripts/eastern_kingdoms/molten_core/molten_core.cpp scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp + scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp + scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp scripts/eastern_kingdoms/scarlet_monastery/boss_arcanist_doan.cpp scripts/eastern_kingdoms/scarlet_monastery/boss_azshir_the_sleepless.cpp scripts/eastern_kingdoms/scarlet_monastery/boss_bloodmage_thalnos.cpp diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 4c98db9abb2..1e6121cada4 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -717,6 +717,14 @@ RelativePath="..\scripts\eastern_kingdoms\scarlet_enclave\the_scarlet_enclave.cpp" > + + + + + + + + SetStandState(UNIT_STAND_STATE_KNEEL); - break; - case 2: - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - //m_creature->UpdateEntry(NPC_KOLTIRA_ALT); //unclear if we must update or not - DoCast(m_creature, SPELL_KOLTIRA_TRANSFORM); - break; - case 3: - IsOnHold = true; - m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); - DoScriptText(SAY_BREAKOUT2, m_creature); - DoCast(m_creature, SPELL_ANTI_MAGIC_ZONE); // cast again that makes bubble up - break; - case 4: - SetRun(true); - break; - case 9: - m_creature->Mount(MODEL_DEATH_KNIGHT_MOUNT); - break; - case 10: - m_creature->Unmount(); - break; - } - } - - void JustSummoned(Creature* pSummoned) - { - if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) - { - pSummoned->AI()->AttackStart(pPlayer); - pSummoned->AddThreat(m_creature, 0.0f); - } - - if (pSummoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH) - m_uiValrothGUID = pSummoned->GetGUID(); - } - - void SummonAcolyte(uint32 uiAmount) - { - for(uint32 i = 0; i < uiAmount; ++i) - m_creature->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 (IsOnHold) - { - if (m_uiWave_Timer < uiDiff) - { - switch(m_uiWave) - { - case 0: - DoScriptText(SAY_BREAKOUT3, m_creature); - SummonAcolyte(3); - m_uiWave_Timer = 20000; - break; - case 1: - DoScriptText(SAY_BREAKOUT4, m_creature); - SummonAcolyte(3); - m_uiWave_Timer = 20000; - break; - case 2: - DoScriptText(SAY_BREAKOUT5, m_creature); - SummonAcolyte(4); - m_uiWave_Timer = 20000; - break; - case 3: - DoScriptText(SAY_BREAKOUT6, m_creature); - m_creature->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: - { - Unit* pTemp = Unit::GetUnit(*m_creature, m_uiValrothGUID); - - if (!pTemp || !pTemp->isAlive()) - { - DoScriptText(SAY_BREAKOUT8, m_creature); - 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, m_creature); - m_creature->RemoveAurasDueToSpell(SPELL_ANTI_MAGIC_ZONE); - m_uiWave_Timer = 2500; - break; - case 6: - DoScriptText(SAY_BREAKOUT10, m_creature); - IsOnHold = 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; -} - -/*###### -##Quest 12848 -######*/ - -enum -{ - 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 - -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 TRINITY_DLL_DECL 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; - } - - bool event_startet; - uint64 event_starter; - UnworthyInitiatePhase phase; - uint32 wait_timer; - float targ_x,targ_y,targ_z; - uint64 anchorGUID; - - EventMap events; - - void Reset() - { - anchorGUID = 0; - phase = PHASE_CHAINED; - events.Reset(); - m_creature->setFaction(7); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); - me->LoadEquipment(0, true); - event_startet = false; - } - - 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; - m_creature->CastSpell(m_creature,SPELL_DK_INITIATE_VISUAL,true); - - if (Unit* starter = Unit::GetUnit((*m_creature),event_starter)) - DoScriptText(say_event_attack[rand()%9],m_creature,starter); - - phase = PHASE_TO_ATTACK; - } - } - - void EventStart(Creature* anchor, Player* target) - { - wait_timer = 5000; - phase = PHASE_TO_EQUIP; - - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - m_creature->RemoveAurasDueToSpell(SPELL_SOUL_PRISON_CHAIN_SELF); - m_creature->RemoveAurasDueToSpell(SPELL_SOUL_PRISON_CHAIN); - - float z; - anchor->GetContactPoint(me, targ_x, targ_y, z, 1.0f); - - event_starter = target->GetGUID(); - DoScriptText(say_event_start[rand()%8], m_creature, target); - } - - void UpdateAI(const uint32 diff); -}; - -CreatureAI* GetAI_npc_unworthy_initiate(Creature* pCreature) -{ - return new npc_unworthy_initiateAI(pCreature); -} - -struct TRINITY_DLL_DECL 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) - { - float x, y, z; - float dist = 99.0f; - GameObject *prison = NULL; - - for(uint8 i = 0; i < 12; ++i) - { - if (GameObject* temp_prison = m_creature->FindNearestGameObject(acherus_soul_prison[i],30)) - { - if (dist == 99.0f || m_creature->IsWithinDist(temp_prison, dist, false)) - { - temp_prison->GetPosition(x, y, z); - dist = m_creature->GetDistance2d(temp_prison); - prison = temp_prison; - } - } - } - - if (!prison) - return; - - if (Creature* trigger = me->FindNearestCreature(29521, 30)) - { - prison->ResetDoorOrButton(); - trigger->AI()->SetGUID(m_creature->GetGUID()); - trigger->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true); - anchorGUID = trigger->GetGUID(); - } - } - return; - case PHASE_TO_EQUIP: - if (wait_timer) - { - if (wait_timer < diff) - { - m_creature->GetMotionMaster()->MovePoint(1,targ_x,targ_y,m_creature->GetPositionZ()); - phase = PHASE_EQUIPING; - wait_timer = 0; - }else wait_timer -= diff; - } - return; - case PHASE_TO_ATTACK: - if (wait_timer) - { - if (wait_timer < diff) - { - m_creature->setFaction(14); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - phase = PHASE_ATTACKING; - - if (Unit* target = Unit::GetUnit((*m_creature),event_starter)) - m_creature->AI()->AttackStart(target); - wait_timer = 0; - }else wait_timer -= diff; - } - return; - case PHASE_ATTACKING: - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_ICY_TOUCH: - DoCast(m_creature->getVictim(), SPELL_ICY_TOUCH); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_ICY_TOUCH, 5000, GCD_CAST); - break; - case EVENT_PLAGUE_STRIKE: - DoCast(m_creature->getVictim(), SPELL_PLAGUE_STRIKE); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(SPELL_PLAGUE_STRIKE, 5000, GCD_CAST); - break; - case EVENT_BLOOD_STRIKE: - DoCast(m_creature->getVictim(), SPELL_BLOOD_STRIKE); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_BLOOD_STRIKE, 5000, GCD_CAST); - break; - case EVENT_DEATH_COIL: - DoCast(m_creature->getVictim(), SPELL_DEATH_COIL); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_DEATH_COIL, 5000, GCD_CAST); - break; - } - } - - DoMeleeAttackIfReady(); - return; - } -} - -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 -{ - 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 TRINITY_DLL_DECL npc_death_knight_initiateAI : public SpellAI -{ - npc_death_knight_initiateAI(Creature* pCreature) : SpellAI(pCreature) - { - m_bIsDuelInProgress = false; - } - - bool lose; - uint64 m_uiDuelerGUID; - uint32 m_uiDuelTimer; - bool m_bIsDuelInProgress; - - void Reset() - { - lose = false; - me->RestoreFaction(); - SpellAI::Reset(); - - m_creature->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_TRIGGERED) - { - 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 >= m_creature->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) - { - m_creature->setFaction(FACTION_HOSTILE); - - if (Unit* pUnit = Unit::GetUnit(*m_creature, 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 - - SpellAI::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(pCreature->GetNpcTextId(),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_UNK_15); - - int32 uiSayId = rand()% (sizeof(m_auiRandomSay)/sizeof(int32)); - DoScriptText(m_auiRandomSay[uiSayId], pCreature, pPlayer); - - pCreature->CastSpell(pPlayer, SPELL_DUEL, false); - pPlayer->CastSpell(pPlayer, SPELL_DUEL_FLAG, true); - } - return true; -} - -/*###### -## npc_dark_rider_of_acherus -######*/ - -#define DESPAWN_HORSE 52267 - -struct TRINITY_DLL_DECL npc_dark_rider_of_acherusAI : public ScriptedAI -{ - npc_dark_rider_of_acherusAI(Creature *c) : ScriptedAI(c) {} - - uint32 PhaseTimer; - uint32 Phase; - bool Intro; - Unit *Target; - - void Reset() - { - PhaseTimer = 4000; - Phase = 0; - Intro = false; - Target = NULL; - } - - void UpdateAI(const uint32 diff) - { - if (!Intro) - return; - - if (PhaseTimer < diff) - { - switch(Phase) - { - case 0: - m_creature->MonsterSay("The realm of shadows awaits...", LANG_UNIVERSAL, 0); - PhaseTimer = 5000; - Phase = 1; - break; - case 1: - DoCast(Target, DESPAWN_HORSE, true); - PhaseTimer = 3000; - Phase = 2; - break; - case 2: - m_creature->SetVisibility(VISIBILITY_OFF); - PhaseTimer = 2000; - Phase = 3; - break; - case 3: - m_creature->ForcedDespawn(); - break; - default: - break; - } - }else PhaseTimer -= diff; - - } - - void InitDespawnHorse(Unit *who) - { - if (!who) - return; - - Target = who; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->SetSpeed(MOVE_RUN, 0.4f); - m_creature->GetMotionMaster()->MoveChase(Target); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Target->GetGUID()); - Intro = true; - } - -}; - -CreatureAI* GetAI_npc_dark_rider_of_acherus(Creature* pCreature) -{ - return new npc_dark_rider_of_acherusAI(pCreature); -} - -/*###### -## npc_salanar_the_horseman -######*/ - -enum -{ - REALM_OF_SHADOWS = 52693, - DELIVER_STOLEN_HORSE = 52264, - CALL_DARK_RIDER = 52266 -}; - -struct TRINITY_DLL_DECL 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 && CAST_CRE(caster)->isVehicle()) - { - if (Unit *charmer = caster->GetCharmer()) - { - charmer->ExitVehicle(); - caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); - caster->setFaction(35); - DoCast(caster, CALL_DARK_RIDER, true); - if (Creature* Dark_Rider = m_creature->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 && CAST_CRE(who)->isVehicle() && me->IsWithinDistInMap(who, 10.0f)) - { - if (Unit *charmer = who->GetCharmer()) - { - if (charmer->GetTypeId() == TYPEID_PLAYER) - { - switch(me->GetEntry()) - { - // for quest Into the Realm of Shadows(12687) - case 28788: - if (CAST_PLR(charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE) - { - if (CAST_PLR(charmer)->HasAura(REALM_OF_SHADOWS)) - charmer->RemoveAurasDueToSpell(REALM_OF_SHADOWS); - CAST_PLR(charmer)->GroupEventHappens(12687, me); - } - break; - default: - return; - } - CAST_PLR(charmer)->ExitVehicle(); - CAST_CRE(who)->Respawn(true); - } - } - } - } -}; - -CreatureAI* GetAI_npc_salanar_the_horseman(Creature* pCreature) -{ - return new npc_salanar_the_horsemanAI(pCreature); -} - -/*###### -## npc_ros_dark_rider -######*/ - -struct TRINITY_DLL_DECL 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->m_Vehicle && deathcharger->isVehicle() && CAST_VEH(deathcharger)->HasEmptySeat(0)) - me->EnterVehicle(CAST_VEH(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 ... -struct TRINITY_DLL_DECL npc_dkc1_gothikAI : public ScriptedAI -{ - npc_dkc1_gothikAI(Creature *c) : ScriptedAI(c) {} - - void MoveInLineOfSight(Unit *who) - { - ScriptedAI::MoveInLineOfSight(who); - - if (who->GetEntry() == 28845 && 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_CRE(who)->ForcedDespawn(); - } - } - } - } - } -}; - -CreatureAI* GetAI_npc_dkc1_gothik(Creature* pCreature) -{ - return new npc_dkc1_gothikAI(pCreature); -} - - -/*#### -## npc_scarlet_miner_cart -####*/ - -#define SPELL_CART_CHECK 54173 -#define SPELL_CART_DRAG 52465 - -struct TRINITY_DLL_DECL npc_scarlet_miner_cartAI : public PassiveAI -{ - npc_scarlet_miner_cartAI(Creature *c) : PassiveAI(c), minerGUID(0) - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - me->SetDisplayId(me->GetCreatureInfo()->DisplayID_A[0]); // 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 PassengerLeft(Unit *who, int8 seatId) - { - 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 -####*/ - -struct TRINITY_DLL_DECL 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(rand()%2) - { - 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->m_Vehicle->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("Where'd this come from? I better get this down to the ships before the foreman sees it!",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("Now I can have a rest!",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(Vehicle *car = pPlayer->m_Vehicle) - { - 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 /*#### ## npc_valkyr_battle_maiden @@ -1624,6 +560,7 @@ CreatureAI* GetAI_npc_valkyr_battle_maiden(Creature* pCreature) return new npc_valkyr_battle_maidenAI (pCreature); } + void AddSC_the_scarlet_enclave() { Script *newscript; @@ -1633,76 +570,6 @@ void AddSC_the_scarlet_enclave() newscript->GetAI = &GetAI_npc_valkyr_battle_maiden; newscript->RegisterSelf(); - // 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(); - - // 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(); - - // 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(); - // A Special Suprise newscript = new Script; newscript->Name = "npc_a_special_surprise"; diff --git a/src/bindings/scripts/system/ScriptLoader.cpp b/src/bindings/scripts/system/ScriptLoader.cpp index 236dab3bfcc..06997e985af 100644 --- a/src/bindings/scripts/system/ScriptLoader.cpp +++ b/src/bindings/scripts/system/ScriptLoader.cpp @@ -91,6 +91,8 @@ extern void AddSC_boss_ragnaros(); extern void AddSC_instance_molten_core(); extern void AddSC_molten_core(); extern void AddSC_the_scarlet_enclave(); //Scarlet Enclave +extern void AddSC_the_scarlet_enclave_c1(); +extern void AddSC_the_scarlet_enclave_c2(); extern void AddSC_boss_arcanist_doan(); //Scarlet Monastery extern void AddSC_boss_azshir_the_sleepless(); extern void AddSC_boss_bloodmage_thalnos(); @@ -477,6 +479,8 @@ void AddScripts() AddSC_instance_molten_core(); AddSC_molten_core(); AddSC_the_scarlet_enclave(); //Scarlet Enclave + AddSC_the_scarlet_enclave_c1(); + AddSC_the_scarlet_enclave_c2(); AddSC_boss_arcanist_doan(); //Scarlet Monastery AddSC_boss_azshir_the_sleepless(); AddSC_boss_bloodmage_thalnos(); diff --git a/src/game/SpellEffects.cpp b/src/game/SpellEffects.cpp index 4824b260334..39eb470bc9c 100644 --- a/src/game/SpellEffects.cpp +++ b/src/game/SpellEffects.cpp @@ -2014,10 +2014,11 @@ void Spell::EffectForceCast(uint32 i) { switch(m_spellInfo->Id) { + // 52463 also use custom damage and the summon veh spell use that damamge and cast mount aura? case 52588: unitTarget->RemoveAura(damage); break; } } - else + else // this was for 52463, need further study { unitTarget->CastCustomSpell(unitTarget, spellInfo->Id, &damage, NULL, NULL, true, NULL, NULL, m_originalCasterGUID); return; -- cgit v1.2.3 From 188a81445757c934e21805d7a23203b2e4ae7a9d Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 16 Aug 2009 16:24:19 -0500 Subject: *Replace 4 spaces with tabs in vcproj files. Please use tabs in the future. 4 spaces should only be used in cpp files. --HG-- branch : trunk --- src/bindings/scripts/VC80/80ScriptDev2.vcproj | 4718 ++++++++++++------------- src/bindings/scripts/VC90/90ScriptDev2.vcproj | 4718 ++++++++++++------------- 2 files changed, 4718 insertions(+), 4718 deletions(-) (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/VC80/80ScriptDev2.vcproj b/src/bindings/scripts/VC80/80ScriptDev2.vcproj index 1e6121cada4..ff8b323c54e 100644 --- a/src/bindings/scripts/VC80/80ScriptDev2.vcproj +++ b/src/bindings/scripts/VC80/80ScriptDev2.vcproj @@ -360,2345 +360,2345 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2763,26 +2763,26 @@ > - - - - - - - - - - + + + + + + + + + + diff --git a/src/bindings/scripts/VC90/90ScriptDev2.vcproj b/src/bindings/scripts/VC90/90ScriptDev2.vcproj index 0712a138e2f..9191348b50f 100644 --- a/src/bindings/scripts/VC90/90ScriptDev2.vcproj +++ b/src/bindings/scripts/VC90/90ScriptDev2.vcproj @@ -357,2345 +357,2345 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -2760,26 +2760,26 @@ > - - - - - - - - - - + + + + + + + + + + -- cgit v1.2.3 From a6dd58f875e63e6a56586be6c940577d53b6273a Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 16 Aug 2009 16:36:07 -0500 Subject: *Add two missing files. --HG-- branch : trunk --- .../eastern_kingdoms/scarlet_enclave/chapter1.cpp | 971 +++++++++ .../eastern_kingdoms/scarlet_enclave/chapter2.cpp | 2225 ++++++++++++++++++++ 2 files changed, 3196 insertions(+) create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp create mode 100644 src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp new file mode 100644 index 00000000000..e07b96ceb2b --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp @@ -0,0 +1,971 @@ +/* + * 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 "precompiled.h" +#include "Vehicle.h" +#include "ObjectMgr.h" +#include "escort_ai.h" + +/*###### +##Quest 12848 +######*/ + +#define GCD_CAST 1 + +enum +{ + 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 + +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 TRINITY_DLL_DECL 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; + } + + bool event_startet; + uint64 event_starter; + UnworthyInitiatePhase phase; + uint32 wait_timer; + float targ_x,targ_y,targ_z; + uint64 anchorGUID; + + EventMap events; + + void Reset() + { + anchorGUID = 0; + phase = PHASE_CHAINED; + events.Reset(); + m_creature->setFaction(7); + m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); + me->LoadEquipment(0, true); + event_startet = false; + } + + 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; + m_creature->CastSpell(m_creature,SPELL_DK_INITIATE_VISUAL,true); + + if (Unit* starter = Unit::GetUnit((*m_creature),event_starter)) + DoScriptText(say_event_attack[rand()%9],m_creature,starter); + + phase = PHASE_TO_ATTACK; + } + } + + void EventStart(Creature* anchor, Player* target) + { + wait_timer = 5000; + phase = PHASE_TO_EQUIP; + + m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); + m_creature->RemoveAurasDueToSpell(SPELL_SOUL_PRISON_CHAIN_SELF); + m_creature->RemoveAurasDueToSpell(SPELL_SOUL_PRISON_CHAIN); + + float z; + anchor->GetContactPoint(me, targ_x, targ_y, z, 1.0f); + + event_starter = target->GetGUID(); + DoScriptText(say_event_start[rand()%8], m_creature, target); + } + + void UpdateAI(const uint32 diff); +}; + +CreatureAI* GetAI_npc_unworthy_initiate(Creature* pCreature) +{ + return new npc_unworthy_initiateAI(pCreature); +} + +struct TRINITY_DLL_DECL 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) + { + float x, y, z; + float dist = 99.0f; + GameObject *prison = NULL; + + for(uint8 i = 0; i < 12; ++i) + { + if (GameObject* temp_prison = m_creature->FindNearestGameObject(acherus_soul_prison[i],30)) + { + if (dist == 99.0f || m_creature->IsWithinDist(temp_prison, dist, false)) + { + temp_prison->GetPosition(x, y, z); + dist = m_creature->GetDistance2d(temp_prison); + prison = temp_prison; + } + } + } + + if (!prison) + return; + + if (Creature* trigger = me->FindNearestCreature(29521, 30)) + { + prison->ResetDoorOrButton(); + trigger->AI()->SetGUID(m_creature->GetGUID()); + trigger->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true); + anchorGUID = trigger->GetGUID(); + } + } + return; + case PHASE_TO_EQUIP: + if (wait_timer) + { + if (wait_timer < diff) + { + m_creature->GetMotionMaster()->MovePoint(1,targ_x,targ_y,m_creature->GetPositionZ()); + phase = PHASE_EQUIPING; + wait_timer = 0; + }else wait_timer -= diff; + } + return; + case PHASE_TO_ATTACK: + if (wait_timer) + { + if (wait_timer < diff) + { + m_creature->setFaction(14); + m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + phase = PHASE_ATTACKING; + + if (Unit* target = Unit::GetUnit((*m_creature),event_starter)) + m_creature->AI()->AttackStart(target); + wait_timer = 0; + }else wait_timer -= diff; + } + return; + case PHASE_ATTACKING: + if (!UpdateVictim()) + return; + + events.Update(diff); + + while(uint32 eventId = events.ExecuteEvent()) + { + switch(eventId) + { + case EVENT_ICY_TOUCH: + DoCast(m_creature->getVictim(), SPELL_ICY_TOUCH); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(EVENT_ICY_TOUCH, 5000, GCD_CAST); + break; + case EVENT_PLAGUE_STRIKE: + DoCast(m_creature->getVictim(), SPELL_PLAGUE_STRIKE); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(SPELL_PLAGUE_STRIKE, 5000, GCD_CAST); + break; + case EVENT_BLOOD_STRIKE: + DoCast(m_creature->getVictim(), SPELL_BLOOD_STRIKE); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(EVENT_BLOOD_STRIKE, 5000, GCD_CAST); + break; + case EVENT_DEATH_COIL: + DoCast(m_creature->getVictim(), SPELL_DEATH_COIL); + events.DelayEvents(1000, GCD_CAST); + events.ScheduleEvent(EVENT_DEATH_COIL, 5000, GCD_CAST); + break; + } + } + + DoMeleeAttackIfReady(); + return; + } +} + +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 +{ + 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 TRINITY_DLL_DECL npc_death_knight_initiateAI : public SpellAI +{ + npc_death_knight_initiateAI(Creature* pCreature) : SpellAI(pCreature) + { + m_bIsDuelInProgress = false; + } + + bool lose; + uint64 m_uiDuelerGUID; + uint32 m_uiDuelTimer; + bool m_bIsDuelInProgress; + + void Reset() + { + lose = false; + me->RestoreFaction(); + SpellAI::Reset(); + + m_creature->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_TRIGGERED) + { + 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 >= m_creature->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) + { + m_creature->setFaction(FACTION_HOSTILE); + + if (Unit* pUnit = Unit::GetUnit(*m_creature, 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 + + SpellAI::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(pCreature->GetNpcTextId(),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_UNK_15); + + int32 uiSayId = rand()% (sizeof(m_auiRandomSay)/sizeof(int32)); + DoScriptText(m_auiRandomSay[uiSayId], pCreature, pPlayer); + + pCreature->CastSpell(pPlayer, SPELL_DUEL, false); + pPlayer->CastSpell(pPlayer, SPELL_DUEL_FLAG, true); + } + return true; +} + +/*###### +## npc_dark_rider_of_acherus +######*/ + +#define DESPAWN_HORSE 52267 + +struct TRINITY_DLL_DECL npc_dark_rider_of_acherusAI : public ScriptedAI +{ + npc_dark_rider_of_acherusAI(Creature *c) : ScriptedAI(c) {} + + uint32 PhaseTimer; + uint32 Phase; + bool Intro; + Unit *Target; + + void Reset() + { + PhaseTimer = 4000; + Phase = 0; + Intro = false; + Target = NULL; + } + + void UpdateAI(const uint32 diff) + { + if (!Intro) + return; + + if (PhaseTimer < diff) + { + switch(Phase) + { + case 0: + m_creature->MonsterSay("The realm of shadows awaits...", LANG_UNIVERSAL, 0); + PhaseTimer = 5000; + Phase = 1; + break; + case 1: + DoCast(Target, DESPAWN_HORSE, true); + PhaseTimer = 3000; + Phase = 2; + break; + case 2: + m_creature->SetVisibility(VISIBILITY_OFF); + PhaseTimer = 2000; + Phase = 3; + break; + case 3: + m_creature->ForcedDespawn(); + break; + default: + break; + } + }else PhaseTimer -= diff; + + } + + void InitDespawnHorse(Unit *who) + { + if (!who) + return; + + Target = who; + m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + m_creature->SetSpeed(MOVE_RUN, 0.4f); + m_creature->GetMotionMaster()->MoveChase(Target); + m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Target->GetGUID()); + Intro = true; + } + +}; + +CreatureAI* GetAI_npc_dark_rider_of_acherus(Creature* pCreature) +{ + return new npc_dark_rider_of_acherusAI(pCreature); +} + +/*###### +## npc_salanar_the_horseman +######*/ + +enum +{ + REALM_OF_SHADOWS = 52693, + DELIVER_STOLEN_HORSE = 52264, + CALL_DARK_RIDER = 52266 +}; + +struct TRINITY_DLL_DECL 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 && CAST_CRE(caster)->isVehicle()) + { + if (Unit *charmer = caster->GetCharmer()) + { + charmer->ExitVehicle(); + caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); + caster->setFaction(35); + DoCast(caster, CALL_DARK_RIDER, true); + if (Creature* Dark_Rider = m_creature->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 && CAST_CRE(who)->isVehicle() && me->IsWithinDistInMap(who, 10.0f)) + { + if (Unit *charmer = who->GetCharmer()) + { + if (charmer->GetTypeId() == TYPEID_PLAYER) + { + switch(me->GetEntry()) + { + // for quest Into the Realm of Shadows(12687) + case 28788: + if (CAST_PLR(charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE) + { + if (CAST_PLR(charmer)->HasAura(REALM_OF_SHADOWS)) + charmer->RemoveAurasDueToSpell(REALM_OF_SHADOWS); + CAST_PLR(charmer)->GroupEventHappens(12687, me); + } + break; + default: + return; + } + CAST_PLR(charmer)->ExitVehicle(); + CAST_CRE(who)->Respawn(true); + } + } + } + } +}; + +CreatureAI* GetAI_npc_salanar_the_horseman(Creature* pCreature) +{ + return new npc_salanar_the_horsemanAI(pCreature); +} + +/*###### +## npc_ros_dark_rider +######*/ + +struct TRINITY_DLL_DECL 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->m_Vehicle && deathcharger->isVehicle() && CAST_VEH(deathcharger)->HasEmptySeat(0)) + me->EnterVehicle(CAST_VEH(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 ... +struct TRINITY_DLL_DECL npc_dkc1_gothikAI : public ScriptedAI +{ + npc_dkc1_gothikAI(Creature *c) : ScriptedAI(c) {} + + void MoveInLineOfSight(Unit *who) + { + ScriptedAI::MoveInLineOfSight(who); + + if (who->GetEntry() == 28845 && 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_CRE(who)->ForcedDespawn(); + } + } + } + } + } +}; + +CreatureAI* GetAI_npc_dkc1_gothik(Creature* pCreature) +{ + return new npc_dkc1_gothikAI(pCreature); +} + +/*#### +## npc_scarlet_miner_cart +####*/ + +#define SPELL_CART_CHECK 54173 +#define SPELL_CART_DRAG 52465 + +struct TRINITY_DLL_DECL npc_scarlet_miner_cartAI : public PassiveAI +{ + npc_scarlet_miner_cartAI(Creature *c) : PassiveAI(c), minerGUID(0) + { + me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); + me->SetDisplayId(me->GetCreatureInfo()->DisplayID_A[0]); // 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 PassengerLeft(Unit *who, int8 seatId) + { + 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 +####*/ + +struct TRINITY_DLL_DECL 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(rand()%2) + { + 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->m_Vehicle->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("Where'd this come from? I better get this down to the ships before the foreman sees it!",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("Now I can have a rest!",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(Vehicle *car = pPlayer->m_Vehicle) + { + 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(); + + // 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(); +} diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp new file mode 100644 index 00000000000..e0e50364d18 --- /dev/null +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp @@ -0,0 +1,2225 @@ +/* + * 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 "precompiled.h" +#include "escort_ai.h" + +//How to win friends and influence enemies +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 TRINITY_DLL_DECL 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); + } + + 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) + { + if (rand()%100 < 5) // chance + { + uiPlayerGUID = caster->GetGUID(); + uiSpeech_timer = 1000; + uiSpeech_counter = 1; + me->setFaction(35); + me->CombatStop(true); + me->GetMotionMaster()->MoveIdle(); + me->SetReactState(REACT_PASSIVE); + + switch(rand()%6) + { + case 0: DoScriptText(SAY_PERSUADE1, caster);break; + case 1: DoScriptText(SAY_PERSUADE2, caster);break; + case 2: DoScriptText(SAY_PERSUADE3, caster);break; + case 3: DoScriptText(SAY_PERSUADE4, caster);break; + case 4: DoScriptText(SAY_PERSUADE5, caster);break; + case 5: DoScriptText(SAY_PERSUADE6, caster);break; + case 6: DoScriptText(SAY_PERSUADE7, caster);break; + } + + switch(rand()%5) + { + case 0: DoScriptText(SAY_CRUSADER1, me);break; + case 1: DoScriptText(SAY_CRUSADER2, me);break; + case 2: DoScriptText(SAY_CRUSADER3, me);break; + case 3: DoScriptText(SAY_CRUSADER4, me);break; + case 4: DoScriptText(SAY_CRUSADER5, me);break; + case 5: DoScriptText(SAY_CRUSADER6, me);break; + } + } + } + } + } + + 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); + me->RestoreFaction(); + pPlayer->Kill(me); + //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE); + //me->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + uiSpeech_counter = 0; + if(pPlayer->GetQuestStatus(12720) == QUEST_STATUS_INCOMPLETE) + pPlayer->AreaExploredOrEventHappens(12720); + return; + } + + ++uiSpeech_counter; + }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 TRINITY_DLL_DECL npc_koltira_deathweaverAI : public npc_escortAI +{ + npc_koltira_deathweaverAI(Creature *pCreature) : npc_escortAI(pCreature) { } + + uint32 m_uiWave; + uint32 m_uiWave_Timer; + uint64 m_uiValrothGUID; + + void Reset() + { + if (!IsBeingEscorted) + { + m_uiWave = 0; + m_uiWave_Timer = 3000; + m_uiValrothGUID = 0; + } + } + + void WaypointReached(uint32 uiPointId) + { + switch(uiPointId) + { + case 0: + DoScriptText(SAY_BREAKOUT1, me); + 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); + break; + case 3: + IsOnHold = 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 (Unit* pPlayer = Unit::GetUnit(*me, PlayerGUID)) + { + pSummoned->AI()->AttackStart(pPlayer); + pSummoned->AddThreat(me, 0.0f); + } + + if (pSummoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH) + m_uiValrothGUID = pSummoned->GetGUID(); + } + + 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 (IsOnHold) + { + 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: + { + Unit* pTemp = Unit::GetUnit(*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); + m_uiWave_Timer = 2500; + break; + case 6: + DoScriptText(SAY_BREAKOUT10, me); + IsOnHold = 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 scarletcourier +{ + SAY_TREE1 = -1609531, + SAY_TREE2 = -1609532, + SPELL_SHOOT = 52818, + GO_INCONSPICUOUS_TREE = 191144, + NPC_SCARLET_COURIER = 29076 +}; + +struct TRINITY_DLL_DECL mob_scarlet_courierAI : public ScriptedAI +{ + mob_scarlet_courierAI(Creature *pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + uint32 uiStage; + uint32 uiStage_timer; + uint64 pPlayer; + + void Reset() { + uiStage = 0; + uiStage_timer = 3000; + pPlayer = 0; + } + + void MovementInform(uint32 type, uint32 id) + { + if(type != POINT_MOTION_TYPE) + return; + + switch(id) + { + case 0: + uiStage = 1; + break; + case 1: + uiStage = 2; + break; + } + } + + void UpdateAI(const uint32 diff) + { + if (uiStage_timer < diff) + { + switch(uiStage) + { + case 1: + { + me->GetMotionMaster()->Clear(false); + me->GetMotionMaster()->MoveIdle(); + me->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + + if (GameObject* treeGO = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f)) + { + DoScriptText(SAY_TREE1, me); + me->GetMotionMaster()->MovePoint(1, treeGO->GetPositionX(), treeGO->GetPositionY(), treeGO->GetPositionZ()); + } + uiStage = 0; + } break; + case 2: + { + me->GetMotionMaster()->Clear(false); + me->GetMotionMaster()->MoveIdle(); + DoScriptText(SAY_TREE2, me); + me->Unmount(); + //who->RemoveSpellsCausingAura(SPELL_AURA_MOD_STEALTH); + uiStage = 0; + } break; + } + uiStage_timer = 3000; + }else uiStage_timer -= diff; + + DoMeleeAttackIfReady(); + } +}; +struct TRINITY_DLL_DECL mob_scarlet_courier_controllerAI : public ScriptedAI +{ + mob_scarlet_courier_controllerAI(Creature *pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + bool bAmbush_overlook; + + void Reset() { + bAmbush_overlook = false; + } + + void UpdateAI(const uint32 diff) + { + GameObject* treeGO = me->FindNearestGameObject(GO_INCONSPICUOUS_TREE, 40.0f); + if(treeGO && bAmbush_overlook == false) + { + Unit* pCourier = me->SummonCreature(NPC_SCARLET_COURIER, 1461.65, -6010.34, 116.369, 0, TEMPSUMMON_TIMED_DESPAWN, 180000); + pCourier->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pCourier->Mount(14338); // not sure about this id + pCourier->GetMotionMaster()->MovePoint(0, me->GetPositionX(), me->GetPositionY(), me->GetPositionZ()); + bAmbush_overlook = true; + } + if(!treeGO && bAmbush_overlook == true) + bAmbush_overlook = false; + } +}; +CreatureAI* GetAI_mob_scarlet_courier_controller(Creature* pCreature) +{ + return new mob_scarlet_courier_controllerAI (pCreature); +} + +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 TRINITY_DLL_DECL mob_high_inquisitor_valrothAI : public ScriptedAI +{ + mob_high_inquisitor_valrothAI(Creature *pCreature) : ScriptedAI(pCreature) + { + Reset(); + } + + 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 Aggro(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() + { + switch(rand()%20) + { + case 0: DoScriptText(SAY_VALROTH3, me);break; + case 1: DoScriptText(SAY_VALROTH4, me);break; + case 2: DoScriptText(SAY_VALROTH5, me);break; + } + } + + 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); +} + +//Light of Dawn +enum mograine +{ + 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 + 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 TRINITY_DLL_DECL 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]; + + // Misc + uint64 uiDawnofLightGUID; + + void Reset() + { + if (!IsBeingEscorted) + { + 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; + + uiDawnofLightGUID = 0; + + uiAnti_magic_zone = 1000 + rand()%5000; + uiDeath_strike = 5000 + rand()%5000; + uiDeath_embrace = 5000 + rand()%5000; + uiIcy_touch = 5000 + rand()%5000; + uiUnholy_blight = 5000 + rand()%5000; + + uiFight_speech = 15000; + uiSpawncheck = 1000; + uiTargetcheck = 10000; + + ((Unit*)me)->SetStandState(UNIT_STAND_STATE_STAND); + me->Mount(25279); + + UpdateWorldState(me->GetMap(), WORLD_STATE_REMAINS, 0); + //UpdateWorldState(me->GetMap(), WORLD_STATE_COUNTDOWN, 0); + UpdateWorldState(me->GetMap(), WORLD_STATE_EVENT_BEGIN, 0); + + if (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + pTemp->setDeathState(JUST_DIED); + if (Unit* pTemp = Unit::GetUnit((*me), uiKorfaxGUID)) + pTemp->setDeathState(JUST_DIED); + if (Unit* pTemp = Unit::GetUnit((*me), uiMaxwellGUID)) + pTemp->setDeathState(JUST_DIED); + if (Unit* pTemp = Unit::GetUnit((*me), uiEligorGUID)) + pTemp->setDeathState(JUST_DIED); + if (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), uiDefenderGUID[i])) + pTemp->setDeathState(JUST_DIED); + uiDefenderGUID[i] = 0; + } + for(uint8 i = 0; i < ENCOUNTER_EARTHSHATTER_NUMBER; ++i) + { + if (Unit* pTemp = Unit::GetUnit((*me), uiEarthshatterGUID[i])) + pTemp->setDeathState(JUST_DIED); + uiEarthshatterGUID[i] = 0; + } + + if (Unit* pTemp = Unit::GetUnit((*me), uiKoltiraGUID)) + pTemp->setDeathState(JUST_DIED); + if (Unit* pTemp = Unit::GetUnit((*me), uiOrbazGUID)) + pTemp->setDeathState(JUST_DIED); + if (Unit* pTemp = Unit::GetUnit((*me), uiThassarianGUID)) + pTemp->setDeathState(JUST_DIED); + if (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + pTemp->setDeathState(JUST_DIED); + + uiKoltiraGUID = NULL; + uiOrbazGUID = NULL; + uiThassarianGUID = NULL; + uiLichKingGUID = NULL; + for(uint8 i = 0; i < ENCOUNTER_ABOMINATION_NUMBER; ++i) + { + if (Unit* pTemp = Unit::GetUnit((*me), uiAbominationGUID[i])) + pTemp->setDeathState(JUST_DIED); + uiAbominationGUID[i] = 0; + } + for(uint8 i = 0; i < ENCOUNTER_BEHEMOTH_NUMBER; ++i) + { + if (Unit* pTemp = Unit::GetUnit((*me), uiBehemothGUID[i])) + pTemp->setDeathState(JUST_DIED); + uiBehemothGUID[i] = 0; + } + for(uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) + { + if (Unit* pTemp = Unit::GetUnit((*me), uiGhoulGUID[i])) + pTemp->setDeathState(JUST_DIED); + uiGhoulGUID[i] = 0; + } + for(uint8 i = 0; i < ENCOUNTER_WARRIOR_NUMBER; ++i) + { + if (Unit* pTemp = Unit::GetUnit((*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) + { + IsOnHold = bOnHold; + } + + void WaypointReached(uint32 i) + { + switch(i) + { + case 0: + me->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + SetHoldState(true); + break; + case 1: + SetHoldState(true); + + if (GameObject* pGo = me->FindNearestGameObject(GO_LIGHT_OF_DAWN, 100.0f)) // make dawn of light effect off + { + uiDawnofLightGUID = pGo->GetGUID(); + pGo->SetPhaseMask(0, true); + } + + SpawnNPC(); + if (Unit* pTemp = Unit::GetUnit((*me), uiKorfaxGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN07, pTemp); + if (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), uiKoltiraGUID)) + pTemp->Unmount(); + if (Unit* pTemp = Unit::GetUnit((*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::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), uiMaxwellGUID)) + { + pTemp->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[13].x, LightofDawnLoc[13].y, LightofDawnLoc[13].z); + } + if (Unit* pTemp = Unit::GetUnit((*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); + ((Unit*)me)->SetStandState(UNIT_STAND_STATE_KNEEL); + + if (Unit* pTemp = Unit::GetUnit((*me), uiKoltiraGUID)) + pTemp->SetStandState(UNIT_STAND_STATE_KNEEL); + if (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + me->CastSpell(pTemp, SPELL_ASHBRINGER, true); + DoScriptText(EMOTE_LIGHT_OF_DAWN14, me); + SetHoldState(true); + break; + } + } + + 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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN28, pTemp); + JumpToNextStep(21000); + break; + + case 12: + if (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN29, pTemp); + JumpToNextStep(13000); + break; + + case 13: + if (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN30, pTemp); + JumpToNextStep(13000); + break; + + case 14: + ((Unit*)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 (Unit* pTemp = Unit::GetUnit((*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: + ((Unit*)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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), uiDarionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN36, pTemp); + JumpToNextStep(4000); + break; + + case 21: + if (Unit* pTemp = Unit::GetUnit((*me), uiDarionGUID)) + DoScriptText(EMOTE_LIGHT_OF_DAWN08, pTemp); + JumpToNextStep(4000); + break; + + case 22: + if (Unit* pTemp = Unit::GetUnit((*me), uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN37, pTemp); + JumpToNextStep(8000); + break; + + case 23: + if (Unit* pTemp = Unit::GetUnit((*me), uiDarionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN38, pTemp); + JumpToNextStep(8000); + break; + + case 24: + if (Unit* pTemp = Unit::GetUnit((*me), uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN39, pTemp); + + if (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), uiDarionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN40, pTemp); + JumpToNextStep(11000); + break; + + case 26: + if (Unit* pTemp = Unit::GetUnit((*me), uiAlexandrosGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN41, pTemp); + JumpToNextStep(5000); + break; + + case 27: + if (Unit* pTemp = Unit::GetUnit((*me), uiDarionGUID)) + pTemp->setDeathState(JUST_DIED); + JumpToNextStep(24000); + break; + + case 28: + if (Unit* pTemp = Unit::GetUnit((*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::GetUnit((*me), uiAlexandrosGUID)) + pTemp->CastSpell(pAlex, SPELL_SOUL_FEAST_ALEX, false); + } + JumpToNextStep(2000); + break; + + case 30: + if (Unit* pTemp = Unit::GetUnit((*me), uiAlexandrosGUID)) // just hide him + { + DoScriptText(EMOTE_LIGHT_OF_DAWN09, pTemp); + pTemp->SetVisibility(VISIBILITY_OFF); + } + if (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + { + pTemp->InterruptNonMeleeSpells(false); + DoScriptText(SAY_LIGHT_OF_DAWN45, pTemp); + } + JumpToNextStep(3000); + break; + + case 31: + ((Unit*)me)->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(EMOTE_LIGHT_OF_DAWN10, me); + DoScriptText(SAY_LIGHT_OF_DAWN44, me); + JumpToNextStep(3000); + break; + + case 32: + if (Unit* pTemp = Unit::GetUnit((*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 +// disable if (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) +// because TRINITY 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 (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + { + pTemp->HandleEmoteCommand(EMOTE_ONESHOT_KICK); + DoScriptText(SAY_LIGHT_OF_DAWN46, pTemp); + } + me->SetSpeed(MOVE_RUN, 6.0f); + ((Unit*)me)->SetStandState(UNIT_STAND_STATE_DEAD); + SetHoldState(false); // Darion got kicked by lich king + JumpToNextStep(0); + break; + + case 37: // Lich king counterattacks + ((Unit*)me)->SetStandState(UNIT_STAND_STATE_KNEEL); + JumpToNextStep(3000); + break; + + case 38: + if (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN47, pTemp); + JumpToNextStep(8000); + break; + + case 39: + if (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN48, pTemp); + JumpToNextStep(15000); + break; + + case 40: + if (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN49, pTemp); + JumpToNextStep(17000); + break; + + case 41: // Lich king - Apocalypse + if (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + { + DoScriptText(EMOTE_LIGHT_OF_DAWN11, pTemp); + DoScriptText(SAY_LIGHT_OF_DAWN51, pTemp); + if (Unit* pTirion = Unit::GetUnit((*me), uiTirionGUID)) + { + ((Unit*)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, fLichPositionY, fLichPositionZ; + if (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + DoScriptText(EMOTE_LIGHT_OF_DAWN13, pTemp); + + if (Unit* pTemp = Unit::GetUnit((*me), uiMaxwellGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + pTemp->SetSpeed(MOVE_RUN, 6.0f); + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_DEAD); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[14].x, LightofDawnLoc[14].y, LightofDawnLoc[14].z); + } + if (Unit* pTemp = Unit::GetUnit((*me), uiKorfaxGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + pTemp->SetSpeed(MOVE_RUN, 6.0f); + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_DEAD); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[11].x, LightofDawnLoc[11].y, LightofDawnLoc[11].z); + } + if (Unit* pTemp = Unit::GetUnit((*me), uiEligorGUID)) + { + pTemp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE); + pTemp->SetSpeed(MOVE_RUN, 6.0f); + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_DEAD); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[17].x, LightofDawnLoc[17].y, LightofDawnLoc[17].z); + } + if (Unit* pTemp = Unit::GetUnit((*me), uiDefenderGUID[0])) + { + pTemp->SetSpeed(MOVE_RUN, 6.0f); + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_DEAD); + pTemp->GetMotionMaster()->MovePoint(0, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z); + } + if (Unit* pTemp = Unit::GetUnit((*me), uiEarthshatterGUID[0])) + { + pTemp->SetSpeed(MOVE_RUN, 6.0f); + ((Unit*)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 (Unit* pTemp = Unit::GetUnit((*me), uiMaxwellGUID)) + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_STAND); + if (Unit* pTemp = Unit::GetUnit((*me), uiKorfaxGUID)) + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_STAND); + if (Unit* pTemp = Unit::GetUnit((*me), uiEligorGUID)) + ((Unit*)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); + ((Unit*)me)->SetStandState(UNIT_STAND_STATE_STAND); + DoScriptText(SAY_LIGHT_OF_DAWN53, me); + SetHoldState(false); // Darion throws sword + JumpToNextStep(7000); + break; + + case 47: // Ashbringer rebirth + ((Unit*)me)->SetStandState(UNIT_STAND_STATE_KNEEL); + DoScriptText(EMOTE_LIGHT_OF_DAWN15, me); + if (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + { + ((Unit*)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); + if (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + pTemp->InterruptNonMeleeSpells(false); + JumpToNextStep(2500); + break; + + case 49: + if (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN54, pTemp); + JumpToNextStep(4000); + break; + + case 50: + if (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN55, pTemp); + JumpToNextStep(5000); + break; + + case 51: + if (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN56, pTemp); + JumpToNextStep(1000); + break; + + case 52: // Tiron charges + if (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN57, pTemp); + JumpToNextStep(1000); + break; + + case 54: + if (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_KNEEL); + JumpToNextStep(2000); + break; + + case 56: + if (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + ((Unit*)pTemp)->SetStandState(UNIT_STAND_STATE_STAND); + JumpToNextStep(1500); + break; + + case 57: + if (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN58, pTemp); + JumpToNextStep(10000); + break; + + case 58: + if (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN59, pTemp); + JumpToNextStep(10000); + break; + + case 59: + if (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) + pTemp->CastSpell(pTemp, SPELL_TELEPORT_VISUAL, false); + if (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), uiLichKingGUID)) // Lich king disappears here + { + DoScriptText(EMOTE_LIGHT_OF_DAWN17, pTemp); + pTemp->DealDamage(pTemp, pTemp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + JumpToNextStep(10000); + break; + + case 61: + if (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN60, pTemp); + JumpToNextStep(3000); + break; + + case 62: + if (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN62, pTemp); + JumpToNextStep(7000); + break; + + case 65: + if (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN63, pTemp); + JumpToNextStep(10000); + break; + + case 66: + if (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN64, pTemp); + JumpToNextStep(11000); + break; + + case 67: + if (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN65, pTemp); + JumpToNextStep(10000); + break; + + case 68: + if (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN66, pTemp); + JumpToNextStep(8000); + break; + + case 69: + if (Unit* pTemp = Unit::GetUnit((*me), uiTirionGUID)) + DoScriptText(SAY_LIGHT_OF_DAWN67, pTemp); + JumpToNextStep(10000); + break; + + case 70: + ((Unit*)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(0); + 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) + { + switch(rand()%15) + { + case 0: DoScriptText(SAY_LIGHT_OF_DAWN09, me);break; + case 1: DoScriptText(SAY_LIGHT_OF_DAWN10, me);break; + case 2: DoScriptText(SAY_LIGHT_OF_DAWN11, me);break; + case 3: DoScriptText(SAY_LIGHT_OF_DAWN12, me);break; + case 4: DoScriptText(SAY_LIGHT_OF_DAWN13, me);break; + case 5: DoScriptText(SAY_LIGHT_OF_DAWN14, me);break; + case 6: DoScriptText(SAY_LIGHT_OF_DAWN15, me);break; + case 7: DoScriptText(SAY_LIGHT_OF_DAWN16, me);break; + case 8: DoScriptText(SAY_LIGHT_OF_DAWN17, me);break; + case 9: DoScriptText(SAY_LIGHT_OF_DAWN18, me);break; + case 10: DoScriptText(SAY_LIGHT_OF_DAWN19, me);break; + case 11: DoScriptText(SAY_LIGHT_OF_DAWN20, me);break; + case 12: DoScriptText(SAY_LIGHT_OF_DAWN21, me);break; + case 13: DoScriptText(SAY_LIGHT_OF_DAWN22, me);break; + case 14: DoScriptText(SAY_LIGHT_OF_DAWN23, me);break; + case 15: DoScriptText(SAY_LIGHT_OF_DAWN24, me);break; + } + 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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), uiOrbazGUID)) + DoScriptText(EMOTE_LIGHT_OF_DAWN04, pTemp); + + if (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*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 (Unit* pTemp = Unit::GetUnit((*me), ui_GUID)) + if (pTemp->isAlive()) + if (Unit* pTarger = SelectUnit(SELECT_TARGET_RANDOM,0)) + if (pTarger->isAlive()) + { + //((Creature*)pTemp)->DeleteThreatList(); + ((Creature*)pTemp)->AddThreat(pTarger, 0.0f); + ((Creature*)pTemp)->AI()->AttackStart(pTarger); + ((Creature*)pTemp)->SetInCombatWith(pTarger); + pTarger->SetInCombatWith(pTemp); + //((Creature*)pTemp)->GetMotionMaster()->MoveChase(pTarger, 20.0f); + } + } + + void SpawnNPC() + { + Unit* pTemp = NULL; + + // Death + for(uint8 i = 0; i < ENCOUNTER_GHOUL_NUMBER; ++i) + { + if (!(pTemp = Unit::GetUnit((*me), uiGhoulGUID[i]))) + { + 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) + { + if (!(pTemp = Unit::GetUnit((*me), uiAbominationGUID[i]))) + { + 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) + { + if (!(pTemp = Unit::GetUnit((*me), uiWarriorGUID[i]))) + { + 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) + { + if (!(pTemp = Unit::GetUnit((*me), uiBehemothGUID[i]))) + { + 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) + { + if (!(pTemp = Unit::GetUnit((*me), uiDefenderGUID[i]))) + { + 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) + { + if (!(pTemp = Unit::GetUnit((*me), uiEarthshatterGUID[i]))) + { + 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(); + } + } + if (!(pTemp = Unit::GetUnit((*me), uiKorfaxGUID))) + { + 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(); + } + if (!(pTemp = Unit::GetUnit((*me), uiMaxwellGUID))) + { + 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(); + } + if (!(pTemp = Unit::GetUnit((*me), uiEligorGUID))) + { + 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(); + } + if (!(pTemp = Unit::GetUnit((*me), uiRayneGUID))) + { + 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 (Unit* pTemp = Unit::GetUnit((*me), pGUID)) + if (pTemp->isAlive()) + { + pTemp->SetVisibility(VISIBILITY_OFF); + pTemp->DealDamage(pTemp, pTemp->GetHealth(), NULL, DIRECT_DAMAGE, SPELL_SCHOOL_MASK_NORMAL, NULL, false); + } + } +}; + +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(pCreature->GetNpcTextId(), 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(); + ((npc_highlord_darion_mograineAI*)pCreature->AI())->uiStep = 1; + ((npc_highlord_darion_mograineAI*)pCreature->AI())->Start(true, false, pPlayer->GetGUID()); + break; + } + return true; +} + +/*###### +## npc the lich king in dawn of light +######*/ +struct TRINITY_DLL_DECL 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) { return; } // very sample, just don't make them aggreesive + void UpdateAI(const uint32 diff) { return; } + void JustDied(Unit* killer) {} +}; + +CreatureAI* GetAI_npc_highlord_darion_mograine(Creature* pCreature) +{ + npc_highlord_darion_mograineAI* tempAI = new npc_highlord_darion_mograineAI(pCreature); + + tempAI->FillPointMovementListForCreature(); + + return (CreatureAI*)tempAI; +} + +CreatureAI* GetAI_npc_the_lich_king_tirion_dawn(Creature* pCreature) +{ + return new npc_the_lich_king_tirion_dawnAI (pCreature); +} + +void AddSC_the_scarlet_enclave_c2() +{ + Script *newscript; + + newscript = new Script; + newscript->Name="npc_crusade_persuaded"; + newscript->GetAI = &GetAI_npc_crusade_persuaded; + 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_scarlet_courier_controller"; + newscript->GetAI = &GetAI_mob_scarlet_courier_controller; + newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="mob_scarlet_courier"; + newscript->GetAI = &GetAI_mob_scarlet_courier; + newscript->RegisterSelf(); + + 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(); + + 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(); +} \ No newline at end of file -- cgit v1.2.3 From bf3928d16352e1c0034ae41aebc69a21504870de Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 16 Aug 2009 16:54:31 -0500 Subject: *Fix endless hunger quest. --HG-- branch : trunk --- .../scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp index e07b96ceb2b..9b086ea0853 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter1.cpp @@ -213,12 +213,14 @@ void npc_unworthy_initiateAI::UpdateAI(const uint32 diff) if (!prison) return; - if (Creature* trigger = me->FindNearestCreature(29521, 30)) + prison->ResetDoorOrButton(); + + if (Creature* anchor = me->FindNearestCreature(29521, 30)) { - prison->ResetDoorOrButton(); - trigger->AI()->SetGUID(m_creature->GetGUID()); - trigger->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true); - anchorGUID = trigger->GetGUID(); + anchor->GetPosition(targ_x, targ_y, targ_z); + anchor->AI()->SetGUID(m_creature->GetGUID()); + anchor->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true); + anchorGUID = anchor->GetGUID(); } } return; -- cgit v1.2.3 From cad925e31d0cf71ead219d717ce34e6fea8be251 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Mon, 17 Aug 2009 00:29:53 +0200 Subject: Merge [SD2] r1326 Correct waypoints and details for quest 863 r1327 Add function GetPlayerForEscort to escortAI (not used by escortAI yet) r1328 Updated 0.12 patch and redesigned Karathress for better maintenance. Fixed an issue with Karathres's speech and a little casting bug. - skip r1329 Remove use of old uint64 variable for player guid in escortAI and use function to retrieve pointer to player instead. r1330 Restore compile and use FailQuest instead of no longer existing FailTimedQuest (ref Mangos 8355). Move all waypoints to db --HG-- branch : trunk --- sql/FULL/world_script_waypoints.sql | 312 +++++++++++++++++++++ sql/updates/5105_world_scripts.sql | 311 ++++++++++++++++++++ src/bindings/scripts/base/escort_ai.cpp | 14 +- src/bindings/scripts/base/escort_ai.h | 9 +- .../scripts/eastern_kingdoms/arathi_highlands.cpp | 5 +- .../scripts/eastern_kingdoms/eversong_woods.cpp | 13 +- .../scripts/eastern_kingdoms/ghostlands.cpp | 2 +- .../scripts/eastern_kingdoms/hinterlands.cpp | 6 +- .../scarlet_enclave/the_scarlet_enclave.cpp | 2 +- .../scripts/eastern_kingdoms/silverpine_forest.cpp | 34 +-- .../scripts/scripts/eastern_kingdoms/westfall.cpp | 4 +- .../scripts/scripts/eastern_kingdoms/wetlands.cpp | 6 +- .../scripts/scripts/examples/example_escort.cpp | 16 +- .../scripts/scripts/kalimdor/ashenvale.cpp | 12 +- .../scripts/scripts/kalimdor/azuremyst_isle.cpp | 2 +- .../old_hillsbrad/old_hillsbrad.cpp | 9 +- .../scripts/scripts/kalimdor/darkshore.cpp | 7 +- src/bindings/scripts/scripts/kalimdor/feralas.cpp | 2 +- .../kalimdor/razorfen_kraul/razorfen_kraul.cpp | 66 +---- .../scripts/kalimdor/stonetalon_mountains.cpp | 6 +- src/bindings/scripts/scripts/kalimdor/tanaris.cpp | 104 +------ .../scripts/scripts/kalimdor/the_barrens.cpp | 195 +++++++------ .../scripts/scripts/kalimdor/thousand_needles.cpp | 6 +- .../scripts/scripts/kalimdor/ungoro_crater.cpp | 79 +----- .../scripts/scripts/northrend/sholazar_basin.cpp | 11 +- .../scripts/scripts/outland/hellfire_peninsula.cpp | 6 +- .../scripts/scripts/outland/netherstorm.cpp | 55 +--- .../scripts/scripts/outland/shadowmoon_valley.cpp | 12 +- .../scripts/scripts/outland/shattrath_city.cpp | 82 +++--- .../scripts/scripts/outland/terokkar_forest.cpp | 82 +----- .../scripts/scripts/outland/zangarmarsh.cpp | 16 +- 31 files changed, 888 insertions(+), 598 deletions(-) create mode 100644 sql/updates/5105_world_scripts.sql (limited to 'src/bindings/scripts') diff --git a/sql/FULL/world_script_waypoints.sql b/sql/FULL/world_script_waypoints.sql index 86aee4a71ac..940ef9920ce 100644 --- a/sql/FULL/world_script_waypoints.sql +++ b/sql/FULL/world_script_waypoints.sql @@ -13,6 +13,318 @@ CREATE TABLE script_waypoint ( PRIMARY KEY (entry, pointid) ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Script Creature waypoints'; +DELETE FROM script_waypoint WHERE entry = 20415; +INSERT INTO script_waypoint VALUES +(20415 ,0, 2488.77, 2184.89, 104.64, 0, ''), +(20415 ,1, 2478.72, 2184.77, 98.58, 0, ''), +(20415 ,2, 2473.52, 2184.71, 99.00, 0, ''), +(20415 ,3, 2453.15, 2184.96, 97.09,4000, ''), +(20415 ,4, 2424.18, 2184.15, 94.11, 0, ''), +(20415 ,5, 2413.18, 2184.15, 93.42, 0, ''), +(20415 ,6, 2402.02, 2183.90, 87.59, 0, ''), +(20415 ,7, 2333.31, 2181.63, 90.03,4000, ''), +(20415 ,8, 2308.73, 2184.34, 92.04, 0, ''), +(20415 ,9, 2303.10, 2196.89, 94.94, 0, ''), +(20415 ,10, 2304.58, 2272.23, 96.67, 0, ''), +(20415 ,11, 2297.09, 2271.40, 95.16, 0, ''), +(20415 ,12, 2297.68, 2266.79, 95.07,4000, ''), +(20415 ,13, 2297.67, 2266.76, 95.07,4000, ''); + +DELETE FROM script_waypoint WHERE entry = 18760; +INSERT INTO script_waypoint VALUES +(18760 ,0, -2265.21, 3091.14, 13.91, 0, ''), +(18760 ,1, -2266.80, 3091.33, 13.82, 1000, ''), +(18760 ,2, -2268.20, 3091.14, 13.82, 7000, 'progress1'), +(18760 ,3, -2278.32, 3098.98, 13.82, 0, ''), +(18760 ,4, -2294.82, 3110.59, 13.82, 0, ''), +(18760 ,5, -2300.71, 3114.60, 13.82, 20000, 'progress2'), +(18760 ,6, -2300.71, 3114.60, 13.82, 3000, 'progress3'), +(18760 ,7, -2307.36, 3122.76, 13.79, 0, ''), +(18760 ,8, -2312.83, 3130.55, 12.04, 0, ''), +(18760 ,9, -2345.02, 3151.00, 8.38, 0, ''), +(18760 ,10, -2351.97, 3157.61, 6.27, 0, ''), +(18760 ,11, -2360.35, 3171.48, 3.31, 0, ''), +(18760 ,12, -2371.44, 3185.41, 0.89, 0, ''), +(18760 ,13, -2371.21, 3197.92, -0.96, 0, ''), +(18760 ,14, -2380.35, 3210.45, -1.08, 0, ''), +(18760 ,15, -2384.74, 3221.25, -1.17, 0, ''), +(18760 ,16, -2386.15, 3233.39, -1.29, 0, ''), +(18760 ,17, -2383.45, 3247.79, -1.32, 0, ''), +(18760 ,18, -2367.50, 3265.64, -1.33, 0, ''), +(18760 ,19, -2354.90, 3273.30, -1.50, 0, ''), +(18760 ,20, -2348.88, 3280.58, -0.09, 0, ''), +(18760 ,21, -2349.06, 3295.86, -0.95, 0, ''), +(18760 ,22, -2350.43, 3328.27, -2.10, 0, ''), +(18760 ,23, -2346.76, 3356.27, -2.82, 0, ''), +(18760 ,24, -2340.56, 3370.68, -4.02, 0, ''), +(18760 ,25, -2318.84, 3384.60, -7.61, 0, ''), +(18760 ,26, -2313.99, 3398.61, -10.40, 0, ''), +(18760 ,27, -2320.85, 3414.49, -11.49, 0, ''), +(18760 ,28, -2338.26, 3426.06, -11.46, 0, ''), +(18760 ,29, -2342.67, 3439.44, -11.32, 12000, 'progress4'), +(18760 ,30, -2342.67, 3439.44, -11.32, 7000, 'emote bye'), +(18760 ,31, -2342.67, 3439.44, -11.32, 5000, 'cat form'), +(18760 ,32, -2344.60, 3461.27, -10.44, 0, ''), +(18760 ,33, -2396.81, 3517.17, -3.55, 0, ''), +(18760 ,34, -2439.23, 3523.00, -1.05, 0, ''); + +DELETE FROM script_waypoint WHERE entry = 9623; +INSERT INTO script_waypoint VALUES +(9623 ,1, -6380.38, -1965.14, -258.292, 5000, ''), +(9623 ,2, -6383.06, -1962.9, -258.936, 0, ''), +(9623 ,3, -6391.09, -1956.13, -260.291, 0, ''), +(9623 ,4, -6395.29, -1933.58, -262.949, 0, ''), +(9623 ,5, -6396.58, -1919.93, -263.838, 0, ''), +(9623 ,6, -6389.01, -1912.64, -260.689, 0, ''), +(9623 ,7, -6369.19, -1892.87, -255.924, 0, ''), +(9623 ,8, -6373.77, -1879.36, -259.268, 0, ''), +(9623 ,9, -6377.55, -1869.56, -260.503, 0, ''), +(9623 ,10, -6376.58, -1860.79, -260.026, 0, ''), +(9623 ,11, -6373.13, -1847.22, -259.249, 0, ''), +(9623 ,12, -6370.54, -1837.04, -260.007, 0, ''), +(9623 ,13, -6372.52, -1829.16, -260.071, 0, ''), +(9623 ,14, -6377.13, -1815.94, -262.632, 0, ''), +(9623 ,15, -6380.27, -1806.95, -265.53, 0, ''), +(9623 ,16, -6386.04, -1790.43, -268.546, 0, ''), +(9623 ,17, -6386.72, -1776.29, -269.851, 0, ''), +(9623 ,18, -6385.92, -1762.31, -271.494, 0, ''), +(9623 ,19, -6384.69, -1744.86, -272.196, 0, ''), +(9623 ,20, -6383.8, -1732.66, -272.222, 0, ''), +(9623 ,21, -6382.66, -1716.96, -272.235, 0, ''), +(9623 ,22, -6381.5, -1703.01, -272.964, 0, ''), +(9623 ,23, -6379.96, -1685.58, -272.842, 0, ''), +(9623 ,24, -6379.34, -1678.61, -272.34, 0, ''), +(9623 ,25, -6364.45, -1636.27, -271.065, 0, ''), +(9623 ,26, -6371.85, -1626.36, -272.188, 0, ''), +(9623 ,27, -6383.5, -1629.01, -272.206, 0, ''), +(9623 ,28, -6388.09, -1635.37, -272.105, 5000, ''), +(9623 ,29, -6375.42, -1637.33, -272.193, 0, ''), +(9623 ,30, -6365.46, -1617.25, -272.141, 0, ''), +(9623 ,31, -6353.79, -1603.48, -271.932, 0, ''), +(9623 ,32, -6340.24, -1592.41, -269.435, 0, ''), +(9623 ,33, -6329.45, -1566.89, -269.895, 0, ''), +(9623 ,34, -6312.2, -1499.06, -269.507, 0, ''), +(9623 ,35, -6304.55, -1468.5, -269.431, 0, ''), +(9623 ,36, -6310.36, -1440.94, -268.427, 0, ''), +(9623 ,37, -6321, -1418.91, -266.525, 0, ''), +(9623 ,38, -6358.76, -1389.97, -267.522, 0, ''), +(9623 ,39, -6378.65, -1375.67, -271.749, 0, ''), +(9623 ,40, -6387.22, -1360.95, -272.109, 0, ''), +(9623 ,41, -6406.95, -1323.87, -271.586, 0, ''), +(9623 ,42, -6405, -1311.92, -271.906, 0, ''), +(9623 ,43, -6395.56, -1303.62, -271.902, 0, ''), +(9623 ,44, -6375.97, -1296.08, -271.865, 0, ''), +(9623 ,45, -6364.39, -1281.23, -269.012, 0, ''), +(9623 ,46, -6353.71, -1263.19, -267.95, 0, ''), +(9623 ,47, -6340.09, -1248.65, -267.441, 0, ''), +(9623 ,48, -6338.21, -1237.11, -267.844, 0, ''), +(9623 ,49, -6336.6, -1219.69, -269.196, 0, ''), +(9623 ,50, -6334.44, -1202.33, -271.527, 0, ''), +(9623 ,51, -6329.56, -1189.82, -270.947, 0, ''), +(9623 ,52, -6324.66, -1179.46, -270.103, 0, ''), +(9623 ,53, -6315.08, -1176.74, -269.735, 0, ''), +(9623 ,54, -6308.49, -1179.12, -269.57, 0, ''), +(9623 ,55, -6302.43, -1181.32, -269.328, 5000, ''), +(9623 ,56, -6298.87, -1185.79, -269.278, 0, ''); + +DELETE FROM script_waypoint WHERE entry = 4508; +INSERT INTO script_waypoint VALUES +(4508 ,0, 2194.38, 1791.65, 65.48, 5000, ''), +(4508 ,1, 2188.56, 1805.87, 64.45, 0, ''), +(4508 ,2, 2187, 1843.49, 59.33, 0, ''), +(4508 ,3, 2163.27, 1851.67, 56.73, 5000, ''), +(4508 ,4, 2137.66, 1843.98, 48.08, 5000, ''), +(4508 ,5, 2140.22, 1845.02, 48.32, 0, ''), +(4508 ,6, 2131.5, 1804.29, 46.85, 0, ''), +(4508 ,7, 2096.18, 1789.03, 51.13, 0, ''), +(4508 ,8, 2074.46, 1780.09, 55.64, 3000, ''), +(4508 ,9, 2055.12, 1768.67, 58.46, 5000, ''), +(4508 ,10, 2037.83, 1748.62, 60.27, 0, ''), +(4508 ,11, 2037.51, 1728.94, 60.85, 0, ''), +(4508 ,12, 2044.7, 1711.71, 59.71, 0, ''), +(4508 ,13, 2067.66, 1701.84, 57.77, 3000, ''), +(4508 ,14, 2078.91, 1704.54, 56.77, 3000, ''), +(4508 ,15, 2097.65, 1715.24, 54.74, 0, ''), +(4508 ,16, 2106.44, 1720.98, 54.41, 0, ''), +(4508 ,17, 2123.96, 1732.56, 52.27, 0, ''), +(4508 ,18, 2153.82, 1728.73, 51.92, 0, ''), +(4508 ,19, 2163.49, 1706.33, 54.42, 0, ''), +(4508 ,20, 2158.75, 1695.98, 55.70, 0, ''), +(4508 ,21, 2142.6, 1680.72, 58.24, 0, ''), +(4508 ,22, 2118.31, 1671.54, 59.21, 0, ''), +(4508 ,23, 2086.02, 1672.04, 61.24, 0, ''), +(4508 ,24, 2068.81, 1658.93, 61.24, 0, ''), +(4508 ,25, 2062.82, 1633.31, 64.35, 3000, ''), +(4508 ,26, 2063.05, 1589.16, 63.26, 0, ''), +(4508 ,27, 2063.67, 1577.22, 65.89, 0, ''), +(4508 ,28, 2057.94, 1560.68, 68.40, 0, ''), +(4508 ,29, 2052.56, 1548.05, 73.35, 0, ''), +(4508 ,30, 2045.22, 1543.4, 76.65, 0, ''), +(4508 ,31, 2034.35, 1543.01, 79.70, 0, ''), +(4508 ,32, 2029.95, 1542.94, 80.79, 0, ''), +(4508 ,33, 2021.34, 1538.67, 80.8, 0, ''), +(4508 ,34, 2012.45, 1549.48, 79.93, 0, ''), +(4508 ,35, 2008.05, 1554.92, 80.44, 0, ''), +(4508 ,36, 2006.54, 1562.72, 81.11, 0, ''), +(4508 ,37, 2003.8, 1576.43, 81.57, 0, ''), +(4508 ,38, 2000.57, 1590.06, 80.62, 0, ''), +(4508 ,39, 1998.96, 1596.87, 80.22, 0, ''), +(4508 ,40, 1991.19, 1600.82, 79.39, 0, ''), +(4508 ,41, 1980.71, 1601.44, 79.77, 3000, ''), +(4508 ,42, 1967.22, 1600.18, 80.62, 3000, ''), +(4508 ,43, 1956.43, 1596.97, 81.75, 3000, ''), +(4508 ,44, 1954.87, 1592.02, 82.18, 0, ''), +(4508 ,45, 1948.35, 1571.35, 80.96, 30000, ''), +(4508 ,46, 1947.02, 1566.42, 81.80, 30000, ''); + +DELETE FROM script_waypoint WHERE entry = 7784; +INSERT INTO script_waypoint VALUES +(7784 ,0, -8843.73, -4374.44, 43.71, 0, ''), +(7784 ,1, -8834.68, -4373.88, 45.71, 0, ''), +(7784 ,2, -8832.93, -4373.85, 45.67, 0, ''), +(7784 ,3, -8829.21, -4373.72, 44.14, 0, ''), +(7784 ,4, -8825.10, -4373.56, 41.44, 0, ''), +(7784 ,5, -8818.88, -4372.75, 36.43, 0, ''), +(7784 ,6, -8803.37, -4369.68, 30.06, 0, ''), +(7784 ,7, -8786.68, -4366.18, 23.91, 0, ''), +(7784 ,8, -8764.97, -4366.94, 25.23, 0, ''), +(7784 ,9, -8745.49, -4363.16, 22.80, 0, ''), +(7784 ,10, -8724.13, -4353.55, 20.72, 0, ''), +(7784 ,11, -8706.77, -4346.14, 16.12, 0, ''), +(7784 ,12, -8688.27, -4372.85, 13.64, 0, ''), +(7784 ,13, -8668.76, -4380.38, 11.69, 0, ''), +(7784 ,14, -8645.19, -4388.62, 12.56, 0, ''), +(7784 ,15, -8614.73, -4398.60, 9.86, 0, ''), +(7784 ,16, -8560.33, -4411.27, 13.17, 0, ''), +(7784 ,17, -8536.45, -4416.49, 11.84, 0, ''), +(7784 ,18, -8503.48, -4423.70, 13.59, 0, ''), +(7784 ,19, -8471.91, -4430.60, 9.56, 0, ''), +(7784 ,20, -8441.36, -4435.31, 9.40, 0, ''), +(7784 ,21, -8403.41, -4441.16, 11.83, 0, ''), +(7784 ,22, -8371.24, -4446.13, 9.47, 0, ''), +(7784 ,23, -8353.96, -4448.79, 10.10, 0, 'Scorpid'), +(7784 ,24, -8336.40, -4446.39, 8.98, 0, ''), +(7784 ,25, -8303.78, -4441.96, 11.89, 0, ''), +(7784 ,26, -8272.20, -4433.31, 9.60, 0, ''), +(7784 ,27, -8224.76, -4419.39, 13.03, 0, ''), +(7784 ,28, -8193.31, -4406.04, 10.17, 0, ''), +(7784 ,29, -8155.65, -4397.74, 8.99, 0, ''), +(7784 ,30, -8129.25, -4394.57, 10.92, 0, ''), +(7784 ,31, -8104.86, -4399.03, 8.93, 0, ''), +(7784 ,32, -8063.15, -4423.40, 10.07, 0, ''), +(7784 ,33, -8032.15, -4443.47, 9.97, 0, ''), +(7784 ,34, -8015.39, -4454.33, 9.39, 0, ''), +(7784 ,35, -7981.64, -4482.44, 10.32, 0, ''), +(7784 ,36, -7958.83, -4503.98, 9.69, 0, ''), +(7784 ,37, -7932.45, -4528.91, 10.08, 0, ''), +(7784 ,38, -7904.09, -4566.67, 12.59, 0, ''), +(7784 ,39, -7883.33, -4593.91, 12.15, 0, ''), +(7784 ,40, -7862.83, -4624.53, 10.21, 0, ''), +(7784 ,41, -7840.79, -4654.26, 9.45, 0, ''), +(7784 ,42, -7826.17, -4673.99, 10.61, 0, ''), +(7784 ,43, -7807.86, -4698.69, 11.24, 0, ''), +(7784 ,44, -7793.88, -4717.55, 10.48, 0, ''), +(7784 ,45, -7778.68, -4738.05, 8.89, 0, ''), +(7784 ,46, -7746.42, -4780.39, 9.84, 0, ''), +(7784 ,47, -7724.11, -4772.75, 10.28, 0, ''), +(7784 ,48, -7697.98, -4763.80, 9.52, 0, ''), +(7784 ,49, -7665.33, -4752.62, 10.56, 0, ''), +(7784 ,50, -7641.47, -4750.33, 8.94, 0, ''), +(7784 ,51, -7620.08, -4753.96, 8.93, 0, ''), +(7784 ,52, -7603.15, -4757.53, 9.06, 0, ''), +(7784 ,53, -7579.43, -4767.07, 8.93, 0, ''), +(7784 ,54, -7558.51, -4779.01, 9.64, 0, ''), +(7784 ,55, -7536.40, -4789.32, 8.92, 0, ''), +(7784 ,56, -7512.07, -4793.50, 9.35, 0, 'Wastewander'), +(7784 ,57, -7490.79, -4788.80, 10.53, 0, ''), +(7784 ,58, -7469.10, -4785.11, 10.42, 0, ''), +(7784 ,59, -7453.18, -4782.41, 9.15, 0, ''), +(7784 ,60, -7426.27, -4777.83, 9.54, 0, ''), +(7784 ,61, -7393.84, -4770.19, 12.57, 0, ''), +(7784 ,62, -7367.25, -4764.17, 11.92, 0, ''), +(7784 ,63, -7341.00, -4752.11, 10.17, 0, ''), +(7784 ,64, -7321.62, -4744.97, 11.58, 0, ''), +(7784 ,65, -7302.35, -4744.35, 11.97, 0, ''), +(7784 ,66, -7281.00, -4743.66, 11.21, 0, ''), +(7784 ,67, -7258.33, -4742.93, 9.64, 0, ''), +(7784 ,68, -7236.70, -4742.24, 10.16, 0, ''), +(7784 ,69, -7217.52, -4743.87, 10.79, 0, ''), +(7784 ,70, -7201.86, -4746.32, 9.58, 0, ''), +(7784 ,71, -7182.01, -4749.41, 9.09, 0, ''), +(7784 ,72, -7159.61, -4752.90, 9.52, 0, ''), +(7784 ,73, -7139.58, -4756.02, 9.53, 0, ''), +(7784 ,74, -7122.60, -4754.91, 9.66, 0, ''), +(7784 ,75, -7101.06, -4753.87, 8.92, 0, ''), +(7784 ,76, -7082.79, -4752.99, 9.97, 0, ''), +(7784 ,77, -7061.81, -4751.98, 9.26, 0, ''), +(7784 ,78, -7035.12, -4754.39, 9.19, 0, ''), +(7784 ,79, -7013.90, -4758.64, 10.28, 0, ''), +(7784 ,80, -7001.71, -4769.73, 10.59, 0, ''), +(7784 ,81, -6984.95, -4788.61, 9.30, 0, ''), +(7784 ,82, -6970.41, -4788.77, 9.42, 0, ''), +(7784 ,83, -6957.16, -4788.92, 6.26, 0, ''), +(7784 ,84, -6951.29, -4802.73, 4.45, 0, ''), +(7784 ,85, -6944.81, -4816.58, 1.60, 0, ''), +(7784 ,86, -6942.06, -4839.40, 0.66, 5000, ''); + +DELETE FROM script_waypoint WHERE entry = 1978; +INSERT INTO script_waypoint VALUES +(1978, 0, 1406.32, 1083.10, 52.55, 0, ''), +(1978, 1, 1400.49, 1080.42, 52.50, 0, 'first say'), +(1978, 2, 1388.48, 1083.10, 52.52, 0, ''), +(1978, 3, 1370.16, 1084.02, 52.30, 0, ''), +(1978, 4, 1359.02, 1080.85, 52.46, 0, ''), +(1978, 5, 1341.43, 1087.39, 52.69, 0, ''), +(1978, 6, 1321.93, 1090.51, 50.66, 0, ''), +(1978, 7, 1312.98, 1095.91, 47.49, 0, ''), +(1978, 8, 1301.09, 1102.94, 47.76, 0, ''), +(1978, 9, 1297.73, 1106.35, 50.18, 0, ''), +(1978, 10, 1295.49, 1124.32, 50.49, 0, ''), +(1978, 11, 1294.84, 1137.25, 51.75, 0, ''), +(1978, 12, 1292.89, 1158.99, 52.65, 0, ''), +(1978, 13, 1290.75, 1168.67, 52.56, 1000, 'complete quest and say last'), +(1978, 14, 1287.12, 1203.49, 52.66, 5000, ''), +(1978, 15, 1287.12, 1203.49, 52.66, 4000, ''), +(1978, 16, 1287.12, 1203.49, 52.66, 5000, ''), +(1978, 17, 1287.12, 1203.49, 52.66, 4000, ''), +(1978, 18, 1290.72, 1207.44, 52.69, 0, ''), +(1978, 19, 1297.50, 1207.18, 53.74, 0, ''), +(1978, 20, 1301.32, 1220.90, 53.74, 0, ''), +(1978, 21, 1298.55, 1220.43, 53.74, 0, ''), +(1978, 22, 1297.59, 1211.23, 58.47, 0, ''), +(1978, 23, 1305.01, 1206.10, 58.51, 0, ''), +(1978, 24, 1310.51, 1207.36, 58.51, 5000, ''), +(1978, 25, 1310.51, 1207.36, 58.51, 5000, ''), +(1978, 26, 1310.51, 1207.36, 58.51, 2000, ''); + +DELETE FROM script_waypoint WHERE entry=3439; +INSERT INTO script_waypoint VALUES +(3439, 0, 1105.090332, -3101.254150, 82.706, 1000, 'SAY_STARTUP1'), +(3439, 1, 1103.204468, -3104.345215, 83.113, 1000, ''), +(3439, 2, 1107.815186, -3106.495361, 82.739, 1000, ''), +(3439, 3, 1104.733276, -3100.830811, 82.747, 1000, ''), +(3439, 4, 1103.242554, -3106.270020, 83.133, 1000, ''), +(3439, 5, 1112.807373, -3106.285400, 82.320, 1000, ''), +(3439, 6, 1112.826782, -3108.908691, 82.377, 1000, ''), +(3439, 7, 1108.053955, -3115.156738, 82.894, 0, ''), +(3439, 8, 1108.355591, -3104.365234, 82.377, 5000, ''), +(3439, 9, 1100.306763, -3097.539063, 83.150, 0, 'SAY_STARTUP2'), +(3439, 10, 1100.562378, -3082.721924, 82.768, 0, ''), +(3439, 11, 1097.512939, -3069.226563, 82.206, 0, ''), +(3439, 12, 1092.964966, -3053.114746, 82.351, 0, ''), +(3439, 13, 1094.010986, -3036.958496, 82.888, 0, ''), +(3439, 14, 1095.623901, -3025.760254, 83.392, 0, ''), +(3439, 15, 1107.656494, -3013.530518, 85.653, 0, ''), +(3439, 16, 1119.647705, -3006.928223, 87.019, 0, ''), +(3439, 17, 1129.991211, -3002.410645, 91.232, 7000, 'SAY_MERCENARY'), +(3439, 18, 1133.328735, -2997.710693, 91.675, 1000, 'SAY_PROGRESS_1'), +(3439, 19, 1131.799316, -2987.948242, 91.976, 1000, ''), +(3439, 20, 1122.028687, -2993.397461, 91.536, 0, ''), +(3439, 21, 1116.614868, -2981.916748, 92.103, 0, ''), +(3439, 22, 1102.239136, -2994.245117, 92.074, 0, ''), +(3439, 23, 1096.366211, -2978.306885, 91.873, 0, ''), +(3439, 24, 1091.971558, -2985.919189, 91.730, 40000, 'SAY_PROGRESS_2'); + DELETE FROM script_waypoint WHERE entry=7806; INSERT INTO script_waypoint VALUES (7806, 0, 495.404358, -3478.350830, 114.837, 0, ''), diff --git a/sql/updates/5105_world_scripts.sql b/sql/updates/5105_world_scripts.sql new file mode 100644 index 00000000000..33a32fcc254 --- /dev/null +++ b/sql/updates/5105_world_scripts.sql @@ -0,0 +1,311 @@ +DELETE FROM script_waypoint WHERE entry=3439; +INSERT INTO script_waypoint VALUES +(3439, 0, 1105.090332, -3101.254150, 82.706, 1000, 'SAY_STARTUP1'), +(3439, 1, 1103.204468, -3104.345215, 83.113, 1000, ''), +(3439, 2, 1107.815186, -3106.495361, 82.739, 1000, ''), +(3439, 3, 1104.733276, -3100.830811, 82.747, 1000, ''), +(3439, 4, 1103.242554, -3106.270020, 83.133, 1000, ''), +(3439, 5, 1112.807373, -3106.285400, 82.320, 1000, ''), +(3439, 6, 1112.826782, -3108.908691, 82.377, 1000, ''), +(3439, 7, 1108.053955, -3115.156738, 82.894, 0, ''), +(3439, 8, 1108.355591, -3104.365234, 82.377, 5000, ''), +(3439, 9, 1100.306763, -3097.539063, 83.150, 0, 'SAY_STARTUP2'), +(3439, 10, 1100.562378, -3082.721924, 82.768, 0, ''), +(3439, 11, 1097.512939, -3069.226563, 82.206, 0, ''), +(3439, 12, 1092.964966, -3053.114746, 82.351, 0, ''), +(3439, 13, 1094.010986, -3036.958496, 82.888, 0, ''), +(3439, 14, 1095.623901, -3025.760254, 83.392, 0, ''), +(3439, 15, 1107.656494, -3013.530518, 85.653, 0, ''), +(3439, 16, 1119.647705, -3006.928223, 87.019, 0, ''), +(3439, 17, 1129.991211, -3002.410645, 91.232, 7000, 'SAY_MERCENARY'), +(3439, 18, 1133.328735, -2997.710693, 91.675, 1000, 'SAY_PROGRESS_1'), +(3439, 19, 1131.799316, -2987.948242, 91.976, 1000, ''), +(3439, 20, 1122.028687, -2993.397461, 91.536, 0, ''), +(3439, 21, 1116.614868, -2981.916748, 92.103, 0, ''), +(3439, 22, 1102.239136, -2994.245117, 92.074, 0, ''), +(3439, 23, 1096.366211, -2978.306885, 91.873, 0, ''), +(3439, 24, 1091.971558, -2985.919189, 91.730, 40000, 'SAY_PROGRESS_2'); + +DELETE FROM script_waypoint WHERE entry = 1978; +INSERT INTO script_waypoint VALUES +(1978, 0, 1406.32, 1083.10, 52.55, 0, ''), +(1978, 1, 1400.49, 1080.42, 52.50, 0, 'first say'), +(1978, 2, 1388.48, 1083.10, 52.52, 0, ''), +(1978, 3, 1370.16, 1084.02, 52.30, 0, ''), +(1978, 4, 1359.02, 1080.85, 52.46, 0, ''), +(1978, 5, 1341.43, 1087.39, 52.69, 0, ''), +(1978, 6, 1321.93, 1090.51, 50.66, 0, ''), +(1978, 7, 1312.98, 1095.91, 47.49, 0, ''), +(1978, 8, 1301.09, 1102.94, 47.76, 0, ''), +(1978, 9, 1297.73, 1106.35, 50.18, 0, ''), +(1978, 10, 1295.49, 1124.32, 50.49, 0, ''), +(1978, 11, 1294.84, 1137.25, 51.75, 0, ''), +(1978, 12, 1292.89, 1158.99, 52.65, 0, ''), +(1978, 13, 1290.75, 1168.67, 52.56, 1000, 'complete quest and say last'), +(1978, 14, 1287.12, 1203.49, 52.66, 5000, ''), +(1978, 15, 1287.12, 1203.49, 52.66, 4000, ''), +(1978, 16, 1287.12, 1203.49, 52.66, 5000, ''), +(1978, 17, 1287.12, 1203.49, 52.66, 4000, ''), +(1978, 18, 1290.72, 1207.44, 52.69, 0, ''), +(1978, 19, 1297.50, 1207.18, 53.74, 0, ''), +(1978, 20, 1301.32, 1220.90, 53.74, 0, ''), +(1978, 21, 1298.55, 1220.43, 53.74, 0, ''), +(1978, 22, 1297.59, 1211.23, 58.47, 0, ''), +(1978, 23, 1305.01, 1206.10, 58.51, 0, ''), +(1978, 24, 1310.51, 1207.36, 58.51, 5000, ''), +(1978, 25, 1310.51, 1207.36, 58.51, 5000, ''), +(1978, 26, 1310.51, 1207.36, 58.51, 2000, ''); + +DELETE FROM script_waypoint WHERE entry = 7784; +INSERT INTO script_waypoint VALUES +(7784 ,0, -8843.73, -4374.44, 43.71, 0, ''), +(7784 ,1, -8834.68, -4373.88, 45.71, 0, ''), +(7784 ,2, -8832.93, -4373.85, 45.67, 0, ''), +(7784 ,3, -8829.21, -4373.72, 44.14, 0, ''), +(7784 ,4, -8825.10, -4373.56, 41.44, 0, ''), +(7784 ,5, -8818.88, -4372.75, 36.43, 0, ''), +(7784 ,6, -8803.37, -4369.68, 30.06, 0, ''), +(7784 ,7, -8786.68, -4366.18, 23.91, 0, ''), +(7784 ,8, -8764.97, -4366.94, 25.23, 0, ''), +(7784 ,9, -8745.49, -4363.16, 22.80, 0, ''), +(7784 ,10, -8724.13, -4353.55, 20.72, 0, ''), +(7784 ,11, -8706.77, -4346.14, 16.12, 0, ''), +(7784 ,12, -8688.27, -4372.85, 13.64, 0, ''), +(7784 ,13, -8668.76, -4380.38, 11.69, 0, ''), +(7784 ,14, -8645.19, -4388.62, 12.56, 0, ''), +(7784 ,15, -8614.73, -4398.60, 9.86, 0, ''), +(7784 ,16, -8560.33, -4411.27, 13.17, 0, ''), +(7784 ,17, -8536.45, -4416.49, 11.84, 0, ''), +(7784 ,18, -8503.48, -4423.70, 13.59, 0, ''), +(7784 ,19, -8471.91, -4430.60, 9.56, 0, ''), +(7784 ,20, -8441.36, -4435.31, 9.40, 0, ''), +(7784 ,21, -8403.41, -4441.16, 11.83, 0, ''), +(7784 ,22, -8371.24, -4446.13, 9.47, 0, ''), +(7784 ,23, -8353.96, -4448.79, 10.10, 0, 'Scorpid'), +(7784 ,24, -8336.40, -4446.39, 8.98, 0, ''), +(7784 ,25, -8303.78, -4441.96, 11.89, 0, ''), +(7784 ,26, -8272.20, -4433.31, 9.60, 0, ''), +(7784 ,27, -8224.76, -4419.39, 13.03, 0, ''), +(7784 ,28, -8193.31, -4406.04, 10.17, 0, ''), +(7784 ,29, -8155.65, -4397.74, 8.99, 0, ''), +(7784 ,30, -8129.25, -4394.57, 10.92, 0, ''), +(7784 ,31, -8104.86, -4399.03, 8.93, 0, ''), +(7784 ,32, -8063.15, -4423.40, 10.07, 0, ''), +(7784 ,33, -8032.15, -4443.47, 9.97, 0, ''), +(7784 ,34, -8015.39, -4454.33, 9.39, 0, ''), +(7784 ,35, -7981.64, -4482.44, 10.32, 0, ''), +(7784 ,36, -7958.83, -4503.98, 9.69, 0, ''), +(7784 ,37, -7932.45, -4528.91, 10.08, 0, ''), +(7784 ,38, -7904.09, -4566.67, 12.59, 0, ''), +(7784 ,39, -7883.33, -4593.91, 12.15, 0, ''), +(7784 ,40, -7862.83, -4624.53, 10.21, 0, ''), +(7784 ,41, -7840.79, -4654.26, 9.45, 0, ''), +(7784 ,42, -7826.17, -4673.99, 10.61, 0, ''), +(7784 ,43, -7807.86, -4698.69, 11.24, 0, ''), +(7784 ,44, -7793.88, -4717.55, 10.48, 0, ''), +(7784 ,45, -7778.68, -4738.05, 8.89, 0, ''), +(7784 ,46, -7746.42, -4780.39, 9.84, 0, ''), +(7784 ,47, -7724.11, -4772.75, 10.28, 0, ''), +(7784 ,48, -7697.98, -4763.80, 9.52, 0, ''), +(7784 ,49, -7665.33, -4752.62, 10.56, 0, ''), +(7784 ,50, -7641.47, -4750.33, 8.94, 0, ''), +(7784 ,51, -7620.08, -4753.96, 8.93, 0, ''), +(7784 ,52, -7603.15, -4757.53, 9.06, 0, ''), +(7784 ,53, -7579.43, -4767.07, 8.93, 0, ''), +(7784 ,54, -7558.51, -4779.01, 9.64, 0, ''), +(7784 ,55, -7536.40, -4789.32, 8.92, 0, ''), +(7784 ,56, -7512.07, -4793.50, 9.35, 0, 'Wastewander'), +(7784 ,57, -7490.79, -4788.80, 10.53, 0, ''), +(7784 ,58, -7469.10, -4785.11, 10.42, 0, ''), +(7784 ,59, -7453.18, -4782.41, 9.15, 0, ''), +(7784 ,60, -7426.27, -4777.83, 9.54, 0, ''), +(7784 ,61, -7393.84, -4770.19, 12.57, 0, ''), +(7784 ,62, -7367.25, -4764.17, 11.92, 0, ''), +(7784 ,63, -7341.00, -4752.11, 10.17, 0, ''), +(7784 ,64, -7321.62, -4744.97, 11.58, 0, ''), +(7784 ,65, -7302.35, -4744.35, 11.97, 0, ''), +(7784 ,66, -7281.00, -4743.66, 11.21, 0, ''), +(7784 ,67, -7258.33, -4742.93, 9.64, 0, ''), +(7784 ,68, -7236.70, -4742.24, 10.16, 0, ''), +(7784 ,69, -7217.52, -4743.87, 10.79, 0, ''), +(7784 ,70, -7201.86, -4746.32, 9.58, 0, ''), +(7784 ,71, -7182.01, -4749.41, 9.09, 0, ''), +(7784 ,72, -7159.61, -4752.90, 9.52, 0, ''), +(7784 ,73, -7139.58, -4756.02, 9.53, 0, ''), +(7784 ,74, -7122.60, -4754.91, 9.66, 0, ''), +(7784 ,75, -7101.06, -4753.87, 8.92, 0, ''), +(7784 ,76, -7082.79, -4752.99, 9.97, 0, ''), +(7784 ,77, -7061.81, -4751.98, 9.26, 0, ''), +(7784 ,78, -7035.12, -4754.39, 9.19, 0, ''), +(7784 ,79, -7013.90, -4758.64, 10.28, 0, ''), +(7784 ,80, -7001.71, -4769.73, 10.59, 0, ''), +(7784 ,81, -6984.95, -4788.61, 9.30, 0, ''), +(7784 ,82, -6970.41, -4788.77, 9.42, 0, ''), +(7784 ,83, -6957.16, -4788.92, 6.26, 0, ''), +(7784 ,84, -6951.29, -4802.73, 4.45, 0, ''), +(7784 ,85, -6944.81, -4816.58, 1.60, 0, ''), +(7784 ,86, -6942.06, -4839.40, 0.66, 5000, ''); + +DELETE FROM script_waypoint WHERE entry = 4508; +INSERT INTO script_waypoint VALUES +(4508 ,0, 2194.38, 1791.65, 65.48, 5000, ''), +(4508 ,1, 2188.56, 1805.87, 64.45, 0, ''), +(4508 ,2, 2187, 1843.49, 59.33, 0, ''), +(4508 ,3, 2163.27, 1851.67, 56.73, 5000, ''), +(4508 ,4, 2137.66, 1843.98, 48.08, 5000, ''), +(4508 ,5, 2140.22, 1845.02, 48.32, 0, ''), +(4508 ,6, 2131.5, 1804.29, 46.85, 0, ''), +(4508 ,7, 2096.18, 1789.03, 51.13, 0, ''), +(4508 ,8, 2074.46, 1780.09, 55.64, 3000, ''), +(4508 ,9, 2055.12, 1768.67, 58.46, 5000, ''), +(4508 ,10, 2037.83, 1748.62, 60.27, 0, ''), +(4508 ,11, 2037.51, 1728.94, 60.85, 0, ''), +(4508 ,12, 2044.7, 1711.71, 59.71, 0, ''), +(4508 ,13, 2067.66, 1701.84, 57.77, 3000, ''), +(4508 ,14, 2078.91, 1704.54, 56.77, 3000, ''), +(4508 ,15, 2097.65, 1715.24, 54.74, 0, ''), +(4508 ,16, 2106.44, 1720.98, 54.41, 0, ''), +(4508 ,17, 2123.96, 1732.56, 52.27, 0, ''), +(4508 ,18, 2153.82, 1728.73, 51.92, 0, ''), +(4508 ,19, 2163.49, 1706.33, 54.42, 0, ''), +(4508 ,20, 2158.75, 1695.98, 55.70, 0, ''), +(4508 ,21, 2142.6, 1680.72, 58.24, 0, ''), +(4508 ,22, 2118.31, 1671.54, 59.21, 0, ''), +(4508 ,23, 2086.02, 1672.04, 61.24, 0, ''), +(4508 ,24, 2068.81, 1658.93, 61.24, 0, ''), +(4508 ,25, 2062.82, 1633.31, 64.35, 3000, ''), +(4508 ,26, 2063.05, 1589.16, 63.26, 0, ''), +(4508 ,27, 2063.67, 1577.22, 65.89, 0, ''), +(4508 ,28, 2057.94, 1560.68, 68.40, 0, ''), +(4508 ,29, 2052.56, 1548.05, 73.35, 0, ''), +(4508 ,30, 2045.22, 1543.4, 76.65, 0, ''), +(4508 ,31, 2034.35, 1543.01, 79.70, 0, ''), +(4508 ,32, 2029.95, 1542.94, 80.79, 0, ''), +(4508 ,33, 2021.34, 1538.67, 80.8, 0, ''), +(4508 ,34, 2012.45, 1549.48, 79.93, 0, ''), +(4508 ,35, 2008.05, 1554.92, 80.44, 0, ''), +(4508 ,36, 2006.54, 1562.72, 81.11, 0, ''), +(4508 ,37, 2003.8, 1576.43, 81.57, 0, ''), +(4508 ,38, 2000.57, 1590.06, 80.62, 0, ''), +(4508 ,39, 1998.96, 1596.87, 80.22, 0, ''), +(4508 ,40, 1991.19, 1600.82, 79.39, 0, ''), +(4508 ,41, 1980.71, 1601.44, 79.77, 3000, ''), +(4508 ,42, 1967.22, 1600.18, 80.62, 3000, ''), +(4508 ,43, 1956.43, 1596.97, 81.75, 3000, ''), +(4508 ,44, 1954.87, 1592.02, 82.18, 0, ''), +(4508 ,45, 1948.35, 1571.35, 80.96, 30000, ''), +(4508 ,46, 1947.02, 1566.42, 81.80, 30000, ''); + +DELETE FROM script_waypoint WHERE entry = 9623; +INSERT INTO script_waypoint VALUES +(9623 ,1, -6380.38, -1965.14, -258.292, 5000, ''), +(9623 ,2, -6383.06, -1962.9, -258.936, 0, ''), +(9623 ,3, -6391.09, -1956.13, -260.291, 0, ''), +(9623 ,4, -6395.29, -1933.58, -262.949, 0, ''), +(9623 ,5, -6396.58, -1919.93, -263.838, 0, ''), +(9623 ,6, -6389.01, -1912.64, -260.689, 0, ''), +(9623 ,7, -6369.19, -1892.87, -255.924, 0, ''), +(9623 ,8, -6373.77, -1879.36, -259.268, 0, ''), +(9623 ,9, -6377.55, -1869.56, -260.503, 0, ''), +(9623 ,10, -6376.58, -1860.79, -260.026, 0, ''), +(9623 ,11, -6373.13, -1847.22, -259.249, 0, ''), +(9623 ,12, -6370.54, -1837.04, -260.007, 0, ''), +(9623 ,13, -6372.52, -1829.16, -260.071, 0, ''), +(9623 ,14, -6377.13, -1815.94, -262.632, 0, ''), +(9623 ,15, -6380.27, -1806.95, -265.53, 0, ''), +(9623 ,16, -6386.04, -1790.43, -268.546, 0, ''), +(9623 ,17, -6386.72, -1776.29, -269.851, 0, ''), +(9623 ,18, -6385.92, -1762.31, -271.494, 0, ''), +(9623 ,19, -6384.69, -1744.86, -272.196, 0, ''), +(9623 ,20, -6383.8, -1732.66, -272.222, 0, ''), +(9623 ,21, -6382.66, -1716.96, -272.235, 0, ''), +(9623 ,22, -6381.5, -1703.01, -272.964, 0, ''), +(9623 ,23, -6379.96, -1685.58, -272.842, 0, ''), +(9623 ,24, -6379.34, -1678.61, -272.34, 0, ''), +(9623 ,25, -6364.45, -1636.27, -271.065, 0, ''), +(9623 ,26, -6371.85, -1626.36, -272.188, 0, ''), +(9623 ,27, -6383.5, -1629.01, -272.206, 0, ''), +(9623 ,28, -6388.09, -1635.37, -272.105, 5000, ''), +(9623 ,29, -6375.42, -1637.33, -272.193, 0, ''), +(9623 ,30, -6365.46, -1617.25, -272.141, 0, ''), +(9623 ,31, -6353.79, -1603.48, -271.932, 0, ''), +(9623 ,32, -6340.24, -1592.41, -269.435, 0, ''), +(9623 ,33, -6329.45, -1566.89, -269.895, 0, ''), +(9623 ,34, -6312.2, -1499.06, -269.507, 0, ''), +(9623 ,35, -6304.55, -1468.5, -269.431, 0, ''), +(9623 ,36, -6310.36, -1440.94, -268.427, 0, ''), +(9623 ,37, -6321, -1418.91, -266.525, 0, ''), +(9623 ,38, -6358.76, -1389.97, -267.522, 0, ''), +(9623 ,39, -6378.65, -1375.67, -271.749, 0, ''), +(9623 ,40, -6387.22, -1360.95, -272.109, 0, ''), +(9623 ,41, -6406.95, -1323.87, -271.586, 0, ''), +(9623 ,42, -6405, -1311.92, -271.906, 0, ''), +(9623 ,43, -6395.56, -1303.62, -271.902, 0, ''), +(9623 ,44, -6375.97, -1296.08, -271.865, 0, ''), +(9623 ,45, -6364.39, -1281.23, -269.012, 0, ''), +(9623 ,46, -6353.71, -1263.19, -267.95, 0, ''), +(9623 ,47, -6340.09, -1248.65, -267.441, 0, ''), +(9623 ,48, -6338.21, -1237.11, -267.844, 0, ''), +(9623 ,49, -6336.6, -1219.69, -269.196, 0, ''), +(9623 ,50, -6334.44, -1202.33, -271.527, 0, ''), +(9623 ,51, -6329.56, -1189.82, -270.947, 0, ''), +(9623 ,52, -6324.66, -1179.46, -270.103, 0, ''), +(9623 ,53, -6315.08, -1176.74, -269.735, 0, ''), +(9623 ,54, -6308.49, -1179.12, -269.57, 0, ''), +(9623 ,55, -6302.43, -1181.32, -269.328, 5000, ''), +(9623 ,56, -6298.87, -1185.79, -269.278, 0, ''); + +DELETE FROM script_waypoint WHERE entry = 18760; +INSERT INTO script_waypoint VALUES +(18760 ,0, -2265.21, 3091.14, 13.91, 0, ''), +(18760 ,1, -2266.80, 3091.33, 13.82, 1000, ''), +(18760 ,2, -2268.20, 3091.14, 13.82, 7000, 'progress1'), +(18760 ,3, -2278.32, 3098.98, 13.82, 0, ''), +(18760 ,4, -2294.82, 3110.59, 13.82, 0, ''), +(18760 ,5, -2300.71, 3114.60, 13.82, 20000, 'progress2'), +(18760 ,6, -2300.71, 3114.60, 13.82, 3000, 'progress3'), +(18760 ,7, -2307.36, 3122.76, 13.79, 0, ''), +(18760 ,8, -2312.83, 3130.55, 12.04, 0, ''), +(18760 ,9, -2345.02, 3151.00, 8.38, 0, ''), +(18760 ,10, -2351.97, 3157.61, 6.27, 0, ''), +(18760 ,11, -2360.35, 3171.48, 3.31, 0, ''), +(18760 ,12, -2371.44, 3185.41, 0.89, 0, ''), +(18760 ,13, -2371.21, 3197.92, -0.96, 0, ''), +(18760 ,14, -2380.35, 3210.45, -1.08, 0, ''), +(18760 ,15, -2384.74, 3221.25, -1.17, 0, ''), +(18760 ,16, -2386.15, 3233.39, -1.29, 0, ''), +(18760 ,17, -2383.45, 3247.79, -1.32, 0, ''), +(18760 ,18, -2367.50, 3265.64, -1.33, 0, ''), +(18760 ,19, -2354.90, 3273.30, -1.50, 0, ''), +(18760 ,20, -2348.88, 3280.58, -0.09, 0, ''), +(18760 ,21, -2349.06, 3295.86, -0.95, 0, ''), +(18760 ,22, -2350.43, 3328.27, -2.10, 0, ''), +(18760 ,23, -2346.76, 3356.27, -2.82, 0, ''), +(18760 ,24, -2340.56, 3370.68, -4.02, 0, ''), +(18760 ,25, -2318.84, 3384.60, -7.61, 0, ''), +(18760 ,26, -2313.99, 3398.61, -10.40, 0, ''), +(18760 ,27, -2320.85, 3414.49, -11.49, 0, ''), +(18760 ,28, -2338.26, 3426.06, -11.46, 0, ''), +(18760 ,29, -2342.67, 3439.44, -11.32, 12000, 'progress4'), +(18760 ,30, -2342.67, 3439.44, -11.32, 7000, 'emote bye'), +(18760 ,31, -2342.67, 3439.44, -11.32, 5000, 'cat form'), +(18760 ,32, -2344.60, 3461.27, -10.44, 0, ''), +(18760 ,33, -2396.81, 3517.17, -3.55, 0, ''), +(18760 ,34, -2439.23, 3523.00, -1.05, 0, ''); + +DELETE FROM script_waypoint WHERE entry = 20415; +INSERT INTO script_waypoint VALUES +(20415 ,0, 2488.77, 2184.89, 104.64, 0, ''), +(20415 ,1, 2478.72, 2184.77, 98.58, 0, ''), +(20415 ,2, 2473.52, 2184.71, 99.00, 0, ''), +(20415 ,3, 2453.15, 2184.96, 97.09,4000, ''), +(20415 ,4, 2424.18, 2184.15, 94.11, 0, ''), +(20415 ,5, 2413.18, 2184.15, 93.42, 0, ''), +(20415 ,6, 2402.02, 2183.90, 87.59, 0, ''), +(20415 ,7, 2333.31, 2181.63, 90.03,4000, ''), +(20415 ,8, 2308.73, 2184.34, 92.04, 0, ''), +(20415 ,9, 2303.10, 2196.89, 94.94, 0, ''), +(20415 ,10, 2304.58, 2272.23, 96.67, 0, ''), +(20415 ,11, 2297.09, 2271.40, 95.16, 0, ''), +(20415 ,12, 2297.68, 2266.79, 95.07,4000, ''), +(20415 ,13, 2297.67, 2266.76, 95.07,4000, ''); diff --git a/src/bindings/scripts/base/escort_ai.cpp b/src/bindings/scripts/base/escort_ai.cpp index 37c8c31981b..34b4efcbe60 100644 --- a/src/bindings/scripts/base/escort_ai.cpp +++ b/src/bindings/scripts/base/escort_ai.cpp @@ -22,7 +22,7 @@ enum npc_escortAI::npc_escortAI(Creature* pCreature) : ScriptedAI(pCreature), IsBeingEscorted(false), IsOnHold(false), - PlayerGUID(0), + m_uiPlayerGUID(0), MaxPlayerDistance(DEFAULT_MAX_PLAYER_DISTANCE), CanMelee(true), m_uiPlayerCheckTimer(1000), @@ -63,10 +63,10 @@ void npc_escortAI::MoveInLineOfSight(Unit* pWho) void npc_escortAI::JustDied(Unit* pKiller) { - if (!IsBeingEscorted || !PlayerGUID || !m_pQuestForEscort) + if (!IsBeingEscorted || !m_uiPlayerGUID || !m_pQuestForEscort) return; - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { if (Group* pGroup = pPlayer->GetGroup()) { @@ -132,7 +132,7 @@ void npc_escortAI::EnterEvadeMode() bool npc_escortAI::IsPlayerOrGroupInRange() { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { if (Group* pGroup = pPlayer->GetGroup()) { @@ -216,7 +216,7 @@ void npc_escortAI::UpdateAI(const uint32 uiDiff) } //Check if player or any member of his group is within range - if (IsBeingEscorted && PlayerGUID && !m_creature->getVictim() && !m_bIsReturning) + if (IsBeingEscorted && m_uiPlayerGUID && !m_creature->getVictim() && !m_bIsReturning) { if (m_uiPlayerCheckTimer < uiDiff) { @@ -404,7 +404,7 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, m_bIsActiveAttacker = bIsActiveAttacker; m_bIsRunning = bRun; - PlayerGUID = uiPlayerGUID; + m_uiPlayerGUID = uiPlayerGUID; m_pQuestForEscort = pQuest; m_bCanInstantRespawn = bInstantRespawn; @@ -423,7 +423,7 @@ void npc_escortAI::Start(bool bIsActiveAttacker, bool bRun, uint64 uiPlayerGUID, //disable npcflags m_creature->SetUInt32Value(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_NONE); - debug_log("TSCR: EscortAI started with %d waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), m_bIsActiveAttacker, m_bIsRunning, PlayerGUID); + debug_log("TSCR: EscortAI started with %d waypoints. ActiveAttacker = %d, Run = %d, PlayerGUID = %d", WaypointList.size(), m_bIsActiveAttacker, m_bIsRunning, m_uiPlayerGUID); CurrentWP = WaypointList.begin(); diff --git a/src/bindings/scripts/base/escort_ai.h b/src/bindings/scripts/base/escort_ai.h index 243e64d6d21..60e555dcfd4 100644 --- a/src/bindings/scripts/base/escort_ai.h +++ b/src/bindings/scripts/base/escort_ai.h @@ -58,6 +58,11 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI bool IsPlayerOrGroupInRange(); + Player* GetPlayerForEscort() + { + return Unit::GetPlayer(m_uiPlayerGUID); + } + void FillPointMovementListForCreature(); void Start(bool bIsActiveAttacker = true, bool bRun = false, uint64 uiPlayerGUID = 0, const Quest* pQuest = NULL, bool bInstantRespawn = false, bool bCanLoopPath = false); @@ -76,15 +81,15 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI bool GetIsBeingEscorted() { return IsBeingEscorted; }//used in EnterEvadeMode override void SetReturning(bool returning) { m_bIsReturning = returning; }//used in EnterEvadeMode override void SetCanAttack(bool attack) { m_bIsActiveAttacker = attack; } - uint64 GetEventStarterGUID() { return PlayerGUID; } + uint64 GetEventStarterGUID() { return m_uiPlayerGUID; } // EscortAI variables protected: - uint64 PlayerGUID; bool IsBeingEscorted; bool IsOnHold; private: + uint64 m_uiPlayerGUID; uint32 m_uiWPWaitTimer; uint32 m_uiPlayerCheckTimer; float MaxPlayerDistance; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp index c5325da12d3..e9169ae60f6 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/arathi_highlands.cpp @@ -55,7 +55,10 @@ struct TRINITY_DLL_DECL npc_professor_phizzlethorpeAI : public npc_escortAI void WaypointReached(uint32 uiPointId) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; switch(uiPointId) { diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp index 929fea7f41a..f63baa7a18f 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/eversong_woods.cpp @@ -52,7 +52,7 @@ struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI // Pure Virtual Functions void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -65,21 +65,14 @@ struct TRINITY_DLL_DECL npc_prospector_anvilwardAI : public npc_escortAI } } - void EnterCombat(Unit* who) { } - void Reset() { - m_creature->setFaction(35); + me->RestoreFaction(); } void JustDied(Unit* killer) { - m_creature->setFaction(35); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); + me->RestoreFaction(); } }; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp index 42122c1f002..849ed2e029a 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/ghostlands.cpp @@ -159,7 +159,7 @@ struct TRINITY_DLL_DECL npc_ranger_lilathaAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp index 6b661dad5ef..f8ae2bc66ff 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/hinterlands.cpp @@ -67,7 +67,7 @@ struct MANGOS_DLL_DECL npc_00x09hlAI : public npc_escortAI break; case 64: DoScriptText(SAY_OOX_COMPLETE, m_creature); - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) pPlayer->GroupEventHappens(QUEST_RESQUE_OOX_09, m_creature); break; } @@ -247,7 +247,7 @@ struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI void WaypointReached(uint32 uiPointId) { - Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -283,7 +283,7 @@ struct TRINITY_DLL_DECL npc_rinjiAI : public npc_escortAI { m_uiPostEventTimer = 3000; - if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + if (Unit* pPlayer = GetPlayerForEscort()) { switch(m_uiPostEventCount) { diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp index 1a081a49050..96a4dbdc2c4 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp @@ -564,7 +564,7 @@ struct TRINITY_DLL_DECL npc_koltira_deathweaverAI : public npc_escortAI void JustSummoned(Creature* pSummoned) { - if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { pSummoned->AI()->AttackStart(pPlayer); pSummoned->AddThreat(m_creature, 0.0f); diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp index 07b1979f87f..409d6702d2b 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/silverpine_forest.cpp @@ -119,7 +119,7 @@ struct TRINITY_DLL_DECL npc_deathstalker_erlandAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -176,37 +176,7 @@ bool QuestAccept_npc_deathstalker_erland(Player* pPlayer, Creature* pCreature, Q CreatureAI* GetAI_npc_deathstalker_erlandAI(Creature* pCreature) { - npc_deathstalker_erlandAI* deathstalker_erlandAI = new npc_deathstalker_erlandAI(pCreature); - - deathstalker_erlandAI->AddWaypoint(0, 1406.32, 1083.10, 52.55); - deathstalker_erlandAI->AddWaypoint(1, 1400.49, 1080.42, 52.50); //first say - deathstalker_erlandAI->AddWaypoint(2, 1388.48, 1083.10, 52.52); - deathstalker_erlandAI->AddWaypoint(3, 1370.16, 1084.02, 52.30); - deathstalker_erlandAI->AddWaypoint(4, 1359.02, 1080.85, 52.46); - deathstalker_erlandAI->AddWaypoint(5, 1341.43, 1087.39, 52.69); - deathstalker_erlandAI->AddWaypoint(6, 1321.93, 1090.51, 50.66); - deathstalker_erlandAI->AddWaypoint(7, 1312.98, 1095.91, 47.49); - deathstalker_erlandAI->AddWaypoint(8, 1301.09, 1102.94, 47.76); - deathstalker_erlandAI->AddWaypoint(9, 1297.73, 1106.35, 50.18); - deathstalker_erlandAI->AddWaypoint(10, 1295.49, 1124.32, 50.49); - deathstalker_erlandAI->AddWaypoint(11, 1294.84, 1137.25, 51.75); - deathstalker_erlandAI->AddWaypoint(12, 1292.89, 1158.99, 52.65); - deathstalker_erlandAI->AddWaypoint(13, 1290.75, 1168.67, 52.56, 1000); //complete quest and say last - deathstalker_erlandAI->AddWaypoint(14, 1287.12, 1203.49, 52.66, 5000); - deathstalker_erlandAI->AddWaypoint(15, 1287.12, 1203.49, 52.66, 4000); - deathstalker_erlandAI->AddWaypoint(16, 1287.12, 1203.49, 52.66, 5000); - deathstalker_erlandAI->AddWaypoint(17, 1287.12, 1203.49, 52.66, 4000); - deathstalker_erlandAI->AddWaypoint(18, 1290.72, 1207.44, 52.69); - deathstalker_erlandAI->AddWaypoint(19, 1297.50, 1207.18, 53.74); - deathstalker_erlandAI->AddWaypoint(20, 1301.32, 1220.90, 53.74); - deathstalker_erlandAI->AddWaypoint(21, 1298.55, 1220.43, 53.74); - deathstalker_erlandAI->AddWaypoint(22, 1297.59, 1211.23, 58.47); - deathstalker_erlandAI->AddWaypoint(23, 1305.01, 1206.10, 58.51); - deathstalker_erlandAI->AddWaypoint(24, 1310.51, 1207.36, 58.51, 5000); - deathstalker_erlandAI->AddWaypoint(25, 1310.51, 1207.36, 58.51, 5000); - deathstalker_erlandAI->AddWaypoint(26, 1310.51, 1207.36, 58.51, 2000); - - return deathstalker_erlandAI; + return new npc_deathstalker_erlandAI(pCreature); } /*###### diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp index d6cbea99fb5..0799f745a70 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/westfall.cpp @@ -73,7 +73,7 @@ struct TRINITY_DLL_DECL npc_daphne_stilwellAI : public npc_escortAI void WaypointReached(uint32 uiPoint) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -197,7 +197,7 @@ struct TRINITY_DLL_DECL npc_defias_traitorAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp index 4a9d944cb3e..3568c7e555b 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/wetlands.cpp @@ -70,7 +70,7 @@ struct TRINITY_DLL_DECL npc_tapoke_slim_jahnAI : public npc_escortAI void Aggro(Unit* pWho) { - Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (IsBeingEscorted && !m_bFriendSummoned && pPlayer) { @@ -83,7 +83,7 @@ struct TRINITY_DLL_DECL npc_tapoke_slim_jahnAI : public npc_escortAI void JustSummoned(Creature* pSummoned) { - if (Unit* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) pSummoned->AI()->AttackStart(pPlayer); } @@ -102,7 +102,7 @@ struct TRINITY_DLL_DECL npc_tapoke_slim_jahnAI : public npc_escortAI { if (m_creature->GetHealth()*100 < m_creature->GetMaxHealth()*20) { - if (Unit* pPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { if (pPlayer->GetTypeId() == TYPEID_PLAYER) CAST_PLR(pPlayer)->GroupEventHappens(QUEST_MISSING_DIPLO_PT11, m_creature); diff --git a/src/bindings/scripts/scripts/examples/example_escort.cpp b/src/bindings/scripts/scripts/examples/example_escort.cpp index e603d3ce79c..4fdc1b7e1ad 100644 --- a/src/bindings/scripts/scripts/examples/example_escort.cpp +++ b/src/bindings/scripts/scripts/examples/example_escort.cpp @@ -76,12 +76,12 @@ struct TRINITY_DLL_DECL example_escortAI : public npc_escortAI m_creature->SummonCreature(NPC_FELBOAR, m_creature->GetPositionX()+5.0f, m_creature->GetPositionY()+7.0f, m_creature->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000); break; case 4: - if (Unit* pTmpPlayer = Unit::GetUnit(*m_creature, PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { //pTmpPlayer is the target of the text - DoScriptText(SAY_WP_3, m_creature, pTmpPlayer); + DoScriptText(SAY_WP_3, m_creature, pPlayer); //pTmpPlayer is the source of the text - DoScriptText(SAY_WP_4, pTmpPlayer); + DoScriptText(SAY_WP_4, pPlayer); } break; } @@ -91,8 +91,8 @@ struct TRINITY_DLL_DECL example_escortAI : public npc_escortAI { if (IsBeingEscorted) { - if (Unit* pTemp = Unit::GetUnit(*m_creature, PlayerGUID)) - DoScriptText(SAY_AGGRO1, m_creature, pTemp); + if (Player* pPlayer = GetPlayerForEscort()) + DoScriptText(SAY_AGGRO1, m_creature, pPlayer); } else DoScriptText(SAY_AGGRO2, m_creature); @@ -108,15 +108,15 @@ struct TRINITY_DLL_DECL example_escortAI : public npc_escortAI { if (IsBeingEscorted) { - if (Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { // not a likely case, code here for the sake of example if (pKiller == m_creature) { - DoScriptText(SAY_DEATH_1, m_creature, pTemp); + DoScriptText(SAY_DEATH_1, m_creature, pPlayer); } else - DoScriptText(SAY_DEATH_2, m_creature, pTemp); + DoScriptText(SAY_DEATH_2, m_creature, pPlayer); } } else diff --git a/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp b/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp index 88572bf3463..7bb193b98be 100644 --- a/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp +++ b/src/bindings/scripts/scripts/kalimdor/ashenvale.cpp @@ -59,7 +59,7 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -81,8 +81,8 @@ struct TRINITY_DLL_DECL npc_torekAI : public npc_escortAI case 20: DoScriptText(SAY_WIN, m_creature, pPlayer); Completed = true; - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_TOREK_ASSULT,m_creature); + if (pPlayer) + pPlayer->GroupEventHappens(QUEST_TOREK_ASSULT, m_creature); break; case 21: DoScriptText(SAY_END, m_creature, pPlayer); @@ -160,7 +160,7 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -185,8 +185,8 @@ struct TRINITY_DLL_DECL npc_ruul_snowhoofAI : public npc_escortAI break; case 21:{ - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_FREEDOM_TO_RUUL,m_creature); + if (pPlayer) + pPlayer->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, m_creature); break; } } diff --git a/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp b/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp index 0e21a4b310d..f881715ca64 100644 --- a/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp +++ b/src/bindings/scripts/scripts/kalimdor/azuremyst_isle.cpp @@ -338,7 +338,7 @@ struct TRINITY_DLL_DECL npc_magwinAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; diff --git a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp index 7c0290fe565..d8471deb96b 100644 --- a/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp +++ b/src/bindings/scripts/scripts/kalimdor/caverns_of_time/old_hillsbrad/old_hillsbrad.cpp @@ -329,14 +329,11 @@ struct TRINITY_DLL_DECL npc_thrall_old_hillsbradAI : public npc_escortAI case 106: { - if (!PlayerGUID) - break; - //trigger taretha to run down outside - if (uint64 TarethaGUID = pInstance->GetData64(DATA_TARETHA)) + if (Creature* Taretha = pInstance->instance->GetCreature(pInstance->GetData64(DATA_TARETHA))) { - if (Creature* Taretha = (Unit::GetCreature(*m_creature, TarethaGUID))) - CAST_AI(npc_escortAI, (Taretha->AI()))->Start(false, true, PlayerGUID); + if (Player* pPlayer = GetPlayerForEscort()) + CAST_AI(npc_escortAI, (Taretha->AI()))->Start(false, true, pPlayer->GetGUID()); } //kill credit Creature for quest diff --git a/src/bindings/scripts/scripts/kalimdor/darkshore.cpp b/src/bindings/scripts/scripts/kalimdor/darkshore.cpp index 6c2520cd8b5..8ff16a53832 100644 --- a/src/bindings/scripts/scripts/kalimdor/darkshore.cpp +++ b/src/bindings/scripts/scripts/kalimdor/darkshore.cpp @@ -62,7 +62,7 @@ struct TRINITY_DLL_DECL npc_prospector_remtravelAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -136,11 +136,6 @@ struct TRINITY_DLL_DECL npc_prospector_remtravelAI : public npc_escortAI //unsure if it should be any //pSummoned->AI()->AttackStart(m_creature); } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } }; CreatureAI* GetAI_npc_prospector_remtravel(Creature* pCreature) diff --git a/src/bindings/scripts/scripts/kalimdor/feralas.cpp b/src/bindings/scripts/scripts/kalimdor/feralas.cpp index 08c00a9a5a7..99090b06039 100644 --- a/src/bindings/scripts/scripts/kalimdor/feralas.cpp +++ b/src/bindings/scripts/scripts/kalimdor/feralas.cpp @@ -111,7 +111,7 @@ struct TRINITY_DLL_DECL npc_oox22feAI : public npc_escortAI case 37: DoScriptText(SAY_END,m_creature); // Award quest credit - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { pPlayer->GroupEventHappens(QUEST_RESCUE_OOX22FE, m_creature); } diff --git a/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp index 5c51e64f5a2..b24a51cb3cb 100644 --- a/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp +++ b/src/bindings/scripts/scripts/kalimdor/razorfen_kraul/razorfen_kraul.cpp @@ -51,7 +51,7 @@ struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -114,16 +114,8 @@ struct TRINITY_DLL_DECL npc_willixAI : public npc_escortAI void JustDied(Unit* killer) { - if (PlayerGUID) - { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - CAST_PLR(pPlayer)->FailQuest(QUEST_WILLIX_THE_IMPORTER); - } - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); + if (Player* pPlayer = GetPlayerForEscort()) + CAST_PLR(pPlayer)->FailQuest(QUEST_WILLIX_THE_IMPORTER); } }; @@ -181,57 +173,7 @@ CreatureAI* GetAI_npc_deaths_head_ward_keeper(Creature* pCreature) CreatureAI* GetAI_npc_willix(Creature* pCreature) { - npc_willixAI* thisAI = new npc_willixAI(pCreature); - - thisAI->AddWaypoint(0, 2194.38, 1791.65, 65.48, 5000); - thisAI->AddWaypoint(1, 2188.56, 1805.87, 64.45); - thisAI->AddWaypoint(2, 2187, 1843.49, 59.33); - thisAI->AddWaypoint(3, 2163.27, 1851.67, 56.73, 5000); - thisAI->AddWaypoint(4, 2137.66, 1843.98, 48.08, 5000); - thisAI->AddWaypoint(5, 2140.22, 1845.02, 48.32); - thisAI->AddWaypoint(6, 2131.5, 1804.29, 46.85); - thisAI->AddWaypoint(7, 2096.18, 1789.03, 51.13); - thisAI->AddWaypoint(8, 2074.46, 1780.09, 55.64, 3000); - thisAI->AddWaypoint(9, 2055.12, 1768.67, 58.46, 5000); - thisAI->AddWaypoint(10, 2037.83, 1748.62, 60.27); - thisAI->AddWaypoint(11, 2037.51, 1728.94, 60.85); - thisAI->AddWaypoint(12, 2044.7, 1711.71, 59.71); - thisAI->AddWaypoint(13, 2067.66, 1701.84, 57.77, 3000); - thisAI->AddWaypoint(14, 2078.91, 1704.54, 56.77, 3000); - thisAI->AddWaypoint(15, 2097.65, 1715.24, 54.74); - thisAI->AddWaypoint(16, 2106.44, 1720.98, 54.41); - thisAI->AddWaypoint(17, 2123.96, 1732.56, 52.27); - thisAI->AddWaypoint(18, 2153.82, 1728.73, 51.92); - thisAI->AddWaypoint(19, 2163.49, 1706.33, 54.42); - thisAI->AddWaypoint(20, 2158.75, 1695.98, 55.70); - thisAI->AddWaypoint(21, 2142.6, 1680.72, 58.24); - thisAI->AddWaypoint(22, 2118.31, 1671.54, 59.21); - thisAI->AddWaypoint(23, 2086.02, 1672.04, 61.24); - thisAI->AddWaypoint(24, 2068.81, 1658.93, 61.24); - thisAI->AddWaypoint(25, 2062.82, 1633.31, 64.35, 3000); - thisAI->AddWaypoint(26, 2063.05, 1589.16, 63.26); - thisAI->AddWaypoint(27, 2063.67, 1577.22, 65.89); - thisAI->AddWaypoint(28, 2057.94, 1560.68, 68.40); - thisAI->AddWaypoint(29, 2052.56, 1548.05, 73.35); - thisAI->AddWaypoint(30, 2045.22, 1543.4, 76.65); - thisAI->AddWaypoint(31, 2034.35, 1543.01, 79.70); - thisAI->AddWaypoint(32, 2029.95, 1542.94, 80.79); - thisAI->AddWaypoint(33, 2021.34, 1538.67, 80.8); - thisAI->AddWaypoint(34, 2012.45, 1549.48, 79.93); - thisAI->AddWaypoint(35, 2008.05, 1554.92, 80.44); - thisAI->AddWaypoint(36, 2006.54, 1562.72, 81.11); - thisAI->AddWaypoint(37, 2003.8, 1576.43, 81.57); - thisAI->AddWaypoint(38, 2000.57, 1590.06, 80.62); - thisAI->AddWaypoint(39, 1998.96, 1596.87, 80.22); - thisAI->AddWaypoint(40, 1991.19, 1600.82, 79.39); - thisAI->AddWaypoint(41, 1980.71, 1601.44, 79.77, 3000); - thisAI->AddWaypoint(42, 1967.22, 1600.18, 80.62, 3000); - thisAI->AddWaypoint(43, 1956.43, 1596.97, 81.75, 3000); - thisAI->AddWaypoint(44, 1954.87, 1592.02, 82.18); - thisAI->AddWaypoint(45, 1948.35, 1571.35, 80.96, 30000); - thisAI->AddWaypoint(46, 1947.02, 1566.42, 81.80, 30000); - - return thisAI; + return new npc_willixAI(pCreature); } void AddSC_razorfen_kraul() diff --git a/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp b/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp index 2b927af4852..272cef3d33b 100644 --- a/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp +++ b/src/bindings/scripts/scripts/kalimdor/stonetalon_mountains.cpp @@ -101,7 +101,7 @@ struct TRINITY_DLL_DECL npc_kaya_flathoofAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -116,8 +116,8 @@ struct TRINITY_DLL_DECL npc_kaya_flathoofAI : public npc_escortAI break; case 18: m_creature->SetInFront(pPlayer); DoScriptText(SAY_END, m_creature, pPlayer); - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_PROTECT_KAYA, m_creature); + if (pPlayer) + pPlayer->GroupEventHappens(QUEST_PROTECT_KAYA, m_creature); break; } } diff --git a/src/bindings/scripts/scripts/kalimdor/tanaris.cpp b/src/bindings/scripts/scripts/kalimdor/tanaris.cpp index 9745fce9966..813e178b6f0 100644 --- a/src/bindings/scripts/scripts/kalimdor/tanaris.cpp +++ b/src/bindings/scripts/scripts/kalimdor/tanaris.cpp @@ -153,7 +153,7 @@ struct TRINITY_DLL_DECL npc_custodian_of_timeAI : public npc_escortAI void WaypointReached(uint32 i) { - Player *pPlayer = Unit::GetPlayer(PlayerGUID); + Player *pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -357,7 +357,7 @@ struct TRINITY_DLL_DECL npc_OOX17AI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -424,97 +424,7 @@ bool QuestAccept_npc_OOX17(Player* pPlayer, Creature* pCreature, Quest const* qu CreatureAI* GetAI_npc_OOX17(Creature* pCreature) { - npc_OOX17AI* OOX17AI = new npc_OOX17AI(pCreature); - - OOX17AI->AddWaypoint(0, -8843.73, -4374.44, 43.71); - OOX17AI->AddWaypoint(1, -8834.68, -4373.88, 45.71); - OOX17AI->AddWaypoint(2, -8832.93, -4373.85, 45.67); - OOX17AI->AddWaypoint(3, -8829.21, -4373.72, 44.14); - OOX17AI->AddWaypoint(4, -8825.10, -4373.56, 41.44); - OOX17AI->AddWaypoint(5, -8818.88, -4372.75, 36.43); - OOX17AI->AddWaypoint(6, -8803.37, -4369.68, 30.06); - OOX17AI->AddWaypoint(7, -8786.68, -4366.18, 23.91); - OOX17AI->AddWaypoint(8, -8764.97, -4366.94, 25.23); - OOX17AI->AddWaypoint(9, -8745.49, -4363.16, 22.80); - OOX17AI->AddWaypoint(10, -8724.13, -4353.55, 20.72); - OOX17AI->AddWaypoint(11, -8706.77, -4346.14, 16.12); - OOX17AI->AddWaypoint(12, -8688.27, -4372.85, 13.64); - OOX17AI->AddWaypoint(13, -8668.76, -4380.38, 11.69); - OOX17AI->AddWaypoint(14, -8645.19, -4388.62, 12.56); - OOX17AI->AddWaypoint(15, -8614.73, -4398.60, 9.86); - OOX17AI->AddWaypoint(16, -8560.33, -4411.27, 13.17); - OOX17AI->AddWaypoint(17, -8536.45, -4416.49, 11.84); - OOX17AI->AddWaypoint(18, -8503.48, -4423.70, 13.59); - OOX17AI->AddWaypoint(19, -8471.91, -4430.60, 9.56); - OOX17AI->AddWaypoint(20, -8441.36, -4435.31, 9.40); - OOX17AI->AddWaypoint(21, -8403.41, -4441.16, 11.83); - OOX17AI->AddWaypoint(22, -8371.24, -4446.13, 9.47); - OOX17AI->AddWaypoint(23, -8353.96, -4448.79, 10.10); //Scorpid - OOX17AI->AddWaypoint(24, -8336.40, -4446.39, 8.98); - OOX17AI->AddWaypoint(25, -8303.78, -4441.96, 11.89); - OOX17AI->AddWaypoint(26, -8272.20, -4433.31, 9.60); - OOX17AI->AddWaypoint(27, -8224.76, -4419.39, 13.03); - OOX17AI->AddWaypoint(28, -8193.31, -4406.04, 10.17); - OOX17AI->AddWaypoint(29, -8155.65, -4397.74, 8.99); - OOX17AI->AddWaypoint(30, -8129.25, -4394.57, 10.92); - OOX17AI->AddWaypoint(31, -8104.86, -4399.03, 8.93); - OOX17AI->AddWaypoint(32, -8063.15, -4423.40, 10.07); - OOX17AI->AddWaypoint(33, -8032.15, -4443.47, 9.97); - OOX17AI->AddWaypoint(34, -8015.39, -4454.33, 9.39); - OOX17AI->AddWaypoint(35, -7981.64, -4482.44, 10.32); - OOX17AI->AddWaypoint(36, -7958.83, -4503.98, 9.69); - OOX17AI->AddWaypoint(37, -7932.45, -4528.91, 10.08); - OOX17AI->AddWaypoint(38, -7904.09, -4566.67, 12.59); - OOX17AI->AddWaypoint(39, -7883.33, -4593.91, 12.15); - OOX17AI->AddWaypoint(40, -7862.83, -4624.53, 10.21); - OOX17AI->AddWaypoint(41, -7840.79, -4654.26, 9.45); - OOX17AI->AddWaypoint(42, -7826.17, -4673.99, 10.61); - OOX17AI->AddWaypoint(43, -7807.86, -4698.69, 11.24); - OOX17AI->AddWaypoint(44, -7793.88, -4717.55, 10.48); - OOX17AI->AddWaypoint(45, -7778.68, -4738.05, 8.89); - OOX17AI->AddWaypoint(46, -7746.42, -4780.39, 9.84); - OOX17AI->AddWaypoint(47, -7724.11, -4772.75, 10.28); - OOX17AI->AddWaypoint(48, -7697.98, -4763.80, 9.52); - OOX17AI->AddWaypoint(49, -7665.33, -4752.62, 10.56); - OOX17AI->AddWaypoint(50, -7641.47, -4750.33, 8.94); - OOX17AI->AddWaypoint(51, -7620.08, -4753.96, 8.93); - OOX17AI->AddWaypoint(52, -7603.15, -4757.53, 9.06); - OOX17AI->AddWaypoint(53, -7579.43, -4767.07, 8.93); - OOX17AI->AddWaypoint(54, -7558.51, -4779.01, 9.64); - OOX17AI->AddWaypoint(55, -7536.40, -4789.32, 8.92); - OOX17AI->AddWaypoint(56, -7512.07, -4793.50, 9.35); //Wastewander - OOX17AI->AddWaypoint(57, -7490.79, -4788.80, 10.53); - OOX17AI->AddWaypoint(58, -7469.10, -4785.11, 10.42); - OOX17AI->AddWaypoint(59, -7453.18, -4782.41, 9.15); - OOX17AI->AddWaypoint(60, -7426.27, -4777.83, 9.54); - OOX17AI->AddWaypoint(61, -7393.84, -4770.19, 12.57); - OOX17AI->AddWaypoint(62, -7367.25, -4764.17, 11.92); - OOX17AI->AddWaypoint(63, -7341.00, -4752.11, 10.17); - OOX17AI->AddWaypoint(64, -7321.62, -4744.97, 11.58); - OOX17AI->AddWaypoint(65, -7302.35, -4744.35, 11.97); - OOX17AI->AddWaypoint(66, -7281.00, -4743.66, 11.21); - OOX17AI->AddWaypoint(67, -7258.33, -4742.93, 9.64); - OOX17AI->AddWaypoint(68, -7236.70, -4742.24, 10.16); - OOX17AI->AddWaypoint(69, -7217.52, -4743.87, 10.79); - OOX17AI->AddWaypoint(70, -7201.86, -4746.32, 9.58); - OOX17AI->AddWaypoint(71, -7182.01, -4749.41, 9.09); - OOX17AI->AddWaypoint(72, -7159.61, -4752.90, 9.52); - OOX17AI->AddWaypoint(73, -7139.58, -4756.02, 9.53); - OOX17AI->AddWaypoint(74, -7122.60, -4754.91, 9.66); - OOX17AI->AddWaypoint(75, -7101.06, -4753.87, 8.92); - OOX17AI->AddWaypoint(76, -7082.79, -4752.99, 9.97); - OOX17AI->AddWaypoint(77, -7061.81, -4751.98, 9.26); - OOX17AI->AddWaypoint(78, -7035.12, -4754.39, 9.19); - OOX17AI->AddWaypoint(79, -7013.90, -4758.64, 10.28); - OOX17AI->AddWaypoint(80, -7001.71, -4769.73, 10.59); - OOX17AI->AddWaypoint(81, -6984.95, -4788.61, 9.30); - OOX17AI->AddWaypoint(82, -6970.41, -4788.77, 9.42); - OOX17AI->AddWaypoint(83, -6957.16, -4788.92, 6.26); - OOX17AI->AddWaypoint(84, -6951.29, -4802.73, 4.45); - OOX17AI->AddWaypoint(85, -6944.81, -4816.58, 1.60); - OOX17AI->AddWaypoint(86, -6942.06, -4839.40, 0.66,5000); - - return OOX17AI; + return new npc_OOX17AI(pCreature); } /*#### @@ -631,8 +541,7 @@ struct MANGOS_DLL_DECL npc_toogaAI : public ScriptedAI void JustRespawned() { - if (m_creature->getFaction() != m_creature->GetCreatureInfo()->faction_A) - m_creature->setFaction(m_creature->GetCreatureInfo()->faction_A); + me->RestoreFaction(); m_creature->SetUInt32Value(UNIT_NPC_FLAGS, m_creature->GetCreatureInfo()->npcflag); @@ -684,7 +593,10 @@ struct MANGOS_DLL_DECL npc_toogaAI : public ScriptedAI void JustDied(Unit* pKiller) { if (Player* pPlayer = Unit::GetPlayer(m_uiPlayerGUID)) - pPlayer->FailQuest(QUEST_TOOGA); + { + if (pPlayer->GetQuestStatus(QUEST_TOOGA) == QUEST_STATUS_INCOMPLETE) + pPlayer->FailQuest(QUEST_TOOGA); + } m_uiPlayerGUID = 0; m_creature->GetMotionMaster()->MovementExpired(); diff --git a/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp b/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp index d17d0b06cd1..d957ba26ae7 100644 --- a/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp +++ b/src/bindings/scripts/scripts/kalimdor/the_barrens.cpp @@ -94,7 +94,7 @@ struct TRINITY_DLL_DECL npc_giltharesAI : public npc_escortAI void WaypointReached(uint32 uiPointId) { - Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -507,75 +507,143 @@ CreatureAI* GetAI_npc_twiggy_flathead(Creature* pCreature) enum { - SAY_PROGRESS_1 = -1000272, - SAY_PROGRESS_2 = -1000273, - SAY_PROGRESS_3 = -1000274, - - SAY_MERCENARY_4 = -1000275, - - SAY_PROGRESS_5 = -1000276, - SAY_PROGRESS_6 = -1000277, - SAY_PROGRESS_7 = -1000278, - SAY_PROGRESS_8 = -1000279, + SAY_START = -1000272, + SAY_STARTUP1 = -1000273, + SAY_STARTUP2 = -1000274, + SAY_MERCENARY = -1000275, + SAY_PROGRESS_1 = -1000276, + SAY_PROGRESS_2 = -1000277, + SAY_PROGRESS_3 = -1000278, + SAY_END = -1000279, QUEST_ESCAPE = 863, FACTION_RATCHET = 637, - NPC_PILOT = 3451, - MOB_MERCENARY = 3282, + NPC_PILOT_WIZZ = 3451, + NPC_MERCENARY = 3282, }; struct TRINITY_DLL_DECL npc_wizzlecrank_shredderAI : public npc_escortAI { - npc_wizzlecrank_shredderAI(Creature* c) : npc_escortAI(c) { } + npc_wizzlecrank_shredderAI(Creature* pCreature) : npc_escortAI(pCreature) + { + m_bIsPostEvent = false; + m_uiPostEventTimer = 1000; + m_uiPostEventCount = 0; + } - bool Completed; + bool m_bIsPostEvent; + uint32 m_uiPostEventTimer; + uint32 m_uiPostEventCount; - void WaypointReached(uint32 i) + void Reset() { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + if (!IsBeingEscorted) + { + if (m_creature->getStandState() == UNIT_STAND_STATE_DEAD) + m_creature->SetStandState(UNIT_STAND_STATE_STAND); + + m_bIsPostEvent = false; + m_uiPostEventTimer = 1000; + m_uiPostEventCount = 0; + } + } + + void WaypointReached(uint32 uiPointId) + { + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; - switch(i) + switch(uiPointId) { - case 0: DoScriptText(SAY_PROGRESS_1, m_creature); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 1: DoScriptText(SAY_PROGRESS_2, m_creature); break; - case 10: DoScriptText(SAY_PROGRESS_3, m_creature, pPlayer); - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 20:{ - Unit* Mercenary = m_creature->FindNearestCreature(MOB_MERCENARY, 99); - if (Mercenary) + case 0: + DoScriptText(SAY_STARTUP1, m_creature); + break; + case 9: + SetRun(false); + break; + case 17: + if (Creature* pTemp = m_creature->SummonCreature(NPC_MERCENARY, 1128.489f, -3037.611f, 92.701f, 1.472f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000)) { - DoScriptText(SAY_MERCENARY_4, Mercenary); - CAST_CRE(Mercenary)->AI()->AttackStart(m_creature); - AttackStart(Mercenary); + DoScriptText(SAY_MERCENARY, pTemp); + m_creature->SummonCreature(NPC_MERCENARY, 1160.172f, -2980.168f, 97.313f, 3.690f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 120000); } - }break; - case 21: DoScriptText(SAY_PROGRESS_5, m_creature); - m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); break; - case 28: DoScriptText(SAY_PROGRESS_6, m_creature); break; - case 29: DoScriptText(SAY_PROGRESS_7, m_creature); break; - case 30: DoScriptText(SAY_PROGRESS_8, m_creature); break; - case 31: m_creature->SummonCreature(NPC_PILOT, 1088.77, -2985.39, 91.84, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 300000); - m_creature->setDeathState(JUST_DIED); - Completed = true; - pPlayer->GroupEventHappens(QUEST_ESCAPE, m_creature); + break; + case 24: + m_bIsPostEvent = true; break; } } - void Reset() + void WaypointStart(uint32 uiPointId) { - m_creature->setDeathState(ALIVE); - Completed = false; - if (!IsBeingEscorted) + Player* pPlayer = GetPlayerForEscort(); + + if (!pPlayer) + return; + + switch(uiPointId) { - if (m_creature->getStandState() == UNIT_STAND_STATE_DEAD) - m_creature->SetStandState(UNIT_STAND_STATE_STAND); + case 9: + DoScriptText(SAY_STARTUP2, m_creature, pPlayer); + break; + case 18: + DoScriptText(SAY_PROGRESS_1, m_creature, pPlayer); + SetRun(); + break; } } + + void JustSummoned(Creature* pSummoned) + { + if (pSummoned->GetEntry() == NPC_PILOT_WIZZ) + m_creature->SetStandState(UNIT_STAND_STATE_DEAD); + + if (pSummoned->GetEntry() == NPC_MERCENARY) + pSummoned->AI()->AttackStart(m_creature); + } + + void UpdateEscortAI(const uint32 uiDiff) + { + if (!UpdateVictim()) + { + if (m_bIsPostEvent) + { + if (m_uiPostEventTimer < uiDiff) + { + switch(m_uiPostEventCount) + { + case 0: + DoScriptText(SAY_PROGRESS_2, m_creature); + break; + case 1: + DoScriptText(SAY_PROGRESS_3, m_creature); + break; + case 2: + DoScriptText(SAY_END, m_creature); + break; + case 3: + if (Player* pPlayer = GetPlayerForEscort()) + { + pPlayer->GroupEventHappens(QUEST_ESCAPE, m_creature); + m_creature->SummonCreature(NPC_PILOT_WIZZ, 0.0f, 0.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN, 180000); + } + break; + } + + ++m_uiPostEventCount; + m_uiPostEventTimer = 5000; + } + else + m_uiPostEventTimer -= uiDiff; + } + + return; + } + + DoMeleeAttackIfReady(); + } }; bool QuestAccept_npc_wizzlecrank_shredder(Player* pPlayer, Creature* pCreature, Quest const* quest) @@ -591,42 +659,7 @@ bool QuestAccept_npc_wizzlecrank_shredder(Player* pPlayer, Creature* pCreature, CreatureAI* GetAI_npc_wizzlecrank_shredderAI(Creature* pCreature) { - npc_wizzlecrank_shredderAI* thisAI = new npc_wizzlecrank_shredderAI(pCreature); - - thisAI->AddWaypoint(0, 1109.15, -3104.11, 82.41, 6000); - thisAI->AddWaypoint(1, 1105.39, -3102.86, 82.74, 2000); - thisAI->AddWaypoint(2, 1104.97, -3108.52, 83.10, 1000); - thisAI->AddWaypoint(3, 1110.01, -3110.48, 82.81, 1000); - thisAI->AddWaypoint(4, 1111.72, -3103.03, 82.21, 1000); - thisAI->AddWaypoint(5, 1106.98, -3099.44, 82.18, 1000); - thisAI->AddWaypoint(6, 1103.74, -3103.29, 83.05, 1000); - thisAI->AddWaypoint(7, 1112.55, -3106.56, 82.31, 1000); - thisAI->AddWaypoint(8, 1108.12, -3111.04, 82.99, 1000); - thisAI->AddWaypoint(9, 1109.32, -3100.39, 82.08, 1000); - thisAI->AddWaypoint(10, 1109.32, -3100.39, 82.08, 6000); - thisAI->AddWaypoint(11, 1098.92, -3095.14, 82.97); - thisAI->AddWaypoint(12, 1100.94, -3082.60, 82.83); - thisAI->AddWaypoint(13, 1101.12, -3068.83, 82.53); - thisAI->AddWaypoint(14, 1096.97, -3051.99, 82.50); - thisAI->AddWaypoint(15, 1094.06, -3036.79, 82.70); - thisAI->AddWaypoint(16, 1098.22, -3027.84, 83.79); - thisAI->AddWaypoint(17, 1109.51, -3015.92, 85.73); - thisAI->AddWaypoint(18, 1119.87, -3007.21, 87.08); - thisAI->AddWaypoint(19, 1130.23, -3002.49, 91.27, 5000); - thisAI->AddWaypoint(20, 1130.23, -3002.49, 91.27, 3000); - thisAI->AddWaypoint(21, 1130.23, -3002.49, 91.27, 4000); - thisAI->AddWaypoint(22, 1129.73, -2985.89, 92.46); - thisAI->AddWaypoint(23, 1124.10, -2983.29, 92.81); - thisAI->AddWaypoint(24, 1111.74, -2992.38, 91.59); - thisAI->AddWaypoint(25, 1111.06, -2976.54, 91.81); - thisAI->AddWaypoint(26, 1099.91, -2991.17, 91.67); - thisAI->AddWaypoint(27, 1096.32, -2981.55, 91.73); - thisAI->AddWaypoint(28, 1091.28, -2985.82, 91.74, 4000); - thisAI->AddWaypoint(29, 1091.28, -2985.82, 91.74, 3000); - thisAI->AddWaypoint(30, 1091.28, -2985.82, 91.74, 7000); - thisAI->AddWaypoint(31, 1091.28, -2985.82, 91.74, 3000); - - return thisAI; + return new npc_wizzlecrank_shredderAI(pCreature); } void AddSC_the_barrens() diff --git a/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp b/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp index be0c2db5aa9..24e6a21e743 100644 --- a/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp +++ b/src/bindings/scripts/scripts/kalimdor/thousand_needles.cpp @@ -60,7 +60,7 @@ struct TRINITY_DLL_DECL npc_kanatiAI : public npc_escortAI DoSpawnGalak(); break; case 1: - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) pPlayer->GroupEventHappens(QUEST_PROTECT_KANATI, m_creature); break; } @@ -149,7 +149,7 @@ struct TRINITY_DLL_DECL npc_lakota_windsongAI : public npc_escortAI DoSpawnBandits(ID_AMBUSH_3); break; case 45: - if (Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) pPlayer->GroupEventHappens(QUEST_FREE_AT_LAST, m_creature); break; } @@ -222,7 +222,7 @@ struct TRINITY_DLL_DECL npc_paoka_swiftmountainAI : public npc_escortAI DoScriptText(SAY_COMPLETE, m_creature); break; case 27: - if (Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) pPlayer->GroupEventHappens(QUEST_HOMEWARD, m_creature); break; } diff --git a/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp b/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp index 323faf67814..81f122d61db 100644 --- a/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp +++ b/src/bindings/scripts/scripts/kalimdor/ungoro_crater.cpp @@ -51,7 +51,7 @@ struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -76,21 +76,18 @@ struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI break; case 55: DoScriptText(SAY_FINISH, m_creature, pPlayer); - if (pPlayer && pPlayer->GetTypeId() == TYPEID_PLAYER) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_CHASING_AME,m_creature); + if (pPlayer) + pPlayer->GroupEventHappens(QUEST_CHASING_AME,m_creature); break; } - } + } void Reset() { DEMORALIZINGSHOUT_Timer = 5000; } - void EnterCombat(Unit* who) - {} - void JustSummoned(Creature* summoned) { summoned->AI()->AttackStart(m_creature); @@ -98,11 +95,8 @@ struct TRINITY_DLL_DECL npc_ameAI : public npc_escortAI void JustDied(Unit* killer) { - if (PlayerGUID) - { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - CAST_PLR(pPlayer)->FailQuest(QUEST_CHASING_AME); - } + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->FailQuest(QUEST_CHASING_AME); } void UpdateAI(const uint32 diff) @@ -135,66 +129,7 @@ bool QuestAccept_npc_ame(Player* pPlayer, Creature* pCreature, Quest const* ques CreatureAI* GetAI_npc_ame(Creature* pCreature) { - npc_ameAI* thisAI = new npc_ameAI(pCreature); - - thisAI->AddWaypoint(1, -6380.38, -1965.14, -258.292, 5000); - thisAI->AddWaypoint(2, -6383.06, -1962.9, -258.936); - thisAI->AddWaypoint(3, -6391.09, -1956.13, -260.291); - thisAI->AddWaypoint(4, -6395.29, -1933.58, -262.949); - thisAI->AddWaypoint(5, -6396.58, -1919.93, -263.838); - thisAI->AddWaypoint(6, -6389.01, -1912.64, -260.689); - thisAI->AddWaypoint(7, -6369.19, -1892.87, -255.924); - thisAI->AddWaypoint(8, -6373.77, -1879.36, -259.268); - thisAI->AddWaypoint(9, -6377.55, -1869.56, -260.503); - thisAI->AddWaypoint(10, -6376.58, -1860.79, -260.026); - thisAI->AddWaypoint(11, -6373.13, -1847.22, -259.249); - thisAI->AddWaypoint(12, -6370.54, -1837.04, -260.007); - thisAI->AddWaypoint(13, -6372.52, -1829.16, -260.071); - thisAI->AddWaypoint(14, -6377.13, -1815.94, -262.632); - thisAI->AddWaypoint(15, -6380.27, -1806.95, -265.53); - thisAI->AddWaypoint(16, -6386.04, -1790.43, -268.546); - thisAI->AddWaypoint(17, -6386.72, -1776.29, -269.851); - thisAI->AddWaypoint(18, -6385.92, -1762.31, -271.494); - thisAI->AddWaypoint(19, -6384.69, -1744.86, -272.196); - thisAI->AddWaypoint(20, -6383.8, -1732.66, -272.222); - thisAI->AddWaypoint(21, -6382.66, -1716.96, -272.235); - thisAI->AddWaypoint(22, -6381.5, -1703.01, -272.964); - thisAI->AddWaypoint(23, -6379.96, -1685.58, -272.842); - thisAI->AddWaypoint(24, -6379.34, -1678.61, -272.34); - thisAI->AddWaypoint(25, -6364.45, -1636.27, -271.065); - thisAI->AddWaypoint(26, -6371.85, -1626.36, -272.188); - thisAI->AddWaypoint(27, -6383.5, -1629.01, -272.206); - thisAI->AddWaypoint(28, -6388.09, -1635.37, -272.105, 5000); - thisAI->AddWaypoint(29, -6375.42, -1637.33, -272.193); - thisAI->AddWaypoint(30, -6365.46, -1617.25, -272.141); - thisAI->AddWaypoint(31, -6353.79, -1603.48, -271.932); - thisAI->AddWaypoint(32, -6340.24, -1592.41, -269.435); - thisAI->AddWaypoint(33, -6329.45, -1566.89, -269.895); - thisAI->AddWaypoint(34, -6312.2, -1499.06, -269.507); - thisAI->AddWaypoint(35, -6304.55, -1468.5, -269.431); - thisAI->AddWaypoint(36, -6310.36, -1440.94, -268.427); - thisAI->AddWaypoint(37, -6321, -1418.91, -266.525); - thisAI->AddWaypoint(38, -6358.76, -1389.97, -267.522); - thisAI->AddWaypoint(39, -6378.65, -1375.67, -271.749); - thisAI->AddWaypoint(40, -6387.22, -1360.95, -272.109); - thisAI->AddWaypoint(41, -6406.95, -1323.87, -271.586); - thisAI->AddWaypoint(42, -6405, -1311.92, -271.906); - thisAI->AddWaypoint(43, -6395.56, -1303.62, -271.902); - thisAI->AddWaypoint(44, -6375.97, -1296.08, -271.865); - thisAI->AddWaypoint(45, -6364.39, -1281.23, -269.012); - thisAI->AddWaypoint(46, -6353.71, -1263.19, -267.95); - thisAI->AddWaypoint(47, -6340.09, -1248.65, -267.441); - thisAI->AddWaypoint(48, -6338.21, -1237.11, -267.844); - thisAI->AddWaypoint(49, -6336.6, -1219.69, -269.196); - thisAI->AddWaypoint(50, -6334.44, -1202.33, -271.527); - thisAI->AddWaypoint(51, -6329.56, -1189.82, -270.947); - thisAI->AddWaypoint(52, -6324.66, -1179.46, -270.103); - thisAI->AddWaypoint(53, -6315.08, -1176.74, -269.735); - thisAI->AddWaypoint(54, -6308.49, -1179.12, -269.57); - thisAI->AddWaypoint(55, -6302.43, -1181.32, -269.328, 5000); - thisAI->AddWaypoint(56, -6298.87, -1185.79, -269.278); - - return thisAI; + return new npc_ameAI(pCreature); } void AddSC_ungoro_crater() diff --git a/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp b/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp index bb97fb12d18..41454f330f1 100644 --- a/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp +++ b/src/bindings/scripts/scripts/northrend/sholazar_basin.cpp @@ -64,7 +64,7 @@ struct TRINITY_DLL_DECL npc_injured_rainspeaker_oracleAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -90,7 +90,7 @@ struct TRINITY_DLL_DECL npc_injured_rainspeaker_oracleAI : public npc_escortAI m_creature->SetUnitMovementFlags(MOVEMENTFLAG_JUMPING); break; case 28: - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) pPlayer->GroupEventHappens(QUEST_FORTUNATE_MISUNDERSTANDINGS, m_creature); // me->RestoreFaction(); DoScriptText(SAY_END_IRO,m_creature); @@ -104,17 +104,12 @@ struct TRINITY_DLL_DECL npc_injured_rainspeaker_oracleAI : public npc_escortAI if (!IsBeingEscorted) return; - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { if (pPlayer->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) != QUEST_STATUS_COMPLETE) pPlayer->FailQuest(QUEST_FORTUNATE_MISUNDERSTANDINGS); } } - - void UpdateAI(Player* pPlayer, Creature* pCreature,const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } }; diff --git a/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp b/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp index 209d11c3509..9e7e6145178 100644 --- a/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp +++ b/src/bindings/scripts/scripts/outland/hellfire_peninsula.cpp @@ -70,8 +70,6 @@ struct TRINITY_DLL_DECL npc_aeranasAI : public ScriptedAI DoScriptText(SAY_SUMMON, m_creature); } - void EnterCombat(Unit *who) {} - void UpdateAI(const uint32 diff) { if (Faction_Timer) @@ -227,9 +225,9 @@ struct TRINITY_DLL_DECL npc_wounded_blood_elfAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); - if (!pPlayer || pPlayer->GetTypeId() != TYPEID_PLAYER) + if (!pPlayer) return; switch (i) diff --git a/src/bindings/scripts/scripts/outland/netherstorm.cpp b/src/bindings/scripts/scripts/outland/netherstorm.cpp index 1e3c4349116..8d1aa2c3b3c 100644 --- a/src/bindings/scripts/scripts/outland/netherstorm.cpp +++ b/src/bindings/scripts/scripts/outland/netherstorm.cpp @@ -803,20 +803,15 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI npc_bessyAI(Creature *c) : npc_escortAI(c) {} - bool Completed; - void JustDied(Unit* killer) { - if (PlayerGUID) - { - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) - CAST_PLR(pPlayer)->FailQuest(Q_ALMABTRIEB); - } + if (Player* pPlayer = GetPlayerForEscort()) + pPlayer->FailQuest(Q_ALMABTRIEB); } void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -836,17 +831,12 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI case 12: if (pPlayer) - { - CAST_PLR(pPlayer)->GroupEventHappens(Q_ALMABTRIEB, m_creature); - Completed = true; - } - {Unit* Thadell = me->FindNearestCreature(N_THADELL, 30); - if (Thadell) - DoScriptText(SAY_THADELL_1, m_creature);}break; + pPlayer->GroupEventHappens(Q_ALMABTRIEB, m_creature); + if (Unit* Thadell = me->FindNearestCreature(N_THADELL, 30)) + DoScriptText(SAY_THADELL_1, m_creature); break; case 13: - {Unit* Thadell = me->FindNearestCreature(N_THADELL, 30); - if (Thadell) - DoScriptText(SAY_THADELL_2, m_creature, pPlayer);}break; + if (Unit* Thadell = me->FindNearestCreature(N_THADELL, 30)) + DoScriptText(SAY_THADELL_2, m_creature, pPlayer); break; } } @@ -855,17 +845,9 @@ struct TRINITY_DLL_DECL npc_bessyAI : public npc_escortAI summoned->AI()->AttackStart(m_creature); } - void EnterCombat(Unit* who){} - void Reset() { - Completed = false; - m_creature->setFaction(35); - } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); + me->RestoreFaction(); } }; @@ -883,24 +865,7 @@ bool QuestAccept_npc_bessy(Player* pPlayer, Creature* pCreature, Quest const* qu CreatureAI* GetAI_npc_bessy(Creature* pCreature) { - npc_bessyAI* bessyAI = new npc_bessyAI(pCreature); - - bessyAI->AddWaypoint(0, 2488.77, 2184.89, 104.64); - bessyAI->AddWaypoint(1, 2478.72, 2184.77, 98.58); - bessyAI->AddWaypoint(2, 2473.52, 2184.71, 99.00); - bessyAI->AddWaypoint(3, 2453.15, 2184.96, 97.09,4000); - bessyAI->AddWaypoint(4, 2424.18, 2184.15, 94.11); - bessyAI->AddWaypoint(5, 2413.18, 2184.15, 93.42); - bessyAI->AddWaypoint(6, 2402.02, 2183.90, 87.59); - bessyAI->AddWaypoint(7, 2333.31, 2181.63, 90.03,4000); - bessyAI->AddWaypoint(8, 2308.73, 2184.34, 92.04); - bessyAI->AddWaypoint(9, 2303.10, 2196.89, 94.94); - bessyAI->AddWaypoint(10, 2304.58, 2272.23, 96.67); - bessyAI->AddWaypoint(11, 2297.09, 2271.40, 95.16); - bessyAI->AddWaypoint(12, 2297.68, 2266.79, 95.07,4000); - bessyAI->AddWaypoint(13, 2297.67, 2266.76, 95.07,4000); - - return bessyAI; + return new npc_bessyAI(pCreature); } /*###### diff --git a/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp b/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp index 998cedf9c1e..5ef2be74bf9 100644 --- a/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp +++ b/src/bindings/scripts/scripts/outland/shadowmoon_valley.cpp @@ -83,8 +83,6 @@ struct TRINITY_DLL_DECL mob_mature_netherwing_drakeAI : public ScriptedAI CastTimer = 5000; } - void EnterCombat(Unit* who) { } - void SpellHit(Unit* pCaster, SpellEntry const* pSpell) { if (bCanEat || bIsEating) @@ -205,8 +203,6 @@ struct TRINITY_DLL_DECL mob_enslaved_netherwing_drakeAI : public ScriptedAI m_creature->SetVisibility(VISIBILITY_ON); } - void EnterCombat(Unit* who) { } - void SpellHit(Unit* caster, const SpellEntry* spell) { if (!caster) @@ -325,8 +321,6 @@ struct TRINITY_DLL_DECL mob_dragonmaw_peonAI : public ScriptedAI PoisonTimer = 0; } - void EnterCombat(Unit* who) { } - void SpellHit(Unit* caster, const SpellEntry* spell) { if (!caster) @@ -696,8 +690,6 @@ struct TRINITY_DLL_DECL npc_overlord_morghorAI : public ScriptedAI Event = false; } - void EnterCombat(Unit* who){} - void StartEvent() { m_creature->SetUInt32Value(UNIT_NPC_FLAGS, 0); @@ -891,7 +883,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI void WaypointReached(uint32 uiPointId) { - Player* pPlayer = (Player*)Unit::GetUnit(*m_creature, PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -944,7 +936,7 @@ struct TRINITY_DLL_DECL npc_earthmender_wildaAI : public npc_escortAI case 50: DoScriptText(SAY_WIL_END, m_creature, pPlayer); - if (Player* pPlayer = Unit::GetPlayer(PlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) pPlayer->GroupEventHappens(QUEST_ESCAPE_COILSCAR, m_creature); break; } diff --git a/src/bindings/scripts/scripts/outland/shattrath_city.cpp b/src/bindings/scripts/scripts/outland/shattrath_city.cpp index 5e0904f7661..23d54ce83b6 100644 --- a/src/bindings/scripts/scripts/outland/shattrath_city.cpp +++ b/src/bindings/scripts/scripts/outland/shattrath_city.cpp @@ -61,12 +61,9 @@ struct TRINITY_DLL_DECL npc_raliq_the_drunkAI : public ScriptedAI void Reset() { Uppercut_Timer = 5000; - if (m_creature->getFaction() != m_uiNormFaction) - m_creature->setFaction(m_uiNormFaction); + me->RestoreFaction(); } - void EnterCombat(Unit *who) {} - void UpdateAI(const uint32 diff) { if (!UpdateVictim()) @@ -126,11 +123,9 @@ struct TRINITY_DLL_DECL npc_salsalabimAI : public ScriptedAI void Reset() { MagneticPull_Timer = 15000; - m_creature->setFaction(FACTION_FRIENDLY_SA); + me->RestoreFaction(); } - void EnterCombat(Unit *who) {} - void DamageTaken(Unit *done_by, uint32 &damage) { if (done_by->GetTypeId() == TYPEID_PLAYER) @@ -288,71 +283,60 @@ public: void WaypointReached(uint32 i) { - Unit *pTemp = Unit::GetUnit(*m_creature,PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); - if (!pTemp) + if (!pPlayer) return; switch(i) { - case 0: DoScriptText(SAY1, m_creature, pTemp); break; - case 4: DoScriptText(WHISP1, m_creature, pTemp); break; - case 6: DoScriptText(WHISP2, m_creature, pTemp); break; - case 7: DoScriptText(WHISP3, m_creature, pTemp); break; - case 8: DoScriptText(WHISP4, m_creature, pTemp); break; - case 17: DoScriptText(WHISP5, m_creature, pTemp); break; - case 18: DoScriptText(WHISP6, m_creature, pTemp); break; - case 19: DoScriptText(WHISP7, m_creature, pTemp); break; - case 33: DoScriptText(WHISP8, m_creature, pTemp); break; - case 34: DoScriptText(WHISP9, m_creature, pTemp); break; - case 35: DoScriptText(WHISP10, m_creature, pTemp); break; - case 36: DoScriptText(WHISP11, m_creature, pTemp); break; - case 43: DoScriptText(WHISP12, m_creature, pTemp); break; - case 44: DoScriptText(WHISP13, m_creature, pTemp); break; - case 49: DoScriptText(WHISP14, m_creature, pTemp); break; - case 50: DoScriptText(WHISP15, m_creature, pTemp); break; - case 51: DoScriptText(WHISP16, m_creature, pTemp); break; - case 52: DoScriptText(WHISP17, m_creature, pTemp); break; - case 53: DoScriptText(WHISP18, m_creature, pTemp); break; - case 54: DoScriptText(WHISP19, m_creature, pTemp); break; - case 55: DoScriptText(WHISP20, m_creature, pTemp); break; - case 56: DoScriptText(WHISP21, m_creature, pTemp); - if (PlayerGUID) - { - Player* pPlayer = (Unit::GetPlayer(PlayerGUID)); - if (pPlayer) - pPlayer->GroupEventHappens(10211,m_creature); - } + case 0: DoScriptText(SAY1, m_creature, pPlayer); break; + case 4: DoScriptText(WHISP1, m_creature, pPlayer); break; + case 6: DoScriptText(WHISP2, m_creature, pPlayer); break; + case 7: DoScriptText(WHISP3, m_creature, pPlayer); break; + case 8: DoScriptText(WHISP4, m_creature, pPlayer); break; + case 17: DoScriptText(WHISP5, m_creature, pPlayer); break; + case 18: DoScriptText(WHISP6, m_creature, pPlayer); break; + case 19: DoScriptText(WHISP7, m_creature, pPlayer); break; + case 33: DoScriptText(WHISP8, m_creature, pPlayer); break; + case 34: DoScriptText(WHISP9, m_creature, pPlayer); break; + case 35: DoScriptText(WHISP10, m_creature, pPlayer); break; + case 36: DoScriptText(WHISP11, m_creature, pPlayer); break; + case 43: DoScriptText(WHISP12, m_creature, pPlayer); break; + case 44: DoScriptText(WHISP13, m_creature, pPlayer); break; + case 49: DoScriptText(WHISP14, m_creature, pPlayer); break; + case 50: DoScriptText(WHISP15, m_creature, pPlayer); break; + case 51: DoScriptText(WHISP16, m_creature, pPlayer); break; + case 52: DoScriptText(WHISP17, m_creature, pPlayer); break; + case 53: DoScriptText(WHISP18, m_creature, pPlayer); break; + case 54: DoScriptText(WHISP19, m_creature, pPlayer); break; + case 55: DoScriptText(WHISP20, m_creature, pPlayer); break; + case 56: DoScriptText(WHISP21, m_creature, pPlayer); + if (pPlayer) + pPlayer->GroupEventHappens(10211,m_creature); break; } } - void EnterCombat(Unit* who) {} - - void MoveInLineOfSight(Unit *who) + void MoveInLineOfSight(Unit* pWho) { if (IsBeingEscorted) return; - if (who->GetTypeId() == TYPEID_PLAYER) + if (pWho->GetTypeId() == TYPEID_PLAYER) { - if (CAST_PLR(who)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE) + if (CAST_PLR(pWho)->GetQuestStatus(10211) == QUEST_STATUS_INCOMPLETE) { float Radius = 10.0; - if (m_creature->IsWithinDistInMap(who, Radius)) + if (m_creature->IsWithinDistInMap(pWho, Radius)) { - Start(false, false, who->GetGUID()); + Start(false, false, pWho->GetGUID()); } } } } void Reset() {} - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } }; CreatureAI* GetAI_npc_kservantAI(Creature* pCreature) { diff --git a/src/bindings/scripts/scripts/outland/terokkar_forest.cpp b/src/bindings/scripts/scripts/outland/terokkar_forest.cpp index b2c658c0eef..bfce48a17dd 100644 --- a/src/bindings/scripts/scripts/outland/terokkar_forest.cpp +++ b/src/bindings/scripts/scripts/outland/terokkar_forest.cpp @@ -179,7 +179,7 @@ public: void WaypointReached(uint32 i) { - Player *pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -412,11 +412,9 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI { npc_isla_starmaneAI(Creature* c) : npc_escortAI(c) {} - bool Completed; - void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if (!pPlayer) return; @@ -435,11 +433,11 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI case 29:DoScriptText(SAY_PROGRESS_4, m_creature, pPlayer); if (pPlayer) { - if (CAST_PLR(pPlayer)->GetTeam() == ALLIANCE) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_EFTW_A, m_creature); - else if (CAST_PLR(pPlayer)->GetTeam() == HORDE) - CAST_PLR(pPlayer)->GroupEventHappens(QUEST_EFTW_H, m_creature); - } Completed = true; + if (pPlayer->GetTeam() == ALLIANCE) + pPlayer->GroupEventHappens(QUEST_EFTW_A, m_creature); + else if (pPlayer->GetTeam() == HORDE) + pPlayer->GroupEventHappens(QUEST_EFTW_H, m_creature); + } m_creature->SetInFront(pPlayer); break; case 30: m_creature->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break; case 31: DoCast(m_creature, SPELL_CAT); @@ -449,31 +447,19 @@ struct TRINITY_DLL_DECL npc_isla_starmaneAI : public npc_escortAI void Reset() { - Completed = false; - m_creature->setFaction(1660); + me->RestoreFaction(); } - void EnterCombat(Unit* who){} - void JustDied(Unit* killer) { - if (PlayerGUID) + if (Player* pPlayer = GetPlayerForEscort()) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); - if (pPlayer && !Completed) - { - if (CAST_PLR(pPlayer)->GetTeam() == ALLIANCE) - CAST_PLR(pPlayer)->FailQuest(QUEST_EFTW_A); - else if (CAST_PLR(pPlayer)->GetTeam() == HORDE) - CAST_PLR(pPlayer)->FailQuest(QUEST_EFTW_H); - } + if (pPlayer->GetTeam() == ALLIANCE) + pPlayer->FailQuest(QUEST_EFTW_A); + else if (pPlayer->GetTeam() == HORDE) + pPlayer->FailQuest(QUEST_EFTW_H); } } - - void UpdateAI(const uint32 diff) - { - npc_escortAI::UpdateAI(diff); - } }; bool QuestAccept_npc_isla_starmane(Player* pPlayer, Creature* pCreature, Quest const* quest) @@ -488,45 +474,7 @@ bool QuestAccept_npc_isla_starmane(Player* pPlayer, Creature* pCreature, Quest c CreatureAI* GetAI_npc_isla_starmaneAI(Creature* pCreature) { - npc_isla_starmaneAI* thisAI = new npc_isla_starmaneAI(pCreature); - - thisAI->AddWaypoint(0, -2265.21, 3091.14, 13.91); - thisAI->AddWaypoint(1, -2266.80, 3091.33, 13.82, 1000); - thisAI->AddWaypoint(2, -2268.20, 3091.14, 13.82, 7000);//progress1 - thisAI->AddWaypoint(3, -2278.32, 3098.98, 13.82); - thisAI->AddWaypoint(4, -2294.82, 3110.59, 13.82); - thisAI->AddWaypoint(5, -2300.71, 3114.60, 13.82, 20000);//progress2 - thisAI->AddWaypoint(6, -2300.71, 3114.60, 13.82, 3000);//progress3 - thisAI->AddWaypoint(7, -2307.36, 3122.76, 13.79); - thisAI->AddWaypoint(8, -2312.83, 3130.55, 12.04); - thisAI->AddWaypoint(9, -2345.02, 3151.00, 8.38); - thisAI->AddWaypoint(10, -2351.97, 3157.61, 6.27); - thisAI->AddWaypoint(11, -2360.35, 3171.48, 3.31); - thisAI->AddWaypoint(12, -2371.44, 3185.41, 0.89); - thisAI->AddWaypoint(13, -2371.21, 3197.92, -0.96); - thisAI->AddWaypoint(14, -2380.35, 3210.45, -1.08); - thisAI->AddWaypoint(15, -2384.74, 3221.25, -1.17); - thisAI->AddWaypoint(16, -2386.15, 3233.39, -1.29); - thisAI->AddWaypoint(17, -2383.45, 3247.79, -1.32); - thisAI->AddWaypoint(18, -2367.50, 3265.64, -1.33); - thisAI->AddWaypoint(19, -2354.90, 3273.30, -1.50); - thisAI->AddWaypoint(20, -2348.88, 3280.58, -0.09); - thisAI->AddWaypoint(21, -2349.06, 3295.86, -0.95); - thisAI->AddWaypoint(22, -2350.43, 3328.27, -2.10); - thisAI->AddWaypoint(23, -2346.76, 3356.27, -2.82); - thisAI->AddWaypoint(24, -2340.56, 3370.68, -4.02); - thisAI->AddWaypoint(25, -2318.84, 3384.60, -7.61); - thisAI->AddWaypoint(26, -2313.99, 3398.61, -10.40); - thisAI->AddWaypoint(27, -2320.85, 3414.49, -11.49); - thisAI->AddWaypoint(28, -2338.26, 3426.06, -11.46); - thisAI->AddWaypoint(29, -2342.67, 3439.44, -11.32, 12000);//progress4 - thisAI->AddWaypoint(30, -2342.67, 3439.44, -11.32, 7000);//emote bye - thisAI->AddWaypoint(31, -2342.67, 3439.44, -11.32, 5000);//cat form - thisAI->AddWaypoint(32, -2344.60, 3461.27, -10.44); - thisAI->AddWaypoint(33, -2396.81, 3517.17, -3.55); - thisAI->AddWaypoint(34, -2439.23, 3523.00, -1.05); - - return thisAI; + return new npc_isla_starmaneAI(pCreature); } /*###### @@ -624,7 +572,7 @@ struct TRINITY_DLL_DECL npc_akunoAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pPlayer = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); if(!pPlayer) return; diff --git a/src/bindings/scripts/scripts/outland/zangarmarsh.cpp b/src/bindings/scripts/scripts/outland/zangarmarsh.cpp index 0ce14cc0aee..2d505a5183a 100644 --- a/src/bindings/scripts/scripts/outland/zangarmarsh.cpp +++ b/src/bindings/scripts/scripts/outland/zangarmarsh.cpp @@ -284,34 +284,34 @@ struct TRINITY_DLL_DECL npc_kayra_longmaneAI : public npc_escortAI void WaypointReached(uint32 i) { - Player* pUnit = Unit::GetPlayer(PlayerGUID); + Player* pPlayer = GetPlayerForEscort(); - if (!pUnit) + if (!pPlayer) return; switch(i) { case 4: - DoScriptText(SAY_AMBUSH1, m_creature, pUnit); + DoScriptText(SAY_AMBUSH1, m_creature, pPlayer); DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; case 5: - DoScriptText(SAY_PROGRESS, m_creature, pUnit); + DoScriptText(SAY_PROGRESS, m_creature, pPlayer); SetRun(); break; case 16: - DoScriptText(SAY_AMBUSH2, m_creature, pUnit); + DoScriptText(SAY_AMBUSH2, m_creature, pPlayer); DoSpawnCreature(NPC_SLAVEBINDER, -10.0f, -5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); DoSpawnCreature(NPC_SLAVEBINDER, -8.0f, 5.0f, 0.0f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000); break; case 17: SetRun(false); - DoScriptText(SAY_NEAR_END, m_creature, pUnit); + DoScriptText(SAY_NEAR_END, m_creature, pPlayer); break; case 25: - DoScriptText(SAY_END, m_creature, pUnit); - pUnit->GroupEventHappens(QUEST_ESCAPE_FROM, m_creature); + DoScriptText(SAY_END, m_creature, pPlayer); + pPlayer->GroupEventHappens(QUEST_ESCAPE_FROM, m_creature); break; } } -- cgit v1.2.3 From bf13d2d5aa32eecd5881fa45af27c0eac4f6f23d Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Mon, 17 Aug 2009 00:37:32 +0200 Subject: Apply one more time rev 5104 cos its removed by merge --HG-- branch : trunk --- .../eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp index a9f379b3819..08b1f818335 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp @@ -852,12 +852,14 @@ void npc_unworthy_initiateAI::UpdateAI(const uint32 diff) if (!prison) return; - if (Creature* trigger = me->FindNearestCreature(29521, 30)) + prison->ResetDoorOrButton(); + + if (Creature* anchor = me->FindNearestCreature(29521, 30)) { - prison->ResetDoorOrButton(); - trigger->AI()->SetGUID(m_creature->GetGUID()); - trigger->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true); - anchorGUID = trigger->GetGUID(); + anchor->GetPosition(targ_x, targ_y, targ_z); + anchor->AI()->SetGUID(m_creature->GetGUID()); + anchor->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true); + anchorGUID = anchor->GetGUID(); } } return; -- cgit v1.2.3 From 418b161bdc33786dab1eefd4567573a4e1ec3a69 Mon Sep 17 00:00:00 2001 From: megamage Date: Sun, 16 Aug 2009 18:03:26 -0500 Subject: *Fix build. --HG-- branch : trunk --- src/bindings/scripts/base/escort_ai.h | 3 ++- .../scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/base/escort_ai.h b/src/bindings/scripts/base/escort_ai.h index 60e555dcfd4..b66bb435163 100644 --- a/src/bindings/scripts/base/escort_ai.h +++ b/src/bindings/scripts/base/escort_ai.h @@ -88,8 +88,9 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI bool IsBeingEscorted; bool IsOnHold; - private: uint64 m_uiPlayerGUID; + + private: uint32 m_uiWPWaitTimer; uint32 m_uiPlayerCheckTimer; float MaxPlayerDistance; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp index e0e50364d18..8423fa99d46 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp @@ -234,7 +234,7 @@ struct TRINITY_DLL_DECL npc_koltira_deathweaverAI : public npc_escortAI void JustSummoned(Creature* pSummoned) { - if (Unit* pPlayer = Unit::GetUnit(*me, PlayerGUID)) + if (Unit* pPlayer = Unit::GetUnit(*me, m_uiPlayerGUID)) { pSummoned->AI()->AttackStart(pPlayer); pSummoned->AddThreat(me, 0.0f); -- cgit v1.2.3 From 48e699745399ab4cd1fffa6fb2b66493807fb5c8 Mon Sep 17 00:00:00 2001 From: Kudlaty Date: Mon, 17 Aug 2009 01:10:34 +0200 Subject: Revert last rev and fix in correct way. Also some clean up after merge --HG-- branch : trunk --- src/bindings/scripts/base/escort_ai.h | 3 +- .../eastern_kingdoms/scarlet_enclave/chapter2.cpp | 2 +- .../scarlet_enclave/the_scarlet_enclave.cpp | 1139 -------------------- 3 files changed, 2 insertions(+), 1142 deletions(-) (limited to 'src/bindings/scripts') diff --git a/src/bindings/scripts/base/escort_ai.h b/src/bindings/scripts/base/escort_ai.h index b66bb435163..60e555dcfd4 100644 --- a/src/bindings/scripts/base/escort_ai.h +++ b/src/bindings/scripts/base/escort_ai.h @@ -88,9 +88,8 @@ struct TRINITY_DLL_DECL npc_escortAI : public ScriptedAI bool IsBeingEscorted; bool IsOnHold; - uint64 m_uiPlayerGUID; - private: + uint64 m_uiPlayerGUID; uint32 m_uiWPWaitTimer; uint32 m_uiPlayerCheckTimer; float MaxPlayerDistance; diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp index 8423fa99d46..87033b9899f 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/chapter2.cpp @@ -234,7 +234,7 @@ struct TRINITY_DLL_DECL npc_koltira_deathweaverAI : public npc_escortAI void JustSummoned(Creature* pSummoned) { - if (Unit* pPlayer = Unit::GetUnit(*me, m_uiPlayerGUID)) + if (Player* pPlayer = GetPlayerForEscort()) { pSummoned->AI()->AttackStart(pPlayer); pSummoned->AddThreat(me, 0.0f); diff --git a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp index 08b1f818335..b9945e4015f 100644 --- a/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp +++ b/src/bindings/scripts/scripts/eastern_kingdoms/scarlet_enclave/the_scarlet_enclave.cpp @@ -17,11 +17,6 @@ */ #include "precompiled.h" -#include "Vehicle.h" -#include "ObjectMgr.h" -#include "escort_ai.h" - -#define GCD_CAST 1 /*###### ## npc_a_special_surprise @@ -480,1070 +475,6 @@ CreatureAI* GetAI_npc_a_special_surprise(Creature* pCreature) return new npc_a_special_surpriseAI(pCreature); } -/*###### -## npc_koltira_deathweaver -######*/ - -enum eKoltira -{ - SAY_BREAKOUT1 = -1609079, - SAY_BREAKOUT2 = -1609080, - SAY_BREAKOUT3 = -1609081, - SAY_BREAKOUT4 = -1609082, - SAY_BREAKOUT5 = -1609083, - SAY_BREAKOUT6 = -1609084, - SAY_BREAKOUT7 = -1609085, - SAY_BREAKOUT8 = -1609086, - SAY_BREAKOUT9 = -1609087, - SAY_BREAKOUT10 = -1609088, - - 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 TRINITY_DLL_DECL npc_koltira_deathweaverAI : public npc_escortAI -{ - npc_koltira_deathweaverAI(Creature *pCreature) : npc_escortAI(pCreature) { } - - uint32 m_uiWave; - uint32 m_uiWave_Timer; - uint64 m_uiValrothGUID; - - void Reset() - { - if (!IsBeingEscorted) - { - m_uiWave = 0; - m_uiWave_Timer = 3000; - m_uiValrothGUID = 0; - } - } - - void WaypointReached(uint32 uiPointId) - { - switch(uiPointId) - { - case 0: - DoScriptText(SAY_BREAKOUT1, m_creature); - break; - case 1: - m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); - break; - case 2: - m_creature->SetStandState(UNIT_STAND_STATE_STAND); - //m_creature->UpdateEntry(NPC_KOLTIRA_ALT); //unclear if we must update or not - DoCast(m_creature, SPELL_KOLTIRA_TRANSFORM); - break; - case 3: - IsOnHold = true; - m_creature->SetStandState(UNIT_STAND_STATE_KNEEL); - DoScriptText(SAY_BREAKOUT2, m_creature); - DoCast(m_creature, SPELL_ANTI_MAGIC_ZONE); // cast again that makes bubble up - break; - case 4: - SetRun(true); - break; - case 9: - m_creature->Mount(MODEL_DEATH_KNIGHT_MOUNT); - break; - case 10: - m_creature->Unmount(); - break; - } - } - - void JustSummoned(Creature* pSummoned) - { - if (Player* pPlayer = GetPlayerForEscort()) - { - pSummoned->AI()->AttackStart(pPlayer); - pSummoned->AddThreat(m_creature, 0.0f); - } - - if (pSummoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH) - m_uiValrothGUID = pSummoned->GetGUID(); - } - - void SummonAcolyte(uint32 uiAmount) - { - for(uint32 i = 0; i < uiAmount; ++i) - m_creature->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 (IsOnHold) - { - if (m_uiWave_Timer < uiDiff) - { - switch(m_uiWave) - { - case 0: - DoScriptText(SAY_BREAKOUT3, m_creature); - SummonAcolyte(3); - m_uiWave_Timer = 20000; - break; - case 1: - DoScriptText(SAY_BREAKOUT4, m_creature); - SummonAcolyte(3); - m_uiWave_Timer = 20000; - break; - case 2: - DoScriptText(SAY_BREAKOUT5, m_creature); - SummonAcolyte(4); - m_uiWave_Timer = 20000; - break; - case 3: - DoScriptText(SAY_BREAKOUT6, m_creature); - m_creature->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: - { - Unit* pTemp = Unit::GetUnit(*m_creature, m_uiValrothGUID); - - if (!pTemp || !pTemp->isAlive()) - { - DoScriptText(SAY_BREAKOUT8, m_creature); - 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, m_creature); - m_creature->RemoveAurasDueToSpell(SPELL_ANTI_MAGIC_ZONE); - m_uiWave_Timer = 2500; - break; - case 6: - DoScriptText(SAY_BREAKOUT10, m_creature); - IsOnHold = 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; -} - -/*###### -##Quest 12848 -######*/ - -enum -{ - 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 - -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 TRINITY_DLL_DECL 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; - } - - bool event_startet; - uint64 event_starter; - UnworthyInitiatePhase phase; - uint32 wait_timer; - float targ_x,targ_y,targ_z; - uint64 anchorGUID; - - EventMap events; - - void Reset() - { - anchorGUID = 0; - phase = PHASE_CHAINED; - events.Reset(); - m_creature->setFaction(7); - m_creature->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 8); - me->LoadEquipment(0, true); - event_startet = false; - } - - 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; - m_creature->CastSpell(m_creature,SPELL_DK_INITIATE_VISUAL,true); - - if (Unit* starter = Unit::GetUnit((*m_creature),event_starter)) - DoScriptText(say_event_attack[rand()%9],m_creature,starter); - - phase = PHASE_TO_ATTACK; - } - } - - void EventStart(Creature* anchor, Player* target) - { - wait_timer = 5000; - phase = PHASE_TO_EQUIP; - - m_creature->SetUInt32Value(UNIT_FIELD_BYTES_1, 0); - m_creature->RemoveAurasDueToSpell(SPELL_SOUL_PRISON_CHAIN_SELF); - m_creature->RemoveAurasDueToSpell(SPELL_SOUL_PRISON_CHAIN); - - float z; - anchor->GetContactPoint(me, targ_x, targ_y, z, 1.0f); - - event_starter = target->GetGUID(); - DoScriptText(say_event_start[rand()%8], m_creature, target); - } - - void UpdateAI(const uint32 diff); -}; - -CreatureAI* GetAI_npc_unworthy_initiate(Creature* pCreature) -{ - return new npc_unworthy_initiateAI(pCreature); -} - -struct TRINITY_DLL_DECL 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) - { - float x, y, z; - float dist = 99.0f; - GameObject *prison = NULL; - - for(uint8 i = 0; i < 12; ++i) - { - if (GameObject* temp_prison = m_creature->FindNearestGameObject(acherus_soul_prison[i],30)) - { - if (dist == 99.0f || m_creature->IsWithinDist(temp_prison, dist, false)) - { - temp_prison->GetPosition(x, y, z); - dist = m_creature->GetDistance2d(temp_prison); - prison = temp_prison; - } - } - } - - if (!prison) - return; - - prison->ResetDoorOrButton(); - - if (Creature* anchor = me->FindNearestCreature(29521, 30)) - { - anchor->GetPosition(targ_x, targ_y, targ_z); - anchor->AI()->SetGUID(m_creature->GetGUID()); - anchor->CastSpell(me, SPELL_SOUL_PRISON_CHAIN, true); - anchorGUID = anchor->GetGUID(); - } - } - return; - case PHASE_TO_EQUIP: - if (wait_timer) - { - if (wait_timer < diff) - { - m_creature->GetMotionMaster()->MovePoint(1,targ_x,targ_y,m_creature->GetPositionZ()); - phase = PHASE_EQUIPING; - wait_timer = 0; - }else wait_timer -= diff; - } - return; - case PHASE_TO_ATTACK: - if (wait_timer) - { - if (wait_timer < diff) - { - m_creature->setFaction(14); - m_creature->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - phase = PHASE_ATTACKING; - - if (Unit* target = Unit::GetUnit((*m_creature),event_starter)) - m_creature->AI()->AttackStart(target); - wait_timer = 0; - }else wait_timer -= diff; - } - return; - case PHASE_ATTACKING: - if (!UpdateVictim()) - return; - - events.Update(diff); - - while(uint32 eventId = events.ExecuteEvent()) - { - switch(eventId) - { - case EVENT_ICY_TOUCH: - DoCast(m_creature->getVictim(), SPELL_ICY_TOUCH); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_ICY_TOUCH, 5000, GCD_CAST); - break; - case EVENT_PLAGUE_STRIKE: - DoCast(m_creature->getVictim(), SPELL_PLAGUE_STRIKE); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(SPELL_PLAGUE_STRIKE, 5000, GCD_CAST); - break; - case EVENT_BLOOD_STRIKE: - DoCast(m_creature->getVictim(), SPELL_BLOOD_STRIKE); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_BLOOD_STRIKE, 5000, GCD_CAST); - break; - case EVENT_DEATH_COIL: - DoCast(m_creature->getVictim(), SPELL_DEATH_COIL); - events.DelayEvents(1000, GCD_CAST); - events.ScheduleEvent(EVENT_DEATH_COIL, 5000, GCD_CAST); - break; - } - } - - DoMeleeAttackIfReady(); - return; - } -} - -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 -{ - 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 TRINITY_DLL_DECL npc_death_knight_initiateAI : public SpellAI -{ - npc_death_knight_initiateAI(Creature* pCreature) : SpellAI(pCreature) - { - m_bIsDuelInProgress = false; - } - - bool lose; - uint64 m_uiDuelerGUID; - uint32 m_uiDuelTimer; - bool m_bIsDuelInProgress; - - void Reset() - { - lose = false; - me->RestoreFaction(); - SpellAI::Reset(); - - m_creature->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_TRIGGERED) - { - 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 >= m_creature->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) - { - m_creature->setFaction(FACTION_HOSTILE); - - if (Unit* pUnit = Unit::GetUnit(*m_creature, 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 - - SpellAI::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(pCreature->GetNpcTextId(),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_UNK_15); - - int32 uiSayId = rand()% (sizeof(m_auiRandomSay)/sizeof(int32)); - DoScriptText(m_auiRandomSay[uiSayId], pCreature, pPlayer); - - pCreature->CastSpell(pPlayer, SPELL_DUEL, false); - pPlayer->CastSpell(pPlayer, SPELL_DUEL_FLAG, true); - } - return true; -} - -/*###### -## npc_dark_rider_of_acherus -######*/ - -#define DESPAWN_HORSE 52267 - -struct TRINITY_DLL_DECL npc_dark_rider_of_acherusAI : public ScriptedAI -{ - npc_dark_rider_of_acherusAI(Creature *c) : ScriptedAI(c) {} - - uint32 PhaseTimer; - uint32 Phase; - bool Intro; - Unit *Target; - - void Reset() - { - PhaseTimer = 4000; - Phase = 0; - Intro = false; - Target = NULL; - } - - void UpdateAI(const uint32 diff) - { - if (!Intro) - return; - - if (PhaseTimer < diff) - { - switch(Phase) - { - case 0: - m_creature->MonsterSay("The realm of shadows awaits...", LANG_UNIVERSAL, 0); - PhaseTimer = 5000; - Phase = 1; - break; - case 1: - DoCast(Target, DESPAWN_HORSE, true); - PhaseTimer = 3000; - Phase = 2; - break; - case 2: - m_creature->SetVisibility(VISIBILITY_OFF); - PhaseTimer = 2000; - Phase = 3; - break; - case 3: - m_creature->ForcedDespawn(); - break; - default: - break; - } - }else PhaseTimer -= diff; - - } - - void InitDespawnHorse(Unit *who) - { - if (!who) - return; - - Target = who; - m_creature->AddUnitMovementFlag(MOVEMENTFLAG_WALK_MODE); - m_creature->SetSpeed(MOVE_RUN, 0.4f); - m_creature->GetMotionMaster()->MoveChase(Target); - m_creature->SetUInt64Value(UNIT_FIELD_TARGET, Target->GetGUID()); - Intro = true; - } - -}; - -CreatureAI* GetAI_npc_dark_rider_of_acherus(Creature* pCreature) -{ - return new npc_dark_rider_of_acherusAI(pCreature); -} - -/*###### -## npc_salanar_the_horseman -######*/ - -enum -{ - REALM_OF_SHADOWS = 52693, - DELIVER_STOLEN_HORSE = 52264, - CALL_DARK_RIDER = 52266 -}; - -struct TRINITY_DLL_DECL 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 && CAST_CRE(caster)->isVehicle()) - { - if (Unit *charmer = caster->GetCharmer()) - { - charmer->ExitVehicle(); - caster->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_SPELLCLICK); - caster->setFaction(35); - DoCast(caster, CALL_DARK_RIDER, true); - if (Creature* Dark_Rider = m_creature->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 && CAST_CRE(who)->isVehicle() && me->IsWithinDistInMap(who, 10.0f)) - { - if (Unit *charmer = who->GetCharmer()) - { - if (charmer->GetTypeId() == TYPEID_PLAYER) - { - switch(me->GetEntry()) - { - // for quest Into the Realm of Shadows(12687) - case 28788: - if (CAST_PLR(charmer)->GetQuestStatus(12687) == QUEST_STATUS_INCOMPLETE) - { - if (CAST_PLR(charmer)->HasAura(REALM_OF_SHADOWS)) - charmer->RemoveAurasDueToSpell(REALM_OF_SHADOWS); - CAST_PLR(charmer)->GroupEventHappens(12687, me); - } - break; - default: - return; - } - CAST_PLR(charmer)->ExitVehicle(); - CAST_CRE(who)->Respawn(true); - } - } - } - } -}; - -CreatureAI* GetAI_npc_salanar_the_horseman(Creature* pCreature) -{ - return new npc_salanar_the_horsemanAI(pCreature); -} - -/*###### -## npc_ros_dark_rider -######*/ - -struct TRINITY_DLL_DECL 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->m_Vehicle && deathcharger->isVehicle() && CAST_VEH(deathcharger)->HasEmptySeat(0)) - me->EnterVehicle(CAST_VEH(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 ... -struct TRINITY_DLL_DECL npc_dkc1_gothikAI : public ScriptedAI -{ - npc_dkc1_gothikAI(Creature *c) : ScriptedAI(c) {} - - void MoveInLineOfSight(Unit *who) - { - ScriptedAI::MoveInLineOfSight(who); - - if (who->GetEntry() == 28845 && 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_CRE(who)->ForcedDespawn(); - } - } - } - } - } -}; - -CreatureAI* GetAI_npc_dkc1_gothik(Creature* pCreature) -{ - return new npc_dkc1_gothikAI(pCreature); -} - - -/*#### -## npc_scarlet_miner_cart -####*/ - -#define SPELL_CART_CHECK 54173 -#define SPELL_CART_DRAG 52465 - -struct TRINITY_DLL_DECL npc_scarlet_miner_cartAI : public PassiveAI -{ - npc_scarlet_miner_cartAI(Creature *c) : PassiveAI(c), minerGUID(0) - { - me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_ATTACKABLE_2); - me->SetDisplayId(me->GetCreatureInfo()->DisplayID_A[0]); // 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 PassengerLeft(Unit *who, int8 seatId) - { - 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 -####*/ - -struct TRINITY_DLL_DECL 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(rand()%2) - { - 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->m_Vehicle->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("Where'd this come from? I better get this down to the ships before the foreman sees it!",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("Now I can have a rest!",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(Vehicle *car = pPlayer->m_Vehicle) - { - 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 - /*#### ## npc_valkyr_battle_maiden ####*/ @@ -1636,76 +567,6 @@ void AddSC_the_scarlet_enclave() newscript->GetAI = &GetAI_npc_valkyr_battle_maiden; newscript->RegisterSelf(); - // 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(); - - // 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(); - - // 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(); - // A Special Suprise newscript = new Script; newscript->Name = "npc_a_special_surprise"; -- cgit v1.2.3