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') 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